Advertisement
Guest User

Handle Chinese characters in multilingual text with XeLaTeX

a guest
Feb 2nd, 2014
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. \documentclass{article} % Document type. With XeLaTeX, no more need for [] parameters.
  2. \usepackage[french]{babel} % Define language such as French, Spanish, Chinese, etc. Here French is set to showh another language that English :-)
  3. \usepackage{hyperref} % For hypertext links
  4. \usepackage{fontspec} % The dark side of the force: XeLaTeX allows fine font tweaks.
  5. \usepackage[stable]{footmisc} % The so-called footnote misc package.
  6. \setmainfont[
  7. Ligatures={Common, Rare, TeX},
  8. Contextuals=Swash,
  9. Style={Historic, Swash, Alternate},
  10. Scale=1.2]{Linux Libertine}
  11.  
  12. \usepackage{xeCJK} % To handle Chinese caracters. I know to be possible to set peculiar font just for some unicode characters sets, but methinks xeCJK to be easy to use.
  13. \setCJKmainfont{AR PL UMing TW} % Set font for CJK caracter.
  14. %\setCJKmainfont{TW-MOE-Std-Kai} % Set font for CJK caracter. This font is so very beautiful! but just works on traditional characters.
  15.  
  16. \title{Simple Chinese typing with \TeX{}}
  17. \begin{document}
  18. Tests (Chinese more French):
  19. \\驛 un caractère chinois
  20. \\驿 sa version simplifiée (n'apparaît pas avec toutes les fontes)
  21. \\文 un caractère pour voir la beauté des fontes
  22. \\ fi fl ffl tt bretzel : exemple de petites ligatures ☻
  23. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement