5 Commits

Author SHA1 Message Date
EthanDeng
78fe2c7daf frozen 3.11 2020-04-12 13:43:33 +08:00
EthanDeng
ae7a9ae8f6 update 3.11 2020-04-12 12:00:13 +08:00
EthanDeng
c84f79922d frozen 3.x 2020-04-11 10:19:16 +08:00
EthanDeng
6ab10beda8 fix problem/example/exercise space 2020-03-21 00:23:42 +08:00
EthanDeng
09b71b9ab7 add lang=it 2020-03-19 13:14:30 +08:00
4 changed files with 1842 additions and 1739 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@
%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% % !Mode:: "TeX:UTF-8" % % !Mode:: "TeX:UTF-8"
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesClass{elegantbook}[2020/02/10 v3.10 ElegantBook document class] \ProvidesClass{elegantbook}[2020/04/12 v3.11 ElegantBook document class]
\RequirePackage{kvoptions} \RequirePackage{kvoptions}
\RequirePackage{etoolbox} \RequirePackage{etoolbox}
@@ -20,7 +20,6 @@
\DeclareStringOption[en]{lang} \DeclareStringOption[en]{lang}
\DeclareStringOption[answer]{result} \DeclareStringOption[answer]{result}
\DeclareStringOption[fancy]{mode} \DeclareStringOption[fancy]{mode}
\DeclareStringOption[show]{base}
\DeclareStringOption[normal]{device} \DeclareStringOption[normal]{device}
\DeclareStringOption[cm]{math} \DeclareStringOption[cm]{math}
\DeclareStringOption[marginfalse]{marginpar} \DeclareStringOption[marginfalse]{marginpar}
@@ -43,6 +42,7 @@
\DeclareVoidOption{en}{\ekv{lang=en}} \DeclareVoidOption{en}{\ekv{lang=en}}
\DeclareVoidOption{cn}{\ekv{lang=cn}} \DeclareVoidOption{cn}{\ekv{lang=cn}}
\DeclareVoidOption{it}{\ekv{lang=it}}
\DeclareVoidOption{fancy}{\ekv{mode=fancy}} \DeclareVoidOption{fancy}{\ekv{mode=fancy}}
\DeclareVoidOption{simple}{\ekv{mode=simple}} \DeclareVoidOption{simple}{\ekv{mode=simple}}
@@ -50,9 +50,6 @@
\DeclareVoidOption{answer}{\ekv{result=answer}} \DeclareVoidOption{answer}{\ekv{result=answer}}
\DeclareVoidOption{noanswer}{\ekv{result=noanswer}} \DeclareVoidOption{noanswer}{\ekv{result=noanswer}}
\DeclareVoidOption{hide}{\ekv{base=hide}}
\DeclareVoidOption{show}{\ekv{base=show}}
\DeclareVoidOption{normal}{\ekv{device=normal}} \DeclareVoidOption{normal}{\ekv{device=normal}}
\DeclareVoidOption{pad}{\ekv{device=pad}} \DeclareVoidOption{pad}{\ekv{device=pad}}
@@ -88,6 +85,25 @@
% \ProcessOptions*\relax % \ProcessOptions*\relax
\LoadClass[a4paper,oneside]{book} \LoadClass[a4paper,oneside]{book}
\RequirePackage{setspace}
\RequirePackage{hyperref}
\hypersetup{
breaklinks,
unicode,
linktoc=all,
bookmarksnumbered=true,
bookmarksopen=true,
pdfkeywords={ElegantBook},
colorlinks,
linkcolor=winered,
citecolor=winered,
urlcolor=winered,
plainpages=false,
pdfstartview=FitH,
pdfborder={0 0 0},
linktocpage
}
%% device settings %% device settings
\RequirePackage{geometry} \RequirePackage{geometry}
\ifdefstring{\ELEGANT@device}{normal}{ \ifdefstring{\ELEGANT@device}{normal}{
@@ -158,6 +174,11 @@
\else \else
\newcommand{\citshape}{\itshape} \newcommand{\citshape}{\itshape}
\fi \fi
\ifcsname kaishu\endcsname
\newcommand{\cnormal}{\kaishu}
\else
\newcommand{\cnormal}{\normalfont}
\fi
\ifcsname fangsong\endcsname \ifcsname fangsong\endcsname
\newcommand{\cfs}{\fangsong} \newcommand{\cfs}{\fangsong}
@@ -251,21 +272,6 @@
\definecolor{winered}{rgb}{0.5,0,0} \definecolor{winered}{rgb}{0.5,0,0}
\definecolor{bule}{RGB}{18,29,57} \definecolor{bule}{RGB}{18,29,57}
\newcommand{\base}[2]{%
\nointerlineskip \vspace{0.1\baselineskip}\hspace{\fill}
{\color{#1}
\resizebox{0.3\linewidth}{1.5ex}
{{%
{\begin{tikzpicture}
\node (C) at (0,0) {};
\node (D) at (4,0) {};
\path (C) to [ornament=#2] (D);
\end{tikzpicture}}}}}%
\hspace{\fill}
\par\nointerlineskip \vspace{0.1\baselineskip}
}
% ----- Title Style ----- % ----- Title Style -----
\ifdefstring{\ELEGANT@titlestyle}{hang}{\def\style{hang}}{\relax} \ifdefstring{\ELEGANT@titlestyle}{hang}{\def\style{hang}}{\relax}
\ifdefstring{\ELEGANT@titlestyle}{display}{\def\style{display}}{\relax} \ifdefstring{\ELEGANT@titlestyle}{display}{\def\style{display}}{\relax}
@@ -289,9 +295,8 @@
\newcommand{\question}[1]{{\par\citshape #1}\\[0.2ex]} \newcommand{\question}[1]{{\par\citshape #1}\\[0.2ex]}
\RequirePackage[\ELEGANT@cite,sort&compress]{natbib} \ifdefstring{\ELEGANT@lang}{cn}{\relax}{
\setlength{\bibsep}{0.0pt} \RequirePackage[\ELEGANT@cite,sort&compress]{natbib}}
\def\bibfont{\footnotesize}
\RequirePackage{enumerate} \RequirePackage{enumerate}
% list/itemize/enumerate setting % list/itemize/enumerate setting
@@ -325,13 +330,13 @@
\RequirePackage{graphicx} \RequirePackage{graphicx}
%\RequirePackage{enumerate} %\RequirePackage{enumerate}
\RequirePackage{amsmath,mathrsfs,amsfonts,amssymb} \RequirePackage{amsmath,mathrsfs,amsfonts,amssymb}
% \providecommand\qed{}
% \renewcommand{\qed}{\hfill\ensuremath{\square}}
\RequirePackage{booktabs} \RequirePackage{booktabs}
\RequirePackage{multicol,multirow} \RequirePackage{multicol,multirow}
\RequirePackage{xcolor} \RequirePackage{xcolor}
\RequirePackage{fancyvrb} \RequirePackage{fancyvrb}
\RequirePackage{makecell,lipsum,hologo,setspace} \RequirePackage{makecell,lipsum,hologo}
%% %%
\ifdefstring{\ELEGANT@lang}{cn}{ \ifdefstring{\ELEGANT@lang}{cn}{
\renewcommand{\contentsname}{} \renewcommand{\contentsname}{}
@@ -349,11 +354,16 @@
\ifdefstring{\ELEGANT@scheme}{chinese}{ \ifdefstring{\ELEGANT@scheme}{chinese}{
\renewcommand{\chaptername}{~\zhnumber{\arabic{chapter}}~}}{ \renewcommand{\chaptername}{~\zhnumber{\arabic{chapter}}~}}{
\renewcommand{\chaptername}{~\thechapter{}~}} \renewcommand{\chaptername}{~\thechapter{}~}}
\newcommand{\authorname}{\textit{}} \newcommand{\authorname}{\citshape }
\newcommand{\institutename}{\textit{}} \newcommand{\institutename}{\citshape }
\newcommand{\datename}{\textit{}} \newcommand{\datename}{\citshape }
\newcommand{\versionname}{\textit{}} \newcommand{\versionname}{\citshape }
\RequirePackage[\ELEGANT@cite]{gbt7714} \RequirePackage{gbt7714}
\ifdefstring{\ELEGANT@cite}{authoryear}{
\bibliographystyle{gbt7714-author-year}}{
\bibliographystyle{gbt7714-numerical}}
\ifdefstring{\ELEGANT@cite}{numbers}{
\citestyle{numbers}}{\relax}
\newcommand{\notename}{} \newcommand{\notename}{}
\renewcommand*{\proofname}{} \renewcommand*{\proofname}{}
\newcommand{\problemname}{} \newcommand{\problemname}{}
@@ -373,10 +383,9 @@
\newcommand{\propertyname}{} \newcommand{\propertyname}{}
\newcommand{\introductionname}{} \newcommand{\introductionname}{}
\newcommand{\problemsetname}{} \newcommand{\problemsetname}{}
\newcommand\bioinfo[2]{\gdef\@bioinfo{\textit{#1}\textit{#2}}} \newcommand\bioinfo[2]{\gdef\@bioinfo{{\citshape #1}#2}}
\newcommand{\updatename}{} \newcommand{\updatename}{}
\newcommand{\historyname}{} \newcommand{\historyname}{}}{\relax}
}{\relax}
\ifdefstring{\ELEGANT@lang}{en}{ \ifdefstring{\ELEGANT@lang}{en}{
\setlength\parindent{2em} \setlength\parindent{2em}
\newcommand\figref[1]{\textbf{Figure}~\ref{#1}} \newcommand\figref[1]{\textbf{Figure}~\ref{#1}}
@@ -411,6 +420,44 @@
\newcommand{\historyname}{Version History} \newcommand{\historyname}{Version History}
}{\relax} }{\relax}
\ifdefstring{\ELEGANT@lang}{it}{
\RequirePackage[italian]{babel}
\setlength\parindent{2em}
\newcommand\figref[1]{\textbf{Figura}~\ref{#1}}
\newcommand\tabref[1]{\textbf{Tabella}~\ref{#1}}
\renewcommand{\chaptername}{Capitolo \thechapter}
\newcommand{\authorname}{\textbf{Autore: }}
\newcommand{\institutename}{\textbf{Istituto: }}
\newcommand{\datename}{\textbf{Data: }}
\newcommand{\versionname}{\textbf{Versione: }}
\bibliographystyle{\ELEGANT@bibstyle}
\newcommand{\notename}{Nota}
\newcommand{\proofname}{Dimostrazione}
\newcommand{\problemname}{Problema}
\newcommand{\definitionname}{Definizione}
\newcommand{\theoremname}{Teorema}
\newcommand{\axiomname}{Assioma}
\newcommand{\postulatename}{Postulato}
\newcommand{\lemmaname}{Lemma}
\newcommand{\propositionname}{Proposizione}
\newcommand{\corollaryname}{Corollario}
\newcommand{\examplename}{Esempio}
\newcommand{\exercisename}{Esercizio}
\newcommand{\remarkname}{Commento}
\newcommand{\assumptionname}{Assunto}
\newcommand{\conclusionname}{Conclusione}
\newcommand{\solutionname}{Soluzione}
\newcommand{\propertyname}{Proprietà}
\newcommand{\introductionname}{Introduzione}
\newcommand{\problemsetname}{Esercizio}
\newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}}
\newcommand{\updatename}{Aggiornamenti:}
\newcommand{\historyname}{Cronologia delle versioni}
}{\relax}
\setlength{\bibsep}{0.0pt}
\def\bibfont{\footnotesize}
\RequirePackage{xpatch} \RequirePackage{xpatch}
\xpatchcmd{\part}{ \xpatchcmd{\part}{
\thispagestyle{plain}}{ \thispagestyle{plain}}{
@@ -421,7 +468,7 @@
\graphicspath{{./figure/}{./figures/}{./image/}{./images/}{./graphics/}{./graphic/}{./pictures/}{./picture/}} \graphicspath{{./figure/}{./figures/}{./image/}{./images/}{./graphics/}{./graphic/}{./pictures/}{./picture/}}
\usepackage{pgfornament} %% load tikz without tikz \usepackage{tikz} %% load tikz without tikz
\usetikzlibrary{backgrounds,calc,shadows} \usetikzlibrary{backgrounds,calc,shadows}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{ \newcommand*\circled[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=1pt] (char) {#1};}} \node[shape=circle,draw,inner sep=1pt] (char) {#1};}}
@@ -439,24 +486,6 @@
\setlist[itemize,3]{label={\eitemiii}} \setlist[itemize,3]{label={\eitemiii}}
\RequirePackage{hyperref}
\hypersetup{
breaklinks,
unicode,
linktoc=all,
bookmarksnumbered=true,
bookmarksopen=true,
pdfkeywords={ElegantBook},
colorlinks,
linkcolor=winered,
citecolor=winered,
urlcolor=winered,
plainpages=false,
pdfstartview=FitH,
pdfborder={0 0 0},
linktocpage
}
%% %%
\RequirePackage[center,pagestyles]{titlesec} \RequirePackage[center,pagestyles]{titlesec}
\RequirePackage{apptools} \RequirePackage{apptools}
@@ -465,7 +494,7 @@
\setcounter{secnumdepth}{5} \setcounter{secnumdepth}{5}
\titleformat{\chapter}[\style]{\bfseries} \titleformat{\chapter}[\style]{\bfseries}
{\filcenter\LARGE\enspace\bfseries{\color{structurecolor}\IfAppendix{\appendixname}{\chaptername}\enspace}}{1pt}{\bfseries\color{structurecolor}\LARGE\filcenter}[\ifdefstring{\ELEGANT@base}{hide}{}{\filcenter\base{structurecolor}{88}}] {\filcenter\LARGE\enspace\bfseries{\color{structurecolor}\IfAppendix{\appendixname}{\chaptername}\enspace}}{1pt}{\bfseries\color{structurecolor}\LARGE\filcenter}[]
\titleformat{\section}[hang]{\bfseries}{ \titleformat{\section}[hang]{\bfseries}{
\Large\bfseries{\color{structurecolor}\thesection}\enspace}{1pt}{% \Large\bfseries{\color{structurecolor}\thesection}\enspace}{1pt}{%
@@ -613,7 +642,7 @@
\renewcommand{\theexam}{\thechapter.\arabic{exam}} \renewcommand{\theexam}{\thechapter.\arabic{exam}}
\newenvironment{example}[1][]{ \newenvironment{example}[1][]{
\refstepcounter{exam} \refstepcounter{exam}
\par\noindent\textbf{\color{main}{\examplename}\theexam #1 }\rmfamily}{ \par\noindent\textbf{\color{main}{\examplename} \theexam #1 }\rmfamily}{
\par\ignorespacesafterend} \par\ignorespacesafterend}
%% Exercise with counter %% Exercise with counter
@@ -624,7 +653,7 @@
\refstepcounter{exer} \refstepcounter{exer}
\par\noindent\makebox[-3pt][r]{ \par\noindent\makebox[-3pt][r]{
\scriptsize\color{red!90}\HandPencilLeft\quad} \scriptsize\color{red!90}\HandPencilLeft\quad}
\textbf{\color{main}{\exercisename}\theexer #1 }\rmfamily}{ \textbf{\color{main}{\exercisename} \theexer #1 }\rmfamily}{
\par\ignorespacesafterend} \par\ignorespacesafterend}
%% Problem with counter %% Problem with counter
@@ -633,7 +662,7 @@
\renewcommand{\theprob}{\thechapter.\arabic{prob}} \renewcommand{\theprob}{\thechapter.\arabic{prob}}
\newenvironment{problem}[1][]{ \newenvironment{problem}[1][]{
\refstepcounter{prob} \refstepcounter{prob}
\par\noindent\textbf{\color{main}{\problemname}\theprob #1 }\rmfamily}{ \par\noindent\textbf{\color{main}{\problemname} \theprob #1 }\rmfamily}{
\par\ignorespacesafterend} \par\ignorespacesafterend}
\newenvironment{note}{ \newenvironment{note}{
@@ -707,29 +736,14 @@
\RequirePackage{fancyhdr} \RequirePackage{fancyhdr}
\fancyhf{} \fancyhf{}
\ifdefstring{\ELEGANT@base}{hide}{
\fancyfoot[c]{\color{structurecolor}\scriptsize\thepage}
\if@twoside
\fancyhead[ER]{\color{structurecolor}\citshape\leftmark}
\fancyhead[OL]{\color{structurecolor}\citshape\rightmark}
\else
\fancyhead[R]{\color{structurecolor}\citshape\rightmark}
\fi
}{\relax}
\ifdefstring{\ELEGANT@base}{show}{
\fancyfoot[c]{\catcode`\$=3\relax\base{structurecolor}{88}}
\if@twoside
\fancyhead[EL,OR]{\color{structurecolor}--\;\thepage\;--}
\fancyhead[ER]{\color{structurecolor}\citshape\leftmark}
\fancyhead[OL]{\color{structurecolor}\citshape\rightmark}
\else
\fancyhead[R]{\color{structurecolor}--\;\thepage\;--}
\fancyhead[L]{\color{structurecolor}\citshape\rightmark}
\fi
}{\relax}
\fancyfoot[c]{\color{structurecolor}\scriptsize\thepage}
\if@twoside
\fancyhead[ER]{\color{structurecolor}\cnormal\leftmark}
\fancyhead[OL]{\color{structurecolor}\cnormal\rightmark}
\else
\fancyhead[R]{\color{structurecolor}\cnormal\rightmark}
\fi
\renewcommand{\headrule}{\color{structurecolor}\hrule width\textwidth} \renewcommand{\headrule}{\color{structurecolor}\hrule width\textwidth}
\pagestyle{fancy} \pagestyle{fancy}
@@ -781,12 +795,12 @@
{\renewcommand{\arraystretch}{0.618} {\renewcommand{\arraystretch}{0.618}
\begin{tabular}{l} \begin{tabular}{l}
% \ifcsname @author\endcsname \authorname \@author\\\fi % \ifcsname @author\endcsname \authorname \@author\\\fi
\ifx\@author\empty\else\authorname\@author\\ \fi \ifx\@author\empty\else\authorname\cnormal\@author\\ \fi
\ifcsname @institute\endcsname \institutename \@institute\\ \fi \ifcsname @institute\endcsname \institutename \cnormal\@institute\\ \fi
% \ifcsname @date\endcsname \@date\\\fi % \ifcsname @date\endcsname \@date\\\fi
\ifx\@date\empty\else\datename\@date \\ \fi \ifx\@date\empty\else\datename\cnormal\@date \\ \fi
\ifcsname @version\endcsname \versionname \@version\\ \fi \ifcsname @version\endcsname \cnormal\versionname\@version\\ \fi
\ifcsname @bioinfo\endcsname \@bioinfo\\ \fi \ifcsname @bioinfo\endcsname \cnormal\@bioinfo\\ \fi
\end{tabular}} \end{tabular}}
\end{minipage} \end{minipage}
\begin{minipage}[c]{0.27\linewidth} \begin{minipage}[c]{0.27\linewidth}
@@ -803,7 +817,7 @@
\vfill \vfill
\begin{center} \begin{center}
\setstretch{1.3} \setstretch{1.3}
\parbox[t]{0.7\textwidth}{\centering \itshape \parbox[t]{0.7\textwidth}{\centering \citshape
\ifcsname @extrainfo\endcsname\@extrainfo\fi} \ifcsname @extrainfo\endcsname\@extrainfo\fi}
\end{center} \end{center}
\vfill \vfill
@@ -832,7 +846,7 @@
breaklines=true, breaklines=true,
keywordstyle=\color{winered}, keywordstyle=\color{winered},
commentstyle=\color{gray}, commentstyle=\color{gray},
emph={elegantpaper,fontenc,fontspec,xeCJK,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,gbt7714,natbib}, emph={elegantpaper,fontenc,fontspec,xeCJK,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},
emphstyle={\color{frenchplum}}, 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}, 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, frame=single,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB