4
votes
1answer
73 views

Convert a latex command with parameter into a two begin end commands without parameter

I have defined a command \newcommand{\CV}[1]{\parbox[c]{0.2\textwidth}{\begin{flushleft}#1\end{flushleft}}} which I obviously have to call like \CV{My text} However I rather would like to use ...
14
votes
3answers
763 views

Use \bgroup and \egroup to set some pre and post code to a macro

Why isn’t it possible to use \bgroup and \egroup in this way? \documentclass{article} \def\precode{\fbox\bgroup} \def\postcode{\egroup} \newcommand{\mymacro}[1]{\precode#1\postcode} ...
9
votes
2answers
575 views

Beamer: content in box register does not survive \end{frame}

Consider the following example (I edited the example to include LaTeX lrbox environment): \documentclass{beamer} \newsavebox\mybox \newsavebox\myboxb \begin{document} \frame{ \sbox\mybox{Hello ...
6
votes
3answers
805 views

Why are box dimension assignments both local and global?

Consider the following code. \setbox0 \hbox{XXX} \fbox{\copy0} { \setbox0\hbox{ZZZ} {\wd0 0pt} \fbox{\copy0} } \fbox{\box0} This produces three ruled boxes. The two XXXs ...