Debian Codegraph @

texmf-dist/doc/latex/tikz-palattice/example5_legend.tex

raw
1 %% example5_legend.tex
2 %% Copyright 2017 J. Schmidt
3 %% tikz-palattice LaTeX package
4 %
5 % This work may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either version 1.3
7 % of this license or (at your option) any later version.
8 % The latest version of this license is in
9 % http://www.latex-project.org/lppl.txt
10 % and version 1.3 or later is part of all distributions of LaTeX
11 % version 2005/12/01 or later.
12 %
13 % This work has the LPPL maintenance status `maintained'.
14 %
15 % The Current Maintainer of this work is J. Schmidt.
16 %
17 % This work consists of the files tikz-palattice.sty and tikz-palattice_documentation.tex
18 % and the 6 example files example1_linear.tex, example2_circular.tex,
19 % example3_coordinates.tex, example4_labels.tex example5_legend.tex and elsa.tex
20
21 \documentclass[]{standalone}
22 \usepackage[english]{babel}
23 \usepackage[utf8]{inputenc}
24 \usepackage{tikz-palattice}
25
26
27
28
29 \begin{document}
30
31 \begin{lattice}
32 \rotate{-90}
33 \drift{0.167}
34 \quadrupole{Q1}{0.4}
35 \drift{0.1}
36 \kicker{C1}{0.1}
37 \drift{0.29}
38 \drift{0.2}
39 \screen{S1}
40 \drift{0.2}
41 \quadrupole{Q2}{0.4}
42 \drift{0.1}
43 \kicker{C2}{0.1}
44 \drift{0.2}
45 \setlegendtext{quadrupole}{argh}
46 \addlegendentry{Vthe Quad}{}
47 \addlegendentry{Vein sextU}{cyan, bottom color=violet, top color=white}
48 \addlegendentry{VCombined Function}{fill=green!40!black}
49
50 \completelegend{(0.8,0)}
51 \end{lattice}
52
53
54 \end{document}
55
56
57
58
59
60
61 % \global\let\legprevi\legindex%
62 % \pgfmathsetmacro{\legindex}{\legindex+1} \global\let\legindex\pgfmathresult%
63
64
65 % \def\q{{1.2,1.5,3.1,0}}
66 % \draw (-0.5,0) -- (-0.5,-{\q[0]});
67 % \draw (-0.6,0) -- (-0.6,-{\q[1]});
68 % \draw (-0.7,0) -- (-0.7,-{\q[2]});
69
70 % \pgfkeyssetvalue{/pal/legend/dipole}{tolle Fahrt}
71 % \pgfkeyssetvalue{/pal/legend/quadrupole}{tolle Wurst}
72 % \pgfkeyssetvalue{/pal/legend/quadrupole/.style}{fill=yellow}
73 % \node[draw] at (2,-4) {\pgfkeysvalueof{/pal/legend/dipole}};
74 % \node[draw] at (2,-5) {\pgfkeysvalueof{/pal/legend/quadrupole}};
75
76 % \tikzset{
77 % /pal/List/.initial = {erstens},
78 % /pal/List/.append = {,roms},
79 % }
80 % \edef\mylist{\pgfkeysvalueof{/pal/List}}
81
82 % \node[align=center] at (2,-4) {%
83 % \foreach \txt in \mylist {\txt, }
84 % };
85
86 % \pgfkeys{
87 % /tikz/.cd,
88 % execute style/.style = {#1},
89 % execute macro/.style = {execute style/.expand once=#1},
90 % /test/hallo/.store in = \hallo
91 % }
92 % \pgfkeys{/test/.cd, hallo = {red,font=\bf,draw}}
93 % \node[execute macro=\hallo] at (2,-4) {Törö!};
94
95
96
97 % \matrix [matrix, draw, ampersand replacement=\&, matrix anchor=north west, anchor=west,column sep=2mm] (legend) at (1,-2)
98 % {
99 % \draw[/legimg/quadrupole] (0,-0.15) rectangle (0.5,0.15); \& \node {\pgfkeysvalueof{/legtxt/quadrupole}}; \\
100 % \draw[/legimg/sextupole] (0,-0.15) rectangle (0.5,0.15); \& \node {\pgfkeysvalueof{/legtxt/sextupole}}; \\
101 %};
102
103 % \pgfmathsetmacro{\legprevi}{0}
104 % \pgfmathsetmacro{\legindex}{1}
105 % \node[draw, anchor=north west] at (1,-2) {
106 % \begin{tikzpicture}[start chain=going below,node distance=2mm]
107 % \foreach \ele in \mylist {%
108 % \node[on chain, /legimg/\ele, draw,minimum width=5mm, minimum height=3mm] (n) {};%
109 % \node[anchor=west,xshift=2mm] at (n.east) {\pgfkeysvalueof{/legtxt/\ele}};%
110 % }
111 % \end{tikzpicture}
112 %;