LaTeX forum ⇒ Math & ScienceHow to write text through an arrow

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

How to write text through an arrow

Postby peaches20 » Tue Feb 27, 2018 11:09 pm


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

I am using

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass{lmcs}
  2. \usepackage{amssymb}
  3. \usepackage{graphicx}

I came up with this:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. $\rightarrowtail \!\!\!\!\!\rightarrow
  2. \mbox{\tiny \hspace*{-.22in}\!\!\!\!{\rm (viii)}}$ and the etc.
  3. by $\rightarrowtail \!\!\!\!\!\rightarrow
  4. \mbox{\tiny \hspace*{-.22in}\!\!\!\!{\rm (viii)}}$

Is there an easier way to do this?


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

Postby Stefan Kottwitz » Fri Aug 31, 2018 12:16 pm

Hi Peaches!

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

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \DeclareRobustCommand\longtwoheadrightarrow
  2. {\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 admin

User avatar
Posts: 1
Joined: Wed Sep 12, 2018 1:45 am

Postby fportales » Wed Sep 12, 2018 2:00 am


I did something similar for my thesis. The code
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \newcommand{\onshell}{\overset{\text{on}}{=}}

creates the command \onshell that writes "on" over the = symbol.

Hope this helps!

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

Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 4 guests