I need to switch fontsize and skip in a new command and want to be able to restore the values before the command was called (so I don't have to worry about knowing what they are all the time).
How would I do that?
Thanks
General ⇒ How do I save values temporarily?
NEW: TikZ book now 40% off at Amazon.com for a short time.

How do I save values temporarily?
Hi,
you can use the grouping mechanism to keep changes local. The following code illustrates this (the font change produced by \myfontb will apply only to its argument):
you can use the grouping mechanism to keep changes local. The following code illustrates this (the font change produced by \myfontb will apply only to its argument):
Code: Select all
\documentclass{book}
\newcommand\myfonta[1]{\fontsize{20}{24}\selectfont#1}
\newcommand\myfontb[1]{{\fontsize{20}{24}\selectfont#1}}
\begin{document}
text text \myfonta{text text} text text
\normalsize
text text \myfontb{text text} text text
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
-
- Posts: 72
- Joined: Sun Nov 16, 2008 1:26 pm
Re: How do I save values temporarily?
Ah! Thanks for the insight/reminder into grouping!