Skip to content

Instantly share code, notes, and snippets.

@voldikss
Last active May 15, 2023 05:45
Show Gist options
  • Save voldikss/7977fb79fc01a2f80d4913a9f5133ee6 to your computer and use it in GitHub Desktop.
Save voldikss/7977fb79fc01a2f80d4913a9f5133ee6 to your computer and use it in GitHub Desktop.
% 1
% UTF-8 encoding
% Compile with latex+dvipdfmx, pdflatex, xelatex or lualatex
% XeLaTeX is recommanded
\documentclass[UTF8]{ctexart}
\begin{document}
文章内容
Hello world
\end{document}
% 2
\documentclass{article}
\usepackage[UTF8]{ctex}
\begin{document}
文章内容
Hello world
\end{document}
% 3
% UTF-8 encoding
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{SimSun}
\begin{document}
文章内容
Hello world
\end{document}
% 4
\documentclass{article}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{SimSun}
\begin{document}
文章内容 Hello world
\end{document}
% Reference: https://tex.stackexchange.com/questions/17611/how-does-one-type-chinese-in-latex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment