TeXnik - Tips TeX and LaTeX


Welcome to the TeXnik website (under construction)

WaboveW\WaboveW
TUG logo

Main page

Index
UK FAQ
Documentation
Software
CTAN
Search CTAN:

Statistics

Google c.t.t.

Google d.c.t.t.

 


 


Mathmode without amsmath |  Mathmode with amsmath |  Minipage | 


Mathmode without amsmath
\stackrel{above word/letter}{bottom word/letter}
e.g. for this example: $\stackrel{\alpha}{argmax}$
\stackrel{}{}
text$\stackrel{b}{a}\hspace{-0.25em}\overset{b}{a}\underset{b}{a}$text
Writing $\stackrel{b}{\textrm{a}}... gives the same baseline while a is in textmode, too. If you want to have the same baseline in mathmode too, than choose AMSMath-command \overset
img3.png
You can write "argmax" in upright mode with \textrm{argmax}.
In mathmode the stack is always bottom orientated to the line.

Minipage
The use of a minipage gives better result if you need this in real textmode.
To find out the width of the minipage, define in latex preamble:
\newlength{myStackWidth}
The minipage can be orientated to the bottom, the top oder vertically centered to the textline. At first we want to set the width, which belongs to the longest word:
\settowidth{\myStackWidth}{argmax}
\begin{minipage}[t]{\myStackWidth}\parskip-1ex\begin{center}
argmax
$\alpha$
\end{center}\end{minipage}
option [t]: alpha is under argmax
option [b]: argmax is over alpha
option [m]: both are vertically centered in the line.

Remember that you can define a new command
\myStackrel{Orientation}{under}{over} in latex preamble, which makes sense,
if you often use this in your text.

If you want it only vertically centered, the following latex construct does it, too:

\begin{tabular}{c}
\alpha \\
\argmax
\end{tabular}
minipage

local time: Wed Oct 16 21:20:37 CEST 2019 ; file is: 110.298460648148 days old
contact webmaster _at_ TeXnik.de