8

I'm new to the systeme package. I was reading the manual to get to know it, but unfortunately it is written in French. I want to typeset the following

enter image description here

The best I can come up with is the following code

\syscodeextracol{\kern 2.5em }{}
 \sysextracolsign{|}\sysdelim{\{}{|}\systeme{3x+7y=1 | 5,
        5x-8y=-18  |(-3)}

which is clearly not exactly what I want. Full MWE is the following:

\documentclass[12pt]{standalone}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{systeme}

\begin{document}

\syscodeextracol{\kern 2.5em }{}
 \sysextracolsign{|}\sysdelim{\{}{|}\systeme{3x+7y=1 | 5,
        5x-8y=-18  |(-3)}

\end{document}

Any suggestions?

3 Answers 3

6

How about consecutive \systeme directives?

enter image description here

The required amount of kerning between the \systeme blocks will depend on both the font size and the math and text fonts that are in use. For Computer Modern and a 12pt document font size, \kern-26pt looks "about right". If one were to load the newtxtext and newtxmath font packages, then \kern-22pt would be "about right".

\documentclass[12pt,border=1pt]{standalone}
\usepackage{systeme}

\begin{document}

 \sysdelim{\{}{|}
 \systeme{ 3x+7y=1 , 5x-8y=-18 }
 \kern-26pt % kerning amount obtained by trial and error :-)
 \sysdelim{.}{.} \sysalign{l,l}
 \systeme{ \cdot 5 , \cdot(-3) }

\end{document}
0
8

You can just set this as an array:

enter image description here

\documentclass{article}

\begin{document}

\[
  \left\{\begin{array}{ @{} r @{} l | l @{} }
    3x + 7y ={} &   1 & \cdot 5    \\[\jot]
    5x - 8y ={} & -18 & \cdot (-3)
  \end{array}\right.
\]

\end{document}
1
  • Good old arrays. (+1)
    – Tolaso
    May 2 at 3:51
7

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}

enter image description here

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{}.

enter image description here

1
  • Do you use LaTeX3 syntax? Anyway, your solution covers a more general case. (+1) though.
    – Tolaso
    May 2 at 3:50

You must log in to answer this question.

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