diff options
Diffstat (limited to 'Master/texmf-dist/tex')
3 files changed, 436 insertions, 209 deletions
diff --git a/Master/texmf-dist/tex/latex/elegantbook/elegantbook.cls b/Master/texmf-dist/tex/latex/elegantbook/elegantbook.cls index ae05a7c3a59..0966c3fc120 100644 --- a/Master/texmf-dist/tex/latex/elegantbook/elegantbook.cls +++ b/Master/texmf-dist/tex/latex/elegantbook/elegantbook.cls @@ -1,6 +1,6 @@ %%%%%%%%%%%%%%%%%%%%%% %% start of file `elegantbook.cls'. -%% Copyright 2013-2021 ElegantLaTeX (elegantlatex2e@gmail.com) +%% Copyright 2013-2022 ElegantLaTeX (elegantlatex2e@gmail.com) %% %% This work may be distributed and/or modified freely %% available at https://github.com/ElegantLaTeX/ElegantBook @@ -8,8 +8,10 @@ %%%%%%%%%%%%%%%%%%%%% % % !Mode:: "TeX:UTF-8" \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{elegantbook}[2021/05/02 v4.1 ElegantBook document class] +\ProvidesClass{elegantbook}[2022/04/09 v4.3 ElegantBook document class] + +%%% \RequirePackage{kvoptions} \RequirePackage{etoolbox} \SetupKeyvalOptions{family=ELEGANT, prefix=ELEGANT@, setkeys=\kvsetkeys} @@ -25,6 +27,7 @@ \DeclareStringOption[marginfalse]{marginpar} \DeclareStringOption[onecol]{toc} \DeclareStringOption{scheme} + % ----- backward compatibility \DeclareVoidOption{green}{\ekv{color=green}} \DeclareVoidOption{cyan}{\ekv{color=cyan}} @@ -32,10 +35,10 @@ \DeclareVoidOption{gray}{\ekv{color=gray}} \DeclareVoidOption{black}{\ekv{color=black}} \DeclareVoidOption{nocolor}{\ekv{color=none}} -\DeclareStringOption[ctexfont]{chinesefont} \DeclareVoidOption{chinese}{\ekv{scheme=chinese}} +\DeclareStringOption[ctexfont]{chinesefont} \DeclareVoidOption{ctexfont}{\ekv{chinesefont=ctexfont}} \DeclareVoidOption{founder}{\ekv{chinesefont=founder}} \DeclareVoidOption{nofont}{\ekv{chinesefont=nofont}} @@ -43,6 +46,13 @@ \DeclareVoidOption{en}{\ekv{lang=en}} \DeclareVoidOption{cn}{\ekv{lang=cn}} \DeclareVoidOption{it}{\ekv{lang=it}} +\DeclareVoidOption{fr}{\ekv{lang=fr}} +\DeclareVoidOption{nl}{\ekv{lang=nl}} +\DeclareVoidOption{hu}{\ekv{lang=hu}} +\DeclareVoidOption{de}{\ekv{lang=de}} +\DeclareVoidOption{mn}{\ekv{lang=mn}} +\DeclareVoidOption{pt}{\ekv{lang=pt}} +\DeclareVoidOption{jp}{\ekv{lang=jp}} \DeclareVoidOption{fancy}{\ekv{mode=fancy}} \DeclareVoidOption{simple}{\ekv{mode=simple}} @@ -56,7 +66,6 @@ \DeclareStringOption[numeric-comp]{citestyle} \DeclareStringOption[numeric]{bibstyle} - \DeclareVoidOption{newtx}{\ekv{math=newtx}} \DeclareVoidOption{mtpro2}{\ekv{math=mtpro2}} \DeclareVoidOption{cm}{\ekv{math=cm}} @@ -68,6 +77,14 @@ \DeclareVoidOption{onecol}{\ekv{toc=onecol}} \DeclareVoidOption{twocol}{\ekv{toc=twocol}} +\DeclareStringOption[chapter]{thmcnt} +\DeclareVoidOption{chapter}{\ekv{thmcnt=chapter}} +\DeclareVoidOption{section}{\ekv{thmcnt=section}} + +\DeclareStringOption[biber]{bibend} +\DeclareVoidOption{biber}{\ekv{bibend=biber}} +\DeclareVoidOption{bibtex}{\ekv{bibend=bibtex}} + % ----- Math option ----- \newcommand\mailto[1]{\href{mailto:#1}{\nolinkurl{#1}}} @@ -133,6 +150,7 @@ footskip=4mm }}{\relax} + \RequirePackage{indentfirst,comment} % fontsetting \ifdefstring{\ELEGANT@math}{mtpro2}{ @@ -144,34 +162,53 @@ \renewcommand{\baselinestretch}{1.2} \PassOptionsToPackage{no-math}{fontspec} +\PassOptionsToPackage{quiet}{fontspec} \RequirePackage{iftex} -\ifdefstring{\ELEGANT@lang}{cn}{ - \ifXeTeX - \ifdefstring{\ELEGANT@chinesefont}{founder}{ - \RequirePackage[UTF8,scheme=plain,fontset=none]{ctex} - \setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01} - \setCJKsansfont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZHei-B01} - \setCJKmonofont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZFangSong-Z02} - \setCJKfamilyfont{zhsong}{FZShuSong-Z01} - \setCJKfamilyfont{zhhei}{FZHei-B01} - \setCJKfamilyfont{zhkai}{FZKai-Z03} - \setCJKfamilyfont{zhfs}{FZFangSong-Z02} - \newcommand*{\songti}{\CJKfamily{zhsong}} - \newcommand*{\heiti}{\CJKfamily{zhhei}} - \newcommand*{\kaishu}{\CJKfamily{zhkai}} - \newcommand*{\fangsong}{\CJKfamily{zhfs}}}{\relax} + +\ifXeTeX + \RequirePackage[no-math]{fontspec} + \setmainfont{texgyretermes}[ + UprightFont = *-regular , + BoldFont = *-bold , + ItalicFont = *-italic , + BoldItalicFont = *-bolditalic , + Extension = .otf , + Scale = 1.0] - \ifdefstring{\ELEGANT@chinesefont}{nofont}{ - \RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}}{\relax} - - \ifdefstring{\ELEGANT@chinesefont}{ctexfont}{ - \RequirePackage[UTF8,scheme=plain]{ctex}}{\relax} - \else - \ifdefstring{\ELEGANT@chinesefont}{ctexfont}{ - \RequirePackage[UTF8,scheme=plain]{ctex}}{\relax} - \fi + \setsansfont{texgyreheros}[ + UprightFont = *-regular , + BoldFont = *-bold , + ItalicFont = *-italic , + BoldItalicFont = *-bolditalic , + Extension = .otf , + Scale = 0.9] +\else + \RequirePackage{newtxtext} + \RequirePackage[scaled=.90]{helvet} +\fi + +\ifdefstring{\ELEGANT@lang}{cn}{ + \ifdefstring{\ELEGANT@chinesefont}{founder}{ + \RequirePackage[UTF8,scheme=plain,fontset=none]{ctex} + \setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01} + \setCJKsansfont[BoldFont={FZHei-B01}]{FZKai-Z03} + \setCJKmonofont[BoldFont={FZHei-B01}]{FZFangSong-Z02} + \setCJKfamilyfont{zhsong}{FZShuSong-Z01} + \setCJKfamilyfont{zhhei}{FZHei-B01} + \setCJKfamilyfont{zhkai}[BoldFont={FZHei-B01}]{FZKai-Z03} + \setCJKfamilyfont{zhfs}[BoldFont={FZHei-B01}]{FZFangSong-Z02} + \newcommand*{\songti}{\CJKfamily{zhsong}} + \newcommand*{\heiti}{\CJKfamily{zhhei}} + \newcommand*{\kaishu}{\CJKfamily{zhkai}} + \newcommand*{\fangsong}{\CJKfamily{zhfs}}}{\relax} + + \ifdefstring{\ELEGANT@chinesefont}{nofont}{ + \RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}}{\relax} + + \ifdefstring{\ELEGANT@chinesefont}{ctexfont}{ + \RequirePackage[UTF8,scheme=plain]{ctex}}{\relax} + \AfterEndPreamble{ - % \renewcommand{\itshape}{\kaishu} \setlength\parindent{2\ccwd}} }{\relax} @@ -199,7 +236,6 @@ \newcommand{\cfs}{\normalfont} \fi -\RequirePackage{newtxtext} \RequirePackage{anyfontsize} \ifdefstring{\ELEGANT@math}{newtx}{ \RequirePackage{newtxmath} @@ -220,6 +256,7 @@ \DeclareMathSymbol{\prodop}{\mathop}{CMlargesymbols}{"51} }{\relax} + % ----- Handle Colors ----- %% 章节以及页脚图形 @@ -340,16 +377,17 @@ \RequirePackage{makecell,lipsum,hologo} %%中文结构名字 -\RequirePackage[ - backend=biber, - citestyle=\ELEGANT@citestyle, - bibstyle=\ELEGANT@bibstyle]{biblatex} - - %% 章节设置 +\RequirePackage[center,pagestyles]{titlesec} +\RequirePackage[title,titletoc,header]{appendix} -\RequirePackage{appendix} + +\RequirePackage[ + backend=\ELEGANT@bibend, + citestyle=\ELEGANT@citestyle, + bibstyle=\ELEGANT@bibstyle]{biblatex} +\defbibheading{elegantbook}[\ebibname]{#1} \ifdefstring{\ELEGANT@lang}{cn}{ \renewcommand{\baselinestretch}{1.3} @@ -361,13 +399,12 @@ \renewcommand{\listfigurename}{插图目录} \renewcommand{\listtablename}{表格目录} \renewcommand{\bibname}{参考文献} + \newcommand{\ebibname}{参考文献} \renewcommand{\appendixname}{附录} + \renewcommand{\appendixtocname}{附录} \renewcommand{\indexname}{索\hspace{2em}引} \newcommand\figref[1]{\textbf{图}~\ref{#1}} \newcommand\tabref[1]{\textbf{表}~\ref{#1}} - \ifdefstring{\ELEGANT@scheme}{chinese}{ - \renewcommand{\chaptername}{第\zhnumber{\arabic{chapter}}章}}{ - \renewcommand{\chaptername}{第 \thechapter{} 章}} \newcommand{\authorname}{\citshape 作者:} \newcommand{\institutename}{\citshape 组织:} \newcommand{\datename}{\citshape 时间:} @@ -394,12 +431,16 @@ \newcommand\bioinfo[2]{\gdef\@bioinfo{{\citshape #1}:#2}} \newcommand{\updatename}{更新:} \newcommand{\historyname}{版本更新历史} - }{\relax} + \newcommand{\beforechap}{第} + \newcommand{\afterchap}{章} +}{\relax} + + \ifdefstring{\ELEGANT@lang}{en}{ \setlength\parindent{2em} \newcommand\figref[1]{\textbf{Figure}~\ref{#1}} \newcommand\tabref[1]{\textbf{Table}~\ref{#1}} - \renewcommand{\chaptername}{Chapter \thechapter} + \renewcommand{\chaptername}{Chapter} \renewcommand{\partname}{\color{structurecolor} Part} \newcommand{\authorname}{\textbf{Author: }} \newcommand{\institutename}{\textbf{Institute: }} @@ -424,6 +465,7 @@ \newcommand{\propertyname}{Property} \newcommand{\introductionname}{Introduction} \renewcommand{\appendixname}{Appendix} + \newcommand{\ebibname}{Bibliography} % \newcommand{\problemsetname}{Exercise} \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} \newcommand{\updatename}{Updates:} @@ -437,7 +479,7 @@ \setlength\parindent{2em} \newcommand\figref[1]{\textbf{Figura}~\ref{#1}} \newcommand\tabref[1]{\textbf{Tabella}~\ref{#1}} - \renewcommand{\chaptername}{Chapter \thechapter} + \renewcommand{\chaptername}{Chapter} \newcommand{\authorname}{\textbf{Autore: }} \newcommand{\institutename}{\textbf{Istituto: }} \newcommand{\datename}{\textbf{Data: }} @@ -462,6 +504,7 @@ \newcommand{\introductionname}{Introduzione} \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} \newcommand{\updatename}{Aggiornamenti:} + \newcommand{\ebibname}{Bibliografia} \newcommand{\historyname}{Cronologia delle versioni} }{\relax} @@ -472,7 +515,7 @@ \setlength\parindent{2em} \renewcommand\figref[1]{\textbf{Figure}\ref{#1}} \renewcommand\tabref[1]{\textbf{Tableau}\ref{#1}} - \renewcommand{\chaptername}{Chapitre \thechapter} + \renewcommand{\chaptername}{Chapitre} \renewcommand{\authorname}{\textbf{Auteur: }} \renewcommand{\institutename}{\textbf{Institut: }} \renewcommand{\datename}{\textbf{Date: }} @@ -497,6 +540,7 @@ \renewcommand{\introductionname}{Introduction} \renewcommand{\problemsetname}{Exercice} \renewcommand{\updatename}{Mises à jour:} + \newcommand{\ebibname}{Bibliographie} \renewcommand{\historyname}{Historique des versions} }{\relax} @@ -506,7 +550,7 @@ \setlength\parindent{2em} \newcommand\figref[1]{\textbf{Figuur}~\ref{#1}} \newcommand\tabref[1]{\textbf{Tabel}~\ref{#1}} - \renewcommand{\chaptername}{Hoofdstuk \arabic{chapter}} + \renewcommand{\chaptername}{Hoofdstuk} \newcommand{\authorname}{\textbf{Auteur: }} \newcommand{\institutename}{\textbf{Instituut: }} \newcommand{\datename}{\textbf{Datum: }} @@ -532,6 +576,7 @@ \newcommand{\problemsetname}{Probleemcomplex} \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} \newcommand{\updatename}{Update:} + \newcommand{\ebibname}{Bibliographie} \newcommand{\historyname}{Versie Geschiedenis} }{\relax} @@ -541,7 +586,7 @@ \setlength\parindent{2em} \newcommand\figref[1]{\ref{#1}~\textbf{Ábra}} \newcommand\tabref[1]{\ref{#1}~\textbf{Táblázat}} - \renewcommand{\chaptername}{\thechapter ~ fejezet} + \renewcommand{\chaptername}{Fejezet} \newcommand{\authorname}{\textbf{Szerző: }} \newcommand{\institutename}{\textbf{Intézmény: }} \newcommand{\datename}{\textbf{Dátum: }} @@ -567,6 +612,7 @@ \newcommand{\problemsetname}{Feladatok} \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} \newcommand{\updatename}{Frissítve:} + \newcommand{\ebibname}{Bibliográfia} \newcommand{\historyname}{Korábbi verziók} }{\relax} @@ -580,7 +626,7 @@ \renewcommand{\listtablename}{Tabellenverzeichnis} \renewcommand{\bibname}{Bibliographie} \renewcommand{\appendixname}{Anhang} - \renewcommand{\chaptername}{Kapitel \thechapter} + \renewcommand{\chaptername}{Kapitel} \newcommand{\authorname}{\textbf{Autor: }} \newcommand{\institutename}{\textbf{Institut: }} \newcommand{\datename}{\textbf{Datum: }} @@ -606,6 +652,7 @@ \newcommand{\introductionname}{Einleitung} \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} \newcommand{\updatename}{Updates:} + \renewcommand{\ebibname}{Bibliographie} \newcommand{\historyname}{Version der Geschichte} }{\relax} @@ -614,7 +661,7 @@ \setlength\parindent{2em} \newcommand\figref[1]{\textbf{Figura}~\ref{#1}} \newcommand\tabref[1]{\textbf{Tabla}~\ref{#1}} - \renewcommand{\spanishchaptername}{Capítulo \thechapter} + \renewcommand{\spanishchaptername}{Capítulo} \newcommand{\authorname}{\textbf{Autor: }} \newcommand{\institutename}{\textbf{Instituto: }} \newcommand{\datename}{\textbf{Fecha: }} @@ -640,6 +687,7 @@ \newcommand{\problemsetname}{Ejercicio} \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} \newcommand{\updatename}{Actualización:} + \newcommand{\ebibname}{Bibliografía} \newcommand{\historyname}{Historial de versiones} }{\relax} @@ -650,7 +698,7 @@ \setlength\parindent{2em} \newcommand\figref[1]{\textbf{Зураг}\ref{#1}} \newcommand\tabref[1]{\textbf{Хүснэгт}\ref{#1}} - \renewcommand{\chaptername}{Бүлэг \thechapter} + \renewcommand{\chaptername}{Бүлэг} \newcommand{\authorname}{\textbf{Зохиогч: }} \newcommand{\institutename}{\textbf{Сургууль: }} \newcommand{\datename}{\textbf{Огноо: }} @@ -676,9 +724,89 @@ \newcommand{\problemsetname}{Бодлогууд} \newcommand\bioinfo[2]{\gdef@bioinfo{\textbf{#1}: #2}} \newcommand{\updatename}{Шинэчлэлтүүд:} + \newcommand{\ebibname}{Ном зүй} \newcommand{\historyname}{Хувилбарын түүх} }{\relax} + +\ifdefstring{\ELEGANT@lang}{pt}{ + \RequirePackage[portuguese]{babel} + \setlength\parindent{2em} + \newcommand\figref[1]{\textbf{Figura}~\ref{#1}} + \newcommand\tabref[1]{\textbf{Tabela}~\ref{#1}} + \renewcommand{\chaptername}{Capítulo} + \newcommand{\authorname}{\textbf{Autor: }} + \newcommand{\institutename}{\textbf{Instituição: }} + \newcommand{\datename}{\textbf{Data: }} + \newcommand{\versionname}{\textbf{Versão: }} + \newcommand{\notename}{Observação} + \newcommand{\proofname}{Demostração} + \newcommand{\problemname}{Problema} + \newcommand{\definitionname}{Definição} + \newcommand{\theoremname}{Teorema} + \newcommand{\axiomname}{Axioma} + \newcommand{\postulatename}{Postulado} + \newcommand{\lemmaname}{Lema} + \newcommand{\propositionname}{Proposição} + \newcommand{\corollaryname}{Corolário} + \newcommand{\examplename}{Exemplo} + \newcommand{\exercisename}{Exercício} + \newcommand{\remarkname}{Comentário} + \newcommand{\assumptionname}{Assunto} + \newcommand{\conclusionname}{Conclusão} + \newcommand{\solutionname}{Soluções} + \newcommand{\propertyname}{Propiedade} + \newcommand{\introductionname}{Introdução} + \newcommand{\problemsetname}{Questão} + \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} + \newcommand{\updatename}{Atualização: } + \newcommand{\ebibname}{Bibliografia} + \newcommand{\historyname}{Histórico de versões} +}{\relax} + + +\ifdefstring{\ELEGANT@lang}{jp}{ + \RequirePackage{luatexja} + \setlength\parindent{2em} + \renewcommand{\contentsname}{目次} + \newcommand\figref[1]{\textbf{図}~\ref{#1}} + \newcommand\tabref[1]{\textbf{表}~\ref{#1}} + \renewcommand{\partname}{\color{structurecolor}} + \renewcommand{\listfigurename}{イラストカタログ} + \renewcommand{\listtablename}{表カタログ} + \renewcommand{\bibname}{参考文献} + \renewcommand{\appendixname}{付録} + \renewcommand{\chaptername}{第 \thechapter 章} + \newcommand{\authorname}{\textbf{著者:}} + \newcommand{\institutename}{\textbf{組織団体:}} + \newcommand{\datename}{\textbf{日付:}} + \newcommand{\versionname}{\textbf{\citshape バージョン:}} + \newcommand{\notename}{ノート} + \newcommand{\proofname}{証明} + \newcommand{\problemname}{問題} + \newcommand{\definitionname}{定義} + \newcommand{\theoremname}{定理} + \newcommand{\axiomname}{公理} + \newcommand{\postulatename}{公準} + \newcommand{\lemmaname}{補題} + \newcommand{\propositionname}{命題} + \newcommand{\corollaryname}{系} + \newcommand{\examplename}{例題} + \newcommand{\instancename}{例} + \newcommand{\exercisename}{練習} + \newcommand{\remarkname}{注} + \newcommand{\assumptionname}{仮設} + \newcommand{\conclusionname}{結論} + \newcommand{\solutionname}{解答} + \newcommand{\propertyname}{性質} + \newcommand{\introductionname}{内容概要} + \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} + \newcommand{\updatename}{更新:} + \newcommand{\ebibname}{参考文献} + \newcommand{\historyname}{バージョン更新履歴} +}{\relax} + + \graphicspath{{./figure/}{./figures/}{./image/}{./images/}{./graphics/}{./graphic/}{./pictures/}{./picture/}} \RequirePackage{tikz} %% load tikz without tikz @@ -698,12 +826,19 @@ \setlist[itemize,2]{label={\eitemii}} \setlist[itemize,3]{label={\eitemiii}} - -\RequirePackage[center,pagestyles]{titlesec} \RequirePackage{apptools} + +% appendix chapter: + +\ifdefstring{\ELEGANT@lang}{cn}{ + \ifdefstring{\ELEGANT@scheme}{chinese}{ + \newcommand{\xchaptertitle}{第\zhnumber{\arabic{chapter}}章} }{ + \newcommand{\xchaptertitle}{第 \thechapter{} 章}} }{ + \newcommand{\xchaptertitle}{\chaptername~\thechapter~}} + \setcounter{secnumdepth}{5} \titleformat{\chapter}[\style]{\bfseries}{ - \filcenter\LARGE\enspace\bfseries{\color{structurecolor} \IfAppendix{\appendixname\;\thechapter}{\chaptername}\;}}{1pt}{ + \filcenter\LARGE\enspace\bfseries{\color{structurecolor} \IfAppendix{\appendixname\;\thechapter\;}{\xchaptertitle\;}}}{1pt}{ \LARGE\bfseries\color{structurecolor}\filcenter}[] \titleformat{\section}[hang]{\bfseries}{ \Large\bfseries{\color{structurecolor}\thesection}\enspace}{1pt}{% @@ -720,7 +855,6 @@ - %%define the note and proof environment \RequirePackage{pifont,manfnt,bbding} \RequirePackage[many]{tcolorbox} @@ -774,37 +908,37 @@ \node[anchor=south east, outer sep=0pt] at (\linewidth-width,0) { \textcolor{third}{$\spadesuit$}};}},} % \newtcbtheorem[auto counter,number within=chapter]{definition}{\definitionname}{defstyle}{def} - \DeclareTColorBox[auto counter,number within=chapter]{definition}{ o t\label g }{ + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{definition}{ o t\label g }{ common,defstyle, IfValueTF={#1}{title={\definitionname~\thetcbcounter\ (#1)}}{title=\definitionname~\thetcbcounter}, IfBooleanTF={#2}{label=#3}{}} % \newtcbtheorem[auto counter,number within=chapter]{theorem}{\theoremname}{thmstyle}{thm} - \DeclareTColorBox[auto counter,number within=chapter]{theorem}{ o t\label g }{ + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{theorem}{ o t\label g }{ common,thmstyle, IfValueTF={#1}{title={\theoremname~\thetcbcounter\ (#1)}}{title=\theoremname~\thetcbcounter}, IfBooleanTF={#2}{label=#3}{}} % \newtcbtheorem[auto counter,number within=chapter]{postulate}{\postulatename}{thmstyle}{pos} - \DeclareTColorBox[auto counter,number within=chapter]{postulate}{ o t\label g }{ + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{postulate}{ o t\label g }{ common,thmstyle, IfValueTF={#1}{title={\postulatename~\thetcbcounter\ (#1)}}{title=\postulatename~\thetcbcounter}, IfBooleanTF={#2}{label=#3}{}} % \newtcbtheorem[auto counter,number within=chapter]{axiom}{\axiomname}{thmstyle}{axi} - \DeclareTColorBox[auto counter,number within=chapter]{axiom}{ o t\label g }{ + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{axiom}{ o t\label g }{ common,thmstyle, IfValueTF={#1}{title={\axiomname~\thetcbcounter\ (#1)}}{title=\axiomname~\thetcbcounter}, IfBooleanTF={#2}{label=#3}{}} % \newtcbtheorem[auto counter,number within=chapter]{corollary}{\corollaryname}{thmstyle}{cor} - \DeclareTColorBox[auto counter,number within=chapter]{corollary}{ o t\label g }{ + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{corollary}{ o t\label g }{ common,thmstyle, IfValueTF={#1}{title={\corollaryname~\thetcbcounter\ (#1)}}{title=\corollaryname~\thetcbcounter}, IfBooleanTF={#2}{label=#3}{}} % \newtcbtheorem[auto counter,number within=chapter]{lemma}{\lemmaname}{thmstyle}{lem} - \DeclareTColorBox[auto counter,number within=chapter]{lemma}{ o t\label g }{ + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{lemma}{ o t\label g }{ common,thmstyle, IfValueTF={#1}{title={\lemmaname~\thetcbcounter\ (#1)}}{title=\lemmaname~\thetcbcounter}, IfBooleanTF={#2}{label=#3}{}} % \newtcbtheorem[auto counter,number within=chapter]{proposition}{\propositionname}{propstyle}{pro} - \DeclareTColorBox[auto counter,number within=chapter]{proposition}{ o t\label g }{ + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{proposition}{ o t\label g }{ common,propstyle, IfValueTF={#1}{title={\propositionname~\thetcbcounter\ (#1)}}{title=\propositionname~\thetcbcounter}, IfBooleanTF={#2}{label=#3}{}}}{\relax} @@ -827,17 +961,17 @@ \theoremstyle{defstyle} % definition style - \newtheorem{definition}{\definitionname}[chapter] + \newtheorem{definition}{\definitionname}[\ELEGANT@thmcnt] \theoremstyle{thmstyle} %theorem style - \newtheorem{theorem}{\theoremname}[chapter] - \newtheorem{lemma}{\lemmaname}[chapter] - \newtheorem{corollary}{\corollaryname}[chapter] - \newtheorem{postulate}{\postulatename}[chapter] - \newtheorem{axiom}{\axiomname}[chapter] + \newtheorem{theorem}{\theoremname}[\ELEGANT@thmcnt] + \newtheorem{lemma}{\lemmaname}[\ELEGANT@thmcnt] + \newtheorem{corollary}{\corollaryname}[\ELEGANT@thmcnt] + \newtheorem{postulate}{\postulatename}[\ELEGANT@thmcnt] + \newtheorem{axiom}{\axiomname}[\ELEGANT@thmcnt] \theoremstyle{prostyle} % proposition style - \newtheorem{proposition}{\propositionname}[chapter] + \newtheorem{proposition}{\propositionname}[\ELEGANT@thmcnt] }{\relax} % main(green-def): example exercise problem solution @@ -921,9 +1055,10 @@ \RequirePackage{adforn} -\newenvironment{problemset}[1][\chaptername~\;\exercisename]{ +\newenvironment{problemset}[1][\xchaptertitle~\exercisename]{ + \vspace*{10pt} \begin{center} - \phantomsection\addcontentsline{toc}{section}{\texorpdfstring{\chaptername\;\exercisename}{\exercisename}} + \phantomsection\addcontentsline{toc}{section}{\texorpdfstring{\xchaptertitle~\exercisename}{\exercisename}} % \markboth{#1}{\rightmark} \markright{#1} \textcolor{structurecolor}{\Large\bfseries\adftripleflourishleft~#1~\adftripleflourishright} @@ -948,7 +1083,7 @@ \fancyhf{} -\fancyfoot[c]{\color{structurecolor}\scriptsize\thepage} +\fancyfoot[c]{\color{structurecolor}\small\thepage} \if@twoside \fancyhead[EL]{\color{structurecolor}\cnormal\leftmark} \fancyhead[OR]{\color{structurecolor}\cnormal\rightmark} @@ -962,8 +1097,7 @@ % \renewcommand{\headrule}{} \fancypagestyle{plain}{\renewcommand{\headrulewidth}{0pt}\fancyhf{}\renewcommand{\headrule}{}} \renewcommand{\sectionmark}[1]{\markright{\thesection\, #1}{}} -\renewcommand{\chaptermark}[1]{\markboth{\chaptername\, #1}{}} - +\renewcommand{\chaptermark}[1]{\markboth{\xchaptertitle\, #1}{}} \renewcommand*{\maketitle}{% @@ -1058,7 +1192,7 @@ breaklines=true, keywordstyle=\color{winered}, commentstyle=\color{gray}, - emph={elegantpaper,fontenc,fontspec,xeCJK,citestyle,FiraMono,xunicode,newtxmath,figure,fig,image,img,table,itemize,enumerate,newtxtext,newtxtt,ctex,microtype,description,times,booktabs,tabular,PDFLaTeX,XeLaTeX,type1cm,BibTeX,device,color,mode,lang,amsthm,tcolorbox,titlestyle,cite,ctex,listings,base,math,scheme,toc,esint,chinesefont,amsmath,bibstyle,natbib,pgfornament}, + emph={elegantpaper,fontenc,fontspec,xeCJK,citestyle,FiraMono,xunicode,figure,fig,image,img,table,itemize,enumerate,ctex,microtype,description,times,booktabs,tabular,PDFLaTeX,XeLaTeX,type1cm,BibTeX,device,color,mode,lang,amsthm,tcolorbox,titlestyle,cite,ctex,listings,base,math,scheme,toc,esint,chinesefont,amsmath,bibstyle,natbib,pgfornament}, emphstyle={\color{frenchplum}}, morekeywords={DeclareSymbolFont,SetSymbolFont,toprule,midrule,bottomrule,institute,version,includegraphics,setmainfont,setsansfont,setmonofont ,setCJKmainfont,setCJKsansfont,setCJKmonofont,RequirePackage,figref,tabref,email,maketitle,keywords,definecolor,extrainfo,logo,cover,subtitle,appendix,chapter,hypersetup,mainmatter,frontmatter,tableofcontents,elegantpar,heiti,kaishu,lstset,pagecolor,zhnumber,marginpar,part,equote,marginnote,bioinfo,datechange,listofchange,lvert,lastpage,songti,heiti,fangsong,setCJKfamilyfont,textbf}, frame=single, @@ -1125,3 +1259,33 @@ \thispagestyle{empty}% \newpage% \if@twocolumn\hbox{}\newpage\fi\fi\fi} + + +% https://tex.stackexchange.com/questions/56839/chaptername-is-used-even-for-appendix-chapters-in-toc +\usepackage{calc} +\usepackage[titles]{tocloft} +\ifdefstring{\ELEGANT@lang}{cn}{ + \renewcommand{\cftchappresnum}{\beforechap\space} + \renewcommand{\cftchapaftersnum}{\space\afterchap} + \setlength{\cftchapnumwidth}{\widthof{\textbf{附录~999}}} + \g@addto@macro\appendix{% + \addtocontents{toc}{% + \protect\renewcommand{\protect\cftchappresnum}{\appendixname\space}% + \protect\renewcommand{\protect\cftchapaftersnum}{}% + }% + } +}{ + \renewcommand{\cftchappresnum}{\chaptername\space} + \renewcommand{\cftchapaftersnum}{\space} + \setlength{\cftchapnumwidth}{\widthof{\textbf{Appendix~9}}} + \g@addto@macro\appendix{% + \addtocontents{toc}{% + \protect\renewcommand{\protect\cftchappresnum}{\appendixname\space}% + \protect\renewcommand{\protect\cftchapaftersnum}{}% + \setlength{\cftchapnumwidth}{\widthof{\textbf{Appendix~999}}} + }% + } +} + +% restore the tt default family to lmodern tt family +\renewcommand\ttdefault{lmtt}
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/elegantnote/elegantnote.cls b/Master/texmf-dist/tex/latex/elegantnote/elegantnote.cls index fac84ea40d9..872e4ff188d 100644 --- a/Master/texmf-dist/tex/latex/elegantnote/elegantnote.cls +++ b/Master/texmf-dist/tex/latex/elegantnote/elegantnote.cls @@ -4,9 +4,10 @@ % Lastest Version: https://github.com/ElegantLaTeX/ElegantNote % --- Class structure: identification part -\ProvidesClass{elegantnote}[2020/04/12 ElegantNote v2.30 class] +\ProvidesClass{elegantnote}[2022/04/09 ElegantNote v2.40 class] \NeedsTeXFormat{LaTeX2e} + \RequirePackage{kvoptions} \RequirePackage{etoolbox} \RequirePackage{calc} @@ -20,6 +21,7 @@ \DeclareVoidOption{blue}{\ekv{color=blue}} \DeclareVoidOption{sakura}{\ekv{color=sakura}} \DeclareVoidOption{black}{\ekv{color=black}} +\DeclareVoidOption{brown}{\ekv{color=brown}} \DeclareStringOption[pad]{device} \DeclareVoidOption{pc}{\ekv{device=pc}} @@ -35,18 +37,20 @@ \DeclareStringOption{mode} \DeclareVoidOption{geye}{\ekv{mode=geye}} \DeclareVoidOption{hazy}{\ekv{mode=hazy}} +\DeclareVoidOption{sepia}{\ekv{mode=sepia}} \DeclareStringOption[ctexfont]{chinesefont} \DeclareVoidOption{ctexfont}{\ekv{chinesefont=ctexfont}} \DeclareVoidOption{founder}{\ekv{chinesefont=founder}} \DeclareVoidOption{nofont}{\ekv{chinesefont=nofont}} -\DeclareStringOption[numbers]{cite} -\DeclareVoidOption{numbers}{\ekv{cite=numbers}} -\DeclareVoidOption{authoryear}{\ekv{cite=authoryear}} -\DeclareVoidOption{super}{\ekv{cite=super}} +\DeclareStringOption[numeric-comp]{citestyle} +\DeclareStringOption[numeric]{bibstyle} + +\DeclareStringOption[biber]{bibend} +\DeclareVoidOption{biber}{\ekv{bibend=biber}} +\DeclareVoidOption{bibtex}{\ekv{bibend=bibtex}} -\DeclareStringOption[apalike]{bibstyle} \DeclareStringOption[11pt]{fontsize} \DeclareVoidOption{10pt}{\ekv{fontsize=10pt}} @@ -66,41 +70,60 @@ \LoadClass{article} \PassOptionsToPackage{no-math}{fontspec} +\PassOptionsToPackage{quiet}{fontspec} \RequirePackage{amsmath,amsthm} \RequirePackage{iftex} -\ifdefstring{\ELEGANT@lang}{cn}{% \ifXeTeX - \ifdefstring{\ELEGANT@chinesefont}{founder}{ - \RequirePackage[UTF8,scheme=plain,fontset=none]{ctex} - \setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01} - \setCJKsansfont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZHei-B01} - \setCJKmonofont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZFangSong-Z02} - \setCJKfamilyfont{zhsong}{FZShuSong-Z01} - \setCJKfamilyfont{zhhei}{FZHei-B01} - \setCJKfamilyfont{zhkai}{FZKai-Z03} - \setCJKfamilyfont{zhfs}{FZFangSong-Z02} - \newcommand*{\songti}{\CJKfamily{zhsong}} - \newcommand*{\heiti}{\CJKfamily{zhhei}} - \newcommand*{\kaishu}{\CJKfamily{zhkai}} - \newcommand*{\fangsong}{\CJKfamily{zhfs}}}{\relax} + \RequirePackage[no-math]{fontspec} + \setmainfont{texgyretermes}[ + UprightFont = *-regular , + BoldFont = *-bold , + ItalicFont = *-italic , + BoldItalicFont = *-bolditalic , + Extension = .otf , + Scale = 1.0] - \ifdefstring{\ELEGANT@chinesefont}{nofont}{ - \RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}}{\relax} - - \ifdefstring{\ELEGANT@chinesefont}{ctexfont}{ - \RequirePackage[UTF8,scheme=plain]{ctex}}{\relax} - \else - \ifdefstring{\ELEGANT@chinesefont}{ctexfont}{ - \RequirePackage[UTF8,scheme=plain]{ctex}}{\relax} - \fi - \AfterEndPreamble{ - % \renewcommand{\itshape}{\kaishu} - \setlength\parindent{2\ccwd}} - }{\relax} + \setsansfont{texgyreheros}[ + UprightFont = *-regular , + BoldFont = *-bold , + ItalicFont = *-italic , + BoldItalicFont = *-bolditalic , + Extension = .otf , + Scale = 0.9] +\else + \RequirePackage{newtxtext} + \RequirePackage[scaled=.90]{helvet} +\fi + +\ifdefstring{\ELEGANT@lang}{cn}{ + \ifdefstring{\ELEGANT@chinesefont}{founder}{ + \RequirePackage[UTF8,scheme=plain,fontset=none]{ctex} + \setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01} + \setCJKsansfont[BoldFont={FZHei-B01}]{FZKai-Z03} + \setCJKmonofont[BoldFont={FZHei-B01}]{FZFangSong-Z02} + \setCJKfamilyfont{zhsong}{FZShuSong-Z01} + \setCJKfamilyfont{zhhei}{FZHei-B01} + \setCJKfamilyfont{zhkai}[BoldFont={FZHei-B01}]{FZKai-Z03} + \setCJKfamilyfont{zhfs}[BoldFont={FZHei-B01}]{FZFangSong-Z02} + \newcommand*{\songti}{\CJKfamily{zhsong}} + \newcommand*{\heiti}{\CJKfamily{zhhei}} + \newcommand*{\kaishu}{\CJKfamily{zhkai}} + \newcommand*{\fangsong}{\CJKfamily{zhfs}}}{\relax} + + \ifdefstring{\ELEGANT@chinesefont}{nofont}{ + \RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}}{\relax} + + \ifdefstring{\ELEGANT@chinesefont}{ctexfont}{ + \RequirePackage[UTF8,scheme=plain]{ctex}}{\relax} + + \AfterEndPreamble{ + \setlength\parindent{2\ccwd}} +}{\relax} + \ifcsname kaishu\endcsname \newcommand{\citshape}{\kaishu} \else @@ -118,7 +141,6 @@ \fi -\RequirePackage{newtxtext} \ifdefstring{\ELEGANT@math}{newtx}{ \RequirePackage{newtxmath} \let\Bbbk\relax @@ -139,6 +161,61 @@ }{\relax} +\RequirePackage[ + backend=\ELEGANT@bibend, + citestyle=\ELEGANT@citestyle, + bibstyle=\ELEGANT@bibstyle]{biblatex} +\defbibheading{elegantbook}[\ebibname]{#1} + +\RequirePackage{appendix} + +\ifdefstring{\ELEGANT@lang}{cn}{% + \theoremstyle{plain}% default + \newtheorem{theorem}{定理}[section] % + \newtheorem{lemma}[theorem]{引理} % + \newtheorem{proposition}[theorem]{命题} % + \newtheorem*{corollary}{推论} % + \theoremstyle{definition} % + \newtheorem{definition}{定义}[section] % + \newtheorem{conjecture}{猜想}[section] % + \newtheorem{example}{例}[section] % + \theoremstyle{remark} % + \newtheorem*{remark}{\normalfont\bfseries 评论} % + \newtheorem*{note}{\normalfont\bfseries 注} % + \newtheorem{case}{\normalfont\bfseries 案例} % + \renewcommand*{\proofname}{\normalfont\bfseries\color{ecolor}证明} % + \renewcommand\contentsname{\color{ecolor}目录} + \renewcommand\refname{\color{ecolor}参考文献} % + \renewcommand\figurename{图} % + \renewcommand\tablename{表} + \newcommand\versiontext{版本:}% + \newcommand\updatetext{更新:}% + \newcommand\ebibname{参考文献} + \setlength{\parindent}{2em} + \newcommand{\keywords}[1]{% + \vskip2ex\par\noindent\normalfont{\bfseries 关键词: } #1} + }{\relax} + +\ifdefstring{\ELEGANT@lang}{en}{ + \theoremstyle{plain}% default + \newtheorem{theorem}{Theorem}[section] % + \newtheorem{lemma}[theorem]{Lemma} % + \newtheorem{proposition}[theorem]{Proposition} % + \newtheorem*{corollary}{Corollary} % + \theoremstyle{definition} % + \newtheorem{definition}{Definition}[section] % + \newtheorem{conjecture}{Conjecture}[section] % + \newtheorem{example}{Example}[section] % + \theoremstyle{remark} % + \newtheorem*{remark}{Remark} % + \newtheorem*{note}{Note} % + \newcommand\ebibname{Bibliography} + \newtheorem{case}{Case} + \renewcommand*{\proofname}{% + \normalfont\bfseries\color{ecolor} Proof} + \newcommand\versiontext{Version: }% + \newcommand\updatetext{Update: }}{\relax} + \RequirePackage{indentfirst} \RequirePackage{anyfontsize} @@ -180,6 +257,10 @@ \definecolor{geyecolor}{RGB}{251,250,248}% \pagecolor{geyecolor} }{\relax} +\ifdefstring{\ELEGANT@mode}{sepia}{ + \definecolor{geyecolor}{RGB}{250,237,225}% + \pagecolor{geyecolor} +}{\relax} % graphics path @@ -242,11 +323,15 @@ \ifdefstring{\ELEGANT@color}{black}{ \definecolor{ecolor}{RGB}{0,0,0}% }{\relax} +\ifdefstring{\ELEGANT@color}{brown}{ + \definecolor{ecolor}{RGB}{109,62,18}% +}{\relax} \definecolor{egreen}{RGB}{0,120,2} \definecolor{ecyan}{RGB}{0,175,152} \definecolor{eblue}{RGB}{20,50,104} \definecolor{sakura}{RGB}{255,183,197} +\definecolor{brown}{RGB}{109,62,18} %% device settings %% default=pad @@ -312,61 +397,7 @@ \pagestyle{fancy-note} -\ifdefstring{\ELEGANT@lang}{cn}{% - \theoremstyle{plain}% default - \newtheorem{theorem}{定理}[section] % - \newtheorem{lemma}[theorem]{引理} % - \newtheorem{proposition}[theorem]{命题} % - \newtheorem*{corollary}{推论} % - \theoremstyle{definition} % - \newtheorem{definition}{定义}[section] % - \newtheorem{conjecture}{猜想}[section] % - \newtheorem{example}{例}[section] % - \theoremstyle{remark} % - \newtheorem*{remark}{\normalfont\bfseries 评论} % - \newtheorem*{note}{\normalfont\bfseries 注} % - \newtheorem{case}{\normalfont\bfseries 案例} % - \renewcommand*{\proofname}{\normalfont\bfseries\color{ecolor}证明} % - \renewcommand\contentsname{\color{ecolor}目录} - \renewcommand\refname{\color{ecolor}参考文献} % - \renewcommand\figurename{图} % - \renewcommand\tablename{表} - \newcommand\versiontext{版本:}% - \newcommand\updatetext{更新:}% - \setlength{\parindent}{2em} - \newcommand{\keywords}[1]{% - \vskip2ex\par\noindent\normalfont{\bfseries 关键词: } #1} - \RequirePackage{gbt7714} - \ifdefstring{\ELEGANT@cite}{authoryear}{ - \bibliographystyle{gbt7714-author-year}}{ - \bibliographystyle{gbt7714-numerical}} - \ifdefstring{\ELEGANT@cite}{numbers}{ - \citestyle{numbers}}{\relax} - }{\relax} - -\ifdefstring{\ELEGANT@lang}{en}{ - \theoremstyle{plain}% default - \newtheorem{theorem}{Theorem}[section] % - \newtheorem{lemma}[theorem]{Lemma} % - \newtheorem{proposition}[theorem]{Proposition} % - \newtheorem*{corollary}{Corollary} % - \theoremstyle{definition} % - \newtheorem{definition}{Definition}[section] % - \newtheorem{conjecture}{Conjecture}[section] % - \newtheorem{example}{Example}[section] % - \theoremstyle{remark} % - \newtheorem*{remark}{Remark} % - \newtheorem*{note}{Note} % - \newtheorem{case}{Case} - \renewcommand*{\proofname}{% - \normalfont\bfseries\color{ecolor} Proof} - \newcommand\versiontext{Version: }% - \newcommand\updatetext{Update: }% - \RequirePackage[\ELEGANT@cite,sort&compress]{natbib} - \bibliographystyle{\ELEGANT@bibstyle}}{% - \relax} -\setlength{\bibsep}{0.0pt} \def\bibfont{\footnotesize} \def\IfEmpty#1{% @@ -426,8 +457,10 @@ \large \lineskip .5em% \begin{tabular}[t]{c}% - \@author\\ - \the\institute + \@author + \end{tabular}\\ + \begin{tabular}[t]{c}% + \the\institute \end{tabular}\par}% \IfEmpty\version @@ -548,3 +581,8 @@ keywords}, frame=none, tabsize=2} + +\addbibresource[location=local]{reference.bib} + +% restore the tt default family to lmodern tt family +\renewcommand\ttdefault{lmtt} diff --git a/Master/texmf-dist/tex/latex/elegantpaper/elegantpaper.cls b/Master/texmf-dist/tex/latex/elegantpaper/elegantpaper.cls index 51ad2b046fb..4b4a2a34d9f 100644 --- a/Master/texmf-dist/tex/latex/elegantpaper/elegantpaper.cls +++ b/Master/texmf-dist/tex/latex/elegantpaper/elegantpaper.cls @@ -4,9 +4,10 @@ % Lastest Version: https://github.com/ElegantLaTeX/ElegantPaper % --- Class structure: identification part -\ProvidesClass{elegantpaper}[2020/04/12 v0.09 ElegantLaTeX Paper class] +\ProvidesClass{elegantpaper}[2022/04/09 v0.10 ElegantLaTeX Paper class] \NeedsTeXFormat{LaTeX2e} +%%% \RequirePackage{kvoptions} \RequirePackage{etoolbox} \RequirePackage{calc} @@ -20,12 +21,13 @@ \DeclareStringOption[cm]{math} -\DeclareStringOption[numbers]{cite} -\DeclareVoidOption{numbers}{\ekv{cite=numbers}} -\DeclareVoidOption{authoryear}{\ekv{cite=authoryear}} -\DeclareVoidOption{super}{\ekv{cite=super}} +\DeclareStringOption[numeric-comp]{citestyle} +\DeclareStringOption[numeric]{bibstyle} + +\DeclareStringOption[biber]{bibend} +\DeclareVoidOption{biber}{\ekv{bibend=biber}} +\DeclareVoidOption{bibtex}{\ekv{bibend=bibtex}} -\DeclareStringOption[apalike]{bibstyle} \DeclareStringOption[ctexfont]{chinesefont} \DeclareVoidOption{ctexfont}{\ekv{chinesefont=ctexfont}} @@ -78,7 +80,7 @@ \graphicspath{{image/}{figure/}{fig/}{img/}} % caption settings -\RequirePackage[font=small,labelfont={bf}]{caption} +\RequirePackage[labelfont={bf}]{caption} \captionsetup[table]{skip=3pt} \captionsetup[figure]{skip=3pt} @@ -101,35 +103,58 @@ % font settings + \PassOptionsToPackage{no-math}{fontspec} -\ifdefstring{\ELEGANT@lang}{cn}{ - \ifXeTeX - \ifdefstring{\ELEGANT@chinesefont}{founder}{ - \RequirePackage[UTF8,scheme=plain,fontset=none]{ctex} - \setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01} - \setCJKsansfont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZHei-B01} - \setCJKmonofont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZFangSong-Z02} - \setCJKfamilyfont{zhsong}{FZShuSong-Z01} - \setCJKfamilyfont{zhhei}{FZHei-B01} - \setCJKfamilyfont{zhkai}{FZKai-Z03} - \setCJKfamilyfont{zhfs}{FZFangSong-Z02} - \newcommand*{\songti}{\CJKfamily{zhsong}} - \newcommand*{\heiti}{\CJKfamily{zhhei}} - \newcommand*{\kaishu}{\CJKfamily{zhkai}} - \newcommand*{\fangsong}{\CJKfamily{zhfs}}}{\relax} +\PassOptionsToPackage{quiet}{fontspec} +\RequirePackage{iftex} + +\ifXeTeX + \RequirePackage[no-math]{fontspec} + \setmainfont{texgyretermes}[ + UprightFont = *-regular , + BoldFont = *-bold , + ItalicFont = *-italic , + BoldItalicFont = *-bolditalic , + Extension = .otf , + Scale = 1.0] - \ifdefstring{\ELEGANT@chinesefont}{nofont}{ - \RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}}{\relax} - - \ifdefstring{\ELEGANT@chinesefont}{ctexfont}{ - \RequirePackage[UTF8,scheme=plain]{ctex}}{\relax} - \else - \ifdefstring{\ELEGANT@chinesefont}{ctexfont}{ - \RequirePackage[UTF8,scheme=plain]{ctex}}{\relax} - \fi + \setsansfont{texgyreheros}[ + UprightFont = *-regular , + BoldFont = *-bold , + ItalicFont = *-italic , + BoldItalicFont = *-bolditalic , + Extension = .otf , + Scale = 0.9] +\else + \RequirePackage{newtxtext} + \RequirePackage[scaled=.90]{helvet} +\fi + +\ifdefstring{\ELEGANT@lang}{cn}{ + \ifdefstring{\ELEGANT@chinesefont}{founder}{ + \RequirePackage[UTF8,scheme=plain,fontset=none]{ctex} + \setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01} + \setCJKsansfont[BoldFont={FZHei-B01}]{FZKai-Z03} + \setCJKmonofont[BoldFont={FZHei-B01}]{FZFangSong-Z02} + \setCJKfamilyfont{zhsong}{FZShuSong-Z01} + \setCJKfamilyfont{zhhei}{FZHei-B01} + \setCJKfamilyfont{zhkai}[BoldFont={FZHei-B01}]{FZKai-Z03} + \setCJKfamilyfont{zhfs}[BoldFont={FZHei-B01}]{FZFangSong-Z02} + \newcommand*{\songti}{\CJKfamily{zhsong}} + \newcommand*{\heiti}{\CJKfamily{zhhei}} + \newcommand*{\kaishu}{\CJKfamily{zhkai}} + \newcommand*{\fangsong}{\CJKfamily{zhfs}}}{\relax} + + \ifdefstring{\ELEGANT@chinesefont}{nofont}{ + \RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}}{\relax} + + \ifdefstring{\ELEGANT@chinesefont}{ctexfont}{ + \RequirePackage[UTF8,scheme=plain]{ctex}}{\relax} + \AfterEndPreamble{ - % \renewcommand{\itshape}{\kaishu} - \setlength\parindent{2\ccwd}}}{\relax} + \setlength\parindent{2\ccwd}} +}{\relax} + \ifcsname kaishu\endcsname \newcommand{\citshape}{\kaishu} @@ -148,7 +173,6 @@ \newcommand{\cfs}{\normalfont} \fi -\RequirePackage{newtxtext} \ifdefstring{\ELEGANT@math}{newtx}{ \RequirePackage{newtxmath} \let\Bbbk\relax @@ -168,6 +192,13 @@ \DeclareMathSymbol{\prodop}{\mathop}{CMlargesymbols}{"51} }{\relax} + +\RequirePackage[ + backend=\ELEGANT@bibend, + citestyle=\ELEGANT@citestyle, + bibstyle=\ELEGANT@bibstyle]{biblatex} +\defbibheading{elegantbook}[\ebibname]{#1} + \RequirePackage{appendix} \ifdefstring{\ELEGANT@lang}{cn}{ @@ -191,6 +222,7 @@ \renewcommand\tablename{表}% \newcommand\versiontext{版本:}% \newcommand\updatetext{日期:}% + \newcommand{\ebibname}{参考文献} \renewcommand\abstractname{摘\hspace{2em}要} \setlength\parindent{2\ccwd} \renewcommand{\abstracttextfont}{\small\citshape\noindent\ignorespaces} @@ -198,12 +230,6 @@ \newcommand{\keywords}[1]{\vskip2ex\par\noindent\normalfont{\bfseries 关键词: } #1} \newcommand\figref[1]{{\bfseries 图~\ref{#1}}} \newcommand\tabref[1]{{\bfseries 表~\ref{#1}}} - \RequirePackage{gbt7714} - \ifdefstring{\ELEGANT@cite}{authoryear}{ - \bibliographystyle{gbt7714-author-year}}{ - \bibliographystyle{gbt7714-numerical}} - \ifdefstring{\ELEGANT@cite}{numbers}{ - \citestyle{numbers}}{\relax} \renewcommand{\appendixtocname}{附录} \renewcommand{\appendixpagename}{附录}}{\relax} @@ -230,10 +256,9 @@ \newcommand{\keywords}[1]{\vskip 2ex\par\noindent\normalfont{\bfseries Keywords: } #1} \newcommand\figref[1]{{\bfseries Figure~\ref{#1}}} \newcommand\tabref[1]{{\bfseries Table~\ref{#1}}} - \RequirePackage[\ELEGANT@cite,sort&compress]{natbib} - \bibliographystyle{\ELEGANT@bibstyle}}{\relax} + \newcommand{\ebibname}{Bibliography}}{\relax} + -\setlength{\bibsep}{0.0pt} \def\bibfont{\footnotesize} \AtBeginEnvironment{verbatim}{\microtypesetup{activate=false}} @@ -341,7 +366,7 @@ backgroundcolor=\color{lightgrey} } +\addbibresource[location=local]{reference.bib} - - - +% restore the tt default family to lmodern tt family +\renewcommand\ttdefault{lmtt} |