Take the 2-minute tour ×
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.

Is there a way to do underscripts? By "underscript" I mean a small font underneath the text object like limits or sums have. I don't want it to behave like a math operator though, where it is typeset as a subscript or underscript depending on the environment (like sums). I want there to always be an underscript in math environments with the possibility of adding a subscript in addition to the underscript. Is there anything like an \underscript{X}{a} command?

Is there even something like that that will only work in mathmode? I haven't been able to find it.

share|improve this question
3  
I think $\underset{a}{X}$ is what you are looking for? There is also $\stackrel{A}{x}$ but that produces smaller text. –  Peter Grill Nov 16 '11 at 18:06
    
Yes, \underset{}{} sounds like the command you want but you'll need to put \usepackage{amsmath} in the preamble. –  DJP Nov 17 '11 at 0:15
add comment

2 Answers

up vote 13 down vote accepted

I would recommend using \underaccent from the accents package. For comparison purposes I have included the output \underset and \stackrel:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\usepackage{accents}
\usepackage{xcolor}

\begin{document}
$\quad\color{blue} \text{underset: }    \underset{x}{A}$
$\quad\color{black}\text{stackrel: }    \stackrel{A}{x}$
$\quad\color{red}  \text{underaccent: } \underaccent{x}{A}$
\end{document}
share|improve this answer
add comment

While the stackengine package is not really designed for math mode, it can work in math mode, if the arguments are set in math delimiters. It gives the flexibility to control the vertical gaps (as either an interelement gap or as a baseline shift), the left-center-right alignment of the stack, whether the stack is built up or down from the anchor of the stack, whether it prints the output (or merely saves it for later use), and whether the width of the stack is defined by the widest element of the stack or merely by the width of the anchor element of the stack.

\documentclass{article}
\usepackage{stackengine}
\begin{document}
\stackengine{4pt}{$A$}{$x$}{U}{c}{F}{T}{S}
\stackengine{2pt}{$A$}{$\scriptstyle x$}{U}{c}{F}{T}{S}
\stackengine{2pt}{$A$}{$\scriptscriptstyle x$}{U}{c}{F}{T}{S}
\end{document}

enter image description here

The \stackengine command is the basic command of the package with all the options to tweak. Often, a shortcut command can be used instead, for example \stackunder[2pt]{$A$}{$\scriptscriptstyle x$} will produce the last item from above.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.