First, we recommend that you go to texshop-> preferences-> source, find the encoding drop-down menu bar, and select the encoding format as Unicode (UTF-8 ).
Although there will be special commands in the latex source code later to specify this encoding, the encoding format is set for compilation, and the encoding in "preference settings" seems to be the encoding format for saving. This is beneficial to the good versatility among platforms.
Two methods are available on the Web to display Chinese characters on texshop.
Method 1: xelatex.
(Original Author: Cheng Yan)
In texshop, xelatex is used as the typeset. Xelatex seems to be integrated in texshop. At least I did not install xelatex in my test.
Source code example:
%! Tex ts-program = xelatex %! Tex encoding = UTF-8 Unicode \ documentclass [12pt] {Article} \ usepackage {geometry} \ geometry {letterpaper} \ usepackage {fontspec, xltxtra, xunicode} \ defaultfontfeatures {mapping = Tex-text} \ setromanfont {simsun} % set the Chinese font \ xetexlinebreaklocale "ZH" \ Signature = 0pt plus 1pt minus 0.1pt % Chinese automatic line breaks \ newfontfamily {\ h} {simhei} \ newfontfamily {\ e} {Arial} % set the new font shortcut command \ title {\ H algorithm design} \ author {Donald} \ Date {\ e \ today} \ begi The section N {document} \ maketitle contains a {\ e word }. \ End {document}
One disadvantage of using xelatex is that if the Chinese font is different from the English font, You need to specify the font continuously in the English and Chinese paragraphs, to ensure that the same English font is used. The original author uses the following method to name a new font command:
\ Newfontfamily {\ e} {Arial}
To use this font later, you only need:
{\ E word}
Method 2: CJK macro package.
(This method is self-developed, but there are still some problems, so to be continue ...)
%! Tex encoding = UTF-8 Unicode \ documentclass {Article} \ usepackage {cjkutf8} \ begin {document} \ begin {CJK} {utf8} {BsmI} work diary \ newline unique idea \ end {CJK} \ end {document}
The output result is:
Some special words cannot be displayed, such as "NOTE" and "independent ". Paste it here first. If you can tell me which prawns are confused, I am very grateful for the bacteria!