How Do I Upload Chinese Chacters in Overleaf

Introduction

This article explains how to typeset Chinese documents on Overleaf. The recommended approach is to utilize the XeLaTeX or LuaLaTeX compilers because they straight support UTF-8 encoded text and piece of work with TrueType and OpenType fonts. Run into this commodity to learn how to change the compiler in Overleaf.

Allow'south start with an instance which uses XeLaTeX and the ctexart document class:

                        \documentclass            {ctexart}            \begin            {document}            \tableofcontents            \begin            {abstract}            这是简介及摘要。            \end            {abstract}            \section            {前言}            \section            {关于数学部分}            数学、中英文皆可以混排。You can intersperse math, Chinese and English language (Latin script) without adding extra environments.  這是繁體中文。            \cease            {document}          

 Open this XeLaTeX instance in Overleaf

This example produces the following output:

OL2Chinese1.png

The ctexart document class part of the ctex package parcel which implements mutual Chinese typesetting practices. We discuss further details about the ctex classes below.

The ctex classes

In lodge to handle characters for Simplified Chinese typesetting you can utilize the ctex document classes: ctexart, ctexrep, ctexbook and ctexbeamer. For example, to apply the ctexart class include the following line in your document preamble:

The ctexart class (and other ctex classes) provides Chinese localisation, much similar babel. You will not only be able to typeset Chinese characters, only likewise ascertain elements such every bit "Abstract" and "Tabular array of Contents" that will be translated as 摘要 and 目录.

You tin import external fonts to your document, either uploading them to the same directory of your LaTeX file, or using arrangement-wide fonts. For instance, if the BabelStone Han font is already installed on your arrangement, y'all can use it in your document with

                        \setCJKmainfont            {BabelStone Han}          

Additional fonts for some parts of the document tin be configured. To ready a specific font for elements that employ a sans serif font manner use \setCJKsansfont{} and for elements that are displayed in a monospace font, such as verbatim environments, utilise the control \setCJKmonofont{}. You can refer to the list of Chinese fonts available on Overleaf hither.

Discover that the terminal line in the example at the introduction is actually using Traditional Chinese characters. This is accomplished past the Fandol font (the default) because this font includes them. And so, with the right font, yous can actually typeset your document in both Simplified and Traditional Chinese. If you utilize a traditional- or simplified-only font, though, and then characters whose glyphs are not bachelor would non show up in the output PDF.

If you demand to utilize document class such as memoir or possibly a thesis .cls provided by your university, merely would still like to apply the ctex bundle, you can load the ctex package, like this:

                        \documentclass            {UniThesis}            \usepackage            {ctex}          

xeCJK with XeLaTeX

If the complete ctex localisation classes and package feels similar an overkill, and you only desire to typeset some Chinese characters, you can utilise the xeCJK parcel—which only works when compiled with XeLaTeX.

                        \documentclass            {commodity}            \usepackage            {xeCJK}            \begin            {document}            \section            {前言}            这是一些文字。            \section            {关于数学部分}            数学、中英文皆可以混排。Yous can intersperse math, Chinese and English (Latin script) without adding extra environments.  這是繁體中文。            \end            {document}          

 Open this xeCJK (XeLaTeX) example in Overleaf

This example produces the following output:

OL2Chinese2.png

Using the CJKutf8 with pdfLaTeX

The CJKutf8 package can be used to typeset CJK languages with pdfLaTeX. Chinese (and Japanese/Korean) text must be placed inside a CJK environment, and then this is usually convenient for primarily Latin-based documents (e.grand., English) which contain fragments of Chinese text (or vice-versa).

                        \documentclass            {article}            \usepackage            {CJKutf8}            \begin            {document}            \begin            {CJK*}{UTF8}{gbsn}            \section            {前言}            \section            {关于数学部分}            数学、中英文皆可以混排。You tin can intersperse math, Chinese and English (Latin script) without adding extra environments.            \cease            {CJK*}            \bigskip            %% Just some white space            You tin also insert Latin text in your document            \bigskip            %% Simply some white space            \begin            {CJK*}{UTF8}{bsmi}            這是繁體中文。            \stop            {CJK*}            \stop            {certificate}          

 Open this CJKutf8 package example (using pdfLaTeX) in Overleaf

This example produces the following output:

OL2Chinese3.png

The line \usepackage{CJKutf8} imports the CJKutf8 bundle which enables UTF-8 encoding for use with Chinese, Japanese and Korean fonts. Every block of Chinese text must exist typed inside a \brainstorm{CJK*}{UTF8}{gbsn} surround. In this environment UTF8 is the encoding and gbsn is the font to exist used. You can use gbsn or gkai fonts for Simplified characters, and bsmi or bkai for Traditional characters.

Farther reading

For more data see

  • Supporting modern fonts with TenƎLaTeX
  • Chinese fonts available on Overleaf
  • Example: Using the CTeX packages on Overleaf
  • Example: How to write multilingual text with unlike scripts in LaTeX
  • Typesetting quotations and quotation marks
  • International language support
  • Standard arabic
  • French
  • German
  • Greek
  • Italian
  • Japanese
  • Korean
  • Portuguese
  • Russian
  • Spanish
  • Ctex packages documentation
  • xeCJK package documentation
  • The not so short introduction to 50aTeXtwo ε
  • LaTeX/Internationalization on WikiBooks
  • LaTeX/Special_Characters on WikiBooks

jamesqualmitill.blogspot.com

Source: https://www.overleaf.com/learn/latex/Chinese

0 Response to "How Do I Upload Chinese Chacters in Overleaf"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel