%% This work is released under the LaTeX Project Public License, v1.3c or later.
% This template is made by Ethan Lu.
% Please use pdfLaTeX engine!
\documentclass{Beautybook-EN}
\coverstyle={
    cover-choose=en, % cn (Need \entitle{#}); en ; enfig ; birkar
}
\mathstyle={
    math-font=plain, % plain; mtpro2
}
%
\mynewtheorem{
    defi={\textbf{Definition}}[section]{interior style={left color=ReD!8,right color=ReD!5!CyaN!50}, borderline west={1.5mm}{0mm}{ReD}},
    thm={\textbf{Theorem}}[section]{interior style={left color=CyaN!80!black!20,right color=CyaN!80!black!15!CyaN!50}, borderline west={1.5mm}{0mm}{CyaN!80!black}},
    lem={\textbf{Lemma}}[section]{interior style={left color=BluE!8,right color=BluE!5!CyaN!50}, borderline west={1.5mm}{0mm}{BluE}},
    prop={\textbf{Proposition}}[section]{interior style={left color=OrangE!8,right color=OrangE!5!CyaN!50}, borderline west={1.5mm}{0mm}{OrangE}},
    exam={\textbf{Example}}[chapter]{interior style={left color=DarkGreen!8,right color=DarkGreen!5!CyaN!50}, borderline west={1.5mm}{0mm}{DarkGreen}},
    cor={\textbf{Corollary}}[chapter]{interior style={left color=violet!8,right color=violet!5!CyaN!50}, borderline west={1.5mm}{0mm}{violet}},
}
\newtheorem*{remark}{\textbf{Remark}}
\makeatletter
\mynewtcbtheorem{
    theorem={
        counter=tcbthm, 
        the counter=\thesection.\arabic{tcbthm}, 
        name=Theorem,
        thmcolor=purple,
        autoref name=\bfseries Theorem, 
        style={
        arc=3pt,breakable,enhanced,interior style={top color=purple!12 ,middle color=purple!9, bottom color=purple!6},boxrule=0pt,top=8mm,
        fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},% up
        fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},% down
        opacityframe=0, opacityback=0.98,
        fontupper=\itshape, step={tcbthm},
        before pre=\smallskip, after app=\smallskip,
        overlay unbroken=\my@theorem@overlay@unbroken{\theorem@name\ \thetcbthm}{\theorem@thmcolor},
        overlay first=\my@theorem@overlay@first{\theorem@name\ \thetcbthm}{\theorem@thmcolor},
        overlay last=\my@theorem@overlay@last,
        }
    },
    proposition={
        counter=tcbprop, 
        the counter=\thesection.\arabic{tcbprop}, 
        autoref name=\bfseries Proposition, 
        style={
        arc=3pt,breakable,enhanced,interior style={top color=purple!12 ,middle color=purple!9, bottom color=purple!6},boxrule=0pt,top=8mm,
        fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},
        fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},
        opacityframe=0, opacityback=0.98,
        fontupper=\itshape, step={tcbprop},
        before pre=\smallskip, after app=\smallskip,
        overlay unbroken=\my@theorem@overlay@unbroken{Proposition\ \thetcbprop}{purple},
        overlay first=\my@theorem@overlay@first{Proposition\ \thetcbprop}{purple},
        overlay last=\my@theorem@overlay@last{purple},
        }
    },
    definition={
        counter=tcbdefi, 
        the counter=\thesection.\arabic{tcbdefi}, 
        autoref name=\bfseries Definition, 
        style={
        arc=3pt,breakable,enhanced,interior style={top color=blue!12 ,middle color=blue!9, bottom color=blue!6},boxrule=0pt,top=8mm,
        fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},
        fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},
        opacityframe=0, opacityback=0.98,
        fontupper=\itshape, step={tcbdefi},
        before pre=\smallskip, after app=\smallskip,
        overlay unbroken=\my@theorem@overlay@unbroken{Definition\ \thetcbdefi}{blue},
        overlay first=\my@theorem@overlay@first{Definition\ \thetcbdefi}{blue},
        overlay last=\my@theorem@overlay@last{blue},
        }
    },
    lemma={
        counter=tcblem,
        the counter=\thesection.\arabic{tcblem},
        name=Lemma, 
        lemcolor=DarkCyan,
        autoref name=\bfseries Lemma,
        style={
        arc=0mm,breakable,enhanced,interior style={top color=DarkCyan!12 ,middle color=DarkCyan!9, bottom color=DarkCyan!6},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm,
        fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},
        fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},
        opacityframe=0, opacityback=0.98,
        fontupper=\normalsize,step={tcblem},
        before pre=\smallskip, after app=\smallskip,
        overlay unbroken=\my@lemma@overlay@unbroken{\lemma@name\ \thetcblem}{\lemma@lemcolor},
        overlay first=\my@lemma@overlay@first{\lemma@name\ \thetcblem}{\lemma@lemcolor},
        overlay last=\my@lemma@overlay@last{\lemma@lemcolor},
        }
    },
    corollary={
        counter=tcbcor,
        the counter=\thesection.\arabic{tcbcor},
        autoref name=\bfseries Corollary,
        style={
        arc=0mm,breakable,enhanced,interior style={top color=orange!12 ,middle color=orange!9, bottom color=orange!6},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm,
        fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},
        fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},
        opacityframe=0, opacityback=0.98,
        fontupper=\normalsize,step={tcbcor},
        before pre=\smallskip, after app=\smallskip,
        overlay unbroken=\my@lemma@overlay@unbroken{Corollary\ \thetcbcor}{orange},
        overlay first=\my@lemma@overlay@first{Corollary\ \thetcbcor}{orange},
        overlay last=\my@lemma@overlay@last{orange},
        }
    },
    example={
        counter=tcbexam,
        the counter=\thesection.\arabic{tcbexam},
        autoref name=\bfseries Example,
        style={
        arc=0mm,breakable,enhanced,interior style={top color=cyan!12 ,middle color=cyan!9, bottom color=cyan!6},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm,
        fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},
        fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},
        opacityframe=0, opacityback=0.98,
        fontupper=\normalsize,step={tcbexam},
        before pre=\smallskip, after app=\smallskip,
        overlay unbroken=\my@lemma@overlay@unbroken{Example\ \thetcbexam}{cyan},
        overlay first=\my@lemma@overlay@first{Example\ \thetcbexam}{cyan},
        overlay last=\my@lemma@overlay@last{cyan},
        }
    },
    Exercise={
        counter=tcbexer,
        the counter=\thechapter.\arabic{tcbexer},
        autoref name=\bfseries Exercise,
        style={
        arc=0mm,breakable,enhanced,interior style={top color=red!12 ,middle color=red!9, bottom color=red!6},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm,
        fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},
        fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},
        opacityframe=0, opacityback=0.9,
        fontupper=\normalsize,step={tcbexer},
        before pre=\smallskip, after app=\smallskip,
        overlay unbroken=\my@lemma@overlay@unbroken{Exercise\ \thetcbexer}{red},
        overlay first=\my@lemma@overlay@first{Exercise\ \thetcbexer}{red},
        overlay last=\my@lemma@overlay@last{red},
        }
    },
}
\makeatother
%
% \newenvironment{note}[1][\bf Note:]{\par\Line\uuline{#1} }{\par\Line}
% \renewcommand{\Line}{\noindent\tikz\draw[line width=0.65pt,gray!80,dashed] (0,0)--++(.99\linewidth,0);\par}
% % \newcommand{\Wedge}[1][]{\tikz\path [draw,line width=1pt] (0,0)--++(4pt,12pt) node[right,font=\scriptsize] {#1} --++(4pt,-12pt);}
% \newenvironment{key}[1]{\begin{fancybox}{#1}\ }{\end{fancybox}}
% \newcommand{\pr}{^\prime}
% \newcommand{\prr}{^{\prime\prime}}
% \newcommand{\itbf}[1]{\textit{\textbf{#1}}}
\usepackage{listings}
\lstset{
	basicstyle=\small\ttfamily,	
		keywordstyle=\color{NavyBlue}, 
		commentstyle=\color{gray!50!black!50},   	
		stringstyle=\rmfamily\slshape\color{red}, 	
	backgroundcolor=\color{gray!5},     
	frame=leftline,						
	framerule=12pt,%
		rulecolor=\color{gray!90},      
	numbers=left,				
		numberstyle=\footnotesize\itshape,	
		firstnumber=1,
		stepnumber=1,                  	
		numbersep=7pt,               	
	aboveskip=.25em, 			
	showspaces=false,               	
	showstringspaces=false,        
	keepspaces=true, 					
	showtabs=false,                 	
	tabsize=2,                     		
	captionpos=b,                   	
	flexiblecolumns=true, 			
	breaklines=true,                	
	breakatwhitespace=false,        	
	breakautoindent=true,			
	breakindent=1em, 			
	title=\lstname,				
	escapeinside=``,  		
	xleftmargin=1em,  xrightmargin=1em,     
	aboveskip=1ex, belowskip=1ex,
	framextopmargin=1pt, framexbottommargin=1pt,
        abovecaptionskip=-2pt,belowcaptionskip=3pt,
	extendedchars=false, columns=flexible, mathescape=true,
	texcl=true,
	fontadjust
}%

\begin{document}
%------------ Cover ----------------%
\thispagestyle{empty}
\title{An Introduction to Beautybook template}
\subtitle{}
\edition{First Edition}
\bookseries{Illustrated by Ethan Lu}
\author{Ethan Lu}
\pressname{logo}
\presslogo{inner_pics/logo.png}
\coverimage{inner_pics/ivy-ge998908f8_1280.jpg}
\makecover
% Theme color
\definecolor{bg}{HTML}{e0e0e0}
\definecolor{fg}{HTML}{203A43}
\colorlet{outermarginbgcolor}{bg}
\colorlet{outermarginfgcolor}{fg}
\colorlet{framegolden}{fg}
\colorlet{framegray}{bg!50}
\chapoddimage{inner_pics/songodd.png}
\chapevenimage{inner_pics/songeven.png}
%
\thispagestyle{empty}\newpage % left blank
\frontmatter
\pagenumbering{Roman}
% preface
\thispagestyle{empty}
\addcontentsline{toc}{chapter}{Preface}
\chapter*{Preface}
As my first english book, i'm happy.

\hfill
\begin{tabular}{lr}
    &----- Ethan Lu\\ 
    &2023-01-11
\end{tabular}

\let\cleardoublepage\clearpage
%
\thispagestyle{empty}
\tableofcontents\let\cleardoublepage\clearpage


\mainmatter
\pagenumbering{arabic}

\partimage{inner_pics/part.png}
\partabstract{\hspace*{2em} Here is the introduction area of each part, where you can write a concise overview of the part, of course, if there is nothing to say, you can leave it blank.}
\part{The template usage introduction of \textbf{Beautybook}}
\chapter{A short introduction of \textbf{Beautybook}}

The Beauty\LaTeX{} collection is a series of templates authored by a humble, unknown individual. In fact, there are only two series, one is the custom book template \textbf{fancybook } , which is dedicated to the fresh and elegant style, the other is my flagship product-\textbf{ Beautybook } !  Why did I choose such an unusual name? My answer is, originally I wanted to name it elegantboook, but there is already the famous elegantbook template. Inspired by the old poem "There is a jade-like beauty waiting for you in the book", the template is named ``Beautybook", which means a beautiful woman in your arms and the fragrance of a book overflowing! Therefore, this is the origin of the name \textbf{Beautybook } !


I am committed to creating a series of beautiful, elegant, simple template to facilitate the use of users and myself. Version changes frequently, please pay attention to version information. Before starting to use templates, it is recommended to choose the latest official version! The latest test version will usually be released in the QQ Group, you can download it and try it yourself!


This article covers some of the setup and basic usage of this template. If you have any other questions, suggestions or comments, feel free to submit them to me on GitHub
\href{https://github.com/BeautyLaTeX/latex-template/issues}{issues} or \href{h1479840692@163.com}{163 mail} or QQ mail \href{1479840692@qq.com}{QQ mail}. 


The Project Addresses are the following.
\begin{itemize}
  \item GitHub repository: \href{https://github.com/BeautyLaTeX/latex-template}{https://github.com/BeautyLaTeX/latex-template},
  \item Download Release: \href{https://github.com/BeautyLaTeX/latex-template/releases}{Official release},
  \item User QQ Group: 809237593. (!If you are not in China, please e-mail me at \href{h1479840692@outlook.com}{outlook-email}.)
\end{itemize}

\textit{This work is released under the LaTeX Project Public License, v1.3c or later.}

\section{Installation and Maintenance of Template}

There are two ways you can use this template. The first method is trivial that just download the zip of template from above channel, and then unzip and compile the main file in the archive (i.e. a file with a name like ``Beautybook-xx. tex"). The second way is uploading the zip of template to \texttt{overleaf} to comply.

Note that if you choose the second way,  you must write \lstinline{math-font=plain} in the premble of the main file!

It is worth noting that when you download the template from CTAN, then the English version of it does not use any third-party fonts, so that one can be compiled using \texttt{pdflatex}. This is an exception to the rule under which all other files must be compiled using the \texttt{XeLaTeX} engine.

\subsection{Local Installation}

To install locally, follow these steps: download the latest version from GitHub, CTAN or the QQ group. Then place the template files in your working directory and copy these folders synchronously: \texttt{fonts}, \texttt{stys}, \texttt{figures}, \texttt{inner\_pics}, and \texttt{frontmatter}, in order to utilize them. (If you are a chinese user, you can choose to copy the chinesefonts folder.) The advantage of this is that you can install \texttt{mtpro2} font to achieve a more elegant effect than if you were using it online. Of course, the choice is left to the users, and I won't comment here.

The following is an example of a minimal work:
\begin{lstlisting}
    \documentclass{Beautybook-EN}
    \coverstyle={
        cover-choose=en, % cn (Need \entitle{#}); en ; enfig ; birkar
    }
    \mathstyle={
        math-font=plain, % plain; mtpro2
    }
\graphicspath{{E:/texlive/2023/texmf-dist/doc/latex/beautybook/}} % You must change it to your texlive installation address!!
%
    \mynewtheorem{
        defi={\textbf{Definition}}[section]{interior style={left color=ReD!8,right color=ReD!5!CyaN!50}, borderline west={1.5mm}{0mm}{ReD}},
        thm={\textbf{Theorem}}[section]{interior style={left color=CyaN!80!black!20,right color=CyaN!80!black!15!CyaN!50}, borderline west={1.5mm}{0mm}{CyaN!80!black}},
        lem={\textbf{Lemma}}[section]{interior style={left color=BluE!8,right color=BluE!5!CyaN!50}, borderline west={1.5mm}{0mm}{BluE}},
        prop={\textbf{Proposition}}[section]{interior style={left color=OrangE!8,right color=OrangE!5!CyaN!50}, borderline west={1.5mm}{0mm}{OrangE}},
        exam={\textbf{Example}}[chapter]{interior style={left color=DarkGreen!8,right color=DarkGreen!5!CyaN!50}, borderline west={1.5mm}{0mm}{DarkGreen}},
        cor={\textbf{Corollary}}[chapter]{interior style={left color=violet!8,right color=violet!5!CyaN!50}, borderline west={1.5mm}{0mm}{violet}},
    }
    \newtheorem*{remark}{\textbf{Remark}}
    \makeatletter
    \mynewtcbtheorem{
        theorem={
            counter=tcbthm, 
            the counter=\thesection.\arabic{tcbthm}, 
            name=Theorem,
            thmcolor=purple,
            autoref name=\bfseries Theorem, 
            style={
            arc=3pt,breakable,enhanced,interior style={top color=purple!12 ,middle color=purple!9, bottom color=purple!6},boxrule=0pt,top=8mm,
            fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},% up
            fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},% down
            opacityframe=0, opacityback=0.98,
            fontupper=\itshape, step={tcbthm},
            before pre=\smallskip, after app=\smallskip,
            overlay unbroken=\my@theorem@overlay@unbroken{\theorem@name\ \thetcbthm}{\theorem@thmcolor},
            overlay first=\my@theorem@overlay@first{\theorem@name\ \thetcbthm}{\theorem@thmcolor},
            overlay last=\my@theorem@overlay@last,
            }
        },
        proposition={
            counter=tcbprop, 
            the counter=\thesection.\arabic{tcbprop}, 
            autoref name=\bfseries Proposition, 
            style={
            arc=3pt,breakable,enhanced,interior style={top color=purple!12 ,middle color=purple!9, bottom color=purple!6},boxrule=0pt,top=8mm,
            fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},
            fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},
            opacityframe=0, opacityback=0.98,
            fontupper=\itshape, step={tcbprop},
            before pre=\smallskip, after app=\smallskip,
            overlay unbroken=\my@theorem@overlay@unbroken{Proposition\ \thetcbprop}{purple},
            overlay first=\my@theorem@overlay@first{Proposition\ \thetcbprop}{purple},
            overlay last=\my@theorem@overlay@last{purple},
            }
        },
        definition={
            counter=tcbdefi, 
            the counter=\thesection.\arabic{tcbdefi}, 
            autoref name=\bfseries Definition, 
            style={
            arc=3pt,breakable,enhanced,interior style={top color=blue!12 ,middle color=blue!9, bottom color=blue!6},boxrule=0pt,top=8mm,
            fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},
            fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},
            opacityframe=0, opacityback=0.98,
            fontupper=\itshape, step={tcbdefi},
            before pre=\smallskip, after app=\smallskip,
            overlay unbroken=\my@theorem@overlay@unbroken{Definition\ \thetcbdefi}{blue},
            overlay first=\my@theorem@overlay@first{Definition\ \thetcbdefi}{blue},
            overlay last=\my@theorem@overlay@last{blue},
            }
        },
        lemma={
            counter=tcblem,
            the counter=\thesection.\arabic{tcblem},
            name=Lemma, 
            lemcolor=DarkCyan,
            autoref name=\bfseries Lemma,
            style={
            arc=0mm,breakable,enhanced,interior style={top color=DarkCyan!12 ,middle color=DarkCyan!9, bottom color=DarkCyan!6},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm,
            fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},
            fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},
            opacityframe=0, opacityback=0.98,
            fontupper=\normalsize,step={tcblem},
            before pre=\smallskip, after app=\smallskip,
            overlay unbroken=\my@lemma@overlay@unbroken{\lemma@name\ \thetcblem}{\lemma@lemcolor},
            overlay first=\my@lemma@overlay@first{\lemma@name\ \thetcblem}{\lemma@lemcolor},
            overlay last=\my@lemma@overlay@last{\lemma@lemcolor},
            }
        },
        corollary={
            counter=tcbcor,
            the counter=\thesection.\arabic{tcbcor},
            autoref name=\bfseries Corollary,
            style={
            arc=0mm,breakable,enhanced,interior style={top color=orange!12 ,middle color=orange!9, bottom color=orange!6},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm,
            fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},
            fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},
            opacityframe=0, opacityback=0.98,
            fontupper=\normalsize,step={tcbcor},
            before pre=\smallskip, after app=\smallskip,
            overlay unbroken=\my@lemma@overlay@unbroken{Corollary\ \thetcbcor}{orange},
            overlay first=\my@lemma@overlay@first{Corollary\ \thetcbcor}{orange},
            overlay last=\my@lemma@overlay@last{orange},
            }
        },
        example={
            counter=tcbexam,
            the counter=\thesection.\arabic{tcbexam},
            autoref name=\bfseries Example,
            style={
            arc=0mm,breakable,enhanced,interior style={top color=cyan!12 ,middle color=cyan!9, bottom color=cyan!6},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm,
            fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},
            fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},
            opacityframe=0, opacityback=0.98,
            fontupper=\normalsize,step={tcbexam},
            before pre=\smallskip, after app=\smallskip,
            overlay unbroken=\my@lemma@overlay@unbroken{Example\ \thetcbexam}{cyan},
            overlay first=\my@lemma@overlay@first{Example\ \thetcbexam}{cyan},
            overlay last=\my@lemma@overlay@last{cyan},
            }
        },
        Exercise={
            counter=tcbexer,
            the counter=\thechapter.\arabic{tcbexer},
            autoref name=\bfseries Exercise,
            style={
            arc=0mm,breakable,enhanced,interior style={top color=red!12 ,middle color=red!9, bottom color=red!6},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm,
            fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},
            fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},
            opacityframe=0, opacityback=0.9,
            fontupper=\normalsize,step={tcbexer},
            before pre=\smallskip, after app=\smallskip,
            overlay unbroken=\my@lemma@overlay@unbroken{Exercise\ \thetcbexer}{red},
            overlay first=\my@lemma@overlay@first{Exercise\ \thetcbexer}{red},
            overlay last=\my@lemma@overlay@last{red},
            }
        },
    }
    \makeatother
    %
    
\begin{document}
%------------ Cover ----------------%
\thispagestyle{empty}
\title{An Introduction to Beautybook template}
\subtitle{}
\edition{First Edition}
\bookseries{Illustrated by Ethan Lu}
\author{Ethan Lu}
\pressname{logo}
\presslogo{inner_pics/logo.png}
\coverimage{inner_pics/ivy-ge998908f8_1280.jpg}
\makecover
% Theme color
\definecolor{bg}{HTML}{e0e0e0}
\definecolor{fg}{HTML}{203A43}
\colorlet{outermarginbgcolor}{bg}
\colorlet{outermarginfgcolor}{fg}
\colorlet{framegolden}{fg}
\colorlet{framegray}{bg!50}
\chapoddimage{inner_pics/songodd.png}
\chapevenimage{inner_pics/songeven.png}
%
\thispagestyle{empty}\newpage % left blank
\frontmatter
\pagenumbering{Roman}
% preface
\thispagestyle{empty}
\addcontentsline{toc}{chapter}{Preface}
\chapter*{Preface}
As my first english book, i'm happy.

\hfill
\begin{tabular}{lr}
    &----- Ethan Lu\\ 
    &2023-01-11
\end{tabular}

\begin{center}
    \vfill
    \thepage
\end{center}
\let\cleardoublepage\clearpage
%
\thispagestyle{empty}
\tableofcontents\let\cleardoublepage\clearpage


\mainmatter
\pagenumbering{arabic}

\partimage{inner_pics/part.png}
\partabstract{\hspace*{2em} Here is the introduction area of each part, where you can write a concise overview of the part, of course, if there is nothing to say, you can leave it blank.}
\part{part title}
\chapter{chap title}
% your main contents here!

{\printbibliography[
heading=bibintoc,
title={References}
]
\printindex
\thispagestyle{empty}}
%--------- Bottom page -------%
\bottomimage{inner_pics/ivy-ge998908f8_1280.jpg}
\ISBNcode{\EANisbn[ISBN=978-80-7340-097-2]} %If no use, delete this line!
\summary{This is the area of the bottom information!}
\makebottomcover
\end{document} 
\end{lstlisting}

\subsection{Release installation and updates}

The test environment for this template is
\begin{enumerate}
\item Win11 22H2 + \TeX{} Live 2023;
\end{enumerate}

For the installation of \TeX Live/Mac\TeX{} , please refer to articles online, which is omitted here.

After installing \TeX{} Live, it is recommended to upgrade all macro packages after installation, upgrade methods: use ``cmd" or ``terminal" to run \lstinline{tlmgr update --all}, if tlmgr needs to be updated, use cmd to run \lstinline{tlmgr update --self}, if there is a break in the update process, please use \lstinline{tlmgr update -- self --all --reinstall-forcibly-removed} update, that is

\begin{lstlisting}
tlmgr update --self 
tlmgr update --all
tlmgr update --self --all --reinstall-forcibly-removed
\end{lstlisting}

Please refer to \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \TeX{} distribution?} for more information.

\chapter{The setting of Beautybook Template}

The English version of this template is based on the basic ``book" class, and the Chinese version is based on the ``ctexbook" class, so the option of book or ctexbook is also valid for this template. The default encoding is \texttt{UTF-8}, and it is recommended to compile with \TeX{} Live.

\section{Language Mode}

This template includes two basic locales: \lstinline{Beautybook-CN.cls} in Chinese and \lstinline{Beautybook-EN.cls} in English. Changing the locales alters the headings (including figures and tables) of the chart title, the article formatting (such as table of contents and references), and the language used for theorem contexts (such as Theorem, Lemma, etc.). You can switch between these language modes using the following instructions in the top of the premble:

\begin{lstlisting}
\documentclass{Beautybook-CN} % chinese
\documentclass{Beautybook-EN} % english
\end{lstlisting}

In addition to the two language settings that come with the template, if you need to use another language, you can do so by modifying the \texttt{.cls} file as follows

\begin{enumerate}
    \item Change the name of the part environment \lstinline{Part\ \thepart} to \lstinline{(translation of part in your language)\ \thepart}
    \item Theorem environment guide words in premble, such as Theorem.
    \item Please remember that only Asian languages can be modified based on \lstinline{Beautybook-CN.cls}, other foreign languages need to be modified based on \lstinline{Beautybook-EN.cls}.
