4

I've produced the following code using the systeme package.

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

\begin{document}

\[
\systeme{3x+y+2z=6,x+3y+2z=-6,x+y+z=1}
\]

\end{document}

This displays the equations as I would expect, apart from the fact that I'd like to add equation numbers to each of the three equations such that the numbering is in-keeping with the equation numbering in the rest of the document.

The equation numbers should appear on the right-hand side immediately after each equation.

Is this possible?

2
  • Where should the equation numbers be placed. More or less immediately to the right of the system, at the right-hand margin of the text block, or somewhere else? Please advise.
    – Mico
    Feb 14, 2021 at 20:28
  • 1
    @Mico I've made an edit to include this information :)
    – MHW
    Feb 14, 2021 at 20:31

2 Answers 2

5

For automatic equation numbering, with the equation numbers -- surrounded by parentheses -- placed to the right of the equations, it suffices to insert @(*) immediately after the first equation. If you require more separation -- say, \qquad -- you could insert @\qquad(*) instead.

enter image description here

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

\begin{document}
\begin{gather*}
\systeme{3x+y+2z=6,x+3y+2z=-6,x+y+z=1} \\[2ex]        % no numbering
\systeme{3x+y+2z=6@(*), x+3y+2z=-6, x+y+z=1} \\[2ex]  % default separation
\systeme{3x+y+2z=6@\qquad(*), x+3y+2z=-6, x+y+z=1}    % separation by '\qquad'
\end{gather*}
\end{document}

Addendum, to address the OP's follow-up question: To have the equation numbers produced by \systeme pick up the value of the equation counter, I suggest you insert the instructions

\renewcommand{\SYSeqnum}{\value{equation}}
\sysautonum{(**)}

in the preamble (after loading the systeme package) and omit the @(*) directives mentioned above. I.e., something like this:

\documentclass{article}
\usepackage{systeme}
\renewcommand{\SYSeqnum}{\value{equation}}
\sysautonum{(**)}

\begin{document}
\addtocounter{equation}{5}\theequation
\[
\systeme{3x+y+2z=6, x+3y+2z=-6 , x+y+z=1 }
\]

\stepcounter{equation}\theequation
\[
\systeme{3x+y+2z=6  , 
         x+3y+2z=-6 , 
         x+y+z=1    }
\]
\theequation
\end{document}

With this setup, the first three systeme equations will be numbered 6, 7, and 8, and the next three systeme equations will be number 10, 11, and 12.


Or, take the following example:

\documentclass{article}
\usepackage{amsmath,systeme}
\renewcommand{\SYSeqnum}{\value{equation}}
\sysautonum{(**)}
\begin{document}
\begin{gather} % create 7 dummy numbered equations:
a \\ b \\ c \\ d \\ e \\ f \\ g 
\end{gather}
\[
\systeme{3x+y+2z=6, x+3y+2z=-6 , x+y+z=1 }
\]
\end{document}

With this setup, the three systeme equations will be numbered 8, 9, and 10.


Second addendum, to address the topic of how to create cross-references to equations within a systeme system (pun intended). It's important to note that the standard \label-\ref mechanism doesn't work for such equations. The following MWE is based on the description of the systeme's approach, on p. 7 of the package's user guide.

\documentclass{article}
\usepackage{systeme}
\renewcommand{\SYSeqnum}{\value{equation}} 
\sysautonum{(**)}

\begin{document}
\setcounter{equation}{15}
\systeme{3x+y+2z=6 @\gdef\foo{**}(**),  % see p. 7 of the package's user guide
         x+3y+2z=-6@\gdef\bar{**}(**), 
         x+y+z=1   @\gdef\baz{**}(**)}      

Cross-references to equations (\foo) and (\baz).
\end{document}

This MWE outputs "Cross-references to equations (16) and (18)."

6
  • 1
    Is it possible to force the equation numbers to pick up the counter from previous equation numbering? That is, if I have, for example, an align environment beforehand whose numbering finished at (7), can we force the systeme numbers to pick up from (8)?
    – MHW
    Feb 14, 2021 at 22:37
  • @MHW - Please see the addendum I just posted.
    – Mico
    Feb 14, 2021 at 23:01
  • 1
    @MHW - I've posted a second addendum to explain how systeme' cross-referencing mechanism works.
    – Mico
    Feb 15, 2021 at 6:56
  • 1
    The addendums are greatly appreciated. This now covers everything I needed.
    – MHW
    Feb 15, 2021 at 9:20
  • @minhthien_2016 - The easiest and best way to suppress equation numbering is to use equation*, align*, gather*, etc environments instead of equation, align, gather, etc environments.
    – Mico
    Sep 27 at 8:08
3

If it is possible to have numbers for the system equations not to be placed at the right margin, here is a simple solution:

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

\begin{document}

\setcounter{equation}{10}

\[ \sysautonum*{\stepcounter{equation}\hbox{(\theequation)}}
\systeme{3x+y+2z=6,x+3y+2z=-6,x+y+z=1} \]%

\[ \sysautonum*{\stepcounter{equation}\hbox{(\theequation)}}
\systeme{3x+y+2z=6,x+3y+2z=-6,x+y+z=1} \]

\begin{equation}
  a + c = b +d
\end{equation}

\end{document}

enter image description here

3
  • Is it possible to individually label and reference each equation? When I try to label within the \systeme command and later reference those labels, it simply produces alphabetic references (e.g. (a)) instead of the actual equation numbers.
    – MHW
    Feb 14, 2021 at 22:47
  • 1
    I don't know, as I never tried that. I'll try to look at the code tomorrow(it's getting very late here) and see what can be done.
    – Bernard
    Feb 14, 2021 at 22:51
  • @MHW - Please check out the material at the top of page 7 of the package's user guide for an example of how to cross-reference equations created with systeme. Hint: you can't the standard \label-\ref LaTeX mechanism.
    – Mico
    Feb 14, 2021 at 23:11

You must log in to answer this question.

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