[texhax] parenthesis problem in LaTeX
Lars Madsen
daleif at imf.au.dk
Sat Jan 17 00:16:02 CET 2009
Tom Schneider wrote:
> Reinhard:
>
>> Tom Schneider writes:
>> > Here's a puzzle for the sharp folks on this list!
>>
>> Hi Tom,
>> the problem is obviously that unlike "silent", the word "ring"
>> contains the letter "g" which has a descender, as Steve explained
>> already.
>>
>> How can you achieve that all braces have the same size? There are
>> many possible solutions. You could use struts or phantoms.
>>
>> However, there is a very elegant solution. All *tex programs except
>> Knuth's tex itself are using the eTeX extensions for a couple of years
>> now.
>>
>> $ pdftex \\relax\\bye
>> This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)
>> %&-line parsing enabled.
>> entering extended mode <===========
>> No pages of output.
>> Transcript written on texput.log.
>>
>> You are using \left and \right already, but eTeX provides a new
>> primitive called \middle. See:
>>
>> http://tug.ctan.org/tex-archive/systems/e-tex/v2/doc/etex_man.pdf
>>
>> section 3.9 on page 12.
>
> Ok, thanks. I'm unsure how it would be used in this case.
>
> \left( ..part A ring .. \right)
> \middle??
> \left( ..part B silent .. \right)
>
> fails with '! Missing delimiter (. inserted).
> <to be read again>
> ?
> l.84 \middle?'
>
> or
>
> \begin{equation}
> \left( ..part A ring .. \right)
> \middle(silent right \middle)
> \left( ..part B silent .. \right)
> \end{equation}
>
> gives 'extra middle('
>
> \begin{equation}
> \middle(
> \left( ..part A ring .. \right)
> \left( ..part B silent .. \right)
> \middle)
> \end{equation}
>
> gives 'extra middle('
>
> \middle(
> \left( ..part A ring .. \right)
> \left( ..part B silent .. \right)
> \middle)
>
> In the original context
>
> \begin{equation}
> H =
> P_{\mbox{ring}} \times \left( -\log_2 ( P_{\mbox{ring}}) \right)
> +
> P_{\mbox{rinc}} \times \left( -\log_2 ( P_{\mbox{rinc}}) \right)
> \end{equation}
>
> doing this:
>
> \begin{equation}
> \middle(
> H =
> P_{\mbox{ring}} \times \left( -\log_2 ( P_{\mbox{ring}}) \right)
> +
> P_{\mbox{rinc}} \times \left( -\log_2 ( P_{\mbox{rinc}}) \right)
> \middle)
> \end{equation}
>
> Also gives the error message 'extra middle('.
>
> Even trying to follow their exact words,
>
> \begin{equation}
> \middle(
> H =
> P_{\mbox{ring}} \times \left( -\log_2 ( P_{\mbox{ring}}) \right)
> \middle)
> +
> \middle(
> P_{\mbox{rinc}} \times \left( -\log_2 ( P_{\mbox{rinc}}) \right)
> \middle)
> \end{equation}
>
> gives the same error.
>
> I have no idea how to use this thing.
>
> Thanks,
>
> Tom
pretty forward
\left( \frac12 \middle | \frac 12 \right)
it goes in the middle ... ;-)
--
/daleif
More information about the texhax
mailing list