1. Main. Tex
% \ Documentclass {Article} \ documentclass [11pt, oneside, openany] {book} \ usepackage {zhfontcfg} % custom Chinese Character setting package \ usepackage [colorlinks, linkcolor = Black] {hyperref} % opening \ input {. /set/code insert} % \ input {. /set/translation} % \ input {. /set/layout size} \ begin {document} \ input {. /set/00 cover. tex} \ input {. /set/01 preface. tex} \ input {. /set/02 directory. tex} % part \ input {. /set/03 text. tex} \ chapter {chaptername} \ section {body} \ Kai {body} \ section {body} \ Hei {body} \ end {document} \ begin {parallel} [c] {0.52 \ textwidth} {0.43 \ textwidth} \ end {parallel}
2. zhfontcfg. sty
\ ProvidesPackage {zhfontcfg} \ usepackage {indentfirst} \ usepackage [cm-default] {fontspec} % [cm-default] is mainly used to solve the problem that the learning symbol cannot be normally displayed when the mathematical environment is used. problem \ usepackage {metalogo} % \ usepackage {xunicode, xltxtra} \ defaultfontfeatures {Mapping = tex-text} % if not, some special tex characters, such as hyphens, cannot be used normally. % Chinese disconnected line \ XeTeXlinebreaklocale "zh" \ XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt % map the system font name to the logical font name, mainly for the convenience of maintenance \ newcommand \ fontnamehei {SimHei} %, SimHei: style = Regular \ newcommand \ fontnamesong {Simsun (Founder Extended)} %-oversized character set, simsun (Founder Extended): style = Regular \ newcommand \ fontnamekai {KaiTi_GB2312} % _ GB2312, layout: style = Regular \ newcommand \ Parameters {DejaVu Sans Mono} \ newcommand \ fontnamerom An {Times New Roman }%% set the common Chinese font size, convenient call of \ newcommand {\ erhao} {\ fontsize {22pt} {\ baselineskip} \ selectfont} \ newcommand {\ xiaoerhao} {\ fontsize {18pt} {\ baselineskip} \ selectfont} \ newcommand {\ sanhao} {\ fontsize {16pt} {\ baselineskip} \ selectfont} \ newcommand {\ xiaosanhao} {\ fontsize {15pt} {\ baselineskip} \ selectfont} \ command {\ sihao} {\ fontsize {14pt} {\ baselineskip} \ selectfont} \ newcommand {\ xiaosihao} {\ fontsize {12pt} {\ basel Ineskip} \ selectfont} \ newcommand {\ wuhao} {\ fontsize {10.5pt} {\ baselineskip} \ selectfont} \ newcommand {\ tags} {\ fontsize {9pt} {\ baselineskip} \ selectfont} \ newcommand {\ liuhao} {\ fontsize {7.5pt} {\ tags} \ selectfont} % set the document body to \ setmainfont [BoldFont = \ fontnamehei] {\ fontnamesong} \ setsansfont [BoldFont = \ fontnamehei] {\ fontnamekai} \ setmonofont {\ fontnamemono} % \ newfontinstance \ KAI {\ fontnamekai} \ newcommand {\ Kai} [1] {\ KAI #1} % \ newfontinstance \ HEI {\ fontnamehei} \ newcommand {\ hei} [1] {\ HEI #1 }}% English \ newfontinstance \ ENF {\ fontnameroman} \ newcommand {\ en} [1] {\, {\ ENF #1 }\,} % Chinese chapter Alibaba \ usepackage {titlesec} \ def \ CJKnumber #1 {\ ifcase #1 \ or {1} \ or {2} \ or {3} \ or {4} \ or {five} \ or {Six} \ or {seven} \ or {eight} \ or {nine} \ or {ten} \ fi} \ renewcommand {\ chaptername} {Chapter \ CJKnumber {\ thechapter} \ Newcommand {\ sectionname} {Section} \ renewcommand {\ figurename} {figure} \ renewcommand {\ tablename} {table} \ renewcommand {\ bibname} {references} \ renewcommand {\ contentsname} {object ~ Recording} \ renewcommand {\ listfigurename} {figure ~ Object ~ Recording} \ renewcommand {\ listtablename} {table ~ Object ~ Recording} \ renewcommand {\ indexname} {suo ~ Reference} % \ renewcommand {\ abstractname} {\ Large {abstract ~ To be} % \ newcommand {\ keywords} [1] {\\\\ textbf {off ~ Key ~ Word }: #1} \ titleformat {\ chapter} [block] {\ center \ Large \ bf} {\ chaptername} {20pt }{}\ titleformat {\ section} [block] {\ large \ bf }{\ thesection }{10pt }{}
3. Code insertion. Tex
\ Font \ smallsong = "Simsun (Founder Extended)" at 9pt \ font \ rsong = "Simsun (Founder Extended): + smcp, color = FF0000 "% at 10pt \ font \ gsong =" Simsun (Founder Extended): + smcp, color = 00FF00 "% at 10pt \ font \ bsong =" Simsun (Founder Extended): + smcp, color = 0000FF "% at 10pt \ usepackage {cprotect} \ usepackage {listings} \ lstset {xrightmargin = 0pt, basicstyle = \ smallsong, frame = shadowbox, columns = fullflexible, showstringspaces = false, commentstyle = \ bsong, breaklines = true, framerule = 0.7pt, frameround = tttt, rulecolor = \ bsong, language = {[LaTeX] TeX }, breaklines % This command enables LaTeX to automatically wrap long lines of code} % language = [ANSI] {C },
4. Translation. tex
% ----- Translate Parallel litem, ritem ----- % % % % \ font \ TimesNewRoman = "Times New Roman" \ usepackage {parallel} \ newcommand {\ litem} [1] {\ ParallelLText {\ parindent = 1em {\ TimesNewRoman #1 }}%\ newcommand {\ ritem} [1] {\ ParallelRText {\ parindent = 1em {#1 }}\ ParallelPar} % % ----- Minipage command ----- % % % % \ newcommand {\ Minipage} [2] {\ begin {minipage} [t] {#2 \ textwidth }% {{# 1 }}\ end {minipage }%}\ newcommand {\ Minipar} [2] {\ begin {minipage} [t] {#2 \ textwidth} {\ vspace *{. 1ex} #1 \ vspace *{. 5em }}\ end {minipage }}
5. layout size. tex
%\setlength\paperheight{297mm}\setlength\paperwidth{210mm}\usepackage[paperwidth=297mm,paperheight=210mm,margin=0.5in,%left=0.1cm,%right=0.1cm,%top=0.1cm,%bottom=0.2cm]{geometry}
6.00 cover. tex
% Cover \ thispagestyle {empty} \ newcommand \ bookversion {1} \ begin {titlepage} \ setlength {\ parindent} {0pt} \ vspace * {\ stretch {1 }}{\ xeTeX {}% title \ rule [0pt] {\ textwidth} {4pt} \ vspace * {\ stretch {2 }} Virhutai % \ url {region}
7.01 preface. tex
% Preface \ frontmatter % preface used to generate the Rome count \ chapter {Preface -- Book structure }%{\ song cover $ \ rightarrow $ preface $ \ rightarrow $ directory $ \ rightarrow $ books content $ \ rightarrow $ appendix} \ begin {lstlisting} [language = {[LaTeX] TeX}] % the built-in command \ frontmatter % used to generate the Rome count preface % preface content \ mainmatter % generate Arabic count page number % subject content \ appendix % appendix, chapter % appendix content \ end {lstlisting} automatically counted by letter}
8.02 directory. tex
% Directory % \ setcounter {tocdepth} {3} \ tableofcontents
9.03 text. tex
\mainmatter\setcounter{page}{1}%\chapter{chaptername}%....
.