9

How can I put the numbering in the systeme package to the left instead to the right?

The "naive" approach as in the following example doesn't work.

\documentclass{article}

\usepackage{systeme}
\begin{document}
\sysdelim..

\systeme{
2x + 3y = 4 @ \mathrm{I},
-x + 7y = -1 @ \mathrm{II} 
}

% This doesn't work:
% \systeme{
% \mathrm{I} @ 2x + 3y = 4,
% \mathrm{II} @ -x + 7y = -1
% }

\end{document}
student
  • 29,003

1 Answers1

7

Here a workaround, we can change the position of numbering with \syscodeextracol
the default is \syscodeextracol{\kern1.5em$}{$} which mean 1.5em from the end of equation, the two $ to put numbering inside math mode. Depending on the length of the equation we can change the position of numbering with negative space.

\documentclass{article}
\usepackage{systeme}


\begin{document}

\sysdelim..

\systeme{
2x + 3y = 4 @ \mathrm{I},
-x + 7y = -1 @ \mathrm{II} 
}

\bigskip
\syscodeextracol{\kern-8.5em\hfill$}{$\kern8.5em}

\systeme{
2x + 3y = 4 @ \mathrm{I},
-x + 7y = -1 @ \mathrm{II} 
}

\bigskip
\syscodeextracol{\kern1.5em$}{$}% return to default

\systeme{
2x + 3y = 4 @ \mathrm{I},
-x + 7y = -1 @ \mathrm{II} 
}


\end{document}

enter image description here

Update 1

To simplify the code we can create two commands \rightnum{width of equation} and \leftnum to switch between numbering on the right or on the left.

\documentclass{article}
\usepackage{systeme}

\newcommand{\rightnum}[1]{\syscodeextracol{\kern-#1\hfill$}{$\kern#1}}
\newcommand{\leftnum}{\syscodeextracol{\kern1.5em$}{$}}% return to default

\begin{document}

\sysdelim..

\systeme{
2x + 3y = 4 @ \mathrm{I},
-x + 7y = -1 @ \mathrm{II} 
}

\bigskip
\rightnum{8.5em}

\systeme{
2x + 3y = 4 @ \mathrm{I},
-x + 7y = -1 @ \mathrm{II} 
}

\bigskip
\leftnum

\systeme{
2x + 3y = 4 @ \mathrm{I},
-x + 7y = -1 @ \mathrm{II} 
}


\end{document}

Update 2

You can define the width of the box containing the whole system of equations as the length of negative space,
in this case you do not need to enter manually any space to left align numbering.

Here to put numbering on left side we use \systemeL command, for numbering on the right we keep on command \systeme

\documentclass{article}

\usepackage{systeme}
\newlength{\systemewd}

\newcommand\systemeL[2][]{
\settowidth{\systemewd}{\systeme{#2}}
\syscodeextracol{\kern-\systemewd\hfill$}{$\kern\systemewd}
\systeme [#1]{#2}
\syscodeextracol{\kern1.5em$}{$}}


\begin{document}

\sysdelim..

\systemeL{
2x + 3y + 4z = 4 @ \mathrm{I},
-x + 7y - 6z = -1 @ \mathrm{II}, 
3x +  y - 2z = 3 @ \mathrm{III}
}

\bigskip

\systeme{
2x + 3y + 4z = 4 @ \mathrm{I},
-x + 7y - 6z = -1 @ \mathrm{II}, 
3x +  y - 2z = 3 @ \mathrm{III}
}

\bigskip

\systemeL[yx]{
2x + 3y = 4 @ \mathrm{I},
-x + 7y = -1 @ \mathrm{II}
}

\end{document}

enter image description here

Salim Bou
  • 17,021
  • 2
  • 31
  • 76
  • Thanks. But do I understand you correctly, that I have to adjust the \kern parameter for each system individually? – student Jul 20 '15 at 08:21
  • Yes, unfortunately this is the method here. or if you have a way to know the length of the longest equation this could simplify matters – Salim Bou Jul 20 '15 at 10:52
  • Thanks thats what I wanted. I just wondered how to make the numbers on the left also left aligned, but this seems to be no problem because I can just change \syscodeextracol{\kern-\systemewd\hfill$}{$\kern\systemewd} to \syscodeextracol{\kern-\systemewd$}{$\kern\systemewd} – student Jul 26 '15 at 09:28