\end{enumerate}

\section{Theme Color}

The colors of this template can be configured according to personal preferences in the following way :

\begin{lstlisting}
    \definecolor{bg}{HTML}{e0e0e0} % Overall style background color % i.e. theme light color
    \definecolor{fg}{HTML}{455a64} % Overall style foreground color   % i.e. theme dark color
    %% The colors below are in the stys/bottompage.sty file
    \definecolor{coverbgcolor}{HTML}{f9b868}      % Cover and bottom page background color
    \definecolor{coverfgcolor}{HTML}{503D4B}     % foreground color on the front and back covers
    \definecolor{coverbar}{HTML}{BF8E6F}             % cover bar color
    \definecolor{bottomcolor}{HTML}{B3686A}      % The theme color of bottom page
    %%%%%%%%%%%%%%%%%%%%%%%%
    \colorlet{framegolden}{fg}                                 % Antique box's line color
    \colorlet{framegray}{Dilu!5}                               % Antique box's background color
\end{lstlisting}

In the preamble of the main file, certain theorem environments' colors can be set. This will be further explained in the upcoming section on mathematical environments.

Here it is recommended to use the color configuration of the cncolours macro package developed by Lin Lianzhi, and you can select the appropriate color for comparison. 


\section{Choice of Cover}
\subsection{How to choose your favorite cover?}

