2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +02:00

Add tikz/triangle-right-abchpq

This commit is contained in:
Martin Thoma 2015-11-10 07:41:56 +01:00
parent 2683ba1459
commit 42266527cd
4 changed files with 91 additions and 0 deletions

View file

@ -0,0 +1,33 @@
SOURCE = triangle-right-abchpq
DELAY = 80
DENSITY = 300
WIDTH = 512
make:
pdflatex $(SOURCE).tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
gif:
pdfcrop $(SOURCE).pdf
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
make clean
png:
make
make svg
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
transparentGif:
convert $(SOURCE).pdf -transparent white result.gif
make clean
svg:
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
pdf2svg $(SOURCE).pdf $(SOURCE)1.svg
# Necessary, as pdf2svg does not always create valid svgs:
inkscape $(SOURCE)1.svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
rm $(SOURCE)1.svg

View file

@ -0,0 +1,3 @@
Compiled example
----------------
![Example](triangle-right-abchpq.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -0,0 +1,55 @@
\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetikzlibrary{angles,quotes}
\usetkzobj{all}
\usetikzlibrary{shapes, calc, decorations}
\usepackage{amsmath,amssymb}
\usepackage{helvet}
\usepackage[eulergreek]{sansmath}
\begin{document}
\begin{preview}
\begin{tikzpicture}[very thick,font=\sansmath\sffamily]
\newcommand{\radius}{5}
\newcommand{\TriangleAngle}{30}
\tkzDefPoint(0,0){A}
\tkzDefPoint(\radius,0){B}
\tkzDefPoint(\TriangleAngle:{cos(\TriangleAngle*\FPpi/180)*\radius}){C}
\tkzDefPoint({cos(\TriangleAngle*\FPpi/180)*\radius*cos(\TriangleAngle*\FPpi/180)},0){E}
% \tkzLabelPoints[below left,font=\sansmath\sffamily](A)
% \tkzLabelPoints[below right,font=\sansmath\sffamily](B)
% \tkzLabelPoints[above,font=\sansmath\sffamily](C)
% Draw polygon
\tkzDrawPolygon[fill=gray!10](A,B,C)
% Label lines
\tkzLabelSegment[right](B,C){$a$}
\tkzLabelSegment[above left=-0.1](A,C){$b$}
\tkzLabelSegment[below](A,B){$c$}
\tkzLabelSegment[above=-0.1](A,E){$q$}
\tkzLabelSegment[above=-0.1](E,B){$p$}
% Mark angles
% \tkzMarkAngle[arc=l,size=0.6cm,fill=green!30](B,A,C)
% \tkzLabelAngle[pos=0.3](B,A,C){$\alpha$}
% \tkzMarkAngle[arc=l,size=0.6cm,fill=green!30](C,B,A)
% \tkzLabelAngle[pos=0.45](C,B,A){$\beta$}
\tkzDrawSegment[dashed](C,E)
\tkzLabelSegment[left](C,E){$h$}
\draw[thin] pic[draw, angle radius=2mm,"$\cdot$",angle eccentricity=.5]{angle=B--E--C};
\draw[thin] pic[draw, angle radius=2mm,"$\cdot$",angle eccentricity=.5]{angle=A--C--B};
% Draw polygon
\tkzDrawPolygon(A,B,C)
\end{tikzpicture}
\end{preview}
\end{document}