I'm trying to get the minted package to work with a simple example code (java) on macOS:


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);



I'm using TexShop with standard LaTeX compiler. My output looks weird and isn't highlighted at all. There are some weird characters added which I also get in the \PY command in the pygmentize output .tex-file when using it from the terminal. Using the .tex-file created directly with pygmentize gives the same output as using minted in latex.

My output: enter image description here

What am I doing wrong? It worked perfectly 5 months ago.

closed as off-topic by TeXnician, Troy, Mensch, Bobyandbob, Torbjørn T. Dec 30 '17 at 18:13

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Works for me, no strange o. – egreg Nov 15 '16 at 8:35
  • @Marvin Kropp: See pygstyle files in a directory _minted-foo. – Akira Kakuto Nov 15 '16 at 10:21
  • 3
    @Akira Kakuto: Thanks a lot! SOLUTION: Just deleted the _minted-foo folder. Seems to be an interference with previous compilations. – Marvin Kropp Nov 15 '16 at 14:28
  • 4
    I'm voting to close this question because it was caused by some old files which simply needed to be deleted. – TeXnician Dec 30 '17 at 16:26
  • This question and comments just saved my sanity. I would never have thought to delete that troublesome folder without this post. – Placidia Feb 16 '18 at 19:10