6

I was trying to close this bracket:

\frac{}{}\theta=2\pi k + \begin{cases}\arctan\left ( \frac{n}{x} \right ) & \text{ if } x> 0 \\ \frac{\pi }{2} & \text{ if } x=0 \\ \arctan\left ( \frac{n}{x} \right )+\pi & \text{ if } x< 0 \end{cases}\

(I don't know how to write Latex in here, go to https://latex.codecogs.com/eqneditor/editor.php)

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\[
\frac{}{}\theta=2\pi k + 
\begin{cases}\arctan\left ( \frac{n}{x} \right ) & \text{ if } x> 0 \\
\frac{\pi }{2} & \text{ if } x=0 \\
\arctan\left ( \frac{n}{x} \right )+\pi & \text{ if } x< 0 \end{cases}
\]
\end{document}

enter image description here

I tried using Bmatrix intead of cases but now the elements aren't aligned:

\frac{}{}\theta=2\pi k + \begin{Bmatrix}\arctan\left ( \frac{n}{x} \right ) & \text{ if } x> 0 \\ \frac{\pi }{2} & \text{ if } x=0 \\ \arctan\left ( \frac{n}{x} \right )+\pi & \text{ if } x< 0 \end{Bmatrix}
2
  • please always post complete documents not just fragments. What is the intention of\frac{}{} a fraction with no values? May 23 at 17:16
  • I added your example. What do you want to change? May 23 at 17:21

2 Answers 2

6

You can use alignedat. The only slight complication is that a thin space would be added in front of “arctan”, but it's easy to remove it.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
\theta=2\pi k +
\left\{
\begin{alignedat}{2}
&\! \arctan \frac{n}{x}      &\qquad& \text{if $x>0$} \\
&   \frac{\pi}{2}            &      & \text{if $x=0$} \\
&\! \arctan \frac{n}{x} +\pi &      & \text{if $x<0$}
\end{alignedat}
\right\}
\]

\end{document}

enter image description here

However, I'd go with cases and not add the closing brace.

1
  • 1
    Upvoted, mainly for the last sentence.
    – mickep
    May 24 at 7:54
5

I works if you use the Bmatrix* environment from mathtools, which takes an optional argument for the alignment (the same in each column):

    \documentclass{article}
    \usepackage{mathtools}

    \begin{document}

        \[ \frac{}{}\theta=2\pi k + \begin{Bmatrix*}[l]\arctan\left ( \frac{n}{x} \right ) & \text{ if } x> 0 \\ \frac{\pi }{2} & \text{ if } x=0 \\ \arctan\left ( \frac{n}{x} \right )+\pi & \text{ if } x< 0 \end{Bmatrix*} \]%

    \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.