[OS X TeX] colorbox

Alain Schremmer schremmer.alain at gmail.com
Mon Jul 28 08:41:21 EDT 2008


On Jul 27, 2008, at 11:36 PM, Alan Munn wrote:

> At 10:28 PM -0400 7/27/08, Alain Schremmer wrote:
>> This is just a LaTeX question but I have already wasted a couple  
>> of hours on it. So, I hope, Š
>>
>> I would like to have the same highlighting effect as in
>>
>> 	$f(x)$\colorbox{yellow}{$\left.\right|_{x:=-3}$}
>>
>> but of course, since the delimiters do not take the height of the  
>> front into account, with
>>
>> 	$\dfrac{x}{x-1}$\colorbox{yellow}{$\left.\right|_{x:=-3}$}
>>
>>  the vertical bar is too short and I am not able to move \left. to  
>> the left of the fraction.
>
> How about:
>
> \newlength{\foo}
> \settoheight{\foo}{$\dfrac{x}{x-1}$}
>
> $\dfrac{x}{x-1}$\colorbox{yellow}{$\left.\rule{0pt}{\foo}\right|_ 
> {x:=-3}$}

I didn't know about \rule

Although, from an purist's point of view, I would assume that this is  
not a solution in that it does not measure the height of the front,  
this works nicely enough for me and bails me out entirely. (Besides,  
if I have remained a radical, I ceased to be a purist a long time ago.)

Very grateful regards
--schremmer


More information about the MacOSX-TeX mailing list