If the expression contains many commas then consider to break it into several math expressions, separated by commas. It reads like a list of math expressions. This way TeX can break the line.
To achieve line breaks after a comma, you could insert \allowbreak
after the comma and before the next math symbol. If necessary, leave a blank after \allowbreak
.
If you would like to have a document wide solution, you could redefine the comma. One solution, following the tip here would be:
\makeatletter
\def\old@comma{,}
\catcode`\,=13
\def,{%
\ifmmode%
\old@comma\discretionary{}{}{}%
\else%
\old@comma%
\fi%
}
\makeatother
When \cite
tries to split the argument, it doesn't find the expected delimiter, which is a category 12 comma and is different from a category 13 comma.
The correct way, other than using breqn is to make the comma "math active", just as it is done in the package icomma.
\AtBeginDocument{%
\mathchardef\mathcomma\mathcode`\,
\mathcode`\,="8000
}
{\catcode`,=\active
\gdef,{\mathcomma\discretionary{}{}{}}
}
But I should warn about making this definition, as TeX might break also formulas such as $(a,b)$. I would suggest
\mathchardef\breakingcomma\mathcode`\,
{\catcode`,=\active
\gdef,{\breakingcomma\discretionary{}{}{}}
}
\newcommand{\mathlist}[1]{$\mathcode`\,=\string"8000 #1$}
and using \mathlist{a,b,c,d}
for a list that can be split across lines. (The \string
is useful in connection with babel, for some languages make the double quote active.)
Best Answer
The
\[...\]
is used to typeset a single equation, not multiple equations.You need to use an environment that allows for multiple equations. One way is to use
gather
, but I normally usealign
, both from theamsmath
package:Notes:
gather*
andalign*
.Code: