Graphics, Figures & TablesSeparate arrows

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
jlazkano
Posts: 9
Joined: Sat Apr 10, 2010 9:43 pm

Separate arrows

Post by jlazkano »

Hello, I am editing a book with Latex, I want to add some arrows but their are so near to "minus" sign.

Is possible to separate them?

This is the code:

Code: Select all

\begin{tabbing}
\hspace*{4,5cm} \= \hspace*{0,5cm} \= \hspace*{2cm} \=
\hspace*{0,5cm}\kill
 \> A$\rightarrow$ \>  1\\
 \> B$\rightarrow$ \> -1 1\\
 \> C$\rightarrow$ \> -1 0\\
 \> D$\rightarrow$ \> -1 -1\\
 \> E$\rightarrow$ \> 0 1\\
 \> F$\rightarrow$ \> 0 0\\
 \> G$\rightarrow$ \> 0 -1 1\\
 \> H$\rightarrow$ \> 0 -1 0\\
 \> I$\rightarrow$ \> 0 -1 -1\\
\end{tabbing}
I attached an image to view the output.

Thanks for all and regards.
Attachments
arrow.png
arrow.png (4.6 KiB) Viewed 1802 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Separate arrows

Post by frabjous »

If you want spaces around the arrows, put in spaces.

But I'm curious why you don't put the whole thing in some kind of math environment, so the natural "relation spacing" of the arrows kicks in. You could do this, for example, with the align* environment of amsmath. I'm not sure if this is the kind of thing you're after or not, but try:

Code: Select all

\documentclass{book}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\hspace*{4.5cm} \mathrm{A} &\rightarrow    1\\
 \mathrm{B} &\rightarrow   -1~1\\
 \mathrm{C} &\rightarrow   -1~0\\
 \mathrm{D} &\rightarrow   -1~-1\\
 \mathrm{E} &\rightarrow   0~1\\
 \mathrm{F} &\rightarrow   0~0\\
 \mathrm{G} &\rightarrow   0~-1~1\\
 \mathrm{H} &\rightarrow   0~-1~0\\
 \mathrm{I} &\rightarrow   0~-1~-1\\
\end{align*}

\end{document}
Actually, with what you have, you're not even getting minus signs; you're getting simple hyphens, since they're not in math mode.

Or you might even try a matrix:

Code: Select all

\documentclass{book}
\usepackage{amsmath}
\begin{document}
\hspace*{4.5cm}$\begin{matrix}
 \mathrm{A} &\rightarrow    &1\\
 \mathrm{B} &\rightarrow   &-1 &1\\
 \mathrm{C} &\rightarrow   &-1 &0\\
 \mathrm{D} &\rightarrow   &-1 &-1\\
 \mathrm{E} &\rightarrow   &0 &1\\
 \mathrm{F} &\rightarrow   &0 &0\\
 \mathrm{G} &\rightarrow   &0 &-1 &1\\
 \mathrm{H} &\rightarrow   &0 &-1 &0\\
 \mathrm{I} &\rightarrow   &0 &-1 &-1\\
\end{matrix}
$
\end{document}
jlazkano
Posts: 9
Joined: Sat Apr 10, 2010 9:43 pm

Separate arrows

Post by jlazkano »

Thanks for the reply, I solved adding spaces this way:

Code: Select all

\begin{tabbing}
\hspace*{4,5cm} \= \hspace*{0,5cm} \= \hspace*{2cm} \=
\hspace*{0,5cm}\kill
 \> A$\rightarrow$ \> $ $ 1\\
 \> B$\rightarrow$ \> $ $ -1 1\\
 \> C$\rightarrow$ \> $ $ -1 0\\
 \> D$\rightarrow$ \> $ $ -1 -1\\
 \> E$\rightarrow$ \> $ $ 0 1\\
 \> F$\rightarrow$ \> $ $ 0 0\\
 \> G$\rightarrow$ \> $ $ 0 -1 1\\
 \> H$\rightarrow$ \> $ $ 0 -1 0\\
 \> I$\rightarrow$ \> $ $ 0 -1 -1\\
\end{tabbing}
Thanks and regards.
Post Reply