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}
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
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
\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}}
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p