enter image description here

I would like to position arrows next to text/through text like this, is there any possible way to do this?


There are plenty of possibilities, here is one of them.

  \tikz[remember picture,baseline=(#1.base),inner sep=0pt] \node (#1) {$%\tikznodestyle 
  \tikz[remember picture,baseline=(#1.base),inner sep=0pt] \node (#1) {#2};%
 \tikz[overlay,remember picture]{
 \draw[-latex] (3p)--(dummy.center);
 \draw[-latex] (2m)--(Al.south east);

enter image description here

  • Very nice. Just a question, if I add like a blank suffix next to the O so that the arrow extends out a little more, what part of the text would I edit to select the reference characters? – Wertea Jun 18 '18 at 17:12
  • @Wertea I made an update. If you want to shorten the arrow from 2- to Al, just draw this arrow with \draw[-latex,shorten >=2pt] (2m)--(Al.south east);, say. – marmot Jun 18 '18 at 17:18

Does this look like what you like

equation with arrow crossing

Here is the code

\usetikzlibrary{arrows.meta} %% Includes arrow head styles.

\draw (-2,0) node[blue,left=0.02cm] {$\mathrm{Al^{3 +}}$}; %% write the Al ion
\draw (0,0) node[red,left=0.02cm] {$\mathrm{O^{2 -}}$}; %% write the O ion
\draw (3,0) node[left=0.02cm] {$\mathrm{{\color{blue}Al}_{{\color{red}2}} {\color{red}O}_{\color{blue}3}}$}; %% write the product
\draw [-{Stealth[round,scale=1.5]}] (-0.5 , 0.06) -- (-2.4 , -0.17); %% Arrow from O ion to Al ion.
\draw [-{Stealth[round,scale=1.5]}] (-2.15 , 0.06) --(-0.5 , -0.13); %% arrow from Al ion to O ion
\draw [-{Stealth[round,scale=1.5]}] (0 , 0) -- (1.7 , 0);

The order of \draw in the code is the actual order of drawing, which means the latter ones would be on top of the previous.

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.