Latex on Fedora
From ITRS
- Fedora 17+ should contain up-to-date TexLive packages.
- Fedora 16- are stuck with outdated TexLive 2007 packages by default. Updates were blocked by a legal audit (wiki, RHBZ:488651)(since resolved).
If you're using Fedora 16-, use the texlive repo packaged by Jindrich Novy (mailing list):
# Support for older Fedora releases and RHEL also available, browse around the folder rpm -i http://jnovy.fedorapeople.org/texlive/packages.f16/texlive-release.noarch.rpm yum -y install 'texlive-*'
Contents |
XeTex Chinese Support
The trick is figuring out which fonts on your system covers your target language:
fc-list :lang=zh ; fc-list :lang=ja ; fc-list :lang=ko
will list Chinese, Japanese and Korean fonts respectively.
/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc: WenQuanYi Zen Hei Sharp,文泉驛點陣正黑,文泉驿点阵正黑:style=Regular /usr/share/fonts/google-droid/DroidSansFallback.ttf: Droid Sans:style=Regular /usr/share/fonts/cjkuni-uming/uming.ttc: AR PL UMing TW MBE:style=Light ...
For more fun with Fontconfig, try:
fc-match -v sans:lang=zh ; fc-list :spacing=100 # all mono fonts
Pattern has 31 elts (size 32) family: "DejaVu Sans"(s) familylang: "en"(s) ...
and fonts-conf(5).
Example
test.tex
% !TEX TS-program = xelatex
% !TEX encoding = UTF-8 Unicode
\documentclass{book}
\usepackage{hyperref}
\usepackage{fontspec}
\usepackage[BoldFont,SlantFont,CJKnumber,fallback]{xeCJK}
\setmainfont{Liberation Serif}
\setromanfont{Liberation Sans}
\setmonofont{Liberation Mono}
%% list Chinese fonts: "fc-list :lang=zh"
%\setCJKmainfont{WenQuanYi Zen Hei}
\setCJKmainfont{AR PL UMing TW}
\setCJKsansfont{AR PL UKai TW}
%\setCJKmainfont{PMingLiU}
\CJKsetecglue{\hspace{2mm}}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
\begin{document}
測試。Your text goes here.\textbf{粗體}
\CJKfamily{\CJKsfdefault}改變字體
\end{document}
The `xeCJK` Latex package can be installed with:
$ yum install texlive-xeCJK
Generating a PDF:
$ xelatex test.tex <...> Output written on test.pdf (1 page).
GUIs
There are a lot of good graphical user interfaces for TeX nowadays:
- TeXstudio: supports Windows, Mac and Linux. CTRL-<space> activates completion. F7 opens the builtin PDF viewer. CTRL-click jumps between source and PDF preview.
- TeXworks: supports Windows, Mac and Linux. CTRL-click jumps between source and PDF preview, <Tab> activates source completion.
- gedit LaTeX Plugin (rubber xetex support patch): CTRL-<Space> activates completion.
- A Look at 8+ Free LaTeX Editors by Kevin Klement, July 2010