views:

40

answers:

1

I'm trying to include all the Unicode whitespace characters in a LaTeX document as verbatim text (e.g. \verb#start end#), but I've gotten three different results:

  • With no packages, the spaces are simply not there in the PDF file.
  • with \usepackage[utf8x,utf8]{inputenc} I get an error: "Unicode char \u8:  not set up for use with LaTeX."
  • With \usepackage[T1]{fontenc} I get rubbish, such as á.
  • With XeTeX all the spacing characters are replaced by some space-looking empty space, so that when I copy it back to a plaintext editor there is no character.
+2  A: 

Full-blown Unicode input is almost impossible to support in vanilla TeX (of which pdflatex is a variant). There are just too many characters to set up enough fonts to handle everything that might occur; there are many partial solutions, but no complete ones.

The TeXnically correct way to go about this is to use xetex instead, which was designed with Unicode in mind. That said, don't all spaces look pretty much the same? What do you actually want rendered? Or is the problem really to be able to process any verbatim input whatsoever, without pre-munging?

Kilian Foth
The point is that I want the PDF to render the different spaces in Unicode, so that I can copy the text verbatim from the PDF to have the correct space character. It is not for layout at all, but rather for test data used in third-party applications.
l0b0
Charles Stewart