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.

4
  • Welcome to TeX.SX! If the only contents of that tabular is maths, consider using array instead.
    – Skillmon
    Oct 1, 2018 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, 2018 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) Oct 1, 2018 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.
    – Jose
    Oct 4, 2018 at 13:27

1 Answer 1

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}
1
  • 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.
    – Jose
    Oct 4, 2018 at 13:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .