mirror of
https://github.com/ElegantLaTeX/ElegantBook.git
synced 2026-01-26 12:24:36 +08:00
chapter section settings and fix header
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
\documentclass[cn,10pt]{elegantbook}
|
\documentclass[cn,10pt,twoside]{elegantbook}
|
||||||
|
|
||||||
\title{ElegantBook:优美的 \LaTeX{} 书籍模板}
|
\title{ElegantBook:优美的 \LaTeX{} 书籍模板}
|
||||||
\subtitle{Elegant\LaTeX{} 经典之作}
|
\subtitle{Elegant\LaTeX{} 经典之作}
|
||||||
@@ -24,18 +24,13 @@
|
|||||||
\usepackage{array}
|
\usepackage{array}
|
||||||
\newcommand{\ccr}[1]{\makecell{{\color{#1}\rule{1cm}{1cm}}}}
|
\newcommand{\ccr}[1]{\makecell{{\color{#1}\rule{1cm}{1cm}}}}
|
||||||
|
|
||||||
\usepackage[lined,dotocloa,algochapter]{algorithm2e}
|
|
||||||
\SetKwData{Left}{left}\SetKwData{This}{this}\SetKwData{Up}{up}
|
|
||||||
\SetKwFunction{Union}{Union}\SetKwFunction{FindCompress}{FindCompress}
|
|
||||||
\SetKwInOut{Input}{input}\SetKwInOut{Output}{output}
|
|
||||||
|
|
||||||
|
|
||||||
\begin{document}
|
\begin{document}
|
||||||
|
|
||||||
\maketitle
|
\maketitle
|
||||||
\frontmatter
|
\frontmatter
|
||||||
|
|
||||||
\chapter*{特别声明}
|
\chapter*{特别声明}
|
||||||
|
|
||||||
\markboth{Introduction}{前言}
|
\markboth{Introduction}{前言}
|
||||||
|
|
||||||
|
|
||||||
@@ -59,9 +54,12 @@ February 10, 2020
|
|||||||
\end{flushright}
|
\end{flushright}
|
||||||
|
|
||||||
\tableofcontents
|
\tableofcontents
|
||||||
%\listofchanges
|
|
||||||
|
|
||||||
\mainmatter
|
\mainmatter
|
||||||
|
|
||||||
|
\part{模板介绍}
|
||||||
|
|
||||||
\chapter{Elegant\LaTeX{} 系列模板介绍}
|
\chapter{Elegant\LaTeX{} 系列模板介绍}
|
||||||
|
|
||||||
Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模板方便用户使用。目前由 \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote},\href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook},\href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} 组成,分别用于排版笔记,书籍和工作论文。强烈推荐使用最新正式版本!本文将介绍本模板的一些设置内容以及基本使用方法。如果您有其他问题,建议或者意见,欢迎在 GitHub 上给我们提交 \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} 或者邮件联系我们。 \ref{sec:update}
|
Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模板方便用户使用。目前由 \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote},\href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook},\href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} 组成,分别用于排版笔记,书籍和工作论文。强烈推荐使用最新正式版本!本文将介绍本模板的一些设置内容以及基本使用方法。如果您有其他问题,建议或者意见,欢迎在 GitHub 上给我们提交 \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} 或者邮件联系我们。 \ref{sec:update}
|
||||||
@@ -409,34 +407,34 @@ The content of theorem.
|
|||||||
\label{tab:theorem-class}%
|
\label{tab:theorem-class}%
|
||||||
\end{table}%
|
\end{table}%
|
||||||
|
|
||||||
\subsection{算法环境}
|
% \subsection{算法环境}
|
||||||
|
|
||||||
|
|
||||||
\begin{algorithm}\label{alg:test}
|
% \begin{algorithm}\label{alg:test}
|
||||||
\Input{A bitmap $I$ of size $w \times l$}
|
% \Input{A bitmap $I$ of size $w \times l$}
|
||||||
\Output{A partition of the bitmap}
|
% \Output{A partition of the bitmap}
|
||||||
\BlankLine
|
% \BlankLine
|
||||||
\emph{special treatment of the first line}\;
|
% \emph{special treatment of the first line}\;
|
||||||
\For{$i \leftarrow 2$ \KwTo $l$}{
|
% \For{$i \leftarrow 2$ \KwTo $l$}{
|
||||||
\emph{special treatment of the first element of line $i$}\;
|
% \emph{special treatment of the first element of line $i$}\;
|
||||||
\For{$j \leftarrow 2$ \KwTo $w$}{\label{forins}
|
% \For{$j \leftarrow 2$ \KwTo $w$}{\label{forins}
|
||||||
$\Left \leftarrow \FindCompress{$I[i,j-1]$}$\;
|
% $\Left \leftarrow \FindCompress{$I[i,j-1]$}$\;
|
||||||
$\Up \leftarrow \FindCompress{$I[i-1,]$}$\;
|
% $\Up \leftarrow \FindCompress{$I[i-1,]$}$\;
|
||||||
$\This \leftarrow \FindCompress{$I[i,j]$}$\;
|
% $\This \leftarrow \FindCompress{$I[i,j]$}$\;
|
||||||
\If(\tcp*[h]{O(\Left,\This)==1}){\Left compatible with \This}{\label{lt}
|
% \If(\tcp*[h]{O(\Left,\This)==1}){\Left compatible with \This}{\label{lt}
|
||||||
\lIf{$\Left < \This$}{$\Union{\Left,\This}$}
|
% \lIf{$\Left < \This$}{$\Union{\Left,\This}$}
|
||||||
\lElse{$\Union{\This,\Left}$}
|
% \lElse{$\Union{\This,\Left}$}
|
||||||
}
|
% }
|
||||||
\If(\tcp*[f]{O(\Up,\This)==1}){\Up compatible with \This}{\label{ut}
|
% \If(\tcp*[f]{O(\Up,\This)==1}){\Up compatible with \This}{\label{ut}
|
||||||
\lIf{$\Up < \This$}{$\Union{\Up,\This}$}
|
% \lIf{$\Up < \This$}{$\Union{\Up,\This}$}
|
||||||
\tcp{\This is put under \Up to keep tree as flat as possible}\label{cmt}
|
% \tcp{\This is put under \Up to keep tree as flat as possible}\label{cmt}
|
||||||
\lElse{$\Union{\This,\Up}$}\tcp*[r]{\This{} linked to \Up}\label{lelse}
|
% \lElse{$\Union{\This,\Up}$}\tcp*[r]{\This{} linked to \Up}\label{lelse}
|
||||||
}
|
% }
|
||||||
}
|
% }
|
||||||
\lForEach{element $e$ of the line $i$}{\FindCompress{p}}
|
% \lForEach{element $e$ of the line $i$}{\FindCompress{p}}
|
||||||
}
|
% }
|
||||||
\caption{disjoint decomposition}\label{algo_disjdecomp}
|
% \caption{disjoint decomposition}\label{algo_disjdecomp}
|
||||||
\end{algorithm}
|
% \end{algorithm}
|
||||||
|
|
||||||
\subsection{其他环境的使用}
|
\subsection{其他环境的使用}
|
||||||
|
|
||||||
@@ -898,7 +896,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
|
|||||||
\datechange{2019/08/18}{版本 3.09 正式发布}
|
\datechange{2019/08/18}{版本 3.09 正式发布}
|
||||||
|
|
||||||
\begin{change}
|
\begin{change}
|
||||||
\item 由于 \lstinline{\elegantpar} 存在一些问题,暂时性删除 \lstinline{\elegantpar} 命令,并提示用户改用 \lstinline{\marginnote} 和 \lstinline{\marginpar} 旁注/边注命令。
|
\item \lstinline{\elegantpar} 存在 bug,删除 \lstinline{\elegantpar} 命令,建议用户改用 \lstinline{\marginnote} 和 \lstinline{\marginpar} 旁注命令。
|
||||||
\item 积分操作符统一更改为 \lstinline{esint} 宏包设置;
|
\item 积分操作符统一更改为 \lstinline{esint} 宏包设置;
|
||||||
\item 新增目录选项 \lstinline{toc},可选项为单栏 \lstinline{onecol} 和双栏 \lstinline{twocol};
|
\item 新增目录选项 \lstinline{toc},可选项为单栏 \lstinline{onecol} 和双栏 \lstinline{twocol};
|
||||||
\item 手动增加参考文献选项 \lstinline{cite},可选项为上标形式 \lstinline{super};
|
\item 手动增加参考文献选项 \lstinline{cite},可选项为上标形式 \lstinline{super};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
\documentclass[11pt,fancy,twocol,twoside]{elegantbook}
|
\documentclass[11pt,fancy,twocol,twoside,bibstyle=abbrv]{elegantbook}
|
||||||
|
|
||||||
\title{An Elegant \LaTeX{} Template for Books}
|
\title{An Elegant \LaTeX{} Template for Books}
|
||||||
\subtitle{Classic Elegant\LaTeX{} Template}
|
\subtitle{Classic Elegant\LaTeX{} Template}
|
||||||
@@ -26,6 +26,15 @@
|
|||||||
|
|
||||||
%\captionsetup{labelsep=space}
|
%\captionsetup{labelsep=space}
|
||||||
|
|
||||||
|
\usepackage{titletoc}% http://ctan.org/pkg/titletoc
|
||||||
|
\titlecontents{chapter}% <section-type>
|
||||||
|
[] % shape
|
||||||
|
{\bfseries}% format
|
||||||
|
{\chaptertitlename\ \thecontentslabel\hspace{1em}}% label
|
||||||
|
{}% sep
|
||||||
|
{\hfill\contentspage} % before code
|
||||||
|
[\addvspace{0.5\baselineskip}] % after code
|
||||||
|
|
||||||
\begin{document}
|
\begin{document}
|
||||||
|
|
||||||
\maketitle
|
\maketitle
|
||||||
@@ -37,6 +46,7 @@
|
|||||||
\printunsrtglossary[type=symbols,style=long]
|
\printunsrtglossary[type=symbols,style=long]
|
||||||
|
|
||||||
\part{HELLO WORLD}
|
\part{HELLO WORLD}
|
||||||
|
|
||||||
\chapter{Elegant\LaTeX{} Templates}
|
\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}$
|
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}$
|
||||||
|
|
||||||
@@ -84,14 +94,6 @@ Visit \href{https://www.overleaf.com/}{Overleaf} to use our template online anyw
|
|||||||
\subsection{To Use Portable Version}
|
\subsection{To Use Portable Version}
|
||||||
For portable version, simply download lastest ElegantBook-master from GitHub or CTAN (to be more accurate, download \lstinline{elegantbook.cls}) and save the file(s) under your working directory. This way of installation is simple and convenient, but you have to manually update \lstinline{cls} now and then.
|
For portable version, simply download lastest ElegantBook-master from GitHub or CTAN (to be more accurate, download \lstinline{elegantbook.cls}) and save the file(s) under your working directory. This way of installation is simple and convenient, but you have to manually update \lstinline{cls} now and then.
|
||||||
|
|
||||||
\subsection{To Use Local Installation Version}
|
|
||||||
If you are a \TeX{} Live 2019 user, using the \lstinline{tlshell}\footnote{namely, \TeX{} Live Manager} of \TeX{} Live 2019 direct installation package is strongly recommended. Simply search and open \lstinline{tlshell}, click on \lstinline{File -> Load Default Repository} or customize repository by \lstinline{Options}. Wait till the repository loads successfully, search \lstinline{elegantbook} by name, installation and update is just a click away.
|
|
||||||
|
|
||||||
\begin{figure}[htbp]
|
|
||||||
\centering
|
|
||||||
\includegraphics[width=0.7\textwidth]{tlshell.png}
|
|
||||||
\caption{Use \TeX{} Live Shell to Install ElegantBook Template}
|
|
||||||
\end{figure}
|
|
||||||
|
|
||||||
\subsection{Update Templates}
|
\subsection{Update Templates}
|
||||||
If you fail to update templates using \lstinline{tlshell}, please use cmd to update all the packages or switch to portable version instead.
|
If you fail to update templates using \lstinline{tlshell}, please use cmd to update all the packages or switch to portable version instead.
|
||||||
@@ -654,7 +656,7 @@ Let $z$ be some element of $xH \cap yH$. Then $z = xa$ for some $a \in H$, and
|
|||||||
|
|
||||||
\begin{figure}[htbp]
|
\begin{figure}[htbp]
|
||||||
\centering
|
\centering
|
||||||
\includegraphics[width=0.6\textwidth]{scatter.pdf}
|
\includegraphics[width=0.6\textwidth]{scatter.jpg}
|
||||||
\caption{Matplotlib: Scatter Plot Example\label{fig:scatter}}
|
\caption{Matplotlib: Scatter Plot Example\label{fig:scatter}}
|
||||||
\end{figure}
|
\end{figure}
|
||||||
|
|
||||||
|
|||||||
@@ -191,7 +191,7 @@
|
|||||||
|
|
||||||
|
|
||||||
\usepackage{fontspec}
|
\usepackage{fontspec}
|
||||||
\setmainfont{TeX Gyre TermesX}
|
\setmainfont{TeX Gyre Termes}
|
||||||
\setsansfont{TeX Gyre Heros}
|
\setsansfont{TeX Gyre Heros}
|
||||||
\setmonofont{Latin Modern Mono}
|
\setmonofont{Latin Modern Mono}
|
||||||
|
|
||||||
@@ -199,7 +199,7 @@
|
|||||||
|
|
||||||
% TeX Gyre TermesX/TeX Gyre Heros
|
% TeX Gyre TermesX/TeX Gyre Heros
|
||||||
|
|
||||||
\defaultfontfeatures[TeX Gyre TermesX,TeX Gyre Heros]{
|
\defaultfontfeatures[TeX Gyre Termes,TeX Gyre Heros]{
|
||||||
Extension = .otf,
|
Extension = .otf,
|
||||||
UprightFont = *-regular,
|
UprightFont = *-regular,
|
||||||
BoldFont = *-bold,
|
BoldFont = *-bold,
|
||||||
@@ -889,8 +889,8 @@
|
|||||||
|
|
||||||
\fancyfoot[c]{\color{structurecolor}\scriptsize\thepage}
|
\fancyfoot[c]{\color{structurecolor}\scriptsize\thepage}
|
||||||
\if@twoside
|
\if@twoside
|
||||||
\fancyhead[ER]{\color{structurecolor}\cnormal\leftmark}
|
\fancyhead[EL]{\color{structurecolor}\cnormal\leftmark}
|
||||||
\fancyhead[OL]{\color{structurecolor}\cnormal\rightmark}
|
\fancyhead[OR]{\color{structurecolor}\cnormal\rightmark}
|
||||||
\else
|
\else
|
||||||
\fancyhead[R]{\color{structurecolor}\cnormal\rightmark}
|
\fancyhead[R]{\color{structurecolor}\cnormal\rightmark}
|
||||||
\fi
|
\fi
|
||||||
@@ -1063,37 +1063,19 @@
|
|||||||
\labelformat{algorithm}{算法~#1}
|
\labelformat{algorithm}{算法~#1}
|
||||||
\labelformat{exercise}{习题~#1}
|
\labelformat{exercise}{习题~#1}
|
||||||
|
|
||||||
\RequirePackage{pagecolor,afterpage}
|
|
||||||
\def\@part[#1]#2{%
|
|
||||||
\newcommand*{\mylmargin}{\dimexpr\oddsidemargin+1in\relax}
|
|
||||||
\ifnum \c@secnumdepth >-2\relax
|
|
||||||
\refstepcounter{part}%
|
|
||||||
\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
|
|
||||||
\else
|
|
||||||
\addcontentsline{toc}{part}{#1}%
|
|
||||||
\fi%
|
|
||||||
{
|
|
||||||
\centering
|
|
||||||
\newpagecolor{structurecolor!10}\afterpage{\restorepagecolor}
|
|
||||||
\interlinepenalty \@M
|
|
||||||
\normalfont
|
|
||||||
\vskip 30\p@
|
|
||||||
\hspace{-\the\mylmargin}
|
|
||||||
\fboxsep0pt
|
|
||||||
\colorbox{white}{
|
|
||||||
\begin{minipage}[c]{1.0\paperwidth}
|
|
||||||
\centering
|
|
||||||
\parbox{0.7\textwidth}{
|
|
||||||
\centering
|
|
||||||
\vspace*{1.5\baselineskip}
|
|
||||||
\Huge\scshape\bfseries \textcolor{structurecolor}{\thepart.\; #2}
|
|
||||||
\vspace*{0.7\baselineskip}}
|
|
||||||
\end{minipage}}}
|
|
||||||
\@endpart}
|
|
||||||
|
|
||||||
|
|
||||||
\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
|
\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
|
||||||
\hbox{}%
|
\hbox{}%
|
||||||
\thispagestyle{empty}%
|
\thispagestyle{empty}%
|
||||||
\newpage%
|
\newpage%
|
||||||
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
|
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
|
||||||
|
|
||||||
|
\usepackage{titletoc}%
|
||||||
|
\titlecontents{chapter}% <section-type>
|
||||||
|
[0pt]% <left>
|
||||||
|
{\vspace{1em}\bfseries}% <above-code>
|
||||||
|
{第~\zhnumber{\thecontentslabel}~章\hspace{0.5em}}% <numbered-entry-format>
|
||||||
|
{}% <numberless-entry-format>
|
||||||
|
{\hspace{0.6em}\hfill\contentspage}% <filler-page-format>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user