0

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        |  
\]
  • 2
    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
3

Here is a MWE:

enter image description here

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

1

Without a tabular:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{gather*}
    \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}
\end{gather*}
\end{document}

enter image description here

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

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.