mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-19 11:38:05 +02:00
Add tikz/triangle-labels
This commit is contained in:
parent
afaf9d4d90
commit
2683ba1459
4 changed files with 83 additions and 0 deletions
33
tikz/triangle-labels/Makefile
Normal file
33
tikz/triangle-labels/Makefile
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
SOURCE = triangle-labels
|
||||||
|
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
|
3
tikz/triangle-labels/README.md
Normal file
3
tikz/triangle-labels/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Compiled example
|
||||||
|
----------------
|
||||||
|

|
BIN
tikz/triangle-labels/triangle-labels.png
Normal file
BIN
tikz/triangle-labels/triangle-labels.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
47
tikz/triangle-labels/triangle-labels.tex
Normal file
47
tikz/triangle-labels/triangle-labels.tex
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
\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]
|
||||||
|
\tkzDefPoint(0,0){A}
|
||||||
|
\tkzDefPoint(2,0){B}
|
||||||
|
\tkzDefPoint(0.5,2.0){C}
|
||||||
|
|
||||||
|
\tkzLabelPoints[below left,font=\sansmath\sffamily](A)
|
||||||
|
\tkzLabelPoints[below right,font=\sansmath\sffamily](B)
|
||||||
|
\tkzLabelPoints[above,font=\sansmath\sffamily](C)
|
||||||
|
|
||||||
|
% Label lines
|
||||||
|
\tkzLabelSegment[right](B,C){$a$}
|
||||||
|
\tkzLabelSegment[left](A,C){$b$}
|
||||||
|
\tkzLabelSegment[below](A,B){$c$}
|
||||||
|
|
||||||
|
% Draw polygon
|
||||||
|
\tkzDrawPolygon[fill=gray!10](A,B,C)
|
||||||
|
|
||||||
|
% 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$}
|
||||||
|
|
||||||
|
\tkzMarkAngle[arc=l,size=0.6cm,fill=green!30](A,C,B)
|
||||||
|
\tkzLabelAngle[pos=0.45](A,C,B){$\gamma$}
|
||||||
|
|
||||||
|
% Draw polygon
|
||||||
|
\tkzDrawPolygon[very thick](A,B,C)
|
||||||
|
\end{tikzpicture}
|
||||||
|
\end{preview}
|
||||||
|
\end{document}
|
Loading…
Add table
Add a link
Reference in a new issue