This template has multiple sets of covers that can be used at will, and the use of them is as follows:

\begin{enumerate}
    \item Chinese classic cover (Chinese default) --corresponding macro package \lstinline{cover-choose=cn} ,
    \item Springer Classic Cover No. 1 (English default) --corresponding to the macro package \lstinline{cover-choose=en} ,
    \item Springer Classic Cover No. 2 (image background) --corresponding to macro package \lstinline{cover-choose=enfig} ,
    \item Springer Classic cover No. 3 (Geometric style) --corresponding to the macro package \lstinline{cover-choose=birkar} .
    
    Note that the information corresponding to the cover is not the same, look at the above example, just follow the requirements.
\end{enumerate}

\begin{table}[htbp]
  \centering
  \caption{cover element information}
  \begin{tabular}{cccccc}
    \hline
    Information & Commands & Information & Commands & Information & Commands \\
    \hline
    Title & \lstinline|\title| & subtitle & \lstinline|\subtitle| & author & \lstinline|\author| \\
    Publisher & \lstinline|\pressname| & Version & \lstinline|\edition| & cover image & \lstinline|\coverimage|\\
    Logo & \lstinline|\presslogo| & English title (cn)&\lstinline|\entitle|&&\\
    \hline
  \end{tabular}
\end{table}

