diff --git a/elegantbook-cn.tex b/elegantbook-cn.tex index 6546cf6..f60c8dc 100644 --- a/elegantbook-cn.tex +++ b/elegantbook-cn.tex @@ -1,4 +1,4 @@ -\documentclass[cn,11pt]{elegantbook} +\documentclass[cn,10pt]{elegantbook} \title{ElegantBook:优美的 \LaTeX{} 书籍模板} \subtitle{Elegant\LaTeX{} 经典之作} diff --git a/elegantbook-en.tex b/elegantbook-en.tex index 2f662fd..ae6f3e4 100644 --- a/elegantbook-en.tex +++ b/elegantbook-en.tex @@ -1,4 +1,4 @@ -\documentclass[11pt,fancy,twocol]{elegantbook} +\documentclass[11pt,fancy,twocol,twoside]{elegantbook} \title{An Elegant \LaTeX{} Template for Books} \subtitle{Classic Elegant\LaTeX{} Template} @@ -13,6 +13,8 @@ \logo{logo-blue.png} \cover{cover.jpg} +\usepackage{imakeidx} +\makeindex \usepackage[symbols,nogroupskip,sort=none]{glossaries-extra} @@ -33,7 +35,7 @@ \mainmatter \printunsrtglossary[type=symbols,style=long] - +\part{HELLO WORLD} \chapter{Elegant\LaTeX{} Templates} Elegant\LaTeX{} Program developers are intended to provide you beautiful, elegant, user-friendly templates. Currently, the Elegant\LaTeX{} is composed of \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote}, \href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook}, \href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper}, designed for typesetting notes, books, and working papers respectively. Latest releases are strongly recommended! This guide is aimed at briefly introducing the 101 of this template. For any other question, suggestion or comment, feel free to contact us on GitHub \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} or email us at \email{elegantlatex2e@gmail.com}. $\gls{F}$ @@ -186,7 +188,7 @@ BTW, we provide Certificate of Donation for those who donated, tippers please le \includegraphics[width=0.7\textwidth]{cert.pdf} \end{figure} -\part{HELLO WORLD} + This template is based on the Standard \LaTeX{} book class, so the options of book class work as well (Note that the option of papersize has no effect due to \lstinline{device} option). The default encoding is UTF-8 while \TeX{} Live is recommended. The test environment is Win10 + \TeX{} Live 2019, either \hologo{pdfLaTeX} or \lstinline{XeLaTeX} works fine. \lstinline{XeLaTeX} is preferred for Chinese articles. @@ -482,7 +484,7 @@ You can change the title of this environment by modifying the optional argument \end{introduction} \end{lstlisting} -\section{Problem Set} +%\section{Problem Set} The environment \lstinline{problemset} is used at the end of each chapter to display corresponding exercises. Just type in the following sentences: \begin{lstlisting} \begin{problemset} @@ -578,7 +580,7 @@ Since the template uses \lstinline{newtx}, please pay attention to the hyphens. The corresponding code is: \begin{lstlisting} \begin{equation} -\int_{R^q} f(x,y) dy.\emph{of \kern0pt f} + \int_{R^q} f(x,y) dy.\emph{of \kern0pt f} \end{equation} \end{lstlisting} @@ -658,6 +660,10 @@ Regression analysis is a powerful statistical method that allows you to examine Let's continue using our application training example. In this case, we'd want to measure the historical levels of satisfaction with the events from the past three years or so, as well as any information possible in regards to the independent variables. +\section{Second section} +This second section\index{S!section} may include some special word, +and expand the ones already used\index{keywords!used}. + \begin{table}[htbp] \small @@ -693,6 +699,7 @@ Let's continue using our application training example. In this case, we'd want t \item Distributed storage and search. \end{itemize} +%\problemset \begin{problemset} \item Solve the equation $5(- 3x - 2) - (x - 3) = -4(4x + 5) + 13$. \item Find the distance between the points $(-4 , -5)$ and $(-1 , -1)$. @@ -776,4 +783,6 @@ This appendix covers some of the basic mathematics used in econometrics. We brie \sum_{i=1}^n x_i \equiv x_1 + x_2 +\cdots + x_n \end{equation} +\printindex + \end{document} \ No newline at end of file diff --git a/elegantbook.cls b/elegantbook.cls index dfe9180..0b8a10c 100644 --- a/elegantbook.cls +++ b/elegantbook.cls @@ -109,6 +109,7 @@ \geometry{ a4paper, top=25.4mm, bottom=25.4mm, + left=20mm, right=20mm, headheight=2.17cm, headsep=4mm, footskip=12mm @@ -136,6 +137,7 @@ }{\relax} \setcounter{tocdepth}{1} +\renewcommand{\baselinestretch}{1.2} \PassOptionsToPackage{no-math}{fontspec} \RequirePackage{iftex} @@ -338,10 +340,6 @@ - -%% 常用宏包 -\linespread{1.3} - \RequirePackage{graphicx} %\RequirePackage{enumerate} \RequirePackage{amsmath,mathrsfs,amsfonts,amssymb} @@ -366,6 +364,7 @@ } \ifdefstring{\ELEGANT@lang}{cn}{ + \renewcommand{\baselinestretch}{1.3} \renewcommand{\contentsname}{目录} \renewcommand{\figurename}{图} \renewcommand{\tablename}{表} @@ -387,7 +386,6 @@ \newcommand{\versionname}{\citshape 版本:} \newcommand{\notename}{笔记} \renewcommand*{\proofname}{证明} - \newcommand{\problemname}{例题} \newcommand{\definitionname}{定义} \newcommand{\theoremname}{定理} \newcommand{\axiomname}{公理} @@ -395,15 +393,16 @@ \newcommand{\lemmaname}{引理} \newcommand{\propositionname}{命题} \newcommand{\corollaryname}{推论} - \newcommand{\examplename}{例} - \newcommand{\exercisename}{练习} + \newcommand{\examplename}{例题} % + \newcommand{\instancename}{示例} % + \newcommand{\problemname}{问题} % 问题 + \newcommand{\exercisename}{练习} % 练习=习题 \newcommand{\remarkname}{注} \newcommand{\assumptionname}{假设} \newcommand{\conclusionname}{结论} \newcommand{\solutionname}{解} \newcommand{\propertyname}{性质} \newcommand{\introductionname}{内容提要} - \newcommand{\problemsetname}{习题} \newcommand\bioinfo[2]{\gdef\@bioinfo{{\citshape #1}:#2}} \newcommand{\updatename}{更新:} \newcommand{\historyname}{版本更新历史} @@ -434,7 +433,7 @@ \newcommand{\solutionname}{Solution} \newcommand{\propertyname}{Property} \newcommand{\introductionname}{Introduction} - \newcommand{\problemsetname}{Exercise} + % \newcommand{\problemsetname}{Exercise} \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} \newcommand{\updatename}{Updates:} \newcommand{\historyname}{Version History} @@ -447,7 +446,6 @@ \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: }} @@ -470,7 +468,6 @@ \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} @@ -720,9 +717,12 @@ \end{tcolorbox}} \RequirePackage{adforn} -\newenvironment{problemset}[1][\chaptername~\chapterextra\problemsetname]{ + +\newenvironment{problemset}[1][\chaptername~\chapterextra\exercisename]{ \begin{center} - \phantomsection\addcontentsline{toc}{section}{\texorpdfstring{\chaptername\;\problemsetname}{\problemsetname}} + \phantomsection\addcontentsline{toc}{section}{\texorpdfstring{\chaptername\;\exercisename}{\exercisename}} + % \markboth{#1}{\rightmark} + \markright{#1} \textcolor{structurecolor}{\Large\bfseries\adftripleflourishleft~#1~\adftripleflourishright} \end{center} \begin{enumerate}}{ @@ -759,9 +759,9 @@ % \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{\chaptername~\chapterextra{}#1}{}} + -\renewcommand{\baselinestretch}{1.35} \renewcommand*{\maketitle}{% \hypersetup{pageanchor=false} @@ -871,8 +871,9 @@ % add the list of change history \newcommand{\dateinfoline}[2]{ \noindent\makebox[0pt][r]{% - \makebox[-5em][r]{% - \textbf{\textcolor{structurecolor}{#1}}}\quad}% + \makebox[-3em][r]{% + \small + \textbf{\textcolor{structurecolor}{#1}}}\;\;}% {\citshape\updatename\ignorespaces#2}} \newcommand{\datechange}[2]{% @@ -920,7 +921,7 @@ \labelformat{algorithm}{算法~#1} \labelformat{exercise}{习题~#1} -\RequirePackage{pagecolor} +\RequirePackage{pagecolor,afterpage} \def\@part[#1]#2{% \newcommand*{\mylmargin}{\dimexpr\oddsidemargin+1in\relax} \ifnum \c@secnumdepth >-2\relax @@ -928,11 +929,10 @@ \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% \else \addcontentsline{toc}{part}{#1}% - \fi - \markboth{}{}% + \fi% { \centering - \newpagecolor{structurecolor!10} + \newpagecolor{structurecolor!10}\afterpage{\restorepagecolor} \interlinepenalty \@M \normalfont \vskip 30\p@ @@ -947,7 +947,11 @@ \Huge\scshape\bfseries \textcolor{structurecolor}{\thepart.\; #2} \vspace*{0.7\baselineskip}} \end{minipage}}} - \@endpart - \restorepagecolor} + \@endpart} +\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else +\hbox{}% +\thispagestyle{empty}% +\newpage% +\if@twocolumn\hbox{}\newpage\fi\fi\fi} \ No newline at end of file