0

I have multiple lines in maths mode, and would like to contain all them in the same vertical lines - kind of like a box around multiple lines but without the top and bottom borders. I would like for this to work in both in-line maths mode ($...$) and the other maths mode ($$...$$, I don't know what its called).

For example, how would you put vertical lines around something like this:
$|a|\Rightarrow|b|$\\
$\text{....}\boxminus|a|\Rightarrow|b|$\\
$\text{....}\Leftrightarrow\neg|a|\vee|b|$\\

I have searched for solutions, and tried using the bars for determinants from linear algebra, but the formatting was very inconsistent with them.

1 Answer 1

1
I propose two easy way:

\documentclass[10pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx,framed}
\begin{document}
    \begin{leftbar}
        $|a|\Rightarrow|b|$\\
        $\text{....}\boxminus|a|\Rightarrow|b|$\\
        $\text{....}\Leftrightarrow\neg|a|\vee|b|$\\
    \end{leftbar}

\vspace{1cm}
\begin{tabular}{|l}
    $|a|\Rightarrow|b|$\\
    $\text{....}\boxminus|a|\Rightarrow|b|$\\
    $\text{....}\Leftrightarrow\neg|a|\vee|b|$\\
\end{tabular}
\end{document}

Output:

enter image description here

1
  • Thanks for answer, it worked almost as I wanted. It did not occur to me that it is possible to use the tabular environment like this. I just have a follow-up question. When I have something like, (should output correctly when put into a TeX editor): ``` \begin{tabular}{|l|} $a$\\ $\sim b$\\ \end{tabular} $\boxminus$ \begin{tabular}{|l|} $a$\\ $\sim b$\\ \end{tabular} ``` How could I put the $\boxminus$ between the tabulars so that it is in line with the top lines? At the moment, the $\boxminus$ formats to be vertically in the middle.
    – Andrei
    Nov 19, 2022 at 8:43

You must log in to answer this question.

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