I noticed the following unexpected (by me!) behaviour, illustrated by this MWE and its output in the figure below:
% arara: xelatex: { shell : yes }
\documentclass[11pt]{article}
\usepackage{minted}
\newcommand{\li}[1]{\mintinline{lean}{#1}}
\begin{document}
\mintinline{lean}{#print axioms}
\begin{minted}{lean}
#print axioms
\end{minted}
\li{#print axioms}
\end{document}
It looks like the command to \li
is interpreted as both a #
and a ##
(see What is the meaning of double pound symbol (number sign, hash character) ##1 in an argument?), which is rather odd!
From a typesetting perspective, the obvious "solution" to my problem is to use \mintinline{lean}{...}
rather than the \li
alias. But I'm also curious to know what's going on with the code. In principle it seems like \li
should work, and, indeed, it does for input that doesn't start with a #
.
\newcommand{\li}{\mintinline{lean}}