summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-03-01 22:06:18 +0000
committerKarl Berry <karl@freefriends.org>2015-03-01 22:06:18 +0000
commit12d15156b306b9558ba418999aba33d28812ef03 (patch)
tree4b466ff2057e6ec065390a58d54a657cb95d4f8b
parent51b5f3be5fb8ffa88fe3ecfe6a171e89e55b7929 (diff)
tikz-palattice (1mar15)
git-svn-id: svn://tug.org/texlive/trunk@36413 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/tikz-palattice/elsa.tex19
-rw-r--r--Master/texmf-dist/doc/latex/tikz-palattice/example3_coordinates.tex10
-rw-r--r--Master/texmf-dist/doc/latex/tikz-palattice/example4_labels.tex4
-rw-r--r--Master/texmf-dist/doc/latex/tikz-palattice/tikz-palattice_documentation.pdfbin333188 -> 457132 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tikz-palattice/tikz-palattice_documentation.tex57
-rw-r--r--Master/texmf-dist/tex/latex/tikz-palattice/tikz-palattice.sty14
6 files changed, 69 insertions, 35 deletions
diff --git a/Master/texmf-dist/doc/latex/tikz-palattice/elsa.tex b/Master/texmf-dist/doc/latex/tikz-palattice/elsa.tex
index 061a3dc40b1..335ab469c65 100644
--- a/Master/texmf-dist/doc/latex/tikz-palattice/elsa.tex
+++ b/Master/texmf-dist/doc/latex/tikz-palattice/elsa.tex
@@ -61,7 +61,7 @@
%-----------------------------------
%LINAC2
%-----------------------------------
-\turnlabels
+\northlabels
\source{}{1}
\savecoordinate{PolQ}[center]
\drift{2.5}
@@ -110,16 +110,18 @@
%-----------------------------------
\goto{M3}
\setangle{-180}
+\northlabels
\drift{0.44}
\quadrupole{Q7}{\quadl}
\drift{0.2}
\quadrupole{Q6}{\quadl}
\drift{0.35}
+\turnlabels
\dipole{M2}{0.3}{45}
\drift{1.1}
\dipole{M1}{0.3}{45}
\savecoordinate{M1}[center]
-\turnlabels
+\southlabels
\drift{0.58}
\quadrupole{Q5}{\quadl}
\drift{0.36}
@@ -162,14 +164,13 @@
%-----------------------------
\goto{M1}
\setangle{90}
-\turnlabels
+\northlabels
\drift{0.25}
\drift{0.37}
\quadrupole{QT1}{\quadl}
\drift{0.2}
\quadrupole{QT2}{\quadl}
\drift{0.45}
-\turnlabels
\savecoordinate{bestrahlung}
\beamdump{}{0.5}
%title
@@ -183,6 +184,7 @@
\begin{scope}
\setelementcolor{dipole}{green!55!black}[green!55!black]
\goto{BoosterInj}
+\southlabels
%\marker{Start}[0.5]
\setlabeldistance{0.5}
\kicker{INJSEPT}{0.88}
@@ -253,8 +255,8 @@
%-----------------------------
\goto{Booster_extract}
\setangle{-47}
+\northlabels
\drift{2}
-\turnlabels
\corrector{KV1}{0.25}
\drift{0.16}
\quadrupole{QA}{0.48}
@@ -280,7 +282,7 @@
\goto{ELSA_inject}
\setangle{-55}
\setlabeldistance{0.5}
-\turnlabels
+\northlabels
% "end" put at beginning to start at injection
\quadrupole{QD31}{0.4997}
@@ -590,7 +592,7 @@
%Extraktion + CB
%-----------------------
\goto{ELSA_extract}
-\turnlabels
+\southlabels
\rotate{-8}
\drift{0.2}
%----
@@ -665,7 +667,7 @@
%-------------------
\goto{MB1}
\rotate{-10.8-11}
- \turnlabels
+ \southlabels
\drift{1.03}
\dipole{MB2}{1.08166}{-11}[r][0.6]
\drift{1.06}
@@ -702,6 +704,7 @@
%neue externe Strahlführung
%-----------------------------
\goto{ELSA_extract_neu}
+\southlabels
\rotate{-4}
\drift{1.578}
\drift{1.578}
diff --git a/Master/texmf-dist/doc/latex/tikz-palattice/example3_coordinates.tex b/Master/texmf-dist/doc/latex/tikz-palattice/example3_coordinates.tex
index a7f34469b18..73412b3c466 100644
--- a/Master/texmf-dist/doc/latex/tikz-palattice/example3_coordinates.tex
+++ b/Master/texmf-dist/doc/latex/tikz-palattice/example3_coordinates.tex
@@ -78,7 +78,7 @@
\centering
\begin{lattice}
\setangle{70}
- \turnlabels %labels to the left
+ \northlabels %labels to the left
\drift{0.5}
\quadrupole{QF1}{0.3}
\drift{0.2}
@@ -105,7 +105,7 @@
% now go back to saved coordinate and continue with another beamline
\goto{Septum}
\rotate{-20}
- \turnlabels %labels to the right
+ \southlabels %labels to the right
\drift{0.6}
\kicker{SS1}{0.2}
\drift{0.2}
@@ -139,7 +139,7 @@
\centering
\begin{lattice}
\rotate{90}
- \turnlabels %labels to the left
+ \northlabels %labels to the left
\drift{0.5}
\quadrupole{QF1}{0.3}
\drift{0.2}
@@ -190,7 +190,7 @@
\centering
\begin{lattice}
\rotate{90}
- \turnlabels %labels to the left
+ \northlabels %labels to the left
\drift{0.5}
\quadrupole{QF1}{0.3}
\drift{0.2}
@@ -217,7 +217,7 @@
% now go back to saved coordinate and continue with another beamline
\goto{Septum}
\rotate{-20}
- \turnlabels %labels to the right
+ \southlabels %labels to the right
\drift{0.6}
\kicker{SS1}{0.2}
\drift{0.2}
diff --git a/Master/texmf-dist/doc/latex/tikz-palattice/example4_labels.tex b/Master/texmf-dist/doc/latex/tikz-palattice/example4_labels.tex
index cb698a2ce31..bfd312ba247 100644
--- a/Master/texmf-dist/doc/latex/tikz-palattice/example4_labels.tex
+++ b/Master/texmf-dist/doc/latex/tikz-palattice/example4_labels.tex
@@ -28,7 +28,7 @@
\begin{lattice}[0.5]
\drawrule{(-9,-11)}[5][3][0.2]
-\turnlabels
+\northlabels % labels "inside" ring
\setlabeldistance{0.5}
\rotate{-35}
\marker{start}[0.5]
@@ -163,7 +163,7 @@
\quadrupole{TJQD16}{0.5515}[0.2]
\drift{0.1614}
-% turn labels to other side
+% turn labels to other side and back
\turnlabels
\quadrupole{QD17}{0.4997}
\turnlabels
diff --git a/Master/texmf-dist/doc/latex/tikz-palattice/tikz-palattice_documentation.pdf b/Master/texmf-dist/doc/latex/tikz-palattice/tikz-palattice_documentation.pdf
index aec4f712bfc..d218b6d24b9 100644
--- a/Master/texmf-dist/doc/latex/tikz-palattice/tikz-palattice_documentation.pdf
+++ b/Master/texmf-dist/doc/latex/tikz-palattice/tikz-palattice_documentation.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tikz-palattice/tikz-palattice_documentation.tex b/Master/texmf-dist/doc/latex/tikz-palattice/tikz-palattice_documentation.tex
index a88c4f61161..201c4e44d7c 100644
--- a/Master/texmf-dist/doc/latex/tikz-palattice/tikz-palattice_documentation.tex
+++ b/Master/texmf-dist/doc/latex/tikz-palattice/tikz-palattice_documentation.tex
@@ -22,10 +22,10 @@
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
+\usepackage{lmodern}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{subcaption}
-\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{marvosym}
@@ -41,8 +41,14 @@
\newcommand{\tikzlabel}{Ti\textit{k}Z}
\author{Jan Schmidt <schmidt@physik.uni-bonn.de>}
-\date{v2.1 (February 23, 2015)}
+\date{v2.2 (March 01, 2015)}
\title{tikz-palattice - draw particle accelerator lattices with \tikzlabel}
+
+\hypersetup{
+ pdftitle={tikz-palattice - draw particle accelerator lattices with \tikzlabel},
+ pdfauthor={Jan Schmidt}
+}
+
\begin{document}
\definecolor{keycolor}{RGB}{172, 42, 42}
@@ -179,6 +185,9 @@ separate tex-files for the source code.
especially for larger beamlines.
\item lengths are set in meter, so you write \{1.32\} for \SI{1.32}{\m}.
\item beamline with angle \SI{0}{\degree} goes to the right, positive angles bend counter clockwise.
+\item some commands use the \tikzlabel{} \textit{north/east/south/west} terms. \textit{east}
+ of an element is always where the beam leaves the element (downstream) and \textit{west} is where the
+ beam enters the element (upstream).
\item settings (colors, font, rotatelabel,\ldots{}) changed within a \verb+scope+ environment are set back to the previous values outside of \verb+scope+
\item picture scale: for lattice scale=1 an element of 1m length is plotted with \SI{2}{\cm} length
\end{itemize}
@@ -245,7 +254,7 @@ shapes. It is shown in example~2. Possible values are:
If you use any other letters, also the default (s) is used.
-\begin{figure}[h]
+\begin{figure}[ht]
\centering
\includegraphics[width=10cm]{example1_linear}
\caption{Example 1}
@@ -308,7 +317,6 @@ textsize if scale=1.
is similar to \lstinline+\legend+, but shows all element types.
-\clearpage
\begin{figure}[h]
\centering
% this is the ring from example 2, but plotted smaller (30%).
@@ -351,12 +359,21 @@ is similar to \lstinline+\legend+, but shows all element types.
Every element has a text label showing the given element name. The position and
orientation of the label is set automatically according to the current angle of the
beamline. Several commands to modify the labels manually are described below. If you want
-to disable labels, leave the element names blank or set the label color (section \ref{sec:colors}) to your background color.
+to disable labels, leave the element names blank or set the label color (section
+\ref{sec:colors}) to your background color.
\begin{lstlisting}
\turnlabels
\end{lstlisting}
-moves labels to other side of elements (swap with marker labels)
+moves labels to other side of elements (swap with marker labels), while
+\begin{lstlisting}
+ \northlabels
+ \southlabels
+\end{lstlisting}
+explicitly sets the labels to north or south (see section \ref{sec:remarks}) of the
+elements. It is recommended to use these and not \lstinline+\turnlabels+, because
+otherwise the label position at a certain element is determined by the number of
+\lstinline+\turnlabels+ commands before this element.
\begin{lstlisting}
\rotatelabels{(*\option{angle/deg}*)}[(*\optiondef{anchor}{}*)]
@@ -432,7 +449,9 @@ You can use element coordinates to draw anything you want using pgf/tikz.
\begin{lstlisting}
\savecoordinate{(*\option{name}*)}[(*\optiondef{position}{east}*)]
\end{lstlisting}
- saves the coordinate of the previous element to access it later. Position specifies the exact place of the element. East and center are available. East is always downstream.
+saves the coordinate of the previous element to access it later. Position specifies the
+exact place of the element. \textit{east} and \textit{center} are available (see section
+\ref{sec:remarks}).
\begin{itemize}
\item you can use all tikz/pgf commands within the lattice environment to draw anything.
@@ -445,11 +464,11 @@ You can use element coordinates to draw anything you want using pgf/tikz.
-\begin{figure}
+\begin{figure}[h]
\centering
\begin{subfigure}[b]{.45\textwidth}
\centering
- \begin{lattice}
+ \begin{lattice}[0.8]
\rotate{90}
\turnlabels %labels to the left
\drift{0.5}
@@ -477,7 +496,7 @@ You can use element coordinates to draw anything you want using pgf/tikz.
\end{lattice}
%
%now draw second lattice and connect them using the saved coordinate
- \begin{lattice}[1][overlay]
+ \begin{lattice}[0.8][overlay]
\start{(Septum)}
\rotate{70}
\drift{0.6}
@@ -500,7 +519,7 @@ You can use element coordinates to draw anything you want using pgf/tikz.
%
\begin{subfigure}[b]{.45\textwidth}
\centering
- \begin{lattice}
+ \begin{lattice}[0.8]
\rotate{90}
\turnlabels %labels to the left
\drift{0.5}
@@ -552,7 +571,19 @@ You can use element coordinates to draw anything you want using pgf/tikz.
\end{figure}
-\clearpage
+
+\section{Changelog}
+\label{sec:changelog}
+v2.1 from 2015/02/23 is the first published version.
+
+\paragraph{v2.2 from 2015/03/01}
+\begin{itemize}
+\item added \lstinline+\northlabels+ and \lstinline+\southlabels+
+\item minor legend improvements (label position is now independent of current lattice settings)
+\item minor documentation improvements
+\end{itemize}
+
+
\section{TODO}
\label{sec:todo}
@@ -573,8 +604,6 @@ bunch of macros. So there is:
\paragraph{Known issues:}
\begin{itemize}
-\item Legend entry alignment is buggy for some legend scales that differ significantly
- from~1
\item Please report bugs!
\end{itemize}
diff --git a/Master/texmf-dist/tex/latex/tikz-palattice/tikz-palattice.sty b/Master/texmf-dist/tex/latex/tikz-palattice/tikz-palattice.sty
index 2084ee12501..44511f240e2 100644
--- a/Master/texmf-dist/tex/latex/tikz-palattice/tikz-palattice.sty
+++ b/Master/texmf-dist/tex/latex/tikz-palattice/tikz-palattice.sty
@@ -18,7 +18,7 @@
% and the 5 example files example1_linear.tex, example2_circular.tex,
% example3_coordinates.tex, example4_labels.tex and elsa.tex
-\ProvidesPackage{tikz-palattice}[2015/02/23 v2.1]
+\ProvidesPackage{tikz-palattice}[2015/03/01 v2.2]
\RequirePackage{tikz}
\RequirePackage{ifthen}
\RequirePackage{siunitx}
@@ -134,6 +134,9 @@
\def\labelang{+90} \def\marklabelang{-90}}{%
\def\labelang{-90} \def\marklabelang{+90}}}
+\newcommand{\southlabels}{\def\labelang{-90} \def\marklabelang{+90}}
+\newcommand{\northlabels}{\def\labelang{+90} \def\marklabelang{-90}}
+
\newcommandx{\rotatelabels}[2][2=notset]{%
\def\labelrot{#1}
\ifthenelse{\equal{#2}{notset}}{%
@@ -174,15 +177,15 @@
\def\h{0.4}
\def\l{0.3}
\def\dist{0.18}
-\turnlabels
-\tikzset{drift/.append style={draw=none}}
\savecoordinate{_here_}
\coordinate (east\j) at (legendstart);
\coordinate (legendstart') at ($(legendstart) + (-\h*\scal*15*#2,\dist*\scal*15*#2)$);
\coordinate (legendstart'') at ($(legendstart) + (\h*\scal*15*#2,\dist*\scal*15*#2)$);
\edef\points{(legendstart') (legendstart'')}
\begin{scope}[scale=#2, every node/.style={scale=#2}]
-\setlabelcolor{black}
+\tikzset{drift/.append style={draw=none}}
+\northlabels%
+\setlabelcolor{black}%
\iftoggle{dip}{\dipole{Dipole}{\l}{0}[s][\h]\xdef\points{(elementlabel\j)
\points}\drift{\dist}}{}%
\iftoggle{quad}{\quadrupole{Quadrupole}{\l}[\h]\xdef\points{(elementlabel\j)
@@ -207,8 +210,7 @@
\node[draw=black, rounded corners, fit=\points] {};
\pgfmathsetmacro{\scal}{\savescal}
\pgfmathsetmacro{\angle}{\saveang}
-\tikzset{drift/.append style={draw=black}}
-\turnlabels
+%\tikzset{drift/.append style={draw=black}}
\coordinate (east\j) at (_here_);
}