4

When using Fira Code in listings you'll get programming/code ligatures. This behavior has to be enabled and usually minted does nothing special. But if you turn on escapeinside with any character that might be a useful delimiter either the code ligatures will not work or the delimiter can't be applied.

In the following example you'll see the first text without escapeinside and with code ligatures (that's fine), the second text turns escapeinside on (with delimiters that are part of a ligature, code ligatures broken, escape works) and the third text turns escapeinside on (with delimiters that would be harmless, code ligatures work, but escaping not).

Question: How to either use code ligatures with a delimiter that's part of a ligature (turning that ligature off) or use unicode delimiters in escapeinside?

code ligatures

% arara: lualatex: {shell: 1}
%!TeX TS-program=arara
\documentclass{article}
\usepackage{fontspec}
\setmonofont[Contextuals={Alternate}]{Fira Code}

\usepackage{minted}

\begin{document}
\begin{minted}{java}
if(a<=b)
    return null;
\end{minted}
\begin{minted}[escapeinside=||]{java}
if(a<=b)|\textbf{test}|
    return null;
\end{minted}
\begin{minted}[escapeinside=µµ]{java}
if(a<=b)µ\textbf{test}µ
    return null;
\end{minted}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.