1

I'd like to know how to create a .tex file including Chinese characters. Preferably, is there a way to enter Chinese characters in Scientific Workplace?

2

With pdflatex

\documentclass{article}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK*}{UTF8}{gbsn}
文章内容。
\clearpage\end{CJK*}
\end{document}
| improve this answer | |
  • Is this for XeTex or XeLaTex? – hermes Dec 22 '19 at 5:13
  • The above code is for pdflatex, not for xelatex – Samjith Dec 22 '19 at 5:18
  • The code can be compiled in Tex Live, right? – hermes Dec 22 '19 at 5:33
  • Yes, of course.. – Samjith Dec 22 '19 at 5:34
1

In XeTeX, you can use the package xeCJK, which allows you to use modern fonts and is being actively maintained (as of 2020). The documentation is only in Chinese, and some of the code samples do not compile on my installation, but here is what I think is a fixed version of the first example in the manual.

\documentclass{article}
\usepackage{xeCJK}
\usepackage{metalogo}

\defaultfontfeatures{Scale=MatchUppercase}
\setCJKmainfont{Noto Serif CJK SC}
\setCJKsansfont{Noto Sans CJK SC}
\setCJKmonofont{Noto Sans Mono CJK SC}

\begin{document}
中文{\LaTeX}\textsf{示例}
\end{document}

Noto Font Sample

If you need to combine different East Asian scripts in the same document, such as both Chinese and Japanese, babel allows this. In this case, the TeX engine can no longer autodetect which language you are typing in, and you must add language tags to tell it.

| improve this answer | |
1

The current mainstream Chinese processing method is utf8 encoding + xelatex + ctex macro package, do not use cjk macro package anymore.

\documentclass[fontset=fandol]{ctexart}
% or
% \documentclass{article}
% \usepackage[fontset=fandol]{ctex}
\begin{document}
中文
\end{document}

Refer to Chapter 2 of texdoc lshort-zh-cn

xelatex 和 lualatex 编译命令配合 ctex 宏包/文档类的方式成为当前的主流中文排版支持方式。 The xelatex and lualatex compilation commands combined with the ctex package / document class have become the current mainstream Chinese typesetting support method.

| improve this answer | |
  • Thanks for the information. You might want to provide a source for this claim, so it doesn’t sound like the opinion of one anonymous editor on the Internet. – Davislor May 16 at 19:17
  • @Davislor,Added in the original text – sikouhjw May 16 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.