# How would you manage to put a vertical bar right to a system of equations?

I've been using the systeme package to write systems of linear equations but I need to do something I don't know how to. I'm trying to put a vertical line to the right of the system and write text after that.

The end result would look like that (sorry about the bad drawing, I didn't really look for an already formatted image). So far I can easily get the system but have no idea how to add the vertical line and text. Thanks for the help.

Two variants, also with systeme:

\documentclass{article}
\usepackage{amsmath}
\usepackage{systeme}

\begin{document}

$\systeme{t + x + y + z = 4, x + y = 2, z = 2}\sysdelim| . \systeme{\mbox{} @ \text{Some text}, \mbox{}@ \text{Some more text},\mbox{} @\text{A last text}}$
\bigskip
\sysdelim\{| \systeme{t + x + y + z = 4, x + y = 2, z = 2\enspace} \enspace \begin{aligned} & \text{Some text} \\ & \text{Some more text} \\ & \text{A last text} \end{aligned}

\end{document}


• Your code it is more beautiful instead of mine :-) Great!!!! Commented Jan 20, 2020 at 22:12
• I don't agree, your code is quite short and clean. Commented Jan 20, 2020 at 22:14
• I have not the left alignment for the text like your code. I'm not an envious person, and I appreciate true beauty... Commented Jan 20, 2020 at 22:15
• Just a suggestion: use matrix*[l]. Commented Jan 20, 2020 at 22:17
• Thanks you very much. That helped a lot. Commented Jan 25, 2020 at 20:43

It is possible to solve your question using systeme package adding a matrix to the right (for example).

 %% Compile and read me!
\documentclass[a4paper,12pt]{article}
\usepackage{mathtools}
\usepackage{systeme}
\begin{document}
$\sysdelim{\{}{|}\systeme{t+x+y+z=4,x+y=2,z=2} \quad \begin{matrix} \text{my text} \\[.3em] \text{another text} \\[.3em] \text{my favorite}\end{matrix}$
\end{document}


\documentclass[a4paper,12pt]{article}
\usepackage{mathtools}
\usepackage{systeme}
\begin{document}
$\sysdelim{\{}{|}\systeme{t+x+y+z=4,x+y=2,z=2} \quad \begin{matrix*}[l] & \text{my text} \\[.3em] &\text{another text} \\[.3em] &\text{my favorite}\end{matrix*}$
\end{document}

• Great minds think together! ;) (+1) Commented Jan 20, 2020 at 22:11
• @Bernard Ahahahahahhaahah LOL LOL :-) Commented Jan 20, 2020 at 22:13
• Thanks ! This looks great, exactly what was needed. Commented Jan 25, 2020 at 20:44
• @Tommy I am only a poor user and the other answers can be more better of mine. Check with the green mark that you like more :-) (no my answer :-))))) Commented Jan 25, 2020 at 20:49

An improvement to Sebastiano's and Bernard's nice answers; it uses a single \systeme and the text is given at the end of each line.

This way, even vertically large texts are coped with, see the second (admittedly contrived) example.

The text is typeset in a zero width box, but the widths are measured and the maximum is computed. At the end I issue a suitable \hspace command to take care of the texts when centering the whole block.

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools}
\usepackage{systeme}

\usepackage{showframe} % to show the page frame, remove it

\newlength{\stextwidth}
\newcommand{\stext}[1]{%
\ifdim\dimen0>\stextwidth \global\stextwidth=\dimen0\fi
}

\begin{document}

\begin{equation*}
\global\stextwidth=0pt
\sysdelim{\{}{|}
\systeme{
t+x+y+z=4\stext{my text},
x+y=2\stext{another text},
z=2\stext{my favorite}
}\hspace{\stextwidth}
\end{equation*}

\end{document}


The second (contrived) example

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools}
\usepackage{systeme}

\usepackage{showframe} % for judging the centering

\newlength{\stextwidth}
\newcommand{\stext}[1]{%
\ifdim\dimen0>\stextwidth \global\stextwidth=\dimen0\fi
}

\begin{document}

\begin{equation*}
\global\stextwidth=0pt
\sysdelim{\{}{|}
\systeme{
t+x+y+z=4\stext{\parbox[t]{8em}{my text that is too long for one line\vspace{2ex}}},
x+y=2\stext{another text},
z=2\stext{my favorite}
}\hspace{\stextwidth}
\end{equation*}

\end{document}


If more than one of these systems are needed, it's better to define a macro:

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools}
\usepackage{systeme}

\usepackage{showframe} % for judging the centering

\newlength{\stextwidth}
\newcommand{\stext}[1]{%
\ifdim\dimen0>\stextwidth \global\stextwidth=\dimen0\fi
}
\newcommand{\tsysteme}[1]{%
\sysdelim{\{}{|}%
\global\stextwidth=0pt
\systeme{#1}%
\hspace{\stextwidth}%
}

\begin{document}

\begin{equation*}
\tsysteme{
t+x+y+z=4\stext{my text},
x+y=2\stext{another text},
z=2\stext{my favorite}
}
\end{equation*}

\end{document}

• Thanks ! This is great. Commented Jan 25, 2020 at 20:45