Code: Select all
\sum_{\substack{i,\, j \,=\, 1 \\ j \, \ne \, i}} A_{ij}
Code: Select all
\sum_{\substack{i,\, j \,=\, 1 \\ j \, \ne \, i}} A_{ij}
Code: Select all
\documentclass[11pt,a4paper]{article}\usepackage{amsmath}\begin{document}\[\sum_{\substack{i,\, j\,=\, 1 \\ \hphantom{i,} j\,\ne\, i}} A_{ij}\]\end{document}
I tried it. The alignment isn't perfect.localghost wrote:You can insert a vertical phantom
The "=" and "\ne" aren't exactly aligned. If you compile and watch the index closely, you'll notice a small (and noticeable) offset. It's ugly.localghost wrote:Works fine for me. Please clarify in which way this is not satisfactory.
Code: Select all
\documentclass{article}\usepackage{amsmath}\begin{document}\[\sum_{\scriptsize\begin{aligned}i, j &= 1 \\[-4pt] j &\ne i\end{aligned}} A_{ij}\]\end{document}
This code works fine. Thanks a lot for it !Stefan_K wrote:Hi Cham,
since equations/inequalities have to be aligned at a relation symbol, you could use an aligned environment. Also here you can customize size and fine-tune spacing. For example:
Code: Select all
Code, edit and compile here:\documentclass{article}\usepackage{amsmath}\begin{document}\[\sum_{\scriptsize\begin{aligned}i, j &= 1 \\[-4pt] j &\ne i\end{aligned}} A_{ij}\]\end{document}
The formula associated to this warning message is this :LaTeX Font Warning: Command \scriptsize invalid in math mode on input line 222.
Code: Select all
\sum_{\scriptsize\begin{aligned} i, j &= 1 \\[-4pt] i &\ne j \end{aligned}}