Math & ScienceHow to write text through an arrow

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
peaches20
Posts: 9
Joined: Thu Oct 25, 2012 4:28 pm

How to write text through an arrow

Post by peaches20 »

Hi,

I need to literally write on top of an arrow. For example
>-(viii)->>
The (viii) needs to be on top of the doublehead rightarrow with a tail

I am using

Code: Select all

\documentclass{lmcs}
\usepackage{amssymb}
\usepackage{graphicx}
I came up with this:

Code: Select all

$\rightarrowtail \!\!\!\!\!\rightarrow  
\mbox{\tiny \hspace*{-.22in}\!\!\!\!{\rm (viii)}}$ and the etc.
by $\rightarrowtail \!\!\!\!\!\rightarrow  
\mbox{\tiny \hspace*{-.22in}\!\!\!\!{\rm (viii)}}$
Is there an easier way to do this?

Thanks,
Peaches

Recommended reading 2024:

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

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

How to write text through an arrow

Post by Stefan Kottwitz »

Hi Peaches!

It could be easier with \twoheadrightarrow of amssymb, or using that one this way

Code: Select all

\DeclareRobustCommand\longtwoheadrightarrow
     {\relbar\joinrel\twoheadrightarrow}
or the \xtwoheadrightarrow{...} command of the extpfeil package.

The most flexible solution would be using TikZ and its arrows.meta library that provides a lot of arrow styles and lots of ways for customization.

Stefan
LaTeX.org admin
User avatar
fportales
Posts: 1
Joined: Wed Sep 12, 2018 1:45 am

How to write text through an arrow

Post by fportales »

Hello

I did something similar for my thesis. The code

Code: Select all

\newcommand{\onshell}{\overset{\text{on}}{=}}
creates the command \onshell that writes "on" over the = symbol.

Hope this helps!
fportales

Physics isn't the most important thing. Love is.” - R. Feynman
Post Reply