I want to add some texts between lines in the align* environment like this:

enter image description here

I tried the following code:


abc &= def + def + def + def \tikzmark{a}\\
    &= ghi + ghi \tikzmark{b}\\
    &= jkl\tikzmark{c}\\
    &= mno + mno\tikzmark{d}
\begin{tikzpicture}[remember picture, overlay]
\draw[->] ([xshift=2mm] pic cs:a)
    to [out=0,in=0 ] 
     node[midway,anchor=west,xshift=3mm] {\footnotesize defitnition}
    ([xshift=2mm] pic cs:b);
\draw[->] ([xshift=2mm] pic cs:c)
    to [out=0,in=0 ] 
     node[midway,anchor=west,xshift=3mm] {\footnotesize blablabla}
    ([xshift=2mm] pic cs:d);

but it only gives

enter image description here

There are two problems:

(i) I want to make every arrow aligned vertically

(ii) As I am going to use this arrow very frequently, I want to define it as a sort of newcommand thing.

What can I do?

  • 1
    Welcome to TeX.SE! Can you please show us what you have tried so far?
    – Mensch
    Mar 6, 2019 at 2:55

2 Answers 2


This can be done using the witharrows package.

enter image description here

Here is the code:




abc &= def+def+def+def \Arrow[tikz={font={\mdseries}}]{definition} \\
 &= hgi+hgi\\
 &= jkl\Arrow[tikz={font={\mdseries}}]{blablabla}\\


Note that you may have to compile twice when using witharrows.

Go to the package documentation at CTAN to see the many options for usage including fonts, arrowheads, curvature, color, etc.

  • This's exactly what I want. Thanks!
    – user182849
    Mar 6, 2019 at 4:46
  • 1
    My pleasure, @user182849. It may seem strange, but we typically don't thank posters in comments. Thanks are expressed by voting up (when you have sufficient reputation) and by accepting the answer you find best resolves your question. Welcome to TeX.SX!
    – Sandy G
    Mar 6, 2019 at 4:50
  • Thank you for introducing me to this wonderful package witharrows : -)
    – AndréC
    Mar 6, 2019 at 5:36

Just for completeness: with tikzmark, which you are using, there is no problem in completing the code to give

abc &= def + def + def + def \tikzmarknode{a}{}\\
    &= ghi + ghi \tikzmarknode{b}{}\\
    &= jkl\tikzmarknode{c}{}\\
    &= mno + mno\tikzmarknode{d}{}
\begin{tikzpicture}[remember picture, overlay,font=\footnotesize]
\draw[-latex] ([xshift=2mm]a.east) coordinate (r)
    to [out=0,in=0,looseness=2] 
     node[midway,anchor=west,xshift=3mm] {definition}
    (b -| r);
\draw[-latex] (c-|r)
    to [out=0,in=0,looseness=2] 
     node[midway,anchor=west,xshift=3mm] {blablabla}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.