remove pagestyles from titlesec pkg and set parindent for lang=cn

This commit is contained in:
EthanDeng
2019-09-23 19:51:06 +08:00
parent b8c165a6b7
commit ce8c1d582d
4 changed files with 59 additions and 12 deletions

BIN
ceshi.pdf Normal file

Binary file not shown.

28
ceshi.tex Normal file
View File

@@ -0,0 +1,28 @@
\documentclass[cn,11pt,onecol,color=black]{elegantbook}
% \usepackage{titlesec}
\usepackage{float}
\makeatletter
\@addtoreset{chapter}{part}
\makeatother
\renewcommand{\thetable}{\arabic{table}}
\title{ElegantBook优美的 \LaTeX{} 书籍模板}
\subtitle{Elegant\LaTeX{} 经典之作}
\author{Ethan Deng \& Liam Huang}
\institute{Elegant\LaTeX{} Program}
\date{\today}
\version{3.09}
\extrainfo{Victory won\rq t come to us unless we go to it. --- M. Moore}
\logo{logo.png}
\cover{cover.jpg}
\begin{document}
\maketitle
\tableofcontents
\mainmatter
\hypersetup{pageanchor=true}
\part{1部分}
\chapter{章1}
\chapter{章2}
\part{2部分}
\chapter{章3}
\chapter{章1}
\end{document}

View File

@@ -1,4 +1,4 @@
\documentclass[cn,11pt,twocol]{elegantbook} \documentclass[cn,11pt]{elegantbook}
\title{ElegantBook优美的 \LaTeX{} 书籍模板} \title{ElegantBook优美的 \LaTeX{} 书籍模板}
\subtitle{Elegant\LaTeX{} 经典之作} \subtitle{Elegant\LaTeX{} 经典之作}
@@ -18,7 +18,7 @@
\maketitle \maketitle
\tableofcontents \tableofcontents
% \thispagestyle{empty}
\mainmatter \mainmatter
\hypersetup{pageanchor=true} \hypersetup{pageanchor=true}
@@ -431,6 +431,15 @@ The content of introduction.
\item exercise 1 \item exercise 1
\item exercise 2 \item exercise 2
\item exercise 3 \item exercise 3
\item 测试数学公式
\begin{equation}
a^2+b^2=c^2
\end{equation}
\item 测试插图
\begin{figure}[htp]
\centering
\includegraphics[width=0.2\textwidth]{logo.png}
\end{figure}
\end{problemset} \end{problemset}
\begin{remark} \begin{remark}
@@ -513,6 +522,7 @@ LaTeX Error:
\chapter{ElegantBook 写作示例} \chapter{ElegantBook 写作示例}
\begin{introduction} \begin{introduction}
@@ -586,6 +596,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
\label{eq:461} \label{eq:461}
\int_{\mathcal{R}^p\times\mathcal{R}^q} f(x,y) dxdy=\int_{\mathcal{R}^p}\left(\int_{\mathcal{R}^q}f(x,y)dy\right)dx. \int_{\mathcal{R}^p\times\mathcal{R}^q} f(x,y) dxdy=\int_{\mathcal{R}^p}\left(\int_{\mathcal{R}^q}f(x,y)dy\right)dx.
\end{equation} \end{equation}
2$f(x,y)$$\mathcal{R}^p\times\mathcal{R}^q$ 上的可积函数,则对几乎处处的 $x\in\mathcal{R}^p$$f(x,y)$ 作为 $y$ 的函数是 $\mathcal{R}^q$ 上的可积函数,并且 $g(x)=\int_{\mathcal{R}^q}f(x,y) dy$$\mathcal{R}^p$ 上的可积函数。而且~\ref{eq:461} 成立。 2$f(x,y)$$\mathcal{R}^p\times\mathcal{R}^q$ 上的可积函数,则对几乎处处的 $x\in\mathcal{R}^p$$f(x,y)$ 作为 $y$ 的函数是 $\mathcal{R}^q$ 上的可积函数,并且 $g(x)=\int_{\mathcal{R}^q}f(x,y) dy$$\mathcal{R}^p$ 上的可积函数。而且~\ref{eq:461} 成立。
\end{theorem} \end{theorem}

View File

