Current location - Education and Training Encyclopedia - Resume - How to edit Chinese with latex?
How to edit Chinese with latex?
-

\documentclass{article}

\ Use package {CJK}

\ begin {CJK} {UTF8} {Song}

When dealing with China people, CJK is the most helpless choice. This law is out of date now, and it is not recommended for everyone to use it.

\ end {CJK} {UTF8} {Song}

\end{document}

-

The quality of the pdf file produced by this method is not good. And because all places in Chinese use CJK macro packages, it is not convenient enough.

Before using xelatex, I also used ctexlive-2005 for linux.

If you have this iso file, the usage is simple, that is, replace article with artutf8. And you don't have to worry about the problem of broken Chinese lines and mixed Chinese and English.

It is actually a package of CJK macro package. Please refer to the relevant documents for a more detailed explanation.

-

\documentclass{artutf8}

\ begin {document}

If you don't want to use xelatex, ctexlive 2005 is quite good.

\end{document}

-

Xelatex is generally used to process Chinese tex files.

Xetex supports Unicode encoding. Therefore, it naturally supports multiple languages.

The relationship between tex, latex, xetex and xelatex is as follows:

Tex is the typesetting engine and latex is the macro package.

Xetex is also a typesetting engine, which can be regarded as an upgraded version of tex (support for international codes is added, the fonts of the system can be directly used, and dvi files are no longer generated by default). After using latex macro package, it is xelatex.

As for dvi, tex system has been produced before the birth of pdf format. At that time, people typeset and generated device-independent files (dvi), then generated device-related files, and then submitted them to the corresponding printers for printing.

Pdf is now widely used. So this upgrade of xetex. By the way, the process of generating dvi is omitted. The advantages of dvi are fast generation, ultra-small, and suitable for preview; The disadvantage is that you can't embed fonts, and there is no widely used browser under windows, which is not suitable for publishing. Few people publish dvi files directly to the network (publishing source files directly is better than that).

It is very convenient to use emacs to edit latex source files under linux operating system. Compile with xelatex after editing. Pdf document will be generated. Compared with the pdf document generated by using CJK macro package, the pdf document generated by this method is small in size, beautiful in font, high in quality, and can directly display Chinese without processing in some places that originally needed special processing, which should be the mainstream of future applications.

Because latex is designed for European languages. On the other hand, European languages rely on spaces to separate words, which is different from East Asian languages. Therefore, it is not enough to use xelatex only, but also use xeCJK, a macro package, so that latex can correctly handle Chinese line breaks and Chinese-English mixed typesetting.

I now use emacs under linux to edit latex files. The system input method is closed, and Ye's eim five-stroke input method is used. By setting, you can automatically turn off the Chinese input method when you enter latex's digital mode, and automatically turn on Chinese input when you leave math mode. Another advantage of this is that you can use Ctrl+space to mark it. You can also edit. Xresource file and set use-xim = off. This can also achieve the goal.

The following is a simple xelatex template file.

-

\documentclass〔 12pt,dvipdfm]{article}

\usepackage{xeCJK}% load the macro package according to your own needs.

\setmainfont{ font installed in your system}%

\ begin {document}

With xelatex, it is no longer difficult to deal with Chinese. It just compiles a little slowly.

\end{document}

-