# Centered vertical rule in a displaymath

How would I place a centered vertical rule that separates two regions of text in a displaymath environoment? The effect I want is described below. Thanks!

$3x + 2 = 6 | x + 5 = 7 -2 = -2 | -5 = -5 3x = 4 | x = 2 x = 4/3 |$

• Could we have a more explicit of what you want to obtain? (multilined maths or not, alignment points,&c.) – Bernard Apr 26 '15 at 0:06
• Welcome to TeX SE! If it is text, why put it in a maths environment at all? – cfr Apr 26 '15 at 0:27
• Edited. Hopefully more clear. – user77001 Apr 26 '15 at 0:55

Here is a MWE: \documentclass[letterpaper]{article}
\usepackage{amsmath}
\begin{document}
\begin{tabular}{l|l}
\begin{aligned} 3x + 2 &= 6\\ -2 &= -2 \\ 3x &= 4 \\ x &= 4/3 \\ \end{aligned}  &
\begin{aligned} 3x + 2 &= 6\\ -2 &= -2 \\ 3x &= 4 \\ x &= 4/3 \\ \end{aligned}
\end{tabular}
\end{document}


In the above example, I implement a tabular environment. You may also use an array or multicolumn version to create the same result.

Without a tabular:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{gather*}
\begin{aligned}
3x + 2 &= 6\\
-2 &= -2    \\
3x &= 4  \\
x &= 4/3  \\
\begin{aligned}
3x + 2 &= 6\\
-2 &= -2    \\
3x &= 4  \\
x &= 4/3  \\
\end{aligned}
\end{gather*}
\end{document} This works too

\begin{aligned} 3x + 2 &= 6\\ -2 &= -2 \\ 3x &= 4 \\ x &= 4/3 \\ \end{aligned} \quad \vrule \quad \begin{aligned} 3x + 2 &= 6\\ -2 &= -2 \\ 3x &= 4 \\ x &= 4/3 \\ \end{aligned}

• Omg I totally forgot about \vrule – azetina Apr 26 '15 at 4:12