How do I enter Unicode characters in LaTeX? What packages do I need to install and what escape sequence do I type to specify Unicode characters in an ASCII source file?
|
migrated from stackoverflow.com Nov 12 '11 at 18:53
|
Have you considered using XeTeX? This is an adaptation of TeX that adds Unicode support, and is included in the latest TeX Live and MiKTeX distributions. This Wikipedia article gives a good introduction. |
|||||||||||
|
|
"Unicode" in this context could mean either in the input or in the output. I assume you're looking to insert something like "©" into your source and have it do something meaningful. For full support for unicode input and unicode fonts, take a look at XeTeX; it's easy to get started — just select an appropriate font and the unicode characters in your input are directly typeset as unicode glyphs in the output. Switching engines is not always a possibility, however, and sometimes you'll want to stick with pdfTeX for its other useful features. The best that regular LaTeX (i.e., based from pdfTeX in a modern distribution) can do is recognise UTF-8 sequences in the text and expand macros based on what it sees. Load the
Note that the resulting input file must not have a byte-order mark (BOM) at the beginning, or else it won't compile. (You can also use the To define behaviour for unicode characters, use the
This defines a dash that has a small space on either side and will only allow a line break after it. |
|||||||||||||
|
|
This is a minimal example that finally worked for me without using XeTeX:
|
||||
|
|
Try |
|||||
|
|
As of today, both XeTeX and LuaTeX will let you input unicode without complaining. |
|||
|
|
|
In order to use XeLaTeX (and even both pdflatex and xelatex on the same document), you can use the simple
You may then compile your document either with Note: the package is in development; the aim is to support as many unicode equivalents as possible. |
|||
|
|
|
This question is really ambiguous, and I believe the answers are to the wrong interpretation. To have LaTeX handle Unicode is what is being answered, what I understand is being asked is how to enter such characters into the file. And that depends on the editor used... I've even copy&pasted some from Wikipedia pages into |
|||
|
|
|
Sorry, I'm not an expert on this, but hope I can at least provide some useful leads. A lot of the early multi-lingual support for LaTeX predates the widespread adoption of Unicode, although it looks like there's been some consolidation around Unicode recently. So you might find something useful in specific language support packages, e.g. CJK LaTeX (for Chinese, Japanese and Korean). It looks like one Unicode package for LaTeX is no longer supported, although it may still be the best thing out there. You might also have a look at the excellent book The LaTeX Companion, which includes a section on multilingual text. |
|||
|
|
In this post I describe a way to use Greek Unicode letters in Latex. It could give you some hints for working around your problem with standard Latex. |
|||||||
|