\subsection{Logo}

You can search and obtain the publisher's logo yourself. To avoid copyright infringement, please ensure to choose a proper and lawful image when replacing the current one.

\subsection{Custom Cover}

Moreover, in case you opt for a personalized cover, say an A4 PDF file created through Adobe Illustrator or any other software, comment out the \lstinline{\makecover} command, and subsequently include the custom cover using the \lstinline{pdfpages} macro package. Likewise, if you utilize the \lstinline{titlepage} environment.

\section{Title Style}

This template is fully customized for section headings, if this is not to your liking, you can comment them out to restore the default style.

\section{Introduction to the Mathematical Environments}

Our template includes four distinct theorem environments. These consist of the default theorem style provided by ``amsthm" in simple mode, as well as a custom style provided by ``thmtools." Additionally, we offer a color emphasis box style, an exquisite box style that I developed, and an ancient style box provided by Mr. Wuyue, which can also be used as a theorem box.

\subsection{Usage of theorem environments}

Here is the effect of the theorem environment provided by amsthm.
\subsubsection{amsthm}

\begin{remark}
    This is an amsthm-based annotation environment
\end{remark}

\subsubsection{thmtools}

\begin{proof}[description of proof]
    Proof environment
\end{proof}

\begin{solution}[description of solution]
    Solution environment
