[texhax] weird LaTeX behavior

Martin Heller mr_heller at yahoo.dk
Sat Jan 30 17:09:25 CET 2010


Fritz Scholz wrote:

> The following code segment gives me problems in running it 
> (in Linux as well Windows XP)
> 
> \documentclass{article}
> 
> \begin{document}
> 
> \begin{eqnarray}
> [a,c) &=& B\\ 
> [g,f) &=& G
> \end{eqnarray}
> 
> \end{document}
> 
> 
> Comments: it appears the problem is the second [.
> It works fine if I replace it by \;[ or (.
> I suspect it has to do with \\ followed by [
> 


It is well known and use of eqnarray should generally be avoided for 
several reasons:
<http://www.tug.org/pracjourn/2006-4/madsen/madsen.pdf>.

Use align from amsmath instead:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

Bad spacing
\begin{eqnarray}
   [a,c) &=& B\\\relax
   [g,f) &=& G
\end{eqnarray}

Correct spacing
\begin{align}
   [a,c) &= B\\
   [g,f) &= G
\end{align}

\end{document}



More information about the texhax mailing list