3

I have the following LaTeX code. It produced output aligned along the commas that divide the equations from their respective areas of validity, as shown below.

\begin{equation}
    \begin{cases}
        i_0-\sqrt{2\ln{2}}\sigma\leq i_k\leq i_0+2\sigma, & i_0>0\\
        i_0-3\sigma\leq i_k\leq i_0+\sqrt{2\ln{2}}\sigma, & i_0<0
    \end{cases},
\end{equation}

enter image description here

I would like to have the i_k vertically aligned as well as the commas. When I try to insert extra alignment markers I get a compilation error. Is there a simple way to have multiple points of vertical alignment in the cases environment, or is there a different environment that I can use for this purpose which would allow for this?

3

Use alignedat. I'll show a version with commas next to the formula and a version with aligned commas.

In general, I'd avoid commas hanging from nowhere, like the one you put after cases. If you want full punctuation, add commas after i_0>0 and i_0<0

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
\begin{cases}
\begin{alignedat}{3}
  i_0-\sqrt{2\ln 2}\,\sigma &\leq i_k &&\leq i_0+2\sigma,               &\qquad& i_0>0\\
  i_0-3\sigma               &\leq i_k &&\leq i_0+\sqrt{2\ln 2}\,\sigma, &\qquad& i_0<0
\end{alignedat}
\end{cases}
\end{equation}

\begin{equation}
\begin{cases}
\begin{alignedat}{3}
  i_0-\sqrt{2\ln 2}\,\sigma &\leq i_k &&\leq i_0+2\sigma               &,\qquad& i_0>0\\
  i_0-3\sigma               &\leq i_k &&\leq i_0+\sqrt{2\ln 2}\,\sigma &,\qquad& i_0<0
\end{alignedat}
\end{cases}
\end{equation}

\end{document}

enter image description here

I also introduced a couple of refinements.

  1. \log{2} is wrong: try \log{\sin{x}} and \log\sin x to realize why.1
  2. After a square root, a \, can help in better clarifying the meaning.

1 \ln is no different; it's just I can't bear that notation for the logarithm. ;-)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.