Inside of a group, a command like \tiny
has effect only until the group ends. One would like to be able to say \global\tiny
to have it last after the group ends, but that does not work.
The best that I was able to come up with (described here) is the following.
\newif\ifhelper
\makeatletter
\def\unithelper#1\@nnil{\global\helpertrue\helper}
\def\helper{\ifhelper\afterassignment\helper\global\fi}
\newcommand*\globalfontsize[1]{%
\begingroup
#1%
\def\@defaultunits{\helperfalse\afterassignment\unithelper\global}%
\let\realvrule\vrule
\def\vrule{\helperfalse\global\helpertrue\afterassignment\helper\realvrule}%
\global\helpertrue
\helper#1%
\helperfalse
\endgroup}
\makeatother
Then you can say \globalfontsize\tiny
or \globalfontsize\normalsize
to achieve the desired effect. What is the right way to do that?
Edit: Several people have suggested some variant of \documentclass[10pt]{article}
. That is not related to my question. I'm using "global" in analogy to the TeX primitive \global
.
Best Answer
Now you can write
\doglobally\tiny