Suppose I need to type a LaTeX document that have mixed CJK, Latin and cyrillic characters, how can I do it?
I tried ucs and inputenc, and run on pdflatex, but none of them work.
Then I tried xelatex, the tex file compiles, but all the CJK and cyrillic characters are missing from the output pdf file
Thanks!
Mark
Here is the example code:
% -*- coding: utf-8 -*-
\documentclass{report}
%\usepackage[cjkjis]{ucs}
\usepackage[utf8x]{inputenc}
\begin{document}
Привет
Ubuntu 是一個啟動速度超快
\end{document}
Fonts & Character Sets ⇒ \usepackage[utf8x]{inputenc} does't work on CJK or cyrillic
-
- Posts: 13
- Joined: Sat Jul 03, 2010 3:08 am
\usepackage[utf8x]{inputenc} does't work on CJK or cyrillic
For XeLaTeX, it should be enough if you make sure to choose a font that has the necessary characters.
For example:
Gives:
For regular LaTeX, just adding the appropriate language to babel, e.g.:
\usepackage[russian]{babel}
should be enough to get the Cyrillic working. More might be necessary for the CJK, but I'm not the person to ask. (I don't even know what language that is.)
For example:
Code: Select all
\documentclass{report}
\usepackage{fontspec}
\setmainfont{Droid Sans Fallback}
\begin{document}
Привет
Ubuntu 是一個啟動速度超快
\end{document}
\usepackage[russian]{babel}
should be enough to get the Cyrillic working. More might be necessary for the CJK, but I'm not the person to ask. (I don't even know what language that is.)
-
- Posts: 13
- Joined: Sat Jul 03, 2010 3:08 am
\usepackage[utf8x]{inputenc} does't work on CJK or cyrillic
I tried your code on xelatex, but it rejected the font name as it contains space:
Mark
Thanks!abcde-macbook:drama abc$ xelatex unicode2.tex
This is XeTeX, Version 3.1415926-2.2-0.9995.2 (TeX Live 2009)
entering extended mode
(./unicode2.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, german-x-2009-06-19, ngerman-x-2009-06-19, ancientgreek, ibycus, ar
abic, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutc
h, esperanto, estonian, farsi, finnish, french, galician, german, ngerman, mono
greek, greek, hungarian, icelandic, indonesian, interlingua, irish, italian, ku
rmanji, latin, latvian, lithuanian, mongolian, mongolian2a, bokmal, nynorsk, po
lish, portuguese, romanian, russian, sanskrit, serbian, slovak, slovenian, span
ish, swedish, turkish, ukenglish, ukrainian, uppersorbian, welsh, loaded.
(/usr/local/texlive/2009/texmf-dist/tex/latex/base/report.cls
Document Class: report 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2009/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2009/texmf-dist/tex/xelatex/fontspec/fontspec.sty
(/usr/local/texlive/2009/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/local/texlive/2009/texmf-dist/tex/latex/tools/calc.sty)
(/usr/local/texlive/2009/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/local/texlive/2009/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/local/texlive/2009/texmf-dist/tex/generic/xkeyval/keyval.tex)))
(/usr/local/texlive/2009/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2009/texmf-dist/tex/xelatex/euenc/eu1enc.def)
(/usr/local/texlive/2009/texmf-dist/tex/xelatex/euenc/eu1lmr.fd))
fontspec.cfg loaded.
(/usr/local/texlive/2009/texmf-dist/tex/xelatex/fontspec/fontspec.cfg))kpathsea: Invalid fontname `Droid Sans Fallback', contains ' '
! Font \zf@basefont="Droid Sans Fallback" at 10.0pt not loadable: Metric (TFM)
file or installed font not found.
\zf@fontspec ...ntname \zf@suffix " at \f@size pt
\unless \ifzf@icu \zf@set@...
l.4 \setmainfont{Droid Sans Fallback}
?
Mark
Re: \usepackage[utf8x]{inputenc} does't work on CJK or cyril
The problem can't be the spaces. You probably just don't have that font installed. (XeLaTeX uses your system fonts, not fonts from LaTeX packages.)
It was just meant as an example. I had hoped you’d substitute some other font on your system that has them.
I gather you’re using Ubuntu (as am I). If you want to try the Droid fonts, just install the ttf-droid package. I think UnDotum or UnBatang should have most of the right characters too. But you probably know better than I would!
It was just meant as an example. I had hoped you’d substitute some other font on your system that has them.
I gather you’re using Ubuntu (as am I). If you want to try the Droid fonts, just install the ttf-droid package. I think UnDotum or UnBatang should have most of the right characters too. But you probably know better than I would!
-
- Posts: 13
- Joined: Sat Jul 03, 2010 3:08 am
Re: \usepackage[utf8x]{inputenc} does't work on CJK or cyril
I have an Ubuntu desktop and a MacBook. On the Ubuntu desktop, after I install the droid font, it works now. I tried both UnDotum or UnBatang and nonw works. Then I tried fonts like Arial and Time and no luck either.
Actaully does fontspec let users to specify the system font to use and if we specify a font that covers all the languages the document use, then we will be fine?
Does TeX come with fonts that cover everything in UTF8? (latin, cyrillic, Greek, CJK and arabic languages)
Actaully does fontspec let users to specify the system font to use and if we specify a font that covers all the languages the document use, then we will be fine?
Does TeX come with fonts that cover everything in UTF8? (latin, cyrillic, Greek, CJK and arabic languages)
\usepackage[utf8x]{inputenc} does't work on CJK or cyrillic
That is my understanding, yes. You can also switch between fonts fairly easily with the fontspec package. I think the xecjk might be worth looking into as a way of easily specifying a different font for CJK, which should open up some possibilities.mark.farnell wrote: Actaully does fontspec let users to specify the system font to use and if we specify a font that covers all the languages the document use, then we will be fine?
I'm not sure whether, e.g., a full installation of texlive (e.g., the texlive-full package in Ubuntu), covers all of UTF8, but I think all those examples you gave should be covered. I recommend searching through the documentation at CTAN for individual languages and to see what packages are available for what.Does TeX come with fonts that cover everything in UTF8? (latin, cyrillic, Greek, CJK and arabic languages)