| 1 |
%% example2_circular.tex |
| 2 |
%% Copyright 2015 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 5 example files example1_linear.tex, example2_circular.tex, |
| 19 |
% example3_coordinates.tex, example4_labels.tex and elsa.tex |
| 20 |
|
| 21 |
\documentclass[]{standalone} |
| 22 |
\usepackage[ngerman]{babel} |
| 23 |
\usepackage[utf8]{inputenc} |
| 24 |
\usepackage{tikz-palattice} |
| 25 |
|
| 26 |
|
| 27 |
\begin{document} |
| 28 |
|
| 29 |
\begin{lattice} |
| 30 |
\setlinecolor{drift}{red} |
| 31 |
|
| 32 |
\drift{1} |
| 33 |
\dipole{M1}{2}{45} |
| 34 |
\drift{1} |
| 35 |
\dipole{M2}{2}{45} |
| 36 |
\drift{1} |
| 37 |
\setelementcolor{dipole}{green!50!black} % change color of all following dipoles |
| 38 |
\dipole{M3}{2}{45} |
| 39 |
\drift{1} |
| 40 |
\dipole{M4}{2}{45} |
| 41 |
\drift{1} |
| 42 |
\begin{scope} % color change only applied within scope |
| 43 |
\setelementcolor{dipole}{red}[red] % optional 3rd argument sets top color -> no (visible) color gradient |
| 44 |
\dipole{M5}{2}{45} |
| 45 |
\end{scope} |
| 46 |
\drift{1} |
| 47 |
\dipole{M6}{2}{45} |
| 48 |
\drift{1} |
| 49 |
\resetelementcolor{dipole} % reset color of following dipoles to default |
| 50 |
\dipole{M7}{2}{45}[r] % rectangle dipole type |
| 51 |
\drift{1} |
| 52 |
\dipole{M8}{2}{45}[br] % bend rectangle dipole type |
| 53 |
|
| 54 |
\drawrule{(1,-0.5)} |
| 55 |
\end{lattice} |
| 56 |
|
| 57 |
\end{document} |
| 58 |
|
| 59 |
|
| 60 |
|