[texhax] weird LaTeX behavior

Axel Freyn axel-freyn at gmx.de
Sat Jan 30 16:43:21 CET 2010


Hello,
> 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 [
> 
> Is this normal behavior?
Yes, I think so. "\\" accepts optional a parameter -- the vertical space
which will be added after the line (e.g. \\[2cm]). The way the
LaTeX-parser works, it is allowed to add a newline between "\\" and "["
-- and nevertheless LaTeX will understand [ as indicating a
parameter-list for the linebreak "\\".

So, your best solution is probably to add some other character(s)
between "\\" and "[", which will prevent this effect.
I would recommend something like e.g. "\\{}[" oder "\\{[}" which will
not influence the result.

Best regard,

Axel


More information about the texhax mailing list