\end{solution}

\subsubsection{Color emphasis box style}

\begin{defi}[name of the definition]\label{defi:def test}
    The first defines the environment
\end{defi}

\begin{thm}[name of the thm]\label{thm:thm test}
    The first theorem environment
\end{thm}

\begin{cor}[name of the corollary]\label{cor:cor test}
    The first inference environment
\end{cor}

\begin{prop}[name of the prop]\label{prop:prop test}
    The first propositional environment
\end{prop}

\begin{exam}[name of the example]\label{exam:exam test}
    The first example problem environment
\end{exam}

\begin{lem}[name of the lem]\label{lem:lem test}
    The first lemma environment
\end{lem}

% \clearpage

\section{Two exquisite theorem boxes crafted by the author!}

\begin{definition}[][Name][def label] 
    Here are the guidelines for using these two boxes.

\begin{itemize}
        \item If the theorem name and label are both empty, you can write it like this : 
    \begin{lstlisting}
        \begin{definition}
            Define the environment content
        \end{definition}
    \end{lstlisting}
        \item If you don't have a label but have a name, use it as 
        \begin{lstlisting}
            \begin{definition}[][Name]
                Define the environment content
            \end{definition}
        \end{lstlisting}
        \item If you have a tag, then whether or not it has a name, use it as 
        \begin{lstlisting}
            \begin{definition}[][Yes, fill in, no blank][Tag]
                Define the environment content
            \end{definition}
        \end{lstlisting}
        \item If you want to change some setting options of the box, such as bordering, etc., use it as
        \begin{lstlisting}
            \begin{definition}[tcolorbox options][If so, write the name, if not, delete it along with the outside brackets.][tag (Here is where the label is written, if there is no label should be deleted together with the outside brackets.)]
                Define the environment content
            \end{definition}
        \end{lstlisting}
    \end{itemize}

\end{definition}

\begin{theorem}
    The usage is the same as above, refer to the tag \ref{def label} below or you can \autoref{def label}.
\end{theorem}

\begin{lemma}
    The usage is the same as above, refer to the tag \ref{def label} below or you can \autoref{def label}.
\end{lemma}

\begin{corollary}
    The usage is the same as above, refer to the tag \ref{def label} below or you can \autoref{def label}.
\end{corollary}

\begin{example}
    The usage is the same as above, refer to the tag \ref{def label} below or you can \autoref{def label}.
\end{example}

\paragraph*{Ancient style box}
\begin{fancybox}
    Test ancient style box , you can use it to nest outside of other environments arbitrarily!
\end{fancybox}

\subsection{Theorem counter adjustment}

If you want to modify the theorem environment to count by section, you can modify the \lstinline{chapter} in the counter option \lstinline{ counter/.code}, the available options are \lstinline{chapter} (default) and \lstinline{section}, \lstinline{subsection}, etc.

\subsection{How to define a new theorem environment?}

There are four ways in which users can define their own theorem environments. Among them amsthm and thmtools can be learned through their macro package documentations. The latter two theorems are defined in the following way.

For example, in premble of the main file, you can write it as
\begin{lstlisting}
    % This is the first one.
    \mynewtheorem{
        defi={\textbf{Definition}}[section]{interior style={left color=ReD!8,right color=ReD!5!CyaN!50}, borderline west={1.5mm}{0mm}{ReD}},  % It is a example of the first one, then you can mimic it to build the theorem setting you need.
    }

    % This is the second one.
    <environment name>={
        counter=tcb<theorem counter>, 
        the counter=\thesection.\arabic{tcb<theorem counter>}, 
        autoref name=\bfseries <environment name>, 
        style={
        arc=3pt,breakable,enhanced,interior style={top color=<your color>!12 ,middle color=<your color>!9, bottom color=<your color>!6},boxrule=0pt,top=8mm,
        fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},
        fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},
        opacityframe=0, opacityback=0.98,
        fontupper=\itshape, step={tcb<theorem counter>},
        before pre=\smallskip, after app=\smallskip,
        overlay unbroken=\my@theorem@overlay@unbroken{<environment name>\ \thetcb<theorem counter>}{<your color>},
        overlay first=\my@theorem@overlay@first{<environment name>\ \thetcb<theorem counter>}{<your color>},
        overlay last=\my@theorem@overlay@last{<your color>},
        }
    },
    <environment name>={
        counter=tcb<theorem counter>,
        the counter=\thesection.\arabic{tcb<theorem counter>},
        autoref name=\bfseries <environment name>,
        style={
        arc=0mm,breakable,enhanced,interior style={top color=<your color>!12 ,middle color=<your color>!9, bottom color=<your color>!6},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm,
        fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},
        fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},
        opacityframe=0, opacityback=0.98,
        fontupper=\normalsize,step={tcb<theorem counter>},
        before pre=\smallskip, after app=\smallskip,
        overlay unbroken=\my@lemma@overlay@unbroken{<environment name>\ \thetcb<theorem counter>}{<your color>},
        overlay first=\my@lemma@overlay@first{<environment name>\ \thetcb<theorem counter>}{<your color>},
        overlay last=\my@lemma@overlay@last{<your color>},
        }
    },
}
\end{lstlisting}

\begin{remark}
 Change the folllowing parts :
 \begin{center}
     \begin{tabular}{ccc}\hline
    <environment name> & $\to$ & your new defined theorem name \\ 
    <theorem counter > & $\to$ & your new defined theorem counter \\ 
    <your color> & $\to$ & your new defined theorem color \\ \hline
 \end{tabular}
 \end{center}
\end{remark}

\section{list environment}
This template is customizable with the help of \lstinline{enumitem}, see the enumitem macro package documentation. Here are two examples.\\[2ex]
\begin{minipage}[b]{0.49\textwidth}
  \begin{itemize}[label=$\bigodot $]
    \item first item of nesti;
    \item second item of nesti;
      \begin{itemize}
        \item first item of nestii;
        \item second item of nestii;
        \begin{itemize}
          \item first item of nestiii;
          \item second item of nestiii.
        \end{itemize}   
      \end{itemize}
  \end{itemize}
\end{minipage}
\begin{minipage}[b]{0.49\textwidth}
  \begin{enumerate}[label=\arabic*)]
    \item first item of nesti;
    \item second item of nesti;
      \begin{enumerate}
        \item first item of nestii;
        \item second item of nestii;
        \begin{enumerate}
          \item first item of nestiii;
          \item second item of nestiii.
        \end{enumerate}   
      \end{enumerate}
  \end{enumerate}
\end{minipage}

\section{References}

\subsection{print reference}

\lstinline{ref.bib} is a file stored in the reference and needs to be placed in the working folder.

\subsection{modify reference format}

In addition, this template calls the Biblatex macro package and provides Biber engine to compile references. Of course, you can also directly delete the Biblatex macro package in cls file (the last few lines of cls) to use Bibtex.

For bib items, you can pick them up in Google Scholar, Mendeley, Endnote and add them to \lstinline{ref.bib}. When quoting in the text, just quote their bib key.

The default reference style used by the template is ``GB7714-2015". There is a simple reference example. \cite{Huybrechts2010Complex}

If you need to set to a numeric style, you need to change the ``GB7714-2015" in the biblatex macro package option to ``numerical".

\begin{lstlisting}
\usepackage[
backend=biber, % can be changed to bibtex (or simply delete bibtex)
style=GB7714-2015, % can be changed to numerical
sorting=nty
]{biblatex}
\addbibresource{ref.bib}
\end{lstlisting}

\chapter{Font options (Chinese users only, English users please do not omit the contents of this chapter.)}

The reason why the font options are independent is that we hope that users of this template care about the fonts used by the template, know the fonts they use and encounter font-related problems more easily to find answers.

This template uses ctexbook class, so the fontset is consistent with it. The default option is \lstinline{fontset=windows}. If not necessary, the font should not be changed.  If you do have a need for third-party fonts, then you can set them up as follows.

\begin{lstlisting}
    \setCJKmainfont[Path=fonts/,BoldFont={XX.TTF},ItalicFont={YY.TTF},SlantedFont = {ZZ.TTF} , SlantedFeatures = {FakeSlant}]{WW.TTF}
    \setCJKsansfont[Path=fonts/,BoldFont={XX.TTF},ItalicFont={XX.TTF}]{XX.TTF}
    \setCJKmonofont[Path=fonts/,BoldFont={XX.TTF},ItalicFont={XX.TTF}]{XX.TTF}
    % Setting new CJK font family
    \newCJKfontfamily[song]\songti{XX.TTF}[Path=fonts/]
    % Setting new font family
    \newfontfamily\largetitlestyle[Path=fonts/]{XX.TTF}
\end{lstlisting}



%\appendix 



{\printbibliography[
heading=bibintoc,
title={References}
]
\printindex
\thispagestyle{empty}}
\bottomimage{inner_pics/ivy-ge998908f8_1280.jpg}
\ISBNcode{\EANisbn[ISBN=978-80-7340-097-2]} %
\summary{This is the area of the bottom information!}
\makebottomcover
\end{document} 