mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-19 11:38:05 +02:00
added tensor diagram
This commit is contained in:
parent
483882ca3a
commit
fdb29b3846
2 changed files with 58 additions and 0 deletions
32
tikz/tensor-diagram/Makefile
Normal file
32
tikz/tensor-diagram/Makefile
Normal file
|
@ -0,0 +1,32 @@
|
|||
SOURCE = tensor-diagram
|
||||
DELAY = 80
|
||||
DENSITY = 300
|
||||
WIDTH = 500
|
||||
|
||||
make:
|
||||
pdflatex $(SOURCE).tex -output-format=pdf
|
||||
make clean
|
||||
|
||||
clean:
|
||||
rm -rf $(TARGET) *.class *.html *.log *.aux
|
||||
|
||||
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:
|
||||
make
|
||||
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
||||
pdf2svg $(SOURCE).pdf $(SOURCE).svg
|
||||
# Necessary, as pdf2svg does not always create valid svgs:
|
||||
inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg
|
26
tikz/tensor-diagram/tensor-diagram.tex
Normal file
26
tikz/tensor-diagram/tensor-diagram.tex
Normal file
|
@ -0,0 +1,26 @@
|
|||
\documentclass[varwidth=true, border=2pt]{standalone}
|
||||
\usepackage{tikz}
|
||||
\usetikzlibrary{shapes, calc, shapes, arrows, decorations.markings}
|
||||
\usepackage{amsmath,amssymb}
|
||||
|
||||
\usepackage{xcolor}
|
||||
\definecolor{xvectorcolor}{HTML}{77933C}
|
||||
|
||||
\begin{document}
|
||||
\begin{tikzpicture}[font=\boldmath]
|
||||
\large
|
||||
|
||||
% Points
|
||||
\node (A) at (0,2) {$X \times Y$};
|
||||
\node (B) at (4,2) {$Z'$};
|
||||
\node (C) at (2,0) {$Z$};
|
||||
|
||||
\draw[->, ultra thick] (2.1,0.7) arc(-70:260:0.4);
|
||||
|
||||
% Draw the triangle
|
||||
\path[fill=blue!10, fill=blue!5] (A) -- (B) -- (C) -- (A);
|
||||
\draw[ultra thick, xvectorcolor, arrows={-latex}] (A) -- (C) node[sloped,midway,below=-0.1cm] {$T$};
|
||||
\draw[ultra thick, blue!80, arrows={-latex}] (C) -- (B) node[sloped,midway,below=-0.1cm] {$f$};
|
||||
\draw[ultra thick, red!80, arrows={-latex},line cap=round] (A) -- (B) node[sloped,midway,right=-0.3cm,above=-0.1cm] {$T'$};
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
Loading…
Add table
Add a link
Reference in a new issue