Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I just started using the minted package. When I insert tabs as indentation, it gives me a bunch of characters instead:

enter image description here

However, when I copy the example from the documentation it seems to work fine. I tried experimenting with the obeytabs and showtabs options but I can't get rid of the characters. I'm using xelatex with TexLive 2011 in TexShop. All files are up to date.

Here's a MWE (please note as pointed out in the comments that the indentation in the code is supposed to be tabs and not spaces):

\documentclass{article}

\usepackage{minted}
\newminted{python}{linenos}

\begin{document}

\begin{minted}[linenos]{python}
def all(iterable):
    for i in iterable:
        if not i:
            return False
    return True
\end{minted}

\end{document}

Edit: I noticed something strange: When I change the typesetting engine back to pdflatex, it seems to be working, but then I can't load the fontspec package. So I guess this is related to xelatex?

I'm using xelatex --file-line-error --shell-escape --synctex=1

share|improve this question
    
Your MWE works fine for me; are you compiling with xelatex -shell-escape myfile.tex? –  cmhughes Dec 1 '11 at 20:06
    
Yes, otherwise it would give me an error. My TexShop Engine says: xelatex --file-line-error --shell-escape --synctex=1 –  pg-robban Dec 1 '11 at 20:08
    
Works for me with an up-to-date TL2011. Could you add the output that \listfiles produces in your log, so we can see file versions? –  Joseph Wright Dec 1 '11 at 20:14
    
I updated the files today, but here you go: pastebin.com/MHV57LbY –  pg-robban Dec 1 '11 at 20:16
    
Please include all your code in your question on here so people can see it immediately without having to go to some external site. –  doncherry Dec 1 '11 at 21:33

1 Answer 1

up vote 8 down vote accepted

This looks like a manifestation of the problem discussed in this question – xe(la)tex has a bug that makes it write tabs incorrectly. The fix discussed there is to pass the -8bit command-line option to xelatex. It is said (by someone who seems pretty knowledgeable) here that "this may have adverse effects on the writing of aux files," but I am not sure what those may be.

share|improve this answer
    
It works using the -8bit option. What does it do? –  pg-robban Dec 2 '11 at 9:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.