Not fully automated, but not difficult to input either: you use \tr
in the top row, \mr
in the middle rows and \br
in the bottom row.
Each of these commands take an optional argument for extra depth (in \tr
), extra height (in \br
) and extra height and depth (in \mr
) in case unusually high rows are present.
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{systeme}
\newcommand{\tr}[1][0pt]{%
\smash{%
\vrule height \ht\strutbox depth \dimexpr\dp\strutbox+0.5ex+#1\relax
}%
}
\newcommand{\mr}[1][0pt]{%
\smash{
\vrule height \dimexpr\ht\strutbox+0.5ex+#1\relax depth\dimexpr\dp\strutbox+0.5ex+#1\relax
}%
}
\newcommand{\br}[1][0pt]{%
\smash{
\vrule height \dimexpr\ht\strutbox+0.5ex+#1\relax depth\dp\strutbox
}%
}
\begin{document}
\[
\syscodeextracol{\kern 0.5em $}{$}
\sysextracolsign{|}
\systeme{
3x+7y=1 |\tr \cdot 5,
5x-8y=-18 |\br \cdot (-3)
}
\]
\[
\syscodeextracol{\kern 0.5em $}{$}
\sysextracolsign{|}
\systeme{
3x+7y+z=1 |\tr \cdot 5,
5x-8y-z=-18 |\mr \cdot (-3),
2x+y+z=2 |\br
}
\]
\end{document}

A different approach, where you can independently add extra height and depth and also set the default vertical separation.
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{systeme}
\ExplSyntaxOn
\keys_define:nn { tolaso/sysrules }
{
t .bool_set:N = \l__tolaso_sysrules_top_bool,
b .bool_set:N = \l__tolaso_sysrules_bot_bool,
m .code:n = \keys_set:nn { tolaso/sysrules } { t,b },
h .dim_set:N = \l__tolaso_sysrules_extra_height_dim,
d .dim_set:N = \l__tolaso_sysrules_extra_depth_dim,
s .dim_set:N = \l__tolaso_sysrules_default_sep_dim,
}
\NewDocumentCommand{\SEP}{m}
{
\group_begin:
\keys_set:nn { tolaso/sysrules } { s=0.5ex, #1 }
\__tolaso_sysrules_make:
\group_end:
}
\cs_new_protected:Nn \__tolaso_sysrules_make:
{
\smash
{
\vrule
height \dim_eval:n {
\ht\strutbox + \l__tolaso_sysrules_extra_height_dim
\bool_if:NF \l__tolaso_sysrules_top_bool { + \l__tolaso_sysrules_default_sep_dim }
}
depth \dim_eval:n {
\dp\strutbox + \l__tolaso_sysrules_extra_depth_dim
\bool_if:NF \l__tolaso_sysrules_bot_bool { + \l__tolaso_sysrules_default_sep_dim }
}
}
}
\ExplSyntaxOff
\begin{document}
\[
\syscodeextracol{\kern 0.5em $}{$}
\sysextracolsign{|}
\systeme{
3x+7y=1 |\SEP{t} \cdot 5,
5x-8y=-18 |\SEP{b} \cdot (-3)
}
\]
\[
\syscodeextracol{\kern 0.5em $}{$}
\sysextracolsign{|}
\systeme{
3x+7y+z=1 |\SEP{t} \cdot 5,
5x-8y-z=-18 |\SEP{} \cdot (-3),
2x+y+z=2 |\SEP{b}
}
\]
\[
\syscodeextracol{\kern 0.5em $}{$}
\sysextracolsign{|}
\systeme{
3x+7y+z=1 |\SEP{t} \cdot 5,
5x-8y-z=-{\displaystyle\sum_{k=1}^n k} |\SEP{h=0.8ex,d=0.8ex} \cdot (-3),
2x+y+z=2 |\SEP{b}
}
\]
\end{document}
For uniformity, you can say \SEP{m}
for a middle row instead of \SEP{}
.
