0

I'm trying to typeset Elixir code using minted. I run into problems when I want to color a custom keyword. More in particular, I run into errors when I use the escapeinside option.

As soon as I pass the escapeinside option to the minted listing every right-hand curly brace is outlined by a red box, even when I'm not actually escaping text in the source code. Below is a MWE and a screenshot of the output.

I have tried passing in multiple delimiters: |, \#, \%, <an actual backtick> and so on. But all of them cause the red outlining on curly braces. I also tried ruby as language, and that seems to work fine. Although not every keyword is highlighted properly in that case.

Is there perhaps another approach to this? I'm going to assume that when I submit this paper I will have no control over the pygments version or the compiler they use, so any modification on that end is not an option.

Input

\documentclass{article}
\usepackage{minted}
\begin{document}

\begin{figure}[htb]
    \begin{minted}{elixir}
def foo() do 
    {:bar, :baz}
end
    \end{minted}
\end{figure}

\definecolor{wgreen}{HTML}{158915}
\begin{figure}[htb]
    \begin{minted}[escapeinside=||]{elixir}
|\textcolor{wgreen}{\textbf{customkeyword}}| foo() do 
    {:bar, :baz}
end
    \end{minted}
\end{figure}

\end{document}

Output

enter image description here

1

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.