Uppercase limits

macrosmath-mode

Sorry if this is a too-simple question, but anyway.

Is there a simple way of writing in LaTeX projective and inductive limits that begin with uppercase (Lim)?

This is what we usually have
https://pbelmans.ncag.info/blog/2010/10/02/direct-and-inverse-limit-in-latex/.

Best Answer

You can patch \varinjlim and \varprojlim to use “Lim” instead of “lim” and to this end it's sufficient to patch the internal macro \varlim@.

\documentclass{article}
\usepackage{amsmath}
\usepackage{xpatch}

\makeatletter
\xpatchcmd{\varlim@}{lim}{Lim}{}{}
\makeatother

\begin{document}

\[
\varinjlim \quad \varprojlim
\]

\end{document}

enter image description here

You may also take the opportunity to make the arrows a bit smaller:

\documentclass{article}
\usepackage{amsmath}
\usepackage{xpatch}

\makeatletter
\xpatchcmd{\varlim@}{lim}{Lim}{}{}
\xpatchcmd{\varinjlim}{\textstyle}{\scriptstyle}{}{}
\xpatchcmd{\varprojlim}{\textstyle}{\scriptstyle}{}{}
\makeatother

\begin{document}

\[
\varinjlim \quad \varprojlim
\]

\end{document}

enter image description here

If you want to keep the old commands, you can patch copies thereof.

\documentclass{article}
\usepackage{amsmath}
\usepackage{xpatch}

\makeatletter
\NewCommandCopy\varLim@\varlim@
\NewCommandCopy\varinjLim\varinjlim
\NewCommandCopy\varprojLim\varprojlim
\xpatchcmd{\varinjLim}{\varlim@}{\varLim@}{}{}
\xpatchcmd{\varprojLim}{\varlim@}{\varLim@}{}{}
\xpatchcmd{\varLim@}{lim}{Lim}{}{}
% smaller arrows
\xpatchcmd{\varinjlim}{\textstyle}{\scriptstyle}{}{}
\xpatchcmd{\varinjLim}{\textstyle}{\scriptstyle}{}{}
\xpatchcmd{\varprojlim}{\textstyle}{\scriptstyle}{}{}
\xpatchcmd{\varprojLim}{\textstyle}{\scriptstyle}{}{}
\makeatother

\begin{document}

\[
\varinjLim \quad \varprojLim
\quad
\varinjlim \quad \varprojlim
\]

\end{document}

enter image description here