5

Code:

\documentclass{article}
\usepackage{minted}

\begin{document}
    \begin{minted}[mathescape,
                   linenos,
                   numbersep=5pt,
                   gobble=2,
                   frame=lines,
                   framesep=2mm]{csharp}
      string title = "This is a Unicode π in the sky"
      /*
      Defined as $\pi=\lim_{n\to\infty}\frac{P_n}{d}$ where $P$ is the perimeter
      of an $n$-sided regular polygon circumscribing a
      circle of diameter $d$.
      */
      const double pi = 3.1415926535
    \end{minted}
\end{document}

And the result:

enter image description here

Note the missing π in the title variable.

Using latest versions of packages from MikTeX distribution with XeLaTeX.

1
  • You get Missing character: There is no π in font cmtt10 in the log. But if you load fontspec, you get Missing character: There is no π in font [lmmono10-regular].
    – egreg
    Oct 11, 2013 at 17:24

1 Answer 1

7

That's a font problem, not a LaTeX engine or Pygments.

Choosing another font will result in a proper output:

\usepackage{fontspec}
    \setmonofont{Consolas}

Expected output:

result

2
  • 4
    Or \setmonofont{CMU Typewriter Text}. Using XeLaTeX without fontspec is not recommended.
    – egreg
    Oct 11, 2013 at 17:25
  • @egreg: Thanks! Didn't know about Unicode version of Computer Modern!
    – m0nhawk
    Oct 11, 2013 at 17:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .