## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Arrow coordinates

Information and discussion about graphics, figures & tables in LaTeX documents.
bstex
Posts: 67
Joined: Mon Oct 23, 2017 10:22 am

### Arrow coordinates

Hi,
i'm having this:
Screen Shot 2018-03-31 at 19.16.56.png (8.59 KiB) Viewed 245 times

and I would like to raise the arrow, so it is vertically center with the text.
Can that happen without the \raisebox command?
Also, how can I modify the tikz code of the arrow, so it automatically puts a blank space after every arrow I insert in my code with the \myArrow command? I want this because, as you see, the letter B is very close to the arrow tip.

My MWE:
\documentclass{book}\usepackage{tikz}\usepackage{chemfig}\newcommand{\myArrow}{\tikz {\draw[semithick] [-{Straight Barb[angle=60:1.5pt 3]}] (0,0) -- ++ (0.4,0);}} \begin{document}A \myArrow B\end{document}

Thank you.

Stefan Kottwitz
Posts: 9164
Joined: Mon Mar 10, 2008 9:44 pm
\documentclass{book}\usepackage{tikz}\usetikzlibrary{positioning}\usepackage{chemfig}\newcommand{\myArrow}[2]{\tikz[baseline=(A.base)] {%  \node (A) {#1};  \node (B) [right =0.4 of A] {#2};  \draw[semithick] [-{Straight Barb[angle=60:1.5pt 3]}] (A) -- (B);}} \begin{document}\myArrow{X}{Y}\end{document}