2

I want to indicate that, in the 2nd set of equations, we are adding 3rd equation to 1st and 2nd with arrow, for example.

I tried with 'WithArrows' but couldn't get it to work. Then I tried doing tikzpicture in equation (and equation in tikzpicture) but set of equations couldn't be centered (I tried with \centering and \begin{center}).

Then I used \node but it didn't work inside of \systeme. Lastly, I used tikzmark and this is closest I got. I drew arrows but couldn't position it next to the system.

\documentclass{article}

\usepackage{tikz} \usetikzlibrary{calc} \usepackage{amssymb,amsthm,amsmath} \usepackage{systeme} \usetikzlibrary{arrows}

\newcommand{\tikzmark}[1]{% \tikz[overlay, remember picture, baseline] \node (#1) {};% }

\begin{document}

\begin{equation*} \sysdelim..\systeme{ 2x + 5y + 2z = - 38, 3x - 2y + 4z = 17,

  • 6x + y - 7z = - 12

} \end{equation} \begin{center} \rule{5cm}{0.4pt} \begin{equation} \sysdelim..\systeme{ 6x+15y+6z=-114 \tikzmark {3}, 6x-4y+8z=34 \tikzmark {2}, -6x+y-7z=-12 \tikzmark {1} } \end{equation*} \begin{tikzpicture} \draw[->] ({2}) arc (-90:90:.5cm and 1cm) node[anchor=west]{$+$}; \draw[->] ({2}) arc (-90:90:.25cm and 0.5cm) node[anchor=west]{$+$}; \end{tikzpicture} \rule{5cm}{0.4pt} \end{center} \end{document}

.

Instead of arcs I also tried:

  \draw[->] ({1}.east) .. controls +(right:7mm) and +(right:7mm) .. ({3}.east);
  \draw[->] ({1}.east) .. controls +(right:3mm) and +(right:5mm) .. ({2}.east);

But same issue occurs.

SebGlav
  • 19,186
  • 1
    Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Now to give you a start, have a look to the tikzmark library which allows you to draw onto your equations. – SebGlav May 05 '22 at 10:32
  • @SebGlav I didn't know about MWE, I'm sorry. I edited my post and provided my attempts of the problem as well as compliable code with my best take on it. – Jasmin Masovic May 06 '22 at 21:32

2 Answers2

3

You tried to use the old definition of tikzmark. Now it's a complete TikZ library that you can load and use. You need to add [remember picture, overlay] to your tikzpicture declaration and it's easier to use \tikzmarknode instead of simple \tikzmark which would need to call the nodes with pic cs:. Heres' a simple example on your code (not sure that the systeme package is really interesting in this case, you may want to use something else).

EDIT

I changed my solution to a better way to draw arrows (with to[out=<>,in=<>] format) and added plus signs along the path.

tikzmark

\documentclass{article}
% https://tex.stackexchange.com/q/643095/204164
\usepackage{tikz}
\usetikzlibrary{calc, tikzmark}
\usepackage{amssymb,amsthm,amsmath}
\usepackage{systeme}
\usetikzlibrary{arrows}

\begin{document} \tikzset{ every node/.style={outer sep=1pt}}

\begin{equation*} \sysdelim..\systeme{ 2x + 5y + 2z = - 38, 3x - 2y + 4z = 17,

  • 6x + y - 7z = - 12

} \end{equation} \begin{center} \rule{5cm}{0.4pt} \begin{equation} \sysdelim..\systeme{ 6x+15y+6z=\tikzmarknode{C}{-114}, 6x-4y+8z=\tikzmarknode{B}{34}, -6x+y-7z=\tikzmarknode{A}{-12} } \end{equation*} \begin{tikzpicture}[remember picture, overlay] %\draw[->] (A.east) .. controls +(right:7mm) and +(right:7mm) .. (C.east) node[signode,right,midway]{$+$}; %\draw[->] (A.east) .. controls +(right:3mm) and +(right:5mm) .. (B.east) node[signode,right,pos=0.8]{$+$}; \draw[red,->] (A.east) to[out=0,in=0,looseness=3] node[right,pos=0.7]{$+$}(C.east) ; \draw[blue,->] (A.east) to[out=30,in=0,looseness=2] node[right,pos=0.8]{$+$} (B.east) ; \end{tikzpicture} \rule{5cm}{0.4pt} \end{center} \end{document}

SebGlav
  • 19,186
  • I was trying to get + signs next to arrows. I tried adding node[anchor= west] {$+$} on the draw, which sets it to high. I want it to be at the middle of arrow. Is it possible to do?

    PS. I searched if I should ask this here or make new question but didn't find the answer. So I thought, since its related to question, it would be better to ask it here.

    – Jasmin Masovic May 07 '22 at 14:32
  • @JasminMasovic I edited my answer, feel free to comment if you need something else, and to accept the answer if it suits your need. – SebGlav May 07 '22 at 16:03
1

Here is what you can do with {WithArrows} of witharrows.

\documentclass{article}
\usepackage{witharrows}

\begin{document}

\WithArrowsOptions{xoffset-for-o-arrows=0mm}

$\left\lbrace\begin{WithArrows}[format = rrCrrCrrCl,group,c] 6&x&+&15&y&+&6&z&=&-114 \Arrow[o,jump=2,tikz={<-,red}]{$-$}\ 6&x&-& 4&y&+&8&z&=&34 \Arrow[tikz={<-,blue}]{$+$} \ -6&x&+&&y&-&7&x&=&-12 \end{WithArrows}\right.$

\end{document}

Output of the above code

F. Pantigny
  • 40,250