I have always disliked the amsmath
commands \varinjlim
and \varprojlim
for categorical limits. The arrows are too big and dominating, and the whole things take up too much vertical space, messing up the line spacing. I therefore usually define my own commands, see below, and would like to know if they can be improved and made more robust? In the current form, they use \raisebox
which uses absolute dimensions and therefore causes issues when used e.g. in an index (see picture below). How can my construction be improved?
This question has some interesting solutions, but one uses PGF, which seems like extreme overkill to me, and the second one does not scale properly when used e.g. in indices. Oh yes, and there is a package called halloweenmath
, but I’m not sure I trust a package with such a name. I think I prefer a solution by some TeX guru in here.
\documentclass{article}
\usepackage{amsmath,graphicx}
\makeatletter
\newcommand\dirlimformat[1]{
\mathop{
\smash{
\operatorname*{#1}\limits_{
{}
\raisebox{.21em}[0pt][0pt]{\scalebox{.85}{$\m@th
\xrightarrow{%
\hphantom
{%
\!\!
\scalebox{1.17}{$\m@th
{\operatorname{#1}}
$}
\!\!
}
}
$}}
}
}
\vphantom{\textstyle\lim_n}
}
}
\newcommand\invlimformat[1]{
\mathop{
\smash{
\operatorname*{#1}\limits_{
{}
\raisebox{.21em}[0pt][0pt]{\scalebox{.85}{$\m@th
\xleftarrow{%
\hphantom
{%
\!\!
\scalebox{1.17}{$\m@th
{\operatorname{#1}}
$}
\!\!
}
}
$}}
}
}
\vphantom{\textstyle\lim_n}
}
}
\makeatother
\newcommand\dirlim{\dirlimformat{lim}}
\newcommand\invlim{\invlimformat{lim}}
\begin{document}
\( \varinjlim X_n \) vs.\ \( \dirlim X_n \)
\( \varprojlim X_n \) vs.\ \( \invlim X_n \)
\( a^{\invlim X_n} \)
\end{document}
old-arrows
package is "very much focused on Computer Modern"? That's decidedly not the case. It works fine with newtxmath, mtpro2, txfonts, mathptmx, newpxmath, pxfonts, mathpazo, and likely many more math font packages too.