[OS X TeX] colorbox

Peter Dyballa Peter_Dyballa at Web.DE
Wed Jul 30 12:04:07 EDT 2008

Am 30.07.2008 um 14:03 schrieb Alain Schremmer:

> In general, I want to be able to highlight specific spots in  
> mathematical expressions.

If it's just the arguments, an operator, a function name, then it's  
easy: \colorbox{yellow}{<the stuff>}. But when you're going to high- 
light a part a compound like \dfrac{}{}, then I'd use a local re- 
definition, \dfracol{}{}{colour}, to colourise the fraction stroke.  
This way automatically an appropriate area will filled with colour.

\dfrac is defined in amsmath.sty as:


and \genfrac is there defined as:

	    \csname @@\ifx @#3 at over\else above\fi
	    \ifx\@tempa\@empty \else withdelims\fi\endcsname}

which introduces \@genfrac defined as:


\genfrac seems to use something like \over or \above, depending on  
the third argument of \dfrac/\genfrac, and this name is changed in  
the presence of a fourth non-zero argument to \overwithdelims or  
\abovewithdelims. These are defined as:


So the proper function might be \primfrac, which is:

	Foreign command \@backslashchar#1;\MessageBreak
	\protect\frac\space or \protect\genfrac\space should be used instead%
	  \global\@xp\let\csname#1\@xp\endcsname\csname @@#1\endcsname

*I* can't see how the fraction is constructed. And so I can't tell  
where to insert a \colorbox{colour}{} ... Could be \@tempa and  
\@tempb are doing some work.



Real Time, adj.:
	Here and now, as opposed to fake time, which only occurs there and  

More information about the MacOSX-TeX mailing list