TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi I am wondering what code is used to get text above the $\rightarrow$

have tried $ \xrightarrow{P}$ but not running on my LaTeX as I do not know which package to install or how to install it.

currently using \usepackage{mathtools} but it wants to load from a random directory and then LaTeX stops working.

share|improve this question

migrated from quant.stackexchange.com May 16 '14 at 4:30

This question came from our site for finance professionals and academics.

Welcome to TeX.sx! Your post was migrated here from Quantitative Finance. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Werner May 16 '14 at 5:11
mathtools should be part of every distribution out there. I would suggest following the instructions in How do I update my TeX distribution? to make sure you have a compatible and complete distribution, which should make even the most minimal of documents (\documentclass{article} \usepackage{mathtools} \begin{document} $ \xrightarrow{P}$ \end{document}) compile. – Werner May 16 '14 at 5:13

\xrightarrow is provided by package amsmath:



LaTeX package amsmath is part of distribution package amsmath in TeX Live and MiKTeX. Usually it should be already installed, because it belongs to the "required" packages: CTAN:macros/latex/required/amslatex/.

Package mathtools loads package amsmath and provides further extensible arrows, see section "3.3 Extensible symbols" in its documentation. It is part of distribution package mh in MiKTeX and TeX Live.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.