65

Is there a way to write the equivalent of \rightarrow in text mode?

I tried but it threw an error, and the math arrow complained about bad environment.

It doesn't need to be exactly the same arrow, I just want to write something like "A → B" as in A points to B.

3 Answers3

90

You can use something like A$\,\to\,$B or A\textrightarrow B (in text mode) from the textcomp package:

\documentclass{article}
\usepackage{textcomp}

\begin{document}


A$\,\to\,$B

A\textrightarrow B

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
5

With fontspec, you can simply paste the Unicode glyphs for arrows after selecting any font that contains them, or use commands such as \char"2194 or \symbol.

Davislor
  • 44,045
2

Try A \verb|->| B.

To me this is the simplest and most flexible solution, and renders nicely too (sure, it does not look like the right arrow in math mode but for many purposes it might be enough). You can control spacing very easily inside the verbatim. For instance, more spacing would be A \verb| -> | B. Both are shown below.

enter image description here

luchonacho
  • 4,161