
macOS에서 간단한 예제 코드(java)를 사용하여 작동하도록 제작된 패키지를 얻으려고 합니다.
\documentclass{article}
\usepackage{minted}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{minted}[frame=single,linenos,mathescape]{java}
public class Fibonacci {
// The golden ratio $\phi = \frac{1 + \sqrt{5}}{2}$.
public static final double PHI = (1.0 + Math.sqrt(5.0)) / 2.0;
public static double fibonacci(long n) {
if (n < 0) throw new IllegalArgumentException();
return Math.floor(Math.pow(PHI, n) / Math.sqrt(5.0) + 0.5);
}
}
\end{minted}
\end{document}
저는 표준 LaTeX 컴파일러와 함께 TexShop을 사용하고 있습니다. 내 출력이 이상해 보이고 전혀 강조 표시되지 않습니다. 터미널에서 사용할 때 pygmentize 출력 .tex 파일의 \PY 명령에도 나타나는 몇 가지 이상한 문자가 추가되었습니다. pygmentize로 직접 생성된 .tex 파일을 사용하면 라텍스에서 minted를 사용하는 것과 동일한 출력이 제공됩니다.
내가 도대체 뭘 잘못하고있는 겁니까? 5개월 전에는 완벽하게 작동했습니다.