Why doesn't this work?
\def\circacc{%
\dimen0=\fontdimen5\textfont2
\fontdimen5\textfont2=-.5ex
\mathaccent\circ
\fontdimen5\textfont2=\dimen0
}$\circacc a$\bye
The last line produces an error (! Missing { inserted.
), but why on earth when it worked just two lines ago?!
If I change the macro to include an argument I can get it to work, but then the last \fontdimen
-change gets applied before the accent has been typeset!
I'm afraid I'm on TeX Wizard -lands now, and I'm lost.
Update: The first part of the question is now clear to me. However, the grouped version didn't work for me for the second (w/ args), is there something I'm still missing?
\def\circacc#1{
\dimen0=\fontdimen5\textfont2 \dimen1=\fontdimen5\scriptfont2 \dimen2=\fontdimen5\scriptscriptfont2
{\fontdimen5\textfont2=-.25ex \fontdimen5\scriptfont2=-.25ex \fontdimen5\scriptscriptfont2=-.25ex
\mathaccent\circ{#1}}
\fontdimen5\textfont2=\dimen0 \fontdimen5\scriptfont2=\dimen1 \fontdimen5\scriptscriptfont2=\dimen2
}$\circacc W$\bye
(produces the accent with the original x-height)
;-)