How to use the Chinese in LaTeX

  Because the epidemic at home, school, work must be submitted using the PDF. Anyway, plenty of time, it is better to take the opportunity to recall LaTeX use.

  Prior has been using Vimtex, but the feeling is not convenient, then switch to the Texpad. The power of Texpad that it supports real-time preview of the speed of light. But when configured to support Chinese Texpad has stepped ten thousand pit, but until now no real Chinese live preview, and then try it tomorrow.

  Following entered, in how to use Chinese in LaTeX, or how to make LaTeX support Chinese?

  I found three methods:


 

  the first method:

%! Tex-winning program =
\documentclass{article}
\usepackage[UTF8, scheme = plain]{ctex}
\begin{document}
Support XeLaTeX compiler, you can insert Chinese, does not affect the layout.
\end{document}

  This code is very clear principle, the compiler choice of Chinese support for better xelatex, a particular document can be seen here https://www.overleaf.com/learn/latex/XeLaTeX , simple to understand, XeLaTeX of this company : overleaf unit of a code encoded in UTF-8 engine of tex, more and more font support. This is also the reason why he is better and by contrast pdfLaTeX but often because of an error in the font support for Chinese. what's next? We use a package, which is called ctex, package a variety of typography, Chinese font set, and so on and so on. ctex specific use or see the documentation. So, with the right engine -xelatex, proper layout specification -ctex, support the Chinese alone.


 

  The second method:  

%! Tex-winning program =

\documentclass[UTF8]{ctexart}
\begin{document}
This is to a utf-8 encoded CTEX example, {\ kaishu here italics}, {\ songti italicized here show}, {\ heiti This is shown in boldface}, {\ fangsong displayed here italics}.
\end{document}

  This code is called ctex had the same package, setting documentclass, we actually have used ctex package. The following {\ songti ooxx} ... and so on, is not difficult to understand ctex package, ctexart document type characteristic! Such fonts are not also the ever-changing.


 

  The third method:

%! Tex-winning program =

\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{SimSun}
\begin{document}
Chinese \ LaTeX example.
\end{document}

  This code is XeCJK of the document. Here to explain CJK: namely Chinese, Japanese, Korean. So we can imagine, XeCJK ctex and is part of a grade! So why should we use XeCJK package, rather than using ctex bag? Readme school science at me: CTeX suit was first developed by the Chinese Academy of Sciences Leo Wu (Wu Lingyun) researcher, maintenance and release of TeX distributions, it is difficult to configure the background when Chinese should (CCT, CJK, etc.) and the birth, and now the Chinese technical support (xeCJK etc.) configuration is very simple; CTeX suit since March 22, 2012 release version 2.9.2.164, has not been updated, can not meet the current development of Chinese TeX technology, citing the development CTeX suite Liu Haiyang one of the words: CTeX has completed its historic mission. Eau, then we should also play gooseberry point, you must not use this package CTeX embrace XeCJK this package.

  XeCJK document: https://www.ctan.org/pkg/xecjk   when I see this package Updated 4 days ago, so why we do not have this active package le ~

  Three ways: personally recommend the third, and the latest one. The first two long-term use because the call is not updated ctex package and is bound to be eliminated (in fact there is a call CJK package of Chinese typesetting program, which has long been eliminated). Instead, grasp the XeCJK, Chinese typesetting will be even more powerful!  

Guess you like

Origin www.cnblogs.com/chester-cs/p/12343942.html