@@ -77,8 +77,6 @@
\LoadClass[a4paper,oneside]{book} \LoadClass[a4paper,oneside]{book}
\RequirePackage{indentfirst,comment} \RequirePackage{indentfirst,comment}
\setlength\parindent{2em}
% fontsetting % fontsetting
\ifdefstring{\ELEGANT@math}{mtpro2}{ \ifdefstring{\ELEGANT@math}{mtpro2}{
\let\Bbbk\relax \let\Bbbk\relax
@@ -93,7 +91,10 @@
\RequirePackage{ifxetex} \RequirePackage{ifxetex}
% \AtBeginDocument{%
% \addtocontents{toc}{\protect\pagestyle{empty}}%
% \addtocontents{lof}{\protect\thispagestyle{empty}}%
% }
\RequirePackage{newtxtext} \RequirePackage{newtxtext}
\RequirePackage{anyfontsize} \RequirePackage{anyfontsize}
@@ -254,6 +255,7 @@
%% %%
\ifdefstring{\ELEGANT@lang}{cn}{ \ifdefstring{\ELEGANT@lang}{cn}{
\setlength\parindent{2\ccwd}
\renewcommand{\contentsname}{\hspace{2em}} \renewcommand{\contentsname}{\hspace{2em}}
\renewcommand{\figurename}{} \renewcommand{\figurename}{}
\renewcommand{\tablename}{} \renewcommand{\tablename}{}
@@ -278,10 +280,11 @@
}{\relax} }{\relax}
}{\relax} }{\relax}
\ifdefstring{\ELEGANT@lang}{en}{ \ifdefstring{\ELEGANT@lang}{en}{
\newcommand\figref[1]{\textbf{Figure}~\ref{#1}} \setlength\parindent{2em}
\newcommand\tabref[1]{\textbf{Table}~\ref{#1}} \newcommand\figref[1]{\textbf{Figure}~\ref{#1}}
\renewcommand{\chaptername}{Chapter \thechapter} \newcommand\tabref[1]{\textbf{Table}~\ref{#1}}
\bibliographystyle{aer} \renewcommand{\chaptername}{Chapter \thechapter}
\bibliographystyle{aer}
}{\relax} }{\relax}
\RequirePackage{xpatch} \RequirePackage{xpatch}
@@ -357,7 +360,7 @@
\newcommand\email[1]{\href{mailto:#1}{\nolinkurl{#1}}} \newcommand\email[1]{\href{mailto:#1}{\nolinkurl{#1}}}
%% %%
\RequirePackage[center,pagestyles]{titlesec} \RequirePackage[center]{titlesec}
\RequirePackage{apptools} \RequirePackage{apptools}
\RequirePackage[toc,page]{appendix} \RequirePackage[toc,page]{appendix}
@@ -369,8 +372,8 @@
\titleformat{\section}[hang]{\bfseries} \titleformat{\section}[hang]{\bfseries}
{\Large\bfseries{\color{structurecolor}\thesection}\enspace}{1pt}{\color{structurecolor}\Large\bfseries\filright} {\Large\bfseries{\color{structurecolor}\thesection}\enspace}{1pt}{\color{structurecolor}\Large\bfseries\filright}
\titleformat{\subsection}[hang]{\bfseries} \titleformat{\subsection}[hang]{\bfseries}{
{\large\bfseries\color{structurecolor}\thesubsection\enspace}{1pt}{\color{structurecolor}\large\bfseries\filright} \large\bfseries\color{structurecolor}\thesubsection\enspace}{1pt}{\color{structurecolor}\large\bfseries\filright}
\titleformat{\subsubsection}[hang]{\bfseries} \titleformat{\subsubsection}[hang]{\bfseries}
{\large\bfseries\color{structurecolor}\thesubsubsection\enspace}{1pt}{\color{structurecolor}\large\bfseries\filright} {\large\bfseries\color{structurecolor}\thesubsubsection\enspace}{1pt}{\color{structurecolor}\large\bfseries\filright}
@@ -389,11 +392,16 @@
\RequirePackage[many]{tcolorbox} \RequirePackage[many]{tcolorbox}
% \newlength{\normalparindent}
% \setlength{\normalparindent}{\parindent}
\ifdefstring{\ELEGANT@mode}{fancy}{ \ifdefstring{\ELEGANT@mode}{fancy}{
\tcbset{ \tcbset{
common/.style={ common/.style={
fontupper=\ifdefstring{\ELEGANT@lang}{en}{\itshape}{\upshape\kaishu}, fontupper=\ifdefstring{\ELEGANT@lang}{en}{\itshape}{\upshape\kaishu},
lower separated=false, lower separated=false,
% before upper={\setlength{\parindent}{\normalparindent}},
coltitle=white, coltitle=white,
colback=gray!5, colback=gray!5,
boxrule=0.5pt, boxrule=0.5pt,