Math symbols in minted

math-modemintedsymbols

Greetings to TeXperts out there,

I am trying to write some code in a minted environment, but I am struggling with the "greater-or-equal" symbol. "≥" is not displayed at all (compiles to a blank space), while "\geq" is just displayed as "\geq", not as the greater-or-equal symbol.

I am pretty sure I am doing something wrong, but I just cannot find the mistake… Any suggestions?

Here is an MWE:

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage[cache=false]{minted}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
    \begin{minted}{text}
       MWE
       -->≥<--
       \geq
    \end{minted}
\end{document}

Thanks in advance
Best regards

Best Answer

As you are using an unicode-aware engine, you'll just need to pick a monospaced font which has the glyph.

To find out, which fonts on your computer have the symbol, type

albatross ≥

in a terminal and pick a monospaced font from the results.

MWE:

% !TeX program = txs:///arara
% arara: lualatex: {synctex: on, interaction: nonstopmode, shell: yes}
\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage[cache=false]{minted}
\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{fontspec}
\setmonofont{Noto Mono}

\begin{document}
    \begin{minted}{text}
       MWE
       -->≥<--
       \geq
    \end{minted}
\end{document}

enter image description here

Related Question