2

In this answer, I got the following nice solution for categorical limits with smaller arrows. My only issue with this solution is that the spacing between the “lim” and the arrows is too big. This is the case with Computer Modern, but even more clear with some other fonts (e.g. with kpfonts, used below). I wonder how I could best raise the arrow to get it closer to the symbol? I could of course try using \raisebox, but I assume this is not the best or most robust solution. How would you accomplish this?

\documentclass{article}

\usepackage{amsmath,kpfonts}

\makeatletter

\def\varlim@@#1#2{%
  \vtop{\m@th\ialign{##\cr
    \hfil$#1\operator@font lim$\hfil\cr
    \noalign{\nointerlineskip\kern1.5\ex@}
    \expandafter#2\ifx#1\scriptscriptstyle\scriptscriptstyle\else\scriptstyle\fi\cr
    \noalign{\nointerlineskip\kern-\ex@}\cr}}%
}
\newcommand\dirlim{\mathop{\mathpalette\varlim@@\rightarrowfill@}\nmlimits@}
\newcommand\invlim{\mathop{\mathpalette\varlim@@\leftarrowfill@}\nmlimits@}

\makeatother

\begin{document}

\parskip=\medskipamount

$\varinjlim_{\varinjlim_{\varinjlim}}$

$\dirlim_{\dirlim_{\dirlim}}$

\end{document}

enter image description here

2
  • 2
    I can't help feeling implicated :-) but the solution is very easy, the line \noalign{\nointerlineskip\kern1.5\ex@} is suppressing the standard line spacing and introducing manually a vertical space of 1.5\ex@. Just reduce the number to something which pleases you.
    – campa
    Mar 12, 2021 at 17:16
  • 1
    @campa I know you are making fun, but it was never meant to implicate you. :-) Few solutions are perfect in all fonts, and adjustments can sometimes be necessary to fit somebody’s tastes. :-) Anyway, 0 spacing fits me perfectly well. Is there any issue then with completely removing kern1.5\ex@? :-)
    – Gaussler
    Mar 12, 2021 at 17:21

1 Answer 1

2

\ialign is a thin wrapper around the TeX primitive \halign with no inter-column spacing. The \noalign inserts vertical material between lines, and

\noalign{\nointerlineskip\kern1.5\ex@}

is basically saying (1) suppress the normal interline spacing here, and (2) add a vertical space of 1.5\ex@. The length\ex@ is defined in amsgen (loaded by amsmath) and roughly scales with the current size. In the linked answer I took that value because that was the predefined one, and is more or less necessary with the CM arrows, because they have a rather large head. You can of course reduce the number or remove the kern1.5\ex@ altogether (though that's a wee bit too close for my taste).

2
  • I’m clearly a TeX noob compared to you, so why the hell do I have more gold medals than you? We’d better do something about that soon. :-)
    – Gaussler
    Mar 12, 2021 at 17:40
  • 2
    @Gaussler You ask famous questions :-)
    – campa
    Mar 12, 2021 at 17:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .