2

I have this on latex

\begin{equation}
\begin{aligned}
[A_i, A_j]&=i\varepsilon_{ijk}A_k\\
[B_i, B_j]&=i\varepsilon_{ijk}B_k\\
[A_i, B_j]&=0
\end{aligned}
\label{eq:10}
\end{equation}

and the output is:

enter image description here

Why isn't the [A_i, A_j] appearing? How can I fix it? Thank you.

Mico
  • 506,678
Cheryl
  • 23

3 Answers3

8

In addition to NBurs answer here is the warning I get in the log

Package amsmath Warning: Bracket group [A_i, A_j] at formula start!
(amsmath)                It could be a misspelled positional argument.
(amsmath)                If it belongs to the formula add a \relax in
(amsmath)                front to hide it on input line 11.

Basically aligned takes an optional argument in [], and in amsmath's default setup spaces are allowed between \begin{aligned} and [...].

You can either use \begin{aligned}\relax or load mathtools (good idea anyway, disclamer I maintain it) as mathtools changes aligned such that space between \begin{aligned} and the argument in []'s are not allowed.

daleif
  • 54,450
  • I wished to add this warning… ;) By the way, even without the optional argument, I've got the correct output. Seems weird? – NBur Jan 12 '21 at 08:05
  • @NBur it depends on the version of amsmath you use. – daleif Jan 12 '21 at 08:57
  • I use the amsmath 2020/09/23 v2.17i. Output is right without the optional argument, but I've got the warning message. – NBur Jan 12 '21 at 09:00
4

It looks like you're using an outdated version of the amsmath package (which provides the aligned environment). With the current version of amsmath (amsmath 2020/09/23 v2.17i), the issue you encountered is no longer present.

enter image description here

\documentclass{article}
\usepackage{amsmath} % for 'aligned' environment
\begin{document}
\begin{equation}
\begin{aligned}
  [A_i, A_j]&=i\varepsilon_{ijk}A_k\\
  [B_i, B_j]&=i\varepsilon_{ijk}B_k\\
  [A_i, B_j]&=0
\end{aligned}
\label{eq:10}
\end{equation}
\end{document}
Mico
  • 506,678
  • 2
    You could maybe update your answer https://tex.stackexchange.com/a/281943/82917 and then we might mark this question as duplicate. – campa Jan 12 '21 at 08:37
  • @campa - Many thanks for locating the earlier posting and for suggesting that I update it suitably. I've updated the answer I gave there and have closed the present query. – Mico Jan 12 '21 at 08:50
1

From the amsmath documentation:

The aligned environment takes an optional argument that indicates its vertical position in relation to surrounding material: t, c, or b for top, center, or bottom.

In your code this optional argument is read as [A_i, A_j], which is unknown. And you get the warning reported in the other answer by @daleif.

Thus you have to write

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\begin{document}
    \begin{equation}\text{at top }
    \begin{aligned}[t]
    [A_i, A_j]&=i\varepsilon_{ijk}A_k\\
    [B_i, B_j]&=i\varepsilon_{ijk}B_k\\
    [A_i, B_j]&=0
    \end{aligned}\text{ after eq}
    \label{eq:10t}
    \end{equation}
    \begin{equation}\text{centered }
    \begin{aligned}[c]
    [A_i, A_j]&=i\varepsilon_{ijk}A_k\\
    [B_i, B_j]&=i\varepsilon_{ijk}B_k\\
    [A_i, B_j]&=0
    \end{aligned}\text{ after eq}
    \label{eq:10c}
    \end{equation}
    \begin{equation}\text{at bottom }
    \begin{aligned}[b]
    [A_i, A_j]&=i\varepsilon_{ijk}A_k\\
    [B_i, B_j]&=i\varepsilon_{ijk}B_k\\
    [A_i, B_j]&=0
    \end{aligned}\text{ after eq}
    \label{eq:10b}
    \end{equation}
\end{document}
NBur
  • 4,326
  • 10
  • 27
  • AFAICT, the question is not about where to place the equation number. Instead, it's about why the [A_i, A_j] term doesn't show up. Changing \begin{aligned} to \begin{aligned}[c] treats the symptom, not the cause, of the problem. – Mico Jan 12 '21 at 08:10
  • 1
    Adding [t], [c] or [b] treats the cause, since [A_i, A_j] is no more the optional argument and thus is diplayed. But indeed my answer lacked this explanation. – NBur Jan 12 '21 at 08:17
  • 1
    In my view, the real solution is to fully update one's TeX distribution and, in particular, the amsmath package. With amsmath 2020/09/23 v2.17i, the problem encountered by the OP doesn't arise at all. – Mico Jan 12 '21 at 08:28
  • @Mico Sure! The output is right, but there is still the warning. – NBur Jan 12 '21 at 08:37