Some solutions latex of Chinese font settings

latex some solutions for Chinese font settings

When using direct file Xelatex compiled with the Chinese, unidentified error occurs because latex default environment does not support Chinese, then you can use CTex set of macros , ctex packages or xeCJK packages makes latex support Chinese output. Chinese font set can be achieved through:
(English is the default font: Computer Modern Roamn [CMR], created by Donald Knuth, but does not support Chinese, you need to set the font support Chinese - {from: Egg's Blog })


%在导言区使用以下代码,获得中文支持
\document[utf8,a4paper,12pt] {ctexart}
%或者
\usepackage {ctex}

After setup, Chinese default font is Arial , need to change, you can set the font for Chinese use the following command, windowsnew fonts include the following fonts:

Fonts Command 1 Command 2
Times New Roman \ Songti \CJKfamily{zhsong}
Blackbody \name \CJKfamily{zhhei}
Italics \ Fangsong \CJKfamily{zhfs}
Regular script \ Kaishu \CJKfamily{zhkai}
Official script \ Lishu \ CJKfamily zhli {}
Round body \ Youyuan \CJKfamily{zhyou}
Microsoft elegant black \ Yahei \CJKfamily{zhyahei}

Note :
songti font family is a new definition of conversion command, the equivalent of \newcommand* {songti}{\CJKfamily{zhsong}}
zhsong is the font family name of the new definition, the equivalent \setCJKfamilyfont {zhsong}{SimSun}, the name changed to SimSun zhsong.

Not recommended \ textrm {}, \ textsf { }, \ texttt {} to change the Chinese font, it will be confused with the English font settings.
The following suggestions have a certain understanding of the latex and then look:

\ textrm {} is equivalent to the default font, Arial namely Chinese, English Roman
\ textit {} default Chinese regular script, if defined earlier following Chinese font, for the definition of fonts, italics English
\ textsf {} Chinese Microsoft elegant black, sans-serif English line body
\ texttt {} italics Chinese, English monospaced font

++ notice textsf will change the Chinese punctuation

However, bold font, such as a conventional \ textbf {} can be interoperable.


打个比方说的话,ctex包若是一辆车,xeCJK就是个轮子。轮子是车子的重要零件,但我还是建议你开车,把装轮胎的事交给工程师。
----- 来自知乎用户

Here, fonts xeCJK packages provided will be briefly described, as long as the introduction xeCJK packages used in the preamble:

\usepackage {xeCJK}

\setCJKmainfont {font name}
% 设置正文罗马族的CJK字体,影响\rmfamily和\textrm 的字体
\setCJKsansfont {font name}
% 设置正文无衬线族的CJK字体,影响\sffamily和\textsf 的字体
\setCJKmonofont {font name}
% 设置正文等宽族的CJK字体,影响\sffamily 和 \textsf 的字体

The windows pre-installed Chinese fonts are:

  • Arial Unicode MS
  • FangSong, italics
  • KaiTi, 楷体
  • Microsoft YaHei, Microsoft elegant black
  • MingLiU, fine Ming
  • NSimSun, Times New Roman
  • PMingLiU, Times New
  • SimHei, blackbody
  • SimSun, Times New Roman

As long as the font name was changed to the above Font Name (Chinese / English) to

In this paper, BY-NC-SA agreement, please indicate the source.

Guess you like

Origin www.cnblogs.com/LitBro/p/12074820.html