0

I want to type two independent equations, one below another, and the second one having an aligned iff chain. I've coded the following:

\documentclass{article}
\usepackage[portuguese]{babel}
\usepackage{commath} 

\begin{document}

\def\,{{,}}

\begin{tabular}{l}
    $1+q_{12}+6=15  \iff q_{12} = 8$; \\
    $\begin{aligned}
            q_{12} + q_{22} + 9= 15 & \iff 8+q_{22} + 9= 15\\
            & \iff q_{22} = -2
    \end{aligned}$
\end{tabular}

\end{document}

The result is what I wanted, except for a comma that was automatically inserted in the middle of the equations.

  • Welcome to TeX.SX! If the only contents of that tabular is maths, consider using array instead. – Skillmon Oct 1 '18 at 13:27
  • I have no such comma inserted. On the other hand, why don't you use a plain align* for this group of equations? – Bernard Oct 1 '18 at 17:31
  • please always post a complete small document that shows the problem. The code that you posted does not produce a comma. (tabular is not the right environment for a math display, but that would not produce the comma) – David Carlisle Oct 1 '18 at 17:38
  • After isolating some parts of the code, I've found out that a \def produced the comma I was talking about. I've updated my question to add a small document. Anyway, thanks for the hints on not using tabular. – Josenaldo Oct 4 '18 at 13:27
2

Your question isn't clear nothing in the code you posted makes a comma (or did you mean the semicolon ; ?)

A tabular is not intended for making math displays, and as you had it, the first row was in inline math style and the later rows in display math.

I think that your intended layout using aligned is as shown below using gather* but perhaps the second version using align* looks more natural.

enter image description here

\documentclass{article}

\usepackage{amsmath}

\begin{document}

gather
\begin{gather*}
    1+q_{12}+6=15  \iff q_{12} = 8 \\
    \begin{aligned}
            q_{12} + q_{22} + 9= 15 & \iff 8+q_{22} + 9= 15\\
            & \iff q_{22} = -2
    \end{aligned}
\end{gather*}

align
\begin{align*}
    1+q_{12}+6=15  &\iff q_{12} = 8 \\
            q_{12} + q_{22} + 9= 15 & \iff 8+q_{22} + 9= 15\\
            & \iff q_{22} = -2
\end{align*}

\end{document}
  • Thanks, I didn't know about gather. The equations are aligned left on my document, so I think that the option with gather is more suitable. – Josenaldo Oct 4 '18 at 13:35

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.