2

I am interested in the absolute value of the horizontal spacing which is automatically assigned by numcases before an alignment point. For instance, what is the spacing after the comma and before "(case 2)" in the following example? The reason I am asking is that I would like to make this spacing uniform in different equations. When using e.g. alignat, I apparently have to manually enter a space before the second alignment point. Alternatively, is there a way to manually set this spacing when using numcases?

This is the example:

\documentclass{book}
\usepackage{amsmath, cases}

\begin{document}

\begin{numcases}{|x|=}
x, & (case 1)\\
-x, & (case 2)
\end{numcases}

\begin{alignat}{2}
& 1+2=3 & \quad & \text{(equation 1)}, \\
& 2+2=4 & \quad & \text{(equation 2)}, \\
& 3+2=5 & \quad & \text{(equation 3)}.
\end{alignat}

\end{document}
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Symbol 1 Mar 17 '15 at 17:19
  • Thanks. I have modified the original question and hope that clarifies my problem. – Eeelearner Mar 18 '15 at 9:03
1

Rather than cases it's better to use the more powerful package empheq:

\documentclass{book}
\usepackage{amsmath,empheq}

\begin{document}

\begin{empheq}[left={|x|=\empheqlbrace}]{alignat=2}
x, & \quad & \text{(case 1)}\\
-x, & \quad & \text{(case 2)}
\end{empheq}

\begin{alignat}{2}
& 1+2=3 & \quad & \text{(equation 1)}, \\
& 2+2=4 & \quad & \text{(equation 2)}, \\
& 3+2=5 & \quad & \text{(equation 3)}.
\end{alignat}

\end{document}

enter image description here

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.