Can someone explain to me how I can include the \begin{lrbox}
in the loop? My problem is that I do not know how to call the macro \PMOne
or \PMTwo
within the lrbox
environment. A Minimal example:
\documentclass[english]{article}
\usepackage{tikz}
%
\foreach [count=\xi] \x in {One,Two} {
\expandafter\newsavebox\csname PM\x \endcsname
}
%
%
\begin{lrbox}{\PMOne}
\begin{tikzpicture}
\draw (1,0.5) node [right] {+1};
\draw (1,-0.5) node [right] {-1};
\draw[-] (0,0) -- node [above] {$+.5$} (1,0.5);
\draw[-] (0,0) -- node [below] {$-.5$} (1,-0.5);
\end{tikzpicture}
\end{lrbox}
%
\begin{lrbox}{\PMTwo}
\begin{tikzpicture}
\draw (1,0.5) node [right] {+2};
\draw (1,-0.5) node [right] {-2};
\draw[-] (0,0) -- node [above] {$.5$} (1,0.5);
\draw[-] (0,0) -- node [below] {$.5$} (1,-0.5);
\end{tikzpicture}
\end{lrbox}
%
\begin{document}
\foreach [count=\xi] \x in {One,Two} {%
\expandafter\usebox\csname PM\x\endcsname}
\end{document}
\usebox
?\foreach [count=\xi] \x in {One,Two} {% \expandafter\usebox\csname PM\x\endcsname}
perhaps?\begin{lrbox}
... in the loop?\begin{lrbox}
loop since I will need \PMOne tow \PMTen. Thanks!\begin{lrbox}
ten times