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'm trying out pgfplots with gnuplot to generate the data. This works by having pgfplots write some stuff to an external file, run gnuplot on the file, and then use the generated data to plot the graph.

The problem I'm having is that I get different behaviour under xelatex as pdflatex or lualatex. In xelatex, the data file is littered with ^^I whereas in the other two formats these are tabs. It appears that the code ^^I is getting stored as a macro which then gets written out to the file, so possibly there's something funny going on with the ^^I syntax: xelatex is reading it literally. Indeed, when I do \show\pgfplots@TAB (the macro in question) then for pdflatex and lualatex then I get a literal tab whereas for xelatex I get ^^I.

So how do I get a tab in xelatex? And why isn't \gdef\pgfplots@TAB{^^I} working?

(The previous line in the code, by the way, is \catcode`\^^I=12 - I don't know if that has anything to do with it.)

share|improve this question
add comment

1 Answer

up vote 11 down vote accepted

In TeX Live, the formats for pdf(la)tex and lua(la)tex are built loading the tcx translation file cp227.tcx that makes ^^I "printable". This means that a category code 12 ^^I is written out as a real tab character.

On the other hand, xetex ignores tcx translation requests and behaves, in this respect, like Knuth's TeX (but it writes UTF-8, of course).

A solution may be to call xetex with the command line option -8bit, but I don't know if this has other side effects.

share|improve this answer
Thanks for correcting me! –  TH. Apr 2 '11 at 0:08
Miktex uses cp227.tcx too. And while the --8bit-option is actually not mentioned in the documentation it nevertheless works with xe(la)tex. As far as I can see the chars > ASCII 32 are printable anyway in xetex, so it will affect only (some or all) ASCII 0-32. –  Ulrike Fischer Apr 2 '11 at 11:36
The -8bit option certainly makes it work. I'll keep an eye out for side effects. Thanks! –  Loop Space Apr 2 '11 at 17:41
Is there a way to ensure a correct behavior directly in the source code? I could patch pgfplots to do the right thing... –  Christian Feuersänger Apr 18 '11 at 20:40
@ChristianFeuersänger How about a "Known limitations" section in the manual? Also you could test for xelatex and print a warning "You're using xelatex. If things don't appear how you expect, try running with the -8bit option." –  Loop Space Apr 17 '12 at 19:33
show 4 more comments

Your Answer


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.