[Latex] 02. CJK Environment

Source: Internet
Author: User
Introduction latex was invented by foreigners, so it does not support Chinese by default. How can we use latex to write Chinese documents? Use CJK. CJK is developed by Werner Lemberg. We only need to use the CJK macro package to display Chinese characters in the latex file. We do not need to configure CJK by ourselves. ctex has been configured. We only need to introduce the macro package. CJK Introduction
12345678910 \ Documentclass [12pt, a4paper] {Article} \ usepackage {CJK} \ begin {document} \ begin {CJK *} {GBK} {SONG} \ cjktilde \ cjkindent Hello everyone, I am ~ \ Latex {}.
\ Clearpage \ end {CJK *} \ end {document}
Row 3: Common Article type. The default font size is 12pt. The text is displayed on the "paper" tab and A4 paper. Row 2nd: imports the CJK macro package. The CJK macro package provides two environments: the CJK environment and the CJK * environment. The differences between these two environments are as follows: for spaces after Chinese characters, the former is not ignored, and the latter is ignored. We recommend that you use the CJK * environment. Row 3rd: starts the document environment. Row 4th: starts the CJK * environment. The default encoding is GBK and the default font is. Row 3: redefinition "~ "Symbol to make" ~" Set to a reasonable interval.
Row 3: indent the first line. Row 3 :~ It indicates a space. Generally, a space is left between Chinese and English. \ latex {} indicates the latex name. Row 8th: This sentence is usually added when we use the CJK environment, because it may lead to unexpected errors, which will be mentioned below. Row 3: end the CJK * environment. Row 3: end the document environment. Small details \ cjkspace command: switch from the CJK * environment to the CJK environment. \ Cjknospace command: switch from the CJK environment to the CJK * environment. Common Errors

Error: argument of \ CJK @ XX has an extra}
If the number of words exceeds a certain limit, this error is reported. The solution is as follows:
1. \ begin {CJK *} {GBK} {Kai} must be placed behind \ begin {document} (not necessarily next ). 2. Add \ clearpage to \ end {CJK *}.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.