[texhax] parenthesis problem in LaTeX

Steve Schwartz s.schwartz at imperial.ac.uk
Wed Jan 14 02:48:13 CET 2009


Tom,

You were the sharp one to diagnose the problem as the descending "g".
That was the hard bit. To fix, just add something that doesn't print but
takes up the same vertical dimension, namely a \vphantom{g}:

\begin{equation}
H =
P_{\mbox{ring}}   \times \left( -\log_2 ( P_{\mbox{ring}})   \right)
+
P_{\mbox{silent}} \times \left( -\log_2 ( P_{\mbox{silent\vphantom{g}}})
\right)
\end{equation}

This worked fine when I tested it.

I use phantoms all the time - be they \vphantoms, \hphantoms, or full
\phantoms.

Cheers
Steve

On Tue, 2009-01-13 at 19:43 -0500, Tom Schneider wrote:
> Here's a puzzle for the sharp folks on this list!
> 
> \documentclass{article}
> \newcommand{\theversion}{{version = 1.00 of latex2009jan13.tex 2009 Jan 13 }}
> \begin{document}
> \begin{center}
> \textbf{A Bug in \LaTeX?}
> \\
> \theversion
> \end{center}
> 
> \begin{equation}
> H =
> P_{\mbox{ring}}   \times \left( -\log_2 ( P_{\mbox{ring}})   \right)
> +
> P_{\mbox{silent}} \times \left( -\log_2 ( P_{\mbox{silent}}) \right)
> \end{equation}
> 
> The outer pair of parenthesis on the left are made using
> \verb|\left(|
> and
> \verb|\right)|, and indeed they show up as larger than the inner parenthesis.
> However, on the right side of the equation, the same
> pair of commands fails to give the same size parenthesis.
> 
> Ok, try go get around the bug by using big:
> 
> \begin{equation}
> H =
> P_{\mbox{ring}}   \times \left( -\log_2 ( P_{\mbox{ring}})   \right)
> +
> P_{\mbox{silent}} \times \big( -\log_2 ( P_{\mbox{silent}}) \big)
> \end{equation}
> That failed.
> 
> Try bigg:
> \begin{equation}
> H =
> P_{\mbox{ring}}   \times \left( -\log_2 ( P_{\mbox{ring}})   \right)
> +
> P_{\mbox{silent}} \times \bigg( -\log_2 ( P_{\mbox{silent}}) \bigg)
> \end{equation}
> bigg is too big!
> 
> \begin{equation}
> H =
> P_{\mbox{ring}}   \times \bigg( -\log_2 ( P_{\mbox{ring}})   \bigg)
> +
> P_{\mbox{silent}} \times \bigg( -\log_2 ( P_{\mbox{silent}}) \bigg)
> \end{equation}
> 
> Extra braces do not help:
> \begin{equation}
> H =
> {P_{\mbox{ring}}   \times \left( -\log_2 ( P_{\mbox{ring}})   \right)}
> +
> {P_{\mbox{silent}} \times \left( -\log_2 ( P_{\mbox{silent}}) \right)}
> \end{equation}
> 
> Finally, make the equation parts exactly identical:
> \begin{equation}
> H =
> P_{\mbox{ring}}   \times \left( -\log_2 ( P_{\mbox{ring}})   \right)
> +
> P_{\mbox{ring}}   \times \left( -\log_2 ( P_{\mbox{ring}})   \right)
> \end{equation}
> That worked.  So why would the height be different?  It's the `g'?
> 
> Try removing the g:
> \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}
> Now they are the same, but of course it says the wrong thing.
> 
> So how should this be typeset?
> 
> \begin{verbatim}
> 
> Tom
> 
>   Dr. Thomas D. Schneider
>   National Institutes of Health
>   National Cancer Institute
>   Center for Cancer Research Nanobiology Program
>   Molecular Information Theory Group
>   Frederick, Maryland  21702-1201
>   toms at ncifcrf.gov
>   permanent email: toms at alum.mit.edu
>   http://www.ccrnp.ncifcrf.gov/~toms/
> \end{verbatim}
> \end{document}
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
> 
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
-- 
+-------------------------------------------------------------------+
Professor Steven J Schwartz        Phone: +44-(0)20-7594-7660
Head, Space & Atmospheric Physics  Fax:   +44-(0)20-7594-7900
The Blackett Laboratory            E-mail: s.schwartz at imperial.ac.uk
Imperial College London            Office: Huxley 711A 
London SW7 2AZ, U.K.               Web: www.sp.ph.ic.ac.uk/~sjs
+-------------------------------------------------------------------+



More information about the texhax mailing list