diff options
author | Norbert Preining <norbert@preining.info> | 2023-06-16 03:00:58 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-06-16 03:00:58 +0000 |
commit | 5a0f1ae73dc99fa5e9279c3ac3612137c55e86b6 (patch) | |
tree | 53475d809bb61ee367335a189fa5fb55d8e7dd2f /macros | |
parent | 9eb6f85105699320d8cbdbb33bcdc88c41ea709a (diff) |
CTAN sync 202306160300
Diffstat (limited to 'macros')
32 files changed, 4176 insertions, 69 deletions
diff --git a/macros/latex/contrib/beautybook/Beautybook-V6.1-CN.cls b/macros/latex/contrib/beautybook/Beautybook-V6.1-CN.cls new file mode 100644 index 0000000000..4e2f170d62 --- /dev/null +++ b/macros/latex/contrib/beautybook/Beautybook-V6.1-CN.cls @@ -0,0 +1,994 @@ +%This Class is based on the default book class and options will be passed +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{Beautybook-V6.1-CN}[01-05-2023 V6.1 Beautybook Class] +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}} +\ProcessOptions\relax +\LoadClass[twoside]{ctexbook} +\overfullrule=1pt +%\usepackage[fontsize=13.5pt]{fontsize} +\usepackage[dvipsnames,svgnames,x11names,table]{xcolor} +\colorlet{outermarginfgcolor}{DarkCyan} % foregroundcolor 较深 +\colorlet{outermarginbgcolor}{DarkCyan!30} % backgroundcolor 较浅 +\definecolor{高粱红}{HTML}{951c48} +\usepackage{cncolours} +\RequirePackage{bropd} % math 自适应数学括号命令 \br{} !!! +\usepackage{tikz-imagelabels} % tikz图像标注 +\usepackage{epigraph-keys} % 名言引用 +\usepackage{fitbox} % 图像自适应 +\usepackage{xeCJKfntef} % 文字两端对齐 +\usepackage{pgfornament-han} +\usepackage{tikz} +\usetikzlibrary{calc,shadows,hobby,intersections, decorations.markings, decorations.pathreplacing,spy,arrows,shapes,fadings,trees,mindmap,patterns,shapes.arrows,shapes.symbols,tikzmark,shapes.geometric,graphs, quotes, angles,decorations.pathmorphing,through,shadings,backgrounds,positioning,fit,arrows.meta,shapes.misc,decorations.shapes} +\RequirePackage{pgfplots} %画图 %%页面样式设计核心包 %提供\pgfonlayer命令以及下列图层指令 +\pgfplotsset{compat=1.18} +% +\ExplSyntaxOn +% 封面切换程序 (LaTeX3)! +\keys_define:nn {Beautybook/coverstyle} + { + cover-choose.choice:, + cover-choose.value_required:n = true, + cover-choose/cn.code:n = {\RequirePackage{stys/Beautybook-cn}}, + cover-choose/en.code:n = {\RequirePackage{stys/Beautybook-en}}, + cover-choose/enfig.code:n = {\RequirePackage{stys/Beautybook-enfig}}, + cover-choose/birkar.code:n = {\RequirePackage{stys/Beautybook-birkar}}, + %cover-choose .initial:n = en , % 设置 en 为初始值 + } +\newtoks \l__Beautybook_tmpa_toks +\cs_new_protected:Npn \coverstyle + { + \tex_afterassignment:D \__Beautybook_set_coverstyle: + \l__Beautybook_tmpa_toks + } +\cs_new:Npn \__Beautybook_set_coverstyle: + { \keys_set:nV { Beautybook / coverstyle } \l__Beautybook_tmpa_toks } +% Math fonts +\keys_define:nn {Beautybook/mathstyle} + { + math-font.choice:, + math-font.value_required:n = true, + math-font/plain.code:n={}, + math-font/mtpro2.code:n = { + \RequirePackage{mtpro2} + \DeclareFontFamily{U}{nxlmi}{} + \DeclareFontSubstitution{U}{nxlmi}{m}{it} + \DeclareFontShape{U}{nxlmi}{m}{it}{ + <-6.3> nxlmi05 + <6.3-8.6> nxlmi07 + <8.6-> nxlmi0 + }{} + + \DeclareFontShape{U}{nxlmi}{b}{it}{ + <-6.3> nxlbmi05 + <6.3-8.6> nxlbmi07 + <8.6-> nxlbmi0 + }{} + \renewcommand{\partial}{{\text{\usefont{U}{nxlmi}{m}{it}\symbol{64}}\mspace{1mu}}} + }, + %cover-choose .initial:n = plain , % 设置 en 为初始值 + } +\cs_new_protected:Npn \mathstyle + { + \tex_afterassignment:D \__Beautybook_set_mathstyle: + \l__Beautybook_tmpa_toks + } +\cs_new:Npn \__Beautybook_set_mathstyle: + { \keys_set:nV { Beautybook / mathstyle } \l__Beautybook_tmpa_toks } +\ExplSyntaxOff +% +\usepackage{stys/Beautybook-bottompage} % 封底 +% +\usepackage{amssymb,amsfonts} +\usepackage{makeidx} +\usepackage{etoolbox} % 判断函数 +\usepackage{paracol} +\usepackage{tikz-cd} +\usepackage{imakeidx} +\usepackage{anyfontsize} +\usepackage{calc} +\usepackage{xkeyval,ifthen} +\usepackage[backgroundcolor=yellow!40!cyan!20,bordercolor=yellow!40!cyan!20,linecolor=DarkCyan]{todonotes} +\usepackage{varwidth} +\usepackage[colorlinks,linkcolor = purple, %%修改此处为你想要的颜色 +anchorcolor = purple, %%修改此处为你想要的颜色 +urlcolor = purple, %%修改此处为你想要的颜色 +citecolor = purple, %%修改此处为你想要的颜色 +]{hyperref} +\setcounter{tocdepth}{3} +\setcounter{secnumdepth}{3}%增加编号深度 +\usepackage{dashrule} +\newlength\outermarginwidth +\setlength\outermarginwidth{1.5cm} +\newlength\covershift +\setlength\covershift{5cm} +\usepackage{caption} +% 图注与表注格式 +\colorlet{captioncolor}{outermarginfgcolor} % 图片和表格题注文字颜色 +\makeatletter +%%----------------------------------封面信息定义--------------------------------------------------------%% +\newcommand\bookseries[1]{\def\@bookseries{#1}} +\newcommand\subtitle[1]{\def\@subtitle{#1}} +\newcommand\edition[1]{\def\@edition{#1}} +\newcommand\presslogo[1]{\def\@presslogo{#1}} +\newcommand\pressname[1]{\def\@pressname{#1}} +\newcommand\coverimage[1]{\def\@coverimage{#1}} +%%----------------------------------封面信息定义--------------------------------------------------------%% +\makeatother +\usepackage{indentfirst} +\usepackage{physics} +\definecolor{nuanbai}{HTML}{f5f5f5} % F5F5F5 +\pagecolor{nuanbai} +\usepackage{amsmath} +\usepackage{zhlipsum} +\setmainfont{XITS} +\usepackage[left=2cm,right=2cm,top=.6cm,bottom=2.2cm]{geometry} +\usepackage{xpatch}%修正章节编号 +\usepackage[automark]{scrlayer-scrpage}%页面设置宏包,隶属于koma-script文档类 +\usepackage{fontawesome5} +\usepackage{mathrsfs} +\usepackage[most]{tcolorbox} +\tcbuselibrary{breakable, skins,theorems}%TcolorBox Library +\usepackage{tabularx} +\usepackage{lastpage} +%\usepackage{twemojis} +\usepackage{ninecolors} +\usepackage{colortbl} %彩色表格 +\RequirePackage{tabularray} +\UseTblrLibrary{amsmath} +% 定义 +array, +matrix, +bmatrix, +Bmatrix, +pmatrix, +vmatrix, +Vmatrix 和 +cases 环境。其 +% 中,每一个环境都类似于不带 + 前缀的环境,但是就像 tblr 环境一样,使用 rowsep=2pt 默认值。 +% 除了+array 环境外,其余的每个环境都可以带一个可选项,通过该可选项,可能为环境设置内部 +% 参数。 +\UseTblrLibrary{booktabs} % 定义 \toprule、 \midrule、\bottomrule 和 \cmidrule 命令,这些命令可以直接用于 tblr环境中 +\UseTblrLibrary{diagbox} % 在tblr 环境中使用 \diagbox 和\diagboxthree 命令排版斜线表头 +\UseTblrLibrary{varwidth} % 为表格添加 measure 内部参数。当设置了 measure=vbox 后,则会使用 \vbox 测量单元格宽度。%可以使用stretch=-1 移除列表环境上下的间距, 注意,stretch=-1 选项也会移除单元格中的支架 +\usepackage{pgfornament} +\usepackage{zhnumber} +\usepackage{dashrule} +\usepackage{adjustbox} +\usepackage{enumitem} +\usepackage{multicol} +\usepackage{amsthm} +\RequirePackage{thmtools,thm-restate}%定理环境 %定理的重写 +\usepackage{bclogo} +\usepackage{ulem} +\RequirePackage{pgfplots} %画图 %%页面样式设计核心包 %提供\pgfonlayer命令以及下列图层指令 +\pgfplotsset{compat=1.18} +\usepackage{graphicx}%修正minipage顶部对齐问题 +\pgfdeclarelayer{background} %背景%底层 +\pgfdeclarelayer{foreground} %上层 +\pgfdeclarelayer{top} %顶部 +\pgfdeclarelayer{bottom} %底部 +\pgfsetlayers{bottom,background,main,foreground,top} +\newcommand{\tikzoverlay}[1]{\begin{tikzpicture}[remember picture,overlay] #1 \end{tikzpicture}} +\usepackage[explicit]{titlesec} +% tcolorbox中插入图片或者tikz绘图方法 +\newcommand\Figure[4]{% + \begin{center} + \captionsetup{type=figure} %消除 Package caption Warning: The option `hypcap=true' will be ignored for this +%(caption) particular \caption on input line XX.警告信息 + \includegraphics[#1]{#2} + \captionof{figure}{#3}\label{#4} + \end{center} +}%用法 : 用于tcolorbox中插入图片 +\newcommand\Tikz[3]{% + \begin{center} + \captionsetup{type=figure} %消除 Package caption Warning: The option `hypcap=true' will be ignored for this(caption) particular \caption on input line XX.警告信息 + #3 %最后一个参数为Tikz画图代码窗口 + \captionof{figure}{#1}\label{#2} %第一与第二个参数是Tikz画图的名称与标签 + \end{center} +} %用法 : 用于tcolorbox中插入Tikz绘图 +%特殊注释矩阵 +\newcommand\coolover[2]{\mathrlap{\smash{\overbrace{\phantom{% + \begin{matrix} #2 \end{matrix}}}^{\mbox{$#1$}}}}#2} + +\newcommand\coolunder[2]{\mathrlap{\smash{\underbrace{\phantom{% + \begin{matrix} #2 \end{matrix}}}_{\mbox{$#1$}}}}#2} + +\newcommand\coolleftbrace[2]{% + #1\left\{\vphantom{\begin{matrix} #2 \end{matrix}}\right.} + +\newcommand\coolrightbrace[2]{% + \left.\vphantom{\begin{matrix} #1 \end{matrix}}\right\}#2} +\definecolor{lightergray}{gray}{0.99} + +\newcommand*{\circled}[1]{\lower.7ex\hbox{\tikz\draw (0pt, 0pt)% + circle (.5em) node {\makebox[1em][c]{\small #1}};}} +\newcommand{\twicecircle}{\raisebox{.7ex}{ + \begin{tikzpicture}[remember picture,overlay] + \draw[line width=0.6pt,black!60] (0,0) circle (3pt); + \fill[black] (0,0) circle (1.6pt) ; + \end{tikzpicture}} +} +\newcommand{\exercise}[2][\bcicosaedre]{\bigskip +\begin{tikzpicture}[remember picture,overlay] +\draw[line width=2pt,loosely dotted,teal] (0,0)--node[pos=0.4,rectangle,minimum height=1.5em,font=\sffamily\Large,text=black,fill=black!2,drop shadow={opacity=.3, shadow xshift=0.1cm},anchor=center, + inner sep=1.5mm, + anchor=west,] {$#1$ ~ #2} (\linewidth,0); +\end{tikzpicture}\bigskip\smallskip +} +\usepackage{extarrows} +\newcommand{\R}{\mathbb{R}} +\newcommand{\F}{\mathcal{F}} +\newcommand{\lan}[1]{\langle #1 \rangle} +\newenvironment{eq}[1]{\begin{equation}\begin{aligned}#1}{\end{aligned}\end{equation}} %有编号 +\newenvironment{eq*}[1]{\begin{equation*}\begin{aligned}#1}{\end{aligned}\end{equation*}} %无编号 +\everymath{\displaystyle} + +%% -------- 章节样式 +\titleformat{\chapter}{\huge\bfseries\filcenter}{}{1em}{ + \makebox[0pt][l]{\def\rad{7pt}% + \begin{tikzpicture}[remember picture, overlay]% + \begin{pgfonlayer}{bottom} + \shade[left color=outermarginbgcolor!20,middle color=outermarginbgcolor!50,right color=outermarginfgcolor!20] (current page.north west) rectangle ++(\paperwidth,-.2\paperheight); % background + \fill[outermarginfgcolor,opacity=.5]([shift={(0,-4.45cm)}]current page.north west) rectangle ++(\paperwidth,-2mm); % line + \end{pgfonlayer} + \path[fill=outermarginfgcolor]node[append after command={ + ([xshift=-3*\rad]chapinfoofpart.north west) to[out=0,in=-180,looseness=1] ([xshift=\rad]chapinfoofpart.south west) --([xshift=-\rad]chapinfoofpart.south east) to[out=0,in=180,looseness=1] ([xshift=3*\rad]chapinfoofpart.north east) --cycle}, + text=white,font=\large\bfseries,align=center,minimum height=1cm] (chapinfoofpart) at ([shift={(.6\linewidth,-4.95cm)}]current page.north west) {Part\ \thepart}; + \begin{pgfonlayer}{bottom} + \fill[outermarginfgcolor!90,opacity=0.5] ([shift={(-3*\rad,0)}]chapinfoofpart.north west) to[out=180,in=0,looseness=1] +(-4*\rad,-1.2cm)--([shift={(7*\rad,-1.2cm)}]chapinfoofpart.north east) to[out=-180,in=0,looseness=1] +(-4*\rad,1.2cm); % partnumber shade + \end{pgfonlayer} + \ifodd\value{page} + \begin{pgfonlayer}{top} + \fill[outermarginfgcolor,opacity=0.8,rounded corners=5pt]node[append after command={([yshift=2cm]chapnum.north west) rectangle (chapnum.south east)},right,text=white,minimum width=2cm,align=center,font=\bf] (chapnum) at ([shift={(2cm,-2.5cm)}]current page.north west) {\scalebox{3}{\thechapter}}; + % \pattern[pattern=sixpointed stars,pattern color=outermarginfgcolor!50,opacity=0.8] + % ([yshift=2cm]chapnum.north west) rectangle (chapnum.south east); + \fill [outermarginfgcolor,path fading=fade up,rounded corners=5pt]% + ([yshift=2cm]chapnum.north west) rectangle (chapnum.south east); + \node[above left,font=\fontsize{25}{25}\selectfont\bfseries,align=center] (contents name) at ([shift={(0cm,-4.45cm)}]current page.north east) {\begin{varwidth}{.7\linewidth}\baselineskip=2ex #1\end{varwidth}}; + \end{pgfonlayer} + \begin{pgfonlayer}{bottom} + \node[right] (image) at ([shift={(-0.5cm,-2.8cm)}]current page.north west) {\includegraphics[width=7cm]{inner_pics/song2.png}}; + \end{pgfonlayer} + \node[above left,font=\fontsize{15}{15}\selectfont,circle,fill=outermarginfgcolor,text=white,inner sep=1mm] (pagenumber) at ([shift={(-5mm,5mm)}]current page.south east) {\thepage}; + \else + \begin{pgfonlayer}{top} + \fill[outermarginfgcolor,opacity=0.8,rounded corners=5pt]node[append after command={([yshift=2cm]chapnum.north west) rectangle (chapnum.south east)},left,text=white,minimum width=2cm,align=center,font=\bf] (chapnum) at ([shift={(-2.0cm,-2.5cm)}]current page.north east) {\scalebox{3}{\thechapter}}; + % \pattern[pattern=sixpointed stars,pattern color=outermarginfgcolor!50,opacity=0.8] + % ([yshift=2cm]chapnum.north west) rectangle (chapnum.south east); + \fill [outermarginfgcolor,path fading=fade up,rounded corners=5pt]% + ([yshift=2cm]chapnum.north west) rectangle (chapnum.south east); + \node[above right,font=\fontsize{25}{25}\selectfont\bfseries,align=center] (contents name) at ([shift={(0cm,-4.45cm)}]current page.north west) {\begin{varwidth}{.7\linewidth}\baselineskip=2ex #1\end{varwidth}}; + \end{pgfonlayer} + \begin{pgfonlayer}{background} + \node[left] (image) at ([shift={(0.5cm,-2.8cm)}]current page.north east) {\includegraphics[width=7cm]{inner_pics/song.png}}; + \end{pgfonlayer} + \node[above right,font=\fontsize{15}{15}\selectfont,circle,fill=outermarginfgcolor,text=white,inner sep=1mm] (pagenumber) at ([shift={(5mm,5mm)}]current page.south west) {\thepage}; + \fi + \fill[outermarginfgcolor,rounded corners=2pt] + (current page.south west) -- ++(1.5mm,1.5mm) --++(\paperwidth-3mm,0mm)--++(1.5mm,-1.5mm)--cycle; + \end{tikzpicture}} + } +\titleformat{name=\chapter,numberless}{\bfseries\huge\filcenter}{}{1em}{ + \begin{tikzpicture}[remember picture, overlay]% + \begin{pgfonlayer}{bottom} + \shade[left color=outermarginbgcolor!10,middle color=outermarginbgcolor!50,right color=outermarginfgcolor!20] (current page.north west) rectangle ++(\paperwidth,-.2\paperheight); + \fill[outermarginfgcolor,opacity=.5]([shift={(0,-4.25cm)}]current page.north west) rectangle ++(\paperwidth,-2mm); + \end{pgfonlayer} + \node[left,font=\huge\bfseries] (contents name) at ([shift={(0cm,-3cm)}]current page.north east) {\begin{varwidth}{.9\linewidth}\baselineskip=2.6ex #1\end{varwidth}}; + \begin{pgfonlayer}{background} + \node[right] (image) at ([shift={(0,-2.2cm)}]current page.north west) {\includegraphics[width=3cm,angle =45]{inner_pics/flower.png}}; + \end{pgfonlayer} + \end{tikzpicture} +} +\titlespacing{\chapter}{0pt}{0pt}{65pt} +% -------- Part定制 +\makeatletter +\newcommand\partabstract[1]{\def\@partabstract{#1}} +\newcommand\partimage[1]{\def\@partimage{#1}} +\titleformat{\part} +{\normalfont\huge\filcenter} +{} +{20pt} +{\begin{tikzpicture}[remember picture,overlay] + \def\barwidth{2cm} + \fill[outermarginbgcolor,opacity=0.6] + (current page.north west) rectangle (current page.south east); + \ifodd\value{page} + \fill[outermarginfgcolor] + (current page.north east) rectangle ++(-\barwidth,-\paperheight); + \node[] (hbar) at ($(current page.north)!0.33!(current page.south)$) { + \begin{tikzpicture} + \fill[white] + (0,0) rectangle ++(\paperwidth,-1cm); + \fill[outermarginbgcolor] + (0,-.25cm) rectangle ++(\paperwidth,-.5cm); + \fill[outermarginfgcolor] + (.67\paperwidth,-.25cm) rectangle ++(4.5cm,-.5cm); + \fill[outermarginfgcolor!20!white] + (.67\paperwidth-1mm,-.25cm) rectangle ++(1mm,-.5cm); + \fill[outermarginfgcolor!20!white] + (.67\paperwidth+4.4cm,-.25cm) rectangle ++(1mm,-.5cm); + \end{tikzpicture} + }; + \node[above,font=\sffamily\huge,shift={(.33\linewidth,.5\barwidth)}] (partname) at (hbar) {第\,\zhnumber{\arabic{part}}\,部\,分}; + \node[below,left,font=\bfseries\huge,shift={(.146\linewidth,-1.5*\barwidth)}] (partcontents) at (partname) {\begin{varwidth}{.8\linewidth}\raggedright\baselineskip=2.8ex #1 \end{varwidth}}; % 标题名称 + \begin{pgfonlayer}{background} + \node[above,shift={(-.4\linewidth,-4*\barwidth)},opacity=0.8] at (partname) {\ifdefvoid{\@partimage}{}{\includegraphics[width=1.2\linewidth]{\@partimage}}}; % 图片位置调整 + \end{pgfonlayer} + \node[above right,font=\fontsize{15}{15}\selectfont,circle,fill=outermarginfgcolor,text=white,inner sep=1mm] (pagenumber) at ([shift={(5mm,5mm)}]current page.south west) {\thepage}; + \else + \fill[outermarginfgcolor] + (current page.north west) rectangle ++(\barwidth,-\paperheight); + \node[] (hbar) at ($(current page.north)!0.33!(current page.south)$) { + \begin{tikzpicture} + \fill[white] + (0,0) rectangle ++(\paperwidth,-1cm); + \fill[outermarginbgcolor] + (0,-.25cm) rectangle ++(\paperwidth,-.5cm); + \fill[outermarginfgcolor] + (.15\paperwidth,-.25cm) rectangle ++(4.5cm,-.5cm); + \fill[outermarginfgcolor!20!white] + (.15\paperwidth-1mm,-.25cm) rectangle ++(1mm,-.5cm); + \fill[outermarginfgcolor!20!white] + (.15\paperwidth+4.5cm,-.25cm) rectangle ++(1mm,-.5cm); + \end{tikzpicture} + }; + \node[above,font=\sffamily\huge,shift={(-.31\linewidth,.5\barwidth)}] (partname) at (hbar) {第\,\zhnumber{\arabic{part}}\,部\,分}; + \node[below right,font=\bfseries\huge,shift={(-.125\linewidth,-1.2*\barwidth)}] (partcontents) at (partname) {\begin{varwidth}{.8\linewidth}\raggedright\baselineskip=2.8ex #1 \end{varwidth}}; % 标题名称 + \begin{pgfonlayer}{background} + \node[above,shift={(.4\linewidth,-4*\barwidth)},opacity=0.8] at (partname) {\ifdefvoid{\@partimage}{}{\includegraphics[width=1.2\linewidth]{\@partimage}}}; % 图片位置调整 + \end{pgfonlayer} + \node[above left,font=\fontsize{15}{15}\selectfont,circle,fill=outermarginfgcolor,text=white,inner sep=1mm] (pagenumber) at ([shift={(-5mm,5mm)}]current page.south east) {\thepage}; + \fi + \node[below,,font=\itshape\fontsize{13}{13}\selectfont,shift={(0\linewidth,-1.65*\barwidth)}] at (hbar) {\ifdefvoid{\@partabstract}{}{\begin{varwidth}{.85\linewidth}\baselineskip=3ex \@partabstract\end{varwidth}}}; % 简介文字调整 + \end{tikzpicture}} +\makeatother +\assignpagestyle{\part}{empty} +\assignpagestyle{\chapter}{empty} +%% -- Section +\titleformat{\section} +{} +{} +{-.5em} %左右移动\thesection标签位置 +{\mysectionformat{#1}} + +\newcommand{\mysectionformat}[1]{% +\makebox[0pt][l]{\def\rad{7pt}% +\begin{tikzpicture}[remember picture] + \path[fill=outermarginfgcolor,drop shadow={opacity=0.3,shadow xshift=.05cm,shadow yshift=-.05cm}]node[append after command={ + ([xshift=\rad]sec.north west) to[out=180,in=0,looseness=1] ([xshift=-3*\rad]sec.south west) --([xshift=-\rad]sec.south east) to[out=0,in=180,looseness=1] ([xshift=3*\rad]sec.north east) --cycle}, + text=white,font=\rmfamily\large\bfseries,align=center,inner ysep=2mm] (sec) at (0,0) {Sec\ \thesection}; + \draw[outermarginbgcolor,line width=0.5pt] (sec.north east)--++(.8\linewidth,0); + \node[text=black,font=\rmfamily\bfseries\Large,below right] (secnum) at ([shift={(0,0mm)}]sec.north east) {\begin{varwidth}{.85\linewidth}\setlength\baselineskip{22.5pt}\hspace{.5cm}#1\end{varwidth}}; +\end{tikzpicture}}}%最后一个选项为 [<after code>] +\titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex} +% 侧边条 +\newlength\chapternumbersize +\setlength\chapternumbersize{40pt} +\setlength{\headheight}{40pt} % 页眉高度 +\usepackage{xpatch} +\usepackage{scrlayer-scrpage} +\renewcommand\chaptermarkformat{} +% define a new mark for the chapter number +\newmarks\chapternum +\xapptocmd\chaptermark{\marks\chapternum{\thechapter}}{}{\PatchFailed} +\newmarks\secnum +\xapptocmd\sectionmark{\marks\secnum{\thesection}}{}{\PatchFailed} + +\newcommand*\outermarginpagemark{% +\tikzoverlay{ + \begin{pgfonlayer}{top} + \ifodd\value{page} + \fill[outermarginfgcolor,rounded corners=2pt] (current page.north east) --++(-5pt,-0.15cm)--++(-\outermarginwidth+10pt,0) --++(-5pt,0.15cm)--cycle; + \coordinate (anchor of headmark) at ([shift={(-1.2\outermarginwidth,-0.2cm)}]current page.north east); + \node[below ,text=outermarginfgcolor,font=\bfseries\fontsize{20}{20}\selectfont] at ([shift={(-.5\outermarginwidth,-0.2cm)}]current page.north east) {\thepage}; + \node[below left,font=\upshape,text=outermarginfgcolor] at (anchor of headmark) {\begin{varwidth}{\linewidth}\rightmark\end{varwidth}}; + \fill[outermarginfgcolor,rounded corners=2pt] (current page.south east) --++(-5pt,0.15cm)--++(-\outermarginwidth+10pt,0) --++(-5pt,-0.15cm)--cycle; + \else + \fill[outermarginfgcolor,rounded corners=2pt] (current page.north west) --++(5pt,-0.15cm)--++(\outermarginwidth-10pt,0) --++(5pt,0.15cm)--cycle; + \coordinate (anchor of headmark) at ([shift={(1.2\outermarginwidth,-0.2cm)}]current page.north west); + \node[below ,text=outermarginfgcolor,font=\bfseries\fontsize{20}{20}\selectfont] at ([shift={(.5\outermarginwidth,-0.2cm)}]current page.north west) {\thepage}; + \node[below right,font=\upshape,text=outermarginfgcolor] at (anchor of headmark) {\begin{varwidth}{\linewidth}\rightmark\end{varwidth}}; + \fill[outermarginfgcolor,rounded corners=2pt] (current page.south west) --++(5pt,0.15cm)--++(\outermarginwidth-10pt,0) --++(5pt,-0.15cm)--cycle; + \fi + \end{pgfonlayer}} +} +\newlength\baryshift +\setlength\baryshift{-2.5\outermarginwidth} +\makeatletter +% Add A Side-Bar Box For The Chapter Number +\newcommand*\outermarginchapternumberbox{% + \if@mainmatter + \tikzoverlay{ + \shade[top color=outermarginfgcolor!90,bottom color=outermarginbgcolor] + (\outermarginwidth,-.5\outermarginwidth) rectangle (0,-1.5\outermarginwidth); + \node[anchor=center,text=white,font=\bfseries] at (1/2*\outermarginwidth,-\outermarginwidth) {\usekomafont{chapternumber}{\botmarks\chapternum}};% + } + \fi + \vfill +} +\makeatother + +\newkomafont{chapternumber}{%页边章节编号字体 + \fontsize{\chapternumbersize}{\chapternumbersize}\selectfont +}% +\makeatletter +\newcommand\outermarginmark{ + \ifodd\value{page}\hfill\else\hspace*{\dimexpr\outermarginwidth*3/8\relax}\fi + \rotatebox{90}{\parbox{\layerheight}{ + \raggedleft + \usekomafont{outermargin}{% + \MakeMarkcase{\ifodd\value{page}\odd@outermargin\else\even@outermargin\fi}}% + }}% + \ifodd\value{page}\hspace*{\dimexpr\outermarginwidth*3/8\relax}\fi% +} +\newcommand*\even@outermargin{} +\newcommand*\odd@outermargin{} +\newcommand*\evenoutermargin[1]{\renewcommand\even@outermargin{#1}}% 偶数页内容 +\newcommand*\oddoutermargin[1]{\renewcommand\odd@outermargin{#1}}% 奇数页内容 +\makeatother +% +\newkomafont{outermargin}{%页边章节名称字体 + \sffamily\bfseries\fontsize{15}{15}\selectfont\color{outermarginfgcolor} +} +% declare new page style using layers +\DeclareNewPageStyleByLayers{scth}{% + scth.outermargin.bg.even,% + scth.outermargin.bg.odd,% + scth.outermargin.fg.even,% + scth.outermargin.fg.odd,% + scth.outermargin.pn.even,% + scth.outermargin.pn.odd,% + scth.outermargin.cn.even,% + scth.outermargin.cn.odd,% + scth.outermargin.text.even,% + scth.outermargin.text.odd% +} +% define the layers for even pages +\DeclareNewLayer[ + background, % 下层(背景) + evenpage, + outermargin, + width=\outermarginwidth, + contents={\color{outermarginbgcolor}\rule{\layerwidth}{\layerheight}} %色彩装饰条 +]{scth.outermargin.bg.even}% +%%=============% 页边条颜色 %=======================%% +\tikzfading[name=fade south, + top color =transparent!0, + bottom color=transparent!80] +\tikzfading[name=fade north, + top color =transparent!100, + bottom color=transparent!0] +%偶数页边纹理效果设置 +\newcommand{\evensidbardeepcolor}{% +\tikzoverlay{ +\ifodd\value{page} +\fill [outermarginfgcolor!20]% + (current page.north east) rectangle ([xshift=-\outermarginwidth,yshift=0]current page.south east); + \pattern [pattern=checkerboard,pattern color=outermarginfgcolor!50]% + (current page.north east) rectangle ([xshift=-\outermarginwidth,yshift=0]current page.south east); + \fill [outermarginbgcolor!90,path fading=fade south]% + ([yshift=1mm]current page.north east) rectangle ([xshift=-\outermarginwidth,yshift=-.5\layerheight]current page.north east); + \fill [outermarginbgcolor,path fading=fade north]% + (current page.south east) rectangle ([xshift=-\outermarginwidth,yshift=.2\layerheight]current page.south east); +\else + \fill [outermarginfgcolor!20]% + (current page.north west) rectangle ([xshift=\outermarginwidth,yshift=0]current page.south west); + \pattern [pattern=checkerboard,pattern color=outermarginfgcolor!50]% + (current page.north west) rectangle ([xshift=\outermarginwidth,yshift=0]current page.south west); + \fill [outermarginbgcolor!90,path fading=fade south]% + ([yshift=1mm]current page.north west) rectangle ([xshift=\outermarginwidth,yshift=-.5\layerheight]current page.north west); + \fill [outermarginbgcolor,path fading=fade north]% + (current page.south west) rectangle ([xshift=\outermarginwidth,yshift=.2\layerheight]current page.south west); + \fi +} +} +%%==============偶数页页边条颜色========================%% +\DeclareNewLayer[ + foreground, % + evenpage, + outermargin, + width=\outermarginwidth, + contents=\evensidbardeepcolor %色彩装饰条 +]{scth.outermargin.fg.even}% +%%==============偶数页页脚页码========================%% +\DeclareNewLayer[ + foreground, %上层 (背景之上) + evenpage, + foot, % 页脚 + contents=\outermarginpagemark +]{scth.outermargin.pn.even}% +%%==============偶数页章节编号========================%% +\DeclareNewLayer[ + foreground, %上层 (背景之上) + evenpage, + head, %页眉 + hoffset=0pt, + width=\outermarginwidth, + align=t, + addvoffset=\dimexpr-\chapternumbersize-12pt+\headheight\relax, + height=\chapternumbersize+\headheight, + contents=\outermarginchapternumberbox%章节编号 +]{scth.outermargin.cn.even}% +%%======================章节名称===================================%% +\DeclareNewLayer[ + clone=scth.outermargin.cn.even, + addheight=\dimexpr\headheight+\headsep+\textheight\relax, + addvoffset=\dimexpr+2\outermarginwidth\relax, + hoffset=-2.5pt, + contents=\outermarginmark % +]{scth.outermargin.text.even}% + +% define the layers for odd page from the settings for even pages +\newcommand*\DeclareOddFromEven[1]{%复制自偶数页样式命令 +\DeclareNewLayer[ + clone=#1.even, + oddpage, + align=r, + hoffset=\paperwidth +]{#1.odd}% +} +\DeclareOddFromEven{scth.outermargin.bg} +\DeclareOddFromEven{scth.outermargin.pn} +\DeclareOddFromEven{scth.outermargin.cn} +\DeclareOddFromEven{scth.outermargin.text} +\DeclareOddFromEven{scth.outermargin.fg} + +% add the layers to page style scrheadings and page style plain +\ForEachLayerOfPageStyle*{scth}{% + \AddLayersToPageStyle{scrheadings}{#1}% + \AddLayersToPageStyle{plain.scrheadings}{#1}% +} +%---------------------------------------------- +\KOMAoptions{markcase=upper} %页眉 +% for page styles scrheadings and plain +\clearpairofpagestyles +\ohead{} +\cfoot{} +\ofoot{} +% set the contents of the outer margin on even and odd pages for scrheadings, plain and scth +\oddoutermargin{\bf\leftmark} % Odd 奇数页 +\makeatletter +\evenoutermargin{\bfseries\@title} % Even 偶数页 +\makeatother +%% Begin The Most Beautiful Box (STYLE : ys style) % 中国风盒子 +\makeatletter +\definecolor{framegolden}{HTML}{455a64} % 控制外框颜色 +\definecolor{framegray}{HTML}{e0e0e0} % 控制填充颜色 +\newdimen\ys@frame@linewidth +\newdimen\ys@frame@radius +\newdimen\ys@frame@sep +\def\ys@frame@fill@opacity{0.2} + +\pgfdeclarehorizontalshading{ys@fade@circle}{500bp} +{color(0bp)=(pgftransparent!100); color(25bp)=(pgftransparent!100); +color(45bp)=(pgftransparent!0); color(55bp)=(pgftransparent!0); +color(75bp)=(pgftransparent!100); color(100bp)=(pgftransparent!100)} +\pgfdeclarefading{ys circle}{\pgfuseshading{ys@fade@circle}} + +\def\ys@frame@star@list@t{% + -0.7071\ys@frame@radius+0.2133\ys@frame@sep/% + -0.7071\ys@frame@radius+0.2133\ys@frame@sep/% + frame.north east,% + 0.7071\ys@frame@radius-0.2133\ys@frame@sep/% + -0.7071\ys@frame@radius+0.2133\ys@frame@sep/% + frame.north west} +\def\ys@frame@star@list@b{% + 0.7071\ys@frame@radius-0.2133\ys@frame@sep/% + 0.7071\ys@frame@radius-0.2133\ys@frame@sep/% + frame.south west,% + -0.7071\ys@frame@radius+0.2133\ys@frame@sep/% + 0.7071\ys@frame@radius-0.2133\ys@frame@sep/% + frame.south east} +\edef\ys@frame@star@list{\ys@frame@star@list@t,\ys@frame@star@list@b} + +%region outer +\def\ys@frame@remove@middleline#1#2{} +\def\ys@frame@draw@middleline#1#2{% + \clip ([xshift=-\ys@frame@linewidth,#1]frame.north west)-- + ([xshift=\ys@frame@linewidth,#1]frame.north east)-- + ([xshift=\ys@frame@linewidth,#2]frame.south east)-- + ([xshift=-\ys@frame@linewidth,#2]frame.south west)--cycle;} +\def\ys@frame@unbrokenouter{% + \path[draw=framegolden,fill=framegray,fill opacity=\ys@frame@fill@opacity,line width=\ys@frame@linewidth] + ([xshift=\ys@frame@radius]frame.north west)--([xshift=-\ys@frame@radius]frame.north east) + arc(-180:-90:\ys@frame@radius)-- + ([yshift=-\ys@frame@radius]frame.north east)--([yshift=\ys@frame@radius]frame.south east) + arc(90:180:\ys@frame@radius)-- + ([xshift=-\ys@frame@radius]frame.south east)--([xshift=\ys@frame@radius]frame.south west) + arc(0:90:\ys@frame@radius)-- + ([yshift=\ys@frame@radius]frame.south west)--([yshift=-\ys@frame@radius]frame.north west) + arc(-90:0:\ys@frame@radius)--cycle;} +\def\ys@frame@firstouter{% + \ys@frame@remove@middleline{yshift=.5\ys@frame@linewidth}{yshift=.7\ys@frame@linewidth}% + \path[draw=framegolden,fill=framegray,fill opacity=\ys@frame@fill@opacity,line width=\ys@frame@linewidth] + ([xshift=\ys@frame@radius]frame.north west)--([xshift=-\ys@frame@radius]frame.north east) + arc(-180:-90:\ys@frame@radius)-- + ([yshift=-\ys@frame@radius]frame.north east)-- + (frame.south east)-- + (frame.south west)-- + ([yshift=-\ys@frame@radius]frame.north west) + arc(-90:0:\ys@frame@radius)--cycle;} +\def\ys@frame@middleouter{% + \ys@frame@remove@middleline{yshift=-.7\ys@frame@linewidth}{yshift=.7\ys@frame@linewidth}% + \path[draw=framegolden,fill=framegray,fill opacity=\ys@frame@fill@opacity,line width=\ys@frame@linewidth] + (frame.north west)--(frame.north east)--(frame.south east)-- + (frame.south west)--cycle;} +\def\ys@frame@lastouter{% + \ys@frame@remove@middleline{yshift=-.7\ys@frame@linewidth}{yshift=-.5\ys@frame@linewidth}% + \path[draw=framegolden,fill=framegray,fill opacity=\ys@frame@fill@opacity,line width=\ys@frame@linewidth] + (frame.north west)--(frame.north east)-- + ([yshift=\ys@frame@radius]frame.south east) + arc(90:180:\ys@frame@radius)-- + ([xshift=-\ys@frame@radius]frame.south east)--([xshift=\ys@frame@radius]frame.south west) + arc(0:90:\ys@frame@radius)-- + ([yshift=\ys@frame@radius]frame.south west)-- + (frame.north west)--cycle;} +%endregion +%region inner +\def\ys@frame@unbrokeninner{% +\path[draw=framegolden,line width=.5\ys@frame@linewidth,line cap=round] +([xshift=\ys@frame@radius+2\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west) + --([xshift=\ys@frame@radius+5\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west) --++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) + ([xshift=\ys@frame@radius+6\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west)--++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) %第一节 + --([xshift=-\ys@frame@radius-8.828\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east)--++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) + ([xshift=-\ys@frame@radius-7.828\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east)--++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第二节 + --([xshift=-\ys@frame@radius-2\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east) + %% +([yshift=-\ys@frame@radius-2\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.north east) +--([yshift=-\ys@frame@radius-5\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.north east) --++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) +([yshift=-\ys@frame@radius-6\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.north east)--++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) %第一节 +--([yshift=\ys@frame@radius+8.828\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.south east)--++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) +([yshift=\ys@frame@radius+7.828\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.south east)--++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第二节 +% + --([yshift=\ys@frame@radius+2\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.south east) +% +([xshift=\ys@frame@radius+2\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west) +--([xshift=\ys@frame@radius+5\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west) --++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) +([xshift=\ys@frame@radius+6\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west)--++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第一节 +--([xshift=-\ys@frame@radius-8.828\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east)--++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) +([xshift=-\ys@frame@radius-7.828\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east)--++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) %第二节 + --([xshift=-\ys@frame@radius-2\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east) +% +([yshift=-\ys@frame@radius-2\ys@frame@linewidth,xshift=\ys@frame@sep]frame.north west) +--([yshift=-\ys@frame@radius-5\ys@frame@linewidth,xshift=\ys@frame@sep]frame.north west) --++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) +([yshift=-\ys@frame@radius-6\ys@frame@linewidth,xshift=\ys@frame@sep]frame.north west)--++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第一节 +--([yshift=\ys@frame@radius+8.828\ys@frame@linewidth,xshift=\ys@frame@sep]frame.south west)--++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) +([yshift=\ys@frame@radius+7.828\ys@frame@linewidth,xshift=\ys@frame@sep]frame.south west)--++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) %第二节 + --([yshift=\ys@frame@radius+2\ys@frame@linewidth,xshift=\ys@frame@sep]frame.south west);} +\def\ys@frame@firstinner{% + \path[draw=framegolden,line width=.5\ys@frame@linewidth,line cap=round] + ([xshift=\ys@frame@radius+2\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west) + --([xshift=\ys@frame@radius+5\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west) --++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) + ([xshift=\ys@frame@radius+6\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west)--++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) %第一节 + --([xshift=-\ys@frame@radius-8.828\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east)--++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) + ([xshift=-\ys@frame@radius-7.828\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east)--++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第二节 + --([xshift=-\ys@frame@radius-2\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east) + %% +([yshift=-\ys@frame@radius-2\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.north east) +--([yshift=-\ys@frame@radius-5\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.north east) --++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) +([yshift=-\ys@frame@radius-6\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.north east)--++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) %第一节 +--([xshift=-\ys@frame@sep]frame.south east) + + ([yshift=-\ys@frame@radius-2\ys@frame@linewidth,xshift=\ys@frame@sep]frame.north west) + --([yshift=-\ys@frame@radius-5\ys@frame@linewidth,xshift=\ys@frame@sep]frame.north west) --++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) + ([yshift=-\ys@frame@radius-6\ys@frame@linewidth,xshift=\ys@frame@sep]frame.north west)--++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第一节 + --([xshift=\ys@frame@sep]frame.south west);} +\def\ys@frame@middleinner{% + \path[draw=framegolden,line width=.5\ys@frame@linewidth,line cap=round] + ([xshift=-\ys@frame@sep]frame.north east)--([xshift=-\ys@frame@sep]frame.south east) + ([xshift=\ys@frame@sep]frame.north west)--([xshift=\ys@frame@sep]frame.south west);} +\def\ys@frame@lastinner{% + \path[draw=framegolden,line width=.5\ys@frame@linewidth,line cap=round] + ([xshift=-\ys@frame@sep]frame.north east) + --([yshift=\ys@frame@radius+8.828\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.south east)--++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) + ([yshift=\ys@frame@radius+7.828\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.south east)--++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第二节 + % + --([yshift=\ys@frame@radius+2\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.south east) +% + ([xshift=\ys@frame@radius+2\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west) + --([xshift=\ys@frame@radius+5\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west) --++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) + ([xshift=\ys@frame@radius+6\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west)--++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第一节 + --([xshift=-\ys@frame@radius-8.828\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east)--++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) + ([xshift=-\ys@frame@radius-7.828\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east)--++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) %第二节 + --([xshift=-\ys@frame@radius-2\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east) +% + ([xshift=\ys@frame@sep]frame.north west) + --([yshift=\ys@frame@radius+8.828\ys@frame@linewidth,xshift=\ys@frame@sep]frame.south west)--++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) + ([yshift=\ys@frame@radius+7.828\ys@frame@linewidth,xshift=\ys@frame@sep]frame.south west)--++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) %第二节 + --([yshift=\ys@frame@radius+2\ys@frame@linewidth,xshift=\ys@frame@sep]frame.south west);} +%endregion +%region corner +\def\ys@frame@unbrokencorner{% + \path[draw=framegolden,line width=1.5\ys@frame@linewidth,line cap=round] + ([xshift=\ys@frame@radius-2.7\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west) + --([xshift=\ys@frame@sep,yshift=-\ys@frame@sep]frame.north west) + --([xshift=\ys@frame@sep,yshift=-\ys@frame@radius+2.7\ys@frame@linewidth]frame.north west) + ([xshift=-\ys@frame@radius+2.7\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east) + --([xshift=-\ys@frame@sep,yshift=-\ys@frame@sep]frame.north east) + --([xshift=-\ys@frame@sep,yshift=-\ys@frame@radius+2.7\ys@frame@linewidth]frame.north east) + ([xshift=-\ys@frame@radius+2.7\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east) + --([xshift=-\ys@frame@sep,yshift=\ys@frame@sep]frame.south east) + --([xshift=-\ys@frame@sep,yshift=\ys@frame@radius-2.7\ys@frame@linewidth]frame.south east) + ([xshift=\ys@frame@radius-2.7\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west) + --([xshift=\ys@frame@sep,yshift=\ys@frame@sep]frame.south west) + --([xshift=\ys@frame@sep,yshift=\ys@frame@radius-2.7\ys@frame@linewidth]frame.south west);} +\def\ys@frame@firstcorner{% + \path[draw=framegolden,line width=1.5\ys@frame@linewidth,line cap=round] + ([xshift=\ys@frame@radius-2.7\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west) + --([xshift=\ys@frame@sep,yshift=-\ys@frame@sep]frame.north west) + --([xshift=\ys@frame@sep,yshift=-\ys@frame@radius+2.7\ys@frame@linewidth]frame.north west) + ([xshift=-\ys@frame@radius+2.7\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east) + --([xshift=-\ys@frame@sep,yshift=-\ys@frame@sep]frame.north east) + --([xshift=-\ys@frame@sep,yshift=-\ys@frame@radius+2.7\ys@frame@linewidth]frame.north east);} +\def\ys@frame@middlecorner{} +\def\ys@frame@lastcorner{% + \path[draw=framegolden,line width=1.5\ys@frame@linewidth,line cap=round] + ([xshift=-\ys@frame@radius+2.7\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east) + --([xshift=-\ys@frame@sep,yshift=\ys@frame@sep]frame.south east) + --([xshift=-\ys@frame@sep,yshift=\ys@frame@radius-2.7\ys@frame@linewidth]frame.south east) + ([xshift=\ys@frame@radius-2.7\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west) + --([xshift=\ys@frame@sep,yshift=\ys@frame@sep]frame.south west) + --([xshift=\ys@frame@sep,yshift=\ys@frame@radius-2.7\ys@frame@linewidth]frame.south west);} +%endregion +\def\ys@frame@star#1#2#3{% + \begin{scope}[shift={([xshift=#1,yshift=#2]#3)},scale=\ys@frame@ratio*0.1] + \path[draw=framegolden,fill=white, + line width=.7\ys@frame@linewidth,line join=round] + (1,1)..controls(0.3,0.5) and (-0.3,0.5).. + (-1,1)..controls(-0.5,0.3) and (-0.5,-0.3).. + (-1,-1)..controls(-0.3,-0.5) and (0.3,-0.5).. + (1,-1)..controls(0.5,-0.3) and (0.5,0.3)..(1,1)--cycle; + \path[scale=0.45,fill=framegolden,line join=round] + (1,1)..controls(0.3,0.7) and (-0.3,0.7).. + (-1,1)..controls(-0.7,0.3) and (-0.7,-0.3).. + (-1,-1)..controls(-0.3,-0.7) and (0.3,-0.7).. + (1,-1)..controls(0.7,-0.3) and (0.7,0.3)..(1,1)--cycle; + \end{scope}} +\def\ys@frame@segmentation{% + \draw[color=framegolden,path fading=ys circle] + ([xshift=5\ys@frame@radius]segmentation.west) to[ornament=88] + ([xshift=-5\ys@frame@radius]segmentation.east);} + +\tcbset{ + % 控制是否在断点处的线不画出来 + ys/frame/not at break/.code=\let\ys@frame@remove@middleline\ys@frame@draw@middleline, + ys/frame/fill opacity/.store in=\ys@frame@fill@opacity, + ys/frame/draw at break/.code=\let\ys@frame@remove@middleline\@gobbletwo, + % 控制线宽 + ys/frame/line width/.code={\pgfmathsetlength\ys@frame@linewidth{#1}}, + ys/frame/line width=1.4pt, + % 控制圆弧大小,应为数字,而非长度 + ys/frame/radius/.code={\pgfmathparse{#1}\let\ys@frame@ratio\pgfmathresult + \pgfmathsetlength\ys@frame@radius{(#1)*1em}% + \pgfmathsetlength\ys@frame@sep{(#1)*0.5ex}}, + ys/frame/radius=2, + ys/frame/unbroken/.style={ + interior code={% + \ys@frame@unbrokenouter % 外框 + \foreach \ii/\jj/\kk in \ys@frame@star@list {\ys@frame@star{\ii}{\jj}{\kk}} % 星 + \ys@frame@unbrokeninner % 内线 + \ys@frame@unbrokencorner % 四角 + }, + interior titled code={% + \ys@frame@unbrokenouter % 外框 + \foreach \ii/\jj/\kk in \ys@frame@star@list {\ys@frame@star{\ii}{\jj}{\kk}} % 星 + \ys@frame@unbrokeninner % 内线 + \ys@frame@unbrokencorner % 四角 + } + }, + ys/frame/first/.style={ + interior code={% + \ys@frame@firstouter + \foreach \ii/\jj/\kk in \ys@frame@star@list@t {\ys@frame@star{\ii}{\jj}{\kk}} + \ys@frame@firstinner + \ys@frame@firstcorner}, + interior titled code={% + \ys@frame@firstouter + \foreach \ii/\jj/\kk in \ys@frame@star@list@t {\ys@frame@star{\ii}{\jj}{\kk}} + \ys@frame@firstinner + \ys@frame@firstcorner}, + }, + ys/frame/middle/.style={ + interior code={% + \ys@frame@middleouter + \ys@frame@middleinner + \ys@frame@middlecorner} + }, + ys/frame/last/.style={ + interior code={% + \ys@frame@lastouter + \foreach \ii/\jj/\kk in \ys@frame@star@list@b {\ys@frame@star{\ii}{\jj}{\kk}} + \ys@frame@lastinner + \ys@frame@lastcorner} + }, + ys/frame style/unbroken/.style={ + boxsep=2\ys@frame@sep, + left={.8\ys@frame@radius},right={.8\ys@frame@radius}, + ys/frame/unbroken,title hidden, + segmentation code=\ys@frame@segmentation + }, + ys/frame style/first/.style={ys/frame/first,title hidden,segmentation code=\ys@frame@segmentation}, + ys/frame style/middle/.style={ys/frame/middle,segmentation code=\ys@frame@segmentation}, + ys/frame style/last/.style={ys/frame/last,segmentation code=\ys@frame@segmentation}, + ys style/.style={frame hidden, + ys/frame style/unbroken, + extras first={ys/frame style/first}, + extras middle={ys/frame style/middle}, + extras last={ys/frame style/last}, + }, +} +\makeatother +\newtcolorbox{fancybox}{enhanced,ys style,breakable,pad at break=2mm, + ys/frame/not at break,ys/frame/fill opacity=0} +%% End The Most Beautiful Box +\makeatletter +\definecolor{CyaN}{HTML}{dbe1e5} +\colorlet{OrangE}{yellow!20!orange} +\colorlet{BluE}{cyan!70!blue} +\colorlet{ReD}{red!20!orange} +\colorlet{GreeN}{yellow!40!green} + +% 第一种定理 +\tcbset{my@basic@thm/.style={enhanced jigsaw, breakable, + enlarge left by=-3.5mm, width=\textwidth+3.5mm, boxrule=0pt, + top=2pt, bottom=2pt, left=2.5mm, frame hidden}} +\newcommand{\@my@newtheorem@n}[1]{\ERROR} +\newcommand{\@my@newtheorem@nn}[2]{% + \@ifundefined{#1}{\@my@newtheorem{#1}#2}{\@my@renewtheorem{#1}#2}} +\NewDocumentCommand{\@my@newtheorem}{ m m o +m } + {\IfNoValueTF{#3}{\newtheorem{#1}{#2}}{\newtheorem{#1}{#2}[#3]}% + \tcbset{my@#1@thmstyle/.style={#4}}% + \tcolorboxenvironment{#1}{my@basic@thm, my@#1@thmstyle}} +\NewDocumentCommand{\@my@renewtheorem}{ m m o +m } + {\IfNoValueTF{#3}{\renewtheorem{#1}{#2}}{\renewtheorem{#1}{#2}[#3]}% + \tcbset{my@#1@thmstyle/.style={#4}}} +% +% ---------------------------------------------------------------------------------- % +% 第二种定理 +\tcbset{my@basic@tcbthm/.style={detach title,}} +\newcommand{\@my@newtcbtheorem@n}[1]{\ERROR} +\newcommand{\@my@newtcbtheorem@nn}[2]{% + \@ifundefined{#1}{\@my@newtcbtheorem{#1}{#2}}{\@my@renewtcbtheorem{#1}{#2}}} +\newcommand{\@my@newtcbtheorem}[2]{% + \edef\my@curr@thmenvname{#1}% 它保存当前定理环境的名称 + \mytcbtheoremset{#2}% + \NewTColorBox{#1}{ O{} O{} o } + {my@basic@tcbthm, my@#1@tcbthmstyle, title={##2}, IfNoValueF={##3}{label={##3}}, ##1}} +\newcommand{\@my@renewtcbtheorem}[2]{\edef\my@curr@thmenvname{#1}\mytcbtheoremset{#2}} + +% 键值设置 +\pgfkeys{/mytcbtheorem/.is family} +\newcommand{\mytcbtheoremset}{\pgfqkeys{/mytcbtheorem}} +\mytcbtheoremset{ + name/.code=\@namedef{\my@curr@thmenvname @name}{#1}, %无效 + counter/.code=\@namedef{my@\my@curr@thmenvname @counter}{#1}\newcounter{#1}[chapter], % 计数器遇到subsection就会自动归零 % https://zhuanlan.zhihu.com/p/57454848#circle=on + the counter/.code=\@namedef{the\@nameuse{my@\my@curr@thmenvname @counter}}{#1}, + autoref name/.code=\@namedef{\@nameuse{my@\my@curr@thmenvname @counter}autorefname}{#1}, + style/.code=\tcbset{my@\my@curr@thmenvname @tcbthmstyle/.style={#1}}, + thmcolor/.code=\@namedef{\my@curr@thmenvname @thmcolor}{#1}, %无效 + lemcolor/.code=\@namedef{\my@curr@thmenvname @lemcolor}{#1}, %无效 +} +% 存储键值 (LaTeX3) +\ExplSyntaxOn +\cs_new_protected:Npn \mynewtheorem + { \keyval_parse:NNn \@my@newtheorem@n \@my@newtheorem@nn } +\cs_new_protected:Npn \mynewtcbtheorem + { \keyval_parse:NNn \@my@newtcbtheorem@n \@my@newtcbtheorem@nn } +\ExplSyntaxOff +\makeatother + +% 第二种定理 +\makeatletter +%% Overlay Settings +\newcommand{\my@theorem@overlay@unbroken}[2]{ + %%============== First ==============%% + \fill[black!60] ([xshift=1cm,yshift=5pt]frame.north west)-- ([xshift=0.8cm,yshift=0cm]frame.north west)--([xshift=1.2cm,yshift=0cm]frame.north west)--cycle; + \node[rectangle, text=white, drop shadow={opacity=.3, shadow xshift=0.1cm}, inner sep=1.5mm,fill=#2, +anchor=west,rounded corners=3pt,font=\bfseries\normalsize] at ([xshift=0cm,yshift=-3.mm]frame.north west) {\hspace*{1.5em}#1.\ \ifdefvoid{\tcbtitletext}{}{(\tcbtitletext)}}; + \fill[color=#2,drop shadow={opacity=0.3,shadow xshift=.3pt}] + ([xshift=1cm,yshift=5pt]frame.north west) {[rounded corners=3pt]--++(-1cm-5pt,0)}--++(0,-1cm-5pt)--cycle; + \fill[color=black!60] ([xshift=-5pt,yshift=-1cm]frame.north west)--([xshift=0cm,yshift=-0.8cm]frame.north west)-- ([xshift=0cm,yshift=-1.2cm]frame.north west)--cycle; + %%============== End ==============%% + \fill[#2,drop shadow={opacity=0.3,shadow xshift=-0.008\linewidth,shadow yshift=0.0016\linewidth}] + ([xshift=-0.05\linewidth,yshift=-5pt]frame.south east) {[rounded corners=3pt]--++(0.05\linewidth+5pt,0)}--++(0,0.05\linewidth+5pt)--cycle; + \fill[black!60] ([xshift=-0.05\linewidth,yshift=-5pt]frame.south east) -- ([xshift=-0.04\linewidth,yshift=0pt]frame.south east)-- ([xshift=-0.06\linewidth,yshift=0pt]frame.south east)--cycle; + \fill[black!60] ([xshift=5pt,yshift=0.05\linewidth]frame.south east)-- ([yshift=0.04\linewidth]frame.south east) -- ([yshift=0.06\linewidth]frame.south east)--cycle; +} +\newcommand{\my@theorem@overlay@first}[2]{ + \fill[black!60] ([xshift=1cm,yshift=5pt]frame.north west)-- ([xshift=0.8cm,yshift=0cm]frame.north west)--([xshift=1.2cm,yshift=0cm]frame.north west)--cycle; + \node[rectangle, text=white, drop shadow={opacity=.3, shadow xshift=0.1cm}, inner sep=1.5mm,fill=#2, anchor=west,rounded corners=3pt,font=\bfseries\normalsize] at ([xshift=0cm,yshift=-3.mm]frame.north west) {\hspace*{1.5em}#1.\ \ifdefvoid{\tcbtitletext}{}{(\tcbtitletext)}}; + \fill[color=#2,drop shadow={opacity=0.3,shadow xshift=.3pt}] + ([xshift=1cm,yshift=5pt]frame.north west) {[rounded corners=3pt]--++(-1cm-5pt,0)}--++(0,-1cm-5pt)--cycle; + \fill[color=black!60] ([xshift=-5pt,yshift=-1cm]frame.north west)--([xshift=0cm,yshift=-0.8cm]frame.north west)-- ([xshift=0cm,yshift=-1.2cm]frame.north west)--cycle; +} +\newcommand{\my@theorem@overlay@last}[1]{ + \fill[#1,drop shadow={opacity=0.3,shadow xshift=-0.008\linewidth,shadow yshift=0.0016\linewidth}] + ([xshift=-0.05\linewidth,yshift=-5pt]frame.south east) {[rounded corners=3pt]--++(0.05\linewidth+5pt,0)}--++(0,0.05\linewidth+5pt)--cycle; + \fill[black!60] ([xshift=-0.05\linewidth,yshift=-5pt]frame.south east) -- ([xshift=-0.04\linewidth,yshift=0pt]frame.south east)-- ([xshift=-0.06\linewidth,yshift=0pt]frame.south east)--cycle; + \fill[black!60] ([xshift=5pt,yshift=0.05\linewidth]frame.south east)-- ([yshift=0.04\linewidth]frame.south east) -- ([yshift=0.06\linewidth]frame.south east)--cycle; +} +% Second theorem style overlay settings +\newcommand{\my@lemma@overlay@unbroken}[2]{ + %%============== First ==============%% + \def\Rad{3.5pt} + \def\theight{0.57cm} + \def\rad{7pt}% + \path[fill=#2,drop shadow={opacity=0.3,shadow xshift=.05cm,shadow yshift=-.05cm}]node[append after command={ + ([xshift=-1.5*\rad]thmname.north west) to[out=0,in=180,looseness=1] ([xshift=2.5*\rad]thmname.south west) --([xshift=-\rad]thmname.south east) to[out=0,in=180,looseness=1] ([xshift=3*\rad]thmname.north east) --cycle}, + text=white,font=\bfseries,align=center,inner ysep=1.5mm,right] (thmname) at ([xshift=\rad,yshift=-\rad]frame.north west) {\hspace*{10pt}#1.\ \ifdefvoid{\tcbtitletext}{}{(\tcbtitletext)}}; + \begin{pgfonlayer}{bottom} + \fill[#2,opacity=0.5] + ([xshift=-1.5*\rad]thmname.north west) to[out=-90,in=0,looseness=1.5] +(3pt,-6pt) -| +(10pt,0)--cycle; + \fill[#2,opacity=0.5] + ([xshift=3*\rad]thmname.north east) to[out=0,in=-90] +(5pt,-5pt) -| ++(-10pt,0) --cycle; + \end{pgfonlayer} + %%============== End ==============%% + \def\tlen{1.5cm} + \path[fill=#2,drop shadow={opacity=0.3,shadow xshift=.3pt}] + ([xshift=-2*\rad,yshift=-5pt]frame.south east) coordinate (SE) to[out=0,in=180] +(4*\rad,5pt+\theight) --([shift={(-\tlen+4*\rad,5pt+\theight)}]SE) to[out=180,in=0] +(-4*\rad,-5pt-\theight) --cycle; + \begin{pgfonlayer}{bottom} + \fill[color=#2!80!black] ([xshift=-1.35*\tlen+\Rad,yshift=-5pt]frame.south east) to[out=180,in=90,looseness=0.7] ([xshift=-1.35*\tlen-0.5*\Rad]frame.south east) coordinate (NWl)--([xshift=2*\rad]NWl) to[out=-90,in=-180,looseness=0.7] ([xshift=-1.35*\tlen+\Rad,yshift=-5pt]frame.south east)--cycle; + \end{pgfonlayer} + } +\newcommand{\my@lemma@overlay@first}[2]{ + %%============== First ==============%% + \def\Rad{3.5pt} + \def\theight{0.57cm} + \def\rad{7pt}% + \path[fill=#2,drop shadow={opacity=0.3,shadow xshift=.05cm,shadow yshift=-.05cm}]node[append after command={ + ([xshift=-1.5*\rad]thmname.north west) to[out=0,in=180,looseness=1] ([xshift=2.5*\rad]thmname.south west) --([xshift=-\rad]thmname.south east) to[out=0,in=180,looseness=1] ([xshift=3*\rad]thmname.north east) --cycle}, + text=white,font=\bfseries,align=center,inner ysep=1.5mm,minimum height=0.6cm,right] (thmname) at ([xshift=\rad,yshift=-\rad]frame.north west) {\hspace*{10pt}#1.\ \ifdefvoid{\tcbtitletext}{}{(\tcbtitletext)}}; + \begin{pgfonlayer}{bottom} + \fill[#2,opacity=0.5] + ([xshift=-1.5*\rad]thmname.north west) to[out=-90,in=0,looseness=1.5] +(3pt,-6pt) -| +(10pt,0)--cycle; + \fill[#2,opacity=0.5] + ([xshift=3*\rad]thmname.north east) to[out=0,in=-90] +(5pt,-5pt) -| ++(-10pt,0) --cycle; + \end{pgfonlayer} + } +\newcommand{\my@lemma@overlay@last}[1]{ + %%============== End ==============%% + \def\Rad{3.5pt} + \def\rad{7pt}% + \def\theight{0.57cm} + \def\tlen{1.5cm} + \path[fill=#1,drop shadow={opacity=0.3,shadow xshift=.3pt}] + ([xshift=-2*\rad,yshift=-5pt]frame.south east) coordinate (SE) to[out=0,in=180] +(4*\rad,5pt+\theight) --([shift={(-\tlen+4*\rad,5pt+\theight)}]SE) to[out=180,in=0] +(-4*\rad,-5pt-\theight) --cycle; + \begin{pgfonlayer}{bottom} + \fill[color=#1!80!black] ([xshift=-1.35*\tlen+\Rad,yshift=-5pt]frame.south east) to[out=180,in=90,looseness=0.7] ([xshift=-1.35*\tlen-0.5*\Rad]frame.south east) coordinate (NWl)--([xshift=2*\rad]NWl) to[out=-90,in=-180,looseness=0.7] ([xshift=-1.35*\tlen+\Rad,yshift=-5pt]frame.south east)--cycle; + \end{pgfonlayer} + } +\makeatother +%% + +% proof +\declaretheoremstyle[ + spaceabove=3pt,spacebelow=3pt, + headfont=\normalfont\bfseries, + notefont=\normalfont\bfseries,notebraces={(}{)}, + bodyfont=\normalfont, + postheadspace=1em, + headpunct={.}, + qed=\qedsymbol +]{Proofstyle} +\declaretheorem[style=Proofstyle,numbered=no,name={\bfseries 证明}]{Proof} +\renewenvironment{proof}{\begin{Proof} }{\end{Proof}} +\declaretheorem[style=Proofstyle,numbered=no,name={\bfseries 解}]{solution} +%% --------参考文献 +\usepackage[ +backend=biber, +style=gb7714-2015, +sorting=nty +]{biblatex} +\addbibresource{ref.bib} +\indexsetup{level=\chapter*,noclearpage} +\makeindex[title=索引,columns=3,columnsep=15pt,columnseprule] +\makeindex + +%%%%%%%%%%%%%%% 计数器知识 %%%%%%%%%%%%%%%%%%%%%% +% 每次用 \newcounter{foo} 定义新计数器,内部都会定义这几个命令 + +% \c@foo,储存计数器的值,初始值为 0 +% \thefoo,储存计数器输出时的格式,初始定义为 \arabic{foo} +% \p@foo,储存计数器被引用时的前缀,初始定义为空 +% \cl@foo,储存「子计数器」列表(此处有简化),foo 自增时它的每个「子计数器」都会归零(详见「自动归零」一节),初始定义为空 +%% 关于计数器的自动归零 +% 如果还定义了计数器 \newcounter{bar}[foo],那么 \cl@foo 里就有了 bar +% \@addtoreset{child}{parent} 和 \@removefromreset{child}{parent} 可以把计数器 child 移入/移出 \cl@parent +% \counterwithin* 和 \counterwithout* 和上一条里两个命令的功能类似,但它们在执行前会检查接受的两个参数是否为已定义的计数器。不加星号的版本会修改 \thechild,详见「输出格式」一节 +% 在使用 \stepcounter{parent} 和 \refstepcounter{parent} 时,parent 自增,同时归零\cl@parent 里的「子计数器」 +% \addtocount{parent}{1} 只自增 parent,没有归零其「子计数器」的效果 +% 归零实现为「对每个子计数器,先设为 -1,然后使用 \stepcounter 自增」,这样实现的「归零」功能是递归的 +% 递归的意思是,如果还有 \newcounter{grandchild}[child],那么 \stepcounter{parent} 会将 child 和 grandchild 都归零 diff --git a/macros/latex/contrib/beautybook/Beautybook-V6.1-EN.cls b/macros/latex/contrib/beautybook/Beautybook-V6.1-EN.cls new file mode 100644 index 0000000000..9efc799295 --- /dev/null +++ b/macros/latex/contrib/beautybook/Beautybook-V6.1-EN.cls @@ -0,0 +1,995 @@ +%This Class is based on the default book class and options will be passed +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{Beautybook-V6.1-EN}[01-05-2023 V6.1 Beautybook Class] +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}} +\ProcessOptions\relax +\LoadClass[twoside]{book} +\overfullrule=1pt +\RequirePackage[fontsize=13.5pt]{fontsize} +\linespread{1.05} +\RequirePackage[dvipsnames,svgnames,x11names,table]{xcolor} +\colorlet{outermarginfgcolor}{DarkCyan} % foregroundcolor 较深 +\colorlet{outermarginbgcolor}{DarkCyan!30} % backgroundcolor 较浅 +\definecolor{高粱红}{HTML}{951c48} +\RequirePackage{cncolours} +\RequirePackage{bropd} % math 自适应数学括号命令 \br{} !!! +\RequirePackage{tikz-imagelabels} % tikz图像标注 +\RequirePackage{epigraph-keys} % 名言引用 +\RequirePackage{fitbox} % 图像自适应 +\RequirePackage{pgfornament-han} +\RequirePackage{tikz} +\usetikzlibrary{calc,shadows,hobby,intersections, decorations.markings, decorations.pathreplacing,spy,arrows,shapes,fadings,trees,mindmap,patterns,shapes.arrows,shapes.symbols,tikzmark,shapes.geometric,graphs, quotes, angles,decorations.pathmorphing,through,shadings,backgrounds,positioning,fit,arrows.meta,shapes.misc,decorations.shapes} +\RequirePackage{pgfplots} %画图 %%页面样式设计核心包 %提供\pgfonlayer命令以及下列图层指令 +\pgfplotsset{compat=1.18} +% +\ExplSyntaxOn +% 封面切换程序 (LaTeX3)! +\keys_define:nn {Beautybook/coverstyle} + { + cover-choose.choice:, + cover-choose.value_required:n = true, + cover-choose/cn.code:n = {\RequirePackage{stys/Beautybook-cn}}, + cover-choose/en.code:n = {\RequirePackage{stys/Beautybook-en}}, + cover-choose/enfig.code:n = {\RequirePackage{stys/Beautybook-enfig}}, + cover-choose/birkar.code:n = {\RequirePackage{stys/Beautybook-birkar}}, + %cover-choose .initial:n = en , % 设置 en 为初始值 + } +\newtoks \l__Beautybook_tmpa_toks +\cs_new_protected:Npn \coverstyle + { + \tex_afterassignment:D \__Beautybook_set_coverstyle: + \l__Beautybook_tmpa_toks + } +\cs_new:Npn \__Beautybook_set_coverstyle: + { \keys_set:nV { Beautybook / coverstyle } \l__Beautybook_tmpa_toks } +% Math fonts +\keys_define:nn {Beautybook/mathstyle} + { + math-font.choice:, + math-font.value_required:n = true, + math-font/plain.code:n={}, + math-font/mtpro2.code:n = { + \RequirePackage{mtpro2} + \DeclareFontFamily{U}{nxlmi}{} + \DeclareFontSubstitution{U}{nxlmi}{m}{it} + \DeclareFontShape{U}{nxlmi}{m}{it}{ + <-6.3> nxlmi05 + <6.3-8.6> nxlmi07 + <8.6-> nxlmi0 + }{} + + \DeclareFontShape{U}{nxlmi}{b}{it}{ + <-6.3> nxlbmi05 + <6.3-8.6> nxlbmi07 + <8.6-> nxlbmi0 + }{} + \renewcommand{\partial}{{\text{\usefont{U}{nxlmi}{m}{it}\symbol{64}}\mspace{1mu}}} + }, + %cover-choose .initial:n = plain , % 设置 en 为初始值 + } +\cs_new_protected:Npn \mathstyle + { + \tex_afterassignment:D \__Beautybook_set_mathstyle: + \l__Beautybook_tmpa_toks + } +\cs_new:Npn \__Beautybook_set_mathstyle: + { \keys_set:nV { Beautybook / mathstyle } \l__Beautybook_tmpa_toks } +\ExplSyntaxOff +% +\RequirePackage{stys/Beautybook-bottompage} +% +\RequirePackage{amssymb,amsfonts} +\RequirePackage{makeidx} +\RequirePackage{etoolbox} % 判断函数 +\RequirePackage{paracol} +\RequirePackage{tikz-cd} +\RequirePackage{imakeidx} +\RequirePackage{anyfontsize} +\RequirePackage{calc} +\RequirePackage{xkeyval,ifthen} +\RequirePackage[backgroundcolor=yellow!40!cyan!20,bordercolor=yellow!40!cyan!20,linecolor=DarkCyan]{todonotes} +\RequirePackage{varwidth} +\RequirePackage[colorlinks,linkcolor = purple, %%修改此处为你想要的颜色 +anchorcolor = purple, %%修改此处为你想要的颜色 +urlcolor = purple, %%修改此处为你想要的颜色 +citecolor = purple, %%修改此处为你想要的颜色 +]{hyperref} +\setcounter{tocdepth}{3} +\setcounter{secnumdepth}{3}%增加编号深度 +\RequirePackage{dashrule} +\newlength\outermarginwidth +\setlength\outermarginwidth{1.5cm} +\newlength\covershift +\setlength\covershift{5cm} +\RequirePackage{caption} +% 图注与表注格式 +\colorlet{captioncolor}{outermarginfgcolor} % 图片和表格题注文字颜色 +\makeatletter +%%----------------------------------封面信息定义--------------------------------------------------------%% +\newcommand\bookseries[1]{\def\@bookseries{#1}} +\newcommand\subtitle[1]{\def\@subtitle{#1}} +\newcommand\edition[1]{\def\@edition{#1}} +\newcommand\presslogo[1]{\def\@presslogo{#1}} +\newcommand\pressname[1]{\def\@pressname{#1}} +\newcommand\coverimage[1]{\def\@coverimage{#1}} +%%----------------------------------封面信息定义--------------------------------------------------------%% +\makeatother +\RequirePackage{indentfirst} +\RequirePackage{physics} +\definecolor{nuanbai}{HTML}{f5f5f5} % F5F5F5 +\pagecolor{nuanbai} +\RequirePackage{amsmath} +\RequirePackage{zhlipsum} +\RequirePackage{times} +\RequirePackage[left=2cm,right=2cm,top=.6cm,bottom=2.2cm]{geometry} +\RequirePackage{xpatch}%修正章节编号 +\RequirePackage[automark]{scrlayer-scrpage}%页面设置宏包,隶属于koma-script文档类 +\RequirePackage{fontawesome5} +\RequirePackage{mathrsfs} +\RequirePackage[most]{tcolorbox} +\tcbuselibrary{breakable, skins,theorems}%TcolorBox Library +\RequirePackage{tabularx} +\RequirePackage{lastpage} +%\RequirePackage{twemojis} +\RequirePackage{ninecolors} +\RequirePackage{colortbl} %彩色表格 +\RequirePackage{tabularray} +\UseTblrLibrary{amsmath} +% 定义 +array, +matrix, +bmatrix, +Bmatrix, +pmatrix, +vmatrix, +Vmatrix 和 +cases 环境。其 +% 中,每一个环境都类似于不带 + 前缀的环境,但是就像 tblr 环境一样,使用 rowsep=2pt 默认值。 +% 除了+array 环境外,其余的每个环境都可以带一个可选项,通过该可选项,可能为环境设置内部 +% 参数。 +\UseTblrLibrary{booktabs} % 定义 \toprule、 \midrule、\bottomrule 和 \cmidrule 命令,这些命令可以直接用于 tblr环境中 +\UseTblrLibrary{diagbox} % 在tblr 环境中使用 \diagbox 和\diagboxthree 命令排版斜线表头 +\UseTblrLibrary{varwidth} % 为表格添加 measure 内部参数。当设置了 measure=vbox 后,则会使用 \vbox 测量单元格宽度。%可以使用stretch=-1 移除列表环境上下的间距, 注意,stretch=-1 选项也会移除单元格中的支架 +\RequirePackage{pgfornament} +\RequirePackage{zhnumber} +\RequirePackage{dashrule} +\RequirePackage{adjustbox} +\RequirePackage{enumitem} +\RequirePackage{multicol} +\RequirePackage{amsthm} +\RequirePackage{thmtools,thm-restate}%定理环境 %定理的重写 +\RequirePackage{bclogo} +\RequirePackage{ulem} +\RequirePackage{pgfplots} %画图 %%页面样式设计核心包 %提供\pgfonlayer命令以及下列图层指令 +\pgfplotsset{compat=1.18} +\RequirePackage{graphicx}%修正minipage顶部对齐问题 +\pgfdeclarelayer{background} %背景%底层 +\pgfdeclarelayer{foreground} %上层 +\pgfdeclarelayer{top} %顶部 +\pgfdeclarelayer{bottom} %底部 +\pgfsetlayers{bottom,background,main,foreground,top} +\newcommand{\tikzoverlay}[1]{\begin{tikzpicture}[remember picture,overlay] #1 \end{tikzpicture}} +\RequirePackage[explicit]{titlesec} +% tcolorbox中插入图片或者tikz绘图方法 +\newcommand\Figure[4]{% + \begin{center} + \captionsetup{type=figure} %消除 Package caption Warning: The option `hypcap=true' will be ignored for this +%(caption) particular \caption on input line XX.警告信息 + \includegraphics[#1]{#2} + \captionof{figure}{#3}\label{#4} + \end{center} +}%用法 : 用于tcolorbox中插入图片 +\newcommand\Tikz[3]{% + \begin{center} + \captionsetup{type=figure} %消除 Package caption Warning: The option `hypcap=true' will be ignored for this(caption) particular \caption on input line XX.警告信息 + #3 %最后一个参数为Tikz画图代码窗口 + \captionof{figure}{#1}\label{#2} %第一与第二个参数是Tikz画图的名称与标签 + \end{center} +} %用法 : 用于tcolorbox中插入Tikz绘图 +%特殊注释矩阵 +\newcommand\coolover[2]{\mathrlap{\smash{\overbrace{\phantom{% + \begin{matrix} #2 \end{matrix}}}^{\mbox{$#1$}}}}#2} + +\newcommand\coolunder[2]{\mathrlap{\smash{\underbrace{\phantom{% + \begin{matrix} #2 \end{matrix}}}_{\mbox{$#1$}}}}#2} + +\newcommand\coolleftbrace[2]{% + #1\left\{\vphantom{\begin{matrix} #2 \end{matrix}}\right.} + +\newcommand\coolrightbrace[2]{% + \left.\vphantom{\begin{matrix} #1 \end{matrix}}\right\}#2} +\definecolor{lightergray}{gray}{0.99} + +\newcommand*{\circled}[1]{\lower.7ex\hbox{\tikz\draw (0pt, 0pt)% + circle (.5em) node {\makebox[1em][c]{\small #1}};}} +\newcommand{\twicecircle}{\raisebox{.7ex}{ + \begin{tikzpicture}[remember picture,overlay] + \draw[line width=0.6pt,black!60] (0,0) circle (3pt); + \fill[black] (0,0) circle (1.6pt) ; + \end{tikzpicture}} +} +\newcommand{\exercise}[2][\bcicosaedre]{\bigskip +\begin{tikzpicture}[remember picture,overlay] +\draw[line width=2pt,loosely dotted,teal] (0,0)--node[pos=0.4,rectangle,minimum height=1.5em,font=\sffamily\Large,text=black,fill=black!2,drop shadow={opacity=.3, shadow xshift=0.1cm},anchor=center, + inner sep=1.5mm, + anchor=west,] {$#1$ ~ #2} (\linewidth,0); +\end{tikzpicture}\bigskip\smallskip +} +\RequirePackage{extarrows} +\newcommand{\R}{\mathbb{R}} +\newcommand{\F}{\mathcal{F}} +\newcommand{\lan}[1]{\langle #1 \rangle} +\newenvironment{eq}[1]{\begin{equation}\begin{aligned}#1}{\end{aligned}\end{equation}} %有编号 +\newenvironment{eq*}[1]{\begin{equation*}\begin{aligned}#1}{\end{aligned}\end{equation*}} %无编号 +% \everymath{\displaystyle} + +%% -------- 章节样式 +\titleformat{\chapter}{\huge\bfseries\filcenter}{}{1em}{ + \makebox[0pt][l]{\def\rad{7pt}% + \begin{tikzpicture}[remember picture, overlay]% + \begin{pgfonlayer}{bottom} + \shade[left color=outermarginbgcolor!20,middle color=outermarginbgcolor!50,right color=outermarginfgcolor!20] (current page.north west) rectangle ++(\paperwidth,-.2\paperheight); % background + \fill[outermarginfgcolor,opacity=.5]([shift={(0,-4.45cm)}]current page.north west) rectangle ++(\paperwidth,-2mm); % line + \end{pgfonlayer} + \path[fill=outermarginfgcolor]node[append after command={ + ([xshift=-3*\rad]chapinfoofpart.north west) to[out=0,in=-180,looseness=1] ([xshift=\rad]chapinfoofpart.south west) --([xshift=-\rad]chapinfoofpart.south east) to[out=0,in=180,looseness=1] ([xshift=3*\rad]chapinfoofpart.north east) --cycle}, + text=white,font=\large\bfseries,align=center,minimum height=1cm] (chapinfoofpart) at ([shift={(.6\linewidth,-4.95cm)}]current page.north west) {Part\ \thepart}; + \begin{pgfonlayer}{bottom} + \fill[outermarginfgcolor!90,opacity=0.5] ([shift={(-3*\rad,0)}]chapinfoofpart.north west) to[out=180,in=0,looseness=1] +(-4*\rad,-1.2cm)--([shift={(7*\rad,-1.2cm)}]chapinfoofpart.north east) to[out=-180,in=0,looseness=1] +(-4*\rad,1.2cm); % partnumber shade + \end{pgfonlayer} + \ifodd\value{page} + \begin{pgfonlayer}{top} + \fill[outermarginfgcolor,opacity=0.8,rounded corners=5pt]node[append after command={([yshift=2cm]chapnum.north west) rectangle (chapnum.south east)},right,text=white,minimum width=2cm,align=center,font=\bf] (chapnum) at ([shift={(2cm,-2.5cm)}]current page.north west) {\scalebox{3}{\thechapter}}; + % \pattern[pattern=sixpointed stars,pattern color=outermarginfgcolor!50,opacity=0.8] + % ([yshift=2cm]chapnum.north west) rectangle (chapnum.south east); + \fill [outermarginfgcolor,path fading=fade up,rounded corners=5pt]% + ([yshift=2cm]chapnum.north west) rectangle (chapnum.south east); + \node[above left,font=\fontsize{25}{25}\selectfont\bfseries,align=center] (contents name) at ([shift={(0cm,-4.45cm)}]current page.north east) {\begin{varwidth}{.7\linewidth}\baselineskip=2ex #1\end{varwidth}}; + \end{pgfonlayer} + \begin{pgfonlayer}{bottom} + \node[right] (image) at ([shift={(-0.5cm,-2.8cm)}]current page.north west) {\includegraphics[width=7cm]{inner_pics/song2.png}}; + \end{pgfonlayer} + \node[above left,font=\fontsize{15}{15}\selectfont,circle,fill=outermarginfgcolor,text=white,inner sep=1mm] (pagenumber) at ([shift={(-5mm,5mm)}]current page.south east) {\thepage}; + \else + \begin{pgfonlayer}{top} + \fill[outermarginfgcolor,opacity=0.8,rounded corners=5pt]node[append after command={([yshift=2cm]chapnum.north west) rectangle (chapnum.south east)},left,text=white,minimum width=2cm,align=center,font=\bf] (chapnum) at ([shift={(-2.0cm,-2.5cm)}]current page.north east) {\scalebox{3}{\thechapter}}; + % \pattern[pattern=sixpointed stars,pattern color=outermarginfgcolor!50,opacity=0.8] + % ([yshift=2cm]chapnum.north west) rectangle (chapnum.south east); + \fill [outermarginfgcolor,path fading=fade up,rounded corners=5pt]% + ([yshift=2cm]chapnum.north west) rectangle (chapnum.south east); + \node[above right,font=\fontsize{25}{25}\selectfont\bfseries,align=center] (contents name) at ([shift={(0cm,-4.45cm)}]current page.north west) {\begin{varwidth}{.7\linewidth}\baselineskip=2ex #1\end{varwidth}}; + \end{pgfonlayer} + \begin{pgfonlayer}{bottom} + \node[left] (image) at ([shift={(0.5cm,-2.8cm)}]current page.north east) {\includegraphics[width=7cm]{inner_pics/song.png}}; + \end{pgfonlayer} + \node[above right,font=\fontsize{15}{15}\selectfont,circle,fill=outermarginfgcolor,text=white,inner sep=1mm] (pagenumber) at ([shift={(5mm,5mm)}]current page.south west) {\thepage}; + \fi + \fill[outermarginfgcolor,rounded corners=2pt] + (current page.south west) -- ++(1.5mm,1.5mm) --++(\paperwidth-3mm,0mm)--++(1.5mm,-1.5mm)--cycle; + \end{tikzpicture}} + } +\titleformat{name=\chapter,numberless}{\bfseries\huge\filcenter}{}{1em}{ + \begin{tikzpicture}[remember picture, overlay]% + \begin{pgfonlayer}{bottom} + \shade[left color=outermarginbgcolor!10,middle color=outermarginbgcolor!50,right color=outermarginfgcolor!20] (current page.north west) rectangle ++(\paperwidth,-.2\paperheight); + \fill[outermarginfgcolor,opacity=.5]([shift={(0,-4.25cm)}]current page.north west) rectangle ++(\paperwidth,-2mm); + \end{pgfonlayer} + \node[left,font=\huge\bfseries] (contents name) at ([shift={(0cm,-3cm)}]current page.north east) {\begin{varwidth}{.9\linewidth}\baselineskip=2.6ex #1\end{varwidth}}; + \begin{pgfonlayer}{background} + \node[right] (image) at ([shift={(0,-2.2cm)}]current page.north west) {\includegraphics[width=3cm,angle =45]{inner_pics/flower.png}}; + \end{pgfonlayer} + \end{tikzpicture} +} +\titlespacing{\chapter}{0pt}{0pt}{65pt} +% -------- Part定制 +\makeatletter +\newcommand\partabstract[1]{\def\@partabstract{#1}} +\newcommand\partimage[1]{\def\@partimage{#1}} +\titleformat{\part} +{\normalfont\huge\filcenter} +{} +{20pt} +{\begin{tikzpicture}[remember picture,overlay] + \def\barwidth{2cm} + \fill[outermarginbgcolor,opacity=0.6] + (current page.north west) rectangle (current page.south east); + \ifodd\value{page} + \fill[outermarginfgcolor] + (current page.north east) rectangle ++(-\barwidth,-\paperheight); + \node[] (hbar) at ($(current page.north)!0.33!(current page.south)$) { + \begin{tikzpicture} + \fill[white] + (0,0) rectangle ++(\paperwidth,-1cm); + \fill[outermarginbgcolor] + (0,-.25cm) rectangle ++(\paperwidth,-.5cm); + \fill[outermarginfgcolor] + (.67\paperwidth,-.25cm) rectangle ++(4.5cm,-.5cm); + \fill[outermarginfgcolor!20!white] + (.67\paperwidth-1mm,-.25cm) rectangle ++(1mm,-.5cm); + \fill[outermarginfgcolor!20!white] + (.67\paperwidth+4.4cm,-.25cm) rectangle ++(1mm,-.5cm); + \end{tikzpicture} + }; + \node[above,font=\huge,shift={(.33\linewidth,.5\barwidth)}] (partname) at (hbar) {Part\ \thepart}; + \node[below,left,font=\sffamily\bfseries\huge,shift={(.146\linewidth,-1.5*\barwidth)}] (partcontents) at (partname) {\begin{varwidth}{.8\linewidth}\raggedright\baselineskip=2ex #1 \end{varwidth}}; % 标题名称 + \begin{pgfonlayer}{background} + \node[above,shift={(-.4\linewidth,-4*\barwidth)},opacity=0.8] at (partname) {\ifdefvoid{\@partimage}{}{\includegraphics[width=1.2\linewidth]{\@partimage}}}; % 图片位置调整 + \end{pgfonlayer} + \node[above right,font=\fontsize{15}{15}\selectfont,circle,fill=outermarginfgcolor,text=white,inner sep=1mm] (pagenumber) at ([shift={(5mm,5mm)}]current page.south west) {\thepage}; + \else + \fill[outermarginfgcolor] + (current page.north west) rectangle ++(\barwidth,-\paperheight); + \node[] (hbar) at ($(current page.north)!0.33!(current page.south)$) { + \begin{tikzpicture} + \fill[white] + (0,0) rectangle ++(\paperwidth,-1cm); + \fill[outermarginbgcolor] + (0,-.25cm) rectangle ++(\paperwidth,-.5cm); + \fill[outermarginfgcolor] + (.15\paperwidth,-.25cm) rectangle ++(4.5cm,-.5cm); + \fill[outermarginfgcolor!20!white] + (.15\paperwidth-1mm,-.25cm) rectangle ++(1mm,-.5cm); + \fill[outermarginfgcolor!20!white] + (.15\paperwidth+4.5cm,-.25cm) rectangle ++(1mm,-.5cm); + \end{tikzpicture} + }; + \node[above,font=\huge,shift={(-.31\linewidth,.5\barwidth)}] (partname) at (hbar) {Part\ \thepart}; + \node[below right,font=\sffamily\bfseries\huge,shift={(-.125\linewidth,-1.2*\barwidth)}] (partcontents) at (partname) {\begin{varwidth}{.8\linewidth}\raggedright\baselineskip=2ex #1 \end{varwidth}}; % 标题名称 + \begin{pgfonlayer}{background} + \node[above,shift={(.4\linewidth,-4*\barwidth)},opacity=0.8] at (partname) {\ifdefvoid{\@partimage}{}{\includegraphics[width=1.2\linewidth]{\@partimage}}}; % 图片位置调整 + \end{pgfonlayer} + \node[above left,font=\fontsize{15}{15}\selectfont,circle,fill=outermarginfgcolor,text=white,inner sep=1mm] (pagenumber) at ([shift={(-5mm,5mm)}]current page.south east) {\thepage}; + \fi + \node[below,,font=\sffamily\fontsize{13}{13}\selectfont,shift={(0\linewidth,-1.65*\barwidth)}] at (hbar) {\ifdefvoid{\@partabstract}{}{\begin{varwidth}{.85\linewidth}\baselineskip=3ex \@partabstract\end{varwidth}}}; % 简介文字调整 + \end{tikzpicture}} +\makeatother +\assignpagestyle{\part}{empty} +\assignpagestyle{\chapter}{empty} +%% -- Section +\titleformat{\section} +{} +{} +{-.5em} %左右移动\thesection标签位置 +{\mysectionformat{#1}} + +\newcommand{\mysectionformat}[1]{% +\makebox[0pt][l]{\def\rad{7pt}% +\begin{tikzpicture}[remember picture] + \path[fill=outermarginfgcolor,drop shadow={opacity=0.3,shadow xshift=.05cm,shadow yshift=-.05cm}]node[append after command={ + ([xshift=\rad]sec.north west) to[out=180,in=0,looseness=1] ([xshift=-3*\rad]sec.south west) --([xshift=-\rad]sec.south east) to[out=0,in=180,looseness=1] ([xshift=3*\rad]sec.north east) --cycle}, + text=white,font=\rmfamily\large\bfseries,align=center,inner ysep=2mm] (sec) at (0,0) {Sec\ \thesection}; + \draw[outermarginbgcolor,line width=0.5pt] (sec.north east)--++(.8\linewidth,0); + \node[text=black,font=\rmfamily\bfseries\Large,below right] (secnum) at ([shift={(0,0mm)}]sec.north east) {\begin{varwidth}{.85\linewidth}\setlength\baselineskip{22.5pt}\hspace{.5cm}#1\end{varwidth}}; +\end{tikzpicture}}}%最后一个选项为 [<after code>] +\titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex} +% 侧边条 +\newlength\chapternumbersize +\setlength\chapternumbersize{40pt} +\setlength{\headheight}{40pt} % 页眉高度 +\RequirePackage{xpatch} +\RequirePackage{scrlayer-scrpage} +\renewcommand\chaptermarkformat{} +% define a new mark for the chapter number +\newmarks\chapternum +\xapptocmd\chaptermark{\marks\chapternum{\thechapter}}{}{\PatchFailed} +\newmarks\secnum +\xapptocmd\sectionmark{\marks\secnum{\thesection}}{}{\PatchFailed} + +\newcommand*\outermarginpagemark{% +\tikzoverlay{ + \begin{pgfonlayer}{top} + \ifodd\value{page} + \fill[outermarginfgcolor,rounded corners=2pt] (current page.north east) --++(-5pt,-0.15cm)--++(-\outermarginwidth+10pt,0) --++(-5pt,0.15cm)--cycle; + \coordinate (anchor of headmark) at ([shift={(-1.2\outermarginwidth,-0.2cm)}]current page.north east); + \node[below ,text=outermarginfgcolor,font=\bfseries\fontsize{20}{20}\selectfont] at ([shift={(-.5\outermarginwidth,-0.2cm)}]current page.north east) {\thepage}; + \node[below left,font=\upshape,text=outermarginfgcolor] at (anchor of headmark) {\begin{varwidth}{\linewidth}\rightmark\end{varwidth}}; + \fill[outermarginfgcolor,rounded corners=2pt] (current page.south east) --++(-5pt,0.15cm)--++(-\outermarginwidth+10pt,0) --++(-5pt,-0.15cm)--cycle; + \else + \fill[outermarginfgcolor,rounded corners=2pt] (current page.north west) --++(5pt,-0.15cm)--++(\outermarginwidth-10pt,0) --++(5pt,0.15cm)--cycle; + \coordinate (anchor of headmark) at ([shift={(1.2\outermarginwidth,-0.2cm)}]current page.north west); + \node[below ,text=outermarginfgcolor,font=\bfseries\fontsize{20}{20}\selectfont] at ([shift={(.5\outermarginwidth,-0.2cm)}]current page.north west) {\thepage}; + \node[below right,font=\upshape,text=outermarginfgcolor] at (anchor of headmark) {\begin{varwidth}{\linewidth}\rightmark\end{varwidth}}; + \fill[outermarginfgcolor,rounded corners=2pt] (current page.south west) --++(5pt,0.15cm)--++(\outermarginwidth-10pt,0) --++(5pt,-0.15cm)--cycle; + \fi + \end{pgfonlayer}} +} +\newlength\baryshift +\setlength\baryshift{-2.5\outermarginwidth} +\makeatletter +% Add A Side-Bar Box For The Chapter Number +\newcommand*\outermarginchapternumberbox{% + \if@mainmatter + \tikzoverlay{ + \shade[top color=outermarginfgcolor!90,bottom color=outermarginbgcolor] + (\outermarginwidth,-.5\outermarginwidth) rectangle (0,-1.5\outermarginwidth); + \node[anchor=center,text=white,font=\bfseries] at (1/2*\outermarginwidth,-\outermarginwidth) {\usekomafont{chapternumber}{\botmarks\chapternum}};% + } + \fi + \vfill +} +\makeatother + +\newkomafont{chapternumber}{%页边章节编号字体 + \fontsize{\chapternumbersize}{\chapternumbersize}\selectfont +}% +\makeatletter +\newcommand\outermarginmark{ + \ifodd\value{page}\hfill\else\hspace*{\dimexpr\outermarginwidth*3/8\relax}\fi + \rotatebox{90}{\parbox{\layerheight}{ + \raggedleft + \usekomafont{outermargin}{% + \MakeMarkcase{\ifodd\value{page}\odd@outermargin\else\even@outermargin\fi}}% + }}% + \ifodd\value{page}\hspace*{\dimexpr\outermarginwidth*3/8\relax}\fi% +} +\newcommand*\even@outermargin{} +\newcommand*\odd@outermargin{} +\newcommand*\evenoutermargin[1]{\renewcommand\even@outermargin{#1}}% 偶数页内容 +\newcommand*\oddoutermargin[1]{\renewcommand\odd@outermargin{#1}}% 奇数页内容 +\makeatother +% +\newkomafont{outermargin}{%页边章节名称字体 + \sffamily\bfseries\fontsize{15}{15}\selectfont\color{outermarginfgcolor} +} +% declare new page style using layers +\DeclareNewPageStyleByLayers{scth}{% + scth.outermargin.bg.even,% + scth.outermargin.bg.odd,% + scth.outermargin.fg.even,% + scth.outermargin.fg.odd,% + scth.outermargin.pn.even,% + scth.outermargin.pn.odd,% + scth.outermargin.cn.even,% + scth.outermargin.cn.odd,% + scth.outermargin.text.even,% + scth.outermargin.text.odd% +} +% define the layers for even pages +\DeclareNewLayer[ + background, % 下层(背景) + evenpage, + outermargin, + width=\outermarginwidth, + contents={\color{outermarginbgcolor}\rule{\layerwidth}{\layerheight}} %色彩装饰条 +]{scth.outermargin.bg.even}% +%%=============% 页边条颜色 %=======================%% +\tikzfading[name=fade south, + top color =transparent!0, + bottom color=transparent!80] +\tikzfading[name=fade north, + top color =transparent!100, + bottom color=transparent!0] +%偶数页边纹理效果设置 +\newcommand{\evensidbardeepcolor}{% +\tikzoverlay{ +\ifodd\value{page} +\fill [outermarginfgcolor!20]% + (current page.north east) rectangle ([xshift=-\outermarginwidth,yshift=0]current page.south east); + \pattern [pattern=checkerboard,pattern color=outermarginfgcolor!50]% + (current page.north east) rectangle ([xshift=-\outermarginwidth,yshift=0]current page.south east); + \fill [outermarginbgcolor!90,path fading=fade south]% + ([yshift=1mm]current page.north east) rectangle ([xshift=-\outermarginwidth,yshift=-.5\layerheight]current page.north east); + \fill [outermarginbgcolor,path fading=fade north]% + (current page.south east) rectangle ([xshift=-\outermarginwidth,yshift=.2\layerheight]current page.south east); +\else + \fill [outermarginfgcolor!20]% + (current page.north west) rectangle ([xshift=\outermarginwidth,yshift=0]current page.south west); + \pattern [pattern=checkerboard,pattern color=outermarginfgcolor!50]% + (current page.north west) rectangle ([xshift=\outermarginwidth,yshift=0]current page.south west); + \fill [outermarginbgcolor!90,path fading=fade south]% + ([yshift=1mm]current page.north west) rectangle ([xshift=\outermarginwidth,yshift=-.5\layerheight]current page.north west); + \fill [outermarginbgcolor,path fading=fade north]% + (current page.south west) rectangle ([xshift=\outermarginwidth,yshift=.2\layerheight]current page.south west); + \fi +} +} +%%==============偶数页页边条颜色========================%% +\DeclareNewLayer[ + foreground, % + evenpage, + outermargin, + width=\outermarginwidth, + contents=\evensidbardeepcolor %色彩装饰条 +]{scth.outermargin.fg.even}% +%%==============偶数页页脚页码========================%% +\DeclareNewLayer[ + foreground, %上层 (背景之上) + evenpage, + foot, % 页脚 + contents=\outermarginpagemark +]{scth.outermargin.pn.even}% +%%==============偶数页章节编号========================%% +\DeclareNewLayer[ + foreground, %上层 (背景之上) + evenpage, + head, %页眉 + hoffset=0pt, + width=\outermarginwidth, + align=t, + addvoffset=\dimexpr-\chapternumbersize-12pt+\headheight\relax, + height=\chapternumbersize+\headheight, + contents=\outermarginchapternumberbox%章节编号 +]{scth.outermargin.cn.even}% +%%======================章节名称===================================%% +\DeclareNewLayer[ + clone=scth.outermargin.cn.even, + addheight=\dimexpr\headheight+\headsep+\textheight\relax, + addvoffset=\dimexpr+2\outermarginwidth\relax, + hoffset=-2.5pt, + contents=\outermarginmark % +]{scth.outermargin.text.even}% + +% define the layers for odd page from the settings for even pages +\newcommand*\DeclareOddFromEven[1]{%复制自偶数页样式命令 +\DeclareNewLayer[ + clone=#1.even, + oddpage, + align=r, + hoffset=\paperwidth +]{#1.odd}% +} +\DeclareOddFromEven{scth.outermargin.bg} +\DeclareOddFromEven{scth.outermargin.pn} +\DeclareOddFromEven{scth.outermargin.cn} +\DeclareOddFromEven{scth.outermargin.text} +\DeclareOddFromEven{scth.outermargin.fg} + +% add the layers to page style scrheadings and page style plain +\ForEachLayerOfPageStyle*{scth}{% + \AddLayersToPageStyle{scrheadings}{#1}% + \AddLayersToPageStyle{plain.scrheadings}{#1}% +} +%---------------------------------------------- +\KOMAoptions{markcase=upper} %页眉 +% for page styles scrheadings and plain +\clearpairofpagestyles +\ohead{} +\cfoot{} +\ofoot{} +% set the contents of the outer margin on even and odd pages for scrheadings, plain and scth +\oddoutermargin{\bf\leftmark} % Odd 奇数页 +\makeatletter +\evenoutermargin{\bfseries\@title} % Even 偶数页 +\makeatother +%% Begin The Most Beautiful Box (STYLE : ys style) % 中国风盒子 +\makeatletter +\definecolor{framegolden}{HTML}{455a64} % 控制外框颜色 +\definecolor{framegray}{HTML}{e0e0e0} % 控制填充颜色 +\newdimen\ys@frame@linewidth +\newdimen\ys@frame@radius +\newdimen\ys@frame@sep +\def\ys@frame@fill@opacity{0.2} + +\pgfdeclarehorizontalshading{ys@fade@circle}{500bp} +{color(0bp)=(pgftransparent!100); color(25bp)=(pgftransparent!100); +color(45bp)=(pgftransparent!0); color(55bp)=(pgftransparent!0); +color(75bp)=(pgftransparent!100); color(100bp)=(pgftransparent!100)} +\pgfdeclarefading{ys circle}{\pgfuseshading{ys@fade@circle}} + +\def\ys@frame@star@list@t{% + -0.7071\ys@frame@radius+0.2133\ys@frame@sep/% + -0.7071\ys@frame@radius+0.2133\ys@frame@sep/% + frame.north east,% + 0.7071\ys@frame@radius-0.2133\ys@frame@sep/% + -0.7071\ys@frame@radius+0.2133\ys@frame@sep/% + frame.north west} +\def\ys@frame@star@list@b{% + 0.7071\ys@frame@radius-0.2133\ys@frame@sep/% + 0.7071\ys@frame@radius-0.2133\ys@frame@sep/% + frame.south west,% + -0.7071\ys@frame@radius+0.2133\ys@frame@sep/% + 0.7071\ys@frame@radius-0.2133\ys@frame@sep/% + frame.south east} +\edef\ys@frame@star@list{\ys@frame@star@list@t,\ys@frame@star@list@b} + +%region outer +\def\ys@frame@remove@middleline#1#2{} +\def\ys@frame@draw@middleline#1#2{% + \clip ([xshift=-\ys@frame@linewidth,#1]frame.north west)-- + ([xshift=\ys@frame@linewidth,#1]frame.north east)-- + ([xshift=\ys@frame@linewidth,#2]frame.south east)-- + ([xshift=-\ys@frame@linewidth,#2]frame.south west)--cycle;} +\def\ys@frame@unbrokenouter{% + \path[draw=framegolden,fill=framegray,fill opacity=\ys@frame@fill@opacity,line width=\ys@frame@linewidth] + ([xshift=\ys@frame@radius]frame.north west)--([xshift=-\ys@frame@radius]frame.north east) + arc(-180:-90:\ys@frame@radius)-- + ([yshift=-\ys@frame@radius]frame.north east)--([yshift=\ys@frame@radius]frame.south east) + arc(90:180:\ys@frame@radius)-- + ([xshift=-\ys@frame@radius]frame.south east)--([xshift=\ys@frame@radius]frame.south west) + arc(0:90:\ys@frame@radius)-- + ([yshift=\ys@frame@radius]frame.south west)--([yshift=-\ys@frame@radius]frame.north west) + arc(-90:0:\ys@frame@radius)--cycle;} +\def\ys@frame@firstouter{% + \ys@frame@remove@middleline{yshift=.5\ys@frame@linewidth}{yshift=.7\ys@frame@linewidth}% + \path[draw=framegolden,fill=framegray,fill opacity=\ys@frame@fill@opacity,line width=\ys@frame@linewidth] + ([xshift=\ys@frame@radius]frame.north west)--([xshift=-\ys@frame@radius]frame.north east) + arc(-180:-90:\ys@frame@radius)-- + ([yshift=-\ys@frame@radius]frame.north east)-- + (frame.south east)-- + (frame.south west)-- + ([yshift=-\ys@frame@radius]frame.north west) + arc(-90:0:\ys@frame@radius)--cycle;} +\def\ys@frame@middleouter{% + \ys@frame@remove@middleline{yshift=-.7\ys@frame@linewidth}{yshift=.7\ys@frame@linewidth}% + \path[draw=framegolden,fill=framegray,fill opacity=\ys@frame@fill@opacity,line width=\ys@frame@linewidth] + (frame.north west)--(frame.north east)--(frame.south east)-- + (frame.south west)--cycle;} +\def\ys@frame@lastouter{% + \ys@frame@remove@middleline{yshift=-.7\ys@frame@linewidth}{yshift=-.5\ys@frame@linewidth}% + \path[draw=framegolden,fill=framegray,fill opacity=\ys@frame@fill@opacity,line width=\ys@frame@linewidth] + (frame.north west)--(frame.north east)-- + ([yshift=\ys@frame@radius]frame.south east) + arc(90:180:\ys@frame@radius)-- + ([xshift=-\ys@frame@radius]frame.south east)--([xshift=\ys@frame@radius]frame.south west) + arc(0:90:\ys@frame@radius)-- + ([yshift=\ys@frame@radius]frame.south west)-- + (frame.north west)--cycle;} +%endregion +%region inner +\def\ys@frame@unbrokeninner{% +\path[draw=framegolden,line width=.5\ys@frame@linewidth,line cap=round] +([xshift=\ys@frame@radius+2\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west) + --([xshift=\ys@frame@radius+5\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west) --++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) + ([xshift=\ys@frame@radius+6\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west)--++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) %第一节 + --([xshift=-\ys@frame@radius-8.828\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east)--++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) + ([xshift=-\ys@frame@radius-7.828\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east)--++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第二节 + --([xshift=-\ys@frame@radius-2\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east) + %% +([yshift=-\ys@frame@radius-2\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.north east) +--([yshift=-\ys@frame@radius-5\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.north east) --++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) +([yshift=-\ys@frame@radius-6\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.north east)--++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) %第一节 +--([yshift=\ys@frame@radius+8.828\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.south east)--++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) +([yshift=\ys@frame@radius+7.828\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.south east)--++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第二节 +% + --([yshift=\ys@frame@radius+2\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.south east) +% +([xshift=\ys@frame@radius+2\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west) +--([xshift=\ys@frame@radius+5\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west) --++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) +([xshift=\ys@frame@radius+6\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west)--++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第一节 +--([xshift=-\ys@frame@radius-8.828\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east)--++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) +([xshift=-\ys@frame@radius-7.828\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east)--++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) %第二节 + --([xshift=-\ys@frame@radius-2\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east) +% +([yshift=-\ys@frame@radius-2\ys@frame@linewidth,xshift=\ys@frame@sep]frame.north west) +--([yshift=-\ys@frame@radius-5\ys@frame@linewidth,xshift=\ys@frame@sep]frame.north west) --++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) +([yshift=-\ys@frame@radius-6\ys@frame@linewidth,xshift=\ys@frame@sep]frame.north west)--++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第一节 +--([yshift=\ys@frame@radius+8.828\ys@frame@linewidth,xshift=\ys@frame@sep]frame.south west)--++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) +([yshift=\ys@frame@radius+7.828\ys@frame@linewidth,xshift=\ys@frame@sep]frame.south west)--++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) %第二节 + --([yshift=\ys@frame@radius+2\ys@frame@linewidth,xshift=\ys@frame@sep]frame.south west);} +\def\ys@frame@firstinner{% + \path[draw=framegolden,line width=.5\ys@frame@linewidth,line cap=round] + ([xshift=\ys@frame@radius+2\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west) + --([xshift=\ys@frame@radius+5\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west) --++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) + ([xshift=\ys@frame@radius+6\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west)--++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) %第一节 + --([xshift=-\ys@frame@radius-8.828\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east)--++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) + ([xshift=-\ys@frame@radius-7.828\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east)--++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第二节 + --([xshift=-\ys@frame@radius-2\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east) + %% +([yshift=-\ys@frame@radius-2\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.north east) +--([yshift=-\ys@frame@radius-5\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.north east) --++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) +([yshift=-\ys@frame@radius-6\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.north east)--++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) %第一节 +--([xshift=-\ys@frame@sep]frame.south east) + + ([yshift=-\ys@frame@radius-2\ys@frame@linewidth,xshift=\ys@frame@sep]frame.north west) + --([yshift=-\ys@frame@radius-5\ys@frame@linewidth,xshift=\ys@frame@sep]frame.north west) --++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) + ([yshift=-\ys@frame@radius-6\ys@frame@linewidth,xshift=\ys@frame@sep]frame.north west)--++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第一节 + --([xshift=\ys@frame@sep]frame.south west);} +\def\ys@frame@middleinner{% + \path[draw=framegolden,line width=.5\ys@frame@linewidth,line cap=round] + ([xshift=-\ys@frame@sep]frame.north east)--([xshift=-\ys@frame@sep]frame.south east) + ([xshift=\ys@frame@sep]frame.north west)--([xshift=\ys@frame@sep]frame.south west);} +\def\ys@frame@lastinner{% + \path[draw=framegolden,line width=.5\ys@frame@linewidth,line cap=round] + ([xshift=-\ys@frame@sep]frame.north east) + --([yshift=\ys@frame@radius+8.828\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.south east)--++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) + ([yshift=\ys@frame@radius+7.828\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.south east)--++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第二节 + % + --([yshift=\ys@frame@radius+2\ys@frame@linewidth,xshift=-\ys@frame@sep]frame.south east) +% + ([xshift=\ys@frame@radius+2\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west) + --([xshift=\ys@frame@radius+5\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west) --++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) + ([xshift=\ys@frame@radius+6\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west)--++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) %第一节 + --([xshift=-\ys@frame@radius-8.828\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east)--++(45:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) + ([xshift=-\ys@frame@radius-7.828\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east)--++(-45:2\ys@frame@linewidth)--++(45:2\ys@frame@linewidth) %第二节 + --([xshift=-\ys@frame@radius-2\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east) +% + ([xshift=\ys@frame@sep]frame.north west) + --([yshift=\ys@frame@radius+8.828\ys@frame@linewidth,xshift=\ys@frame@sep]frame.south west)--++(-135:2\ys@frame@linewidth)--++(-45:2\ys@frame@linewidth) + ([yshift=\ys@frame@radius+7.828\ys@frame@linewidth,xshift=\ys@frame@sep]frame.south west)--++(-45:2\ys@frame@linewidth)--++(-135:2\ys@frame@linewidth) %第二节 + --([yshift=\ys@frame@radius+2\ys@frame@linewidth,xshift=\ys@frame@sep]frame.south west);} +%endregion +%region corner +\def\ys@frame@unbrokencorner{% + \path[draw=framegolden,line width=1.5\ys@frame@linewidth,line cap=round] + ([xshift=\ys@frame@radius-2.7\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west) + --([xshift=\ys@frame@sep,yshift=-\ys@frame@sep]frame.north west) + --([xshift=\ys@frame@sep,yshift=-\ys@frame@radius+2.7\ys@frame@linewidth]frame.north west) + ([xshift=-\ys@frame@radius+2.7\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east) + --([xshift=-\ys@frame@sep,yshift=-\ys@frame@sep]frame.north east) + --([xshift=-\ys@frame@sep,yshift=-\ys@frame@radius+2.7\ys@frame@linewidth]frame.north east) + ([xshift=-\ys@frame@radius+2.7\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east) + --([xshift=-\ys@frame@sep,yshift=\ys@frame@sep]frame.south east) + --([xshift=-\ys@frame@sep,yshift=\ys@frame@radius-2.7\ys@frame@linewidth]frame.south east) + ([xshift=\ys@frame@radius-2.7\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west) + --([xshift=\ys@frame@sep,yshift=\ys@frame@sep]frame.south west) + --([xshift=\ys@frame@sep,yshift=\ys@frame@radius-2.7\ys@frame@linewidth]frame.south west);} +\def\ys@frame@firstcorner{% + \path[draw=framegolden,line width=1.5\ys@frame@linewidth,line cap=round] + ([xshift=\ys@frame@radius-2.7\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north west) + --([xshift=\ys@frame@sep,yshift=-\ys@frame@sep]frame.north west) + --([xshift=\ys@frame@sep,yshift=-\ys@frame@radius+2.7\ys@frame@linewidth]frame.north west) + ([xshift=-\ys@frame@radius+2.7\ys@frame@linewidth,yshift=-\ys@frame@sep]frame.north east) + --([xshift=-\ys@frame@sep,yshift=-\ys@frame@sep]frame.north east) + --([xshift=-\ys@frame@sep,yshift=-\ys@frame@radius+2.7\ys@frame@linewidth]frame.north east);} +\def\ys@frame@middlecorner{} +\def\ys@frame@lastcorner{% + \path[draw=framegolden,line width=1.5\ys@frame@linewidth,line cap=round] + ([xshift=-\ys@frame@radius+2.7\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south east) + --([xshift=-\ys@frame@sep,yshift=\ys@frame@sep]frame.south east) + --([xshift=-\ys@frame@sep,yshift=\ys@frame@radius-2.7\ys@frame@linewidth]frame.south east) + ([xshift=\ys@frame@radius-2.7\ys@frame@linewidth,yshift=\ys@frame@sep]frame.south west) + --([xshift=\ys@frame@sep,yshift=\ys@frame@sep]frame.south west) + --([xshift=\ys@frame@sep,yshift=\ys@frame@radius-2.7\ys@frame@linewidth]frame.south west);} +%endregion +\def\ys@frame@star#1#2#3{% + \begin{scope}[shift={([xshift=#1,yshift=#2]#3)},scale=\ys@frame@ratio*0.1] + \path[draw=framegolden,fill=white, + line width=.7\ys@frame@linewidth,line join=round] + (1,1)..controls(0.3,0.5) and (-0.3,0.5).. + (-1,1)..controls(-0.5,0.3) and (-0.5,-0.3).. + (-1,-1)..controls(-0.3,-0.5) and (0.3,-0.5).. + (1,-1)..controls(0.5,-0.3) and (0.5,0.3)..(1,1)--cycle; + \path[scale=0.45,fill=framegolden,line join=round] + (1,1)..controls(0.3,0.7) and (-0.3,0.7).. + (-1,1)..controls(-0.7,0.3) and (-0.7,-0.3).. + (-1,-1)..controls(-0.3,-0.7) and (0.3,-0.7).. + (1,-1)..controls(0.7,-0.3) and (0.7,0.3)..(1,1)--cycle; + \end{scope}} +\def\ys@frame@segmentation{% + \draw[color=framegolden,path fading=ys circle] + ([xshift=5\ys@frame@radius]segmentation.west) to[ornament=88] + ([xshift=-5\ys@frame@radius]segmentation.east);} + +\tcbset{ + % 控制是否在断点处的线不画出来 + ys/frame/not at break/.code=\let\ys@frame@remove@middleline\ys@frame@draw@middleline, + ys/frame/fill opacity/.store in=\ys@frame@fill@opacity, + ys/frame/draw at break/.code=\let\ys@frame@remove@middleline\@gobbletwo, + % 控制线宽 + ys/frame/line width/.code={\pgfmathsetlength\ys@frame@linewidth{#1}}, + ys/frame/line width=1.4pt, + % 控制圆弧大小,应为数字,而非长度 + ys/frame/radius/.code={\pgfmathparse{#1}\let\ys@frame@ratio\pgfmathresult + \pgfmathsetlength\ys@frame@radius{(#1)*1em}% + \pgfmathsetlength\ys@frame@sep{(#1)*0.5ex}}, + ys/frame/radius=2, + ys/frame/unbroken/.style={ + interior code={% + \ys@frame@unbrokenouter % 外框 + \foreach \ii/\jj/\kk in \ys@frame@star@list {\ys@frame@star{\ii}{\jj}{\kk}} % 星 + \ys@frame@unbrokeninner % 内线 + \ys@frame@unbrokencorner % 四角 + }, + interior titled code={% + \ys@frame@unbrokenouter % 外框 + \foreach \ii/\jj/\kk in \ys@frame@star@list {\ys@frame@star{\ii}{\jj}{\kk}} % 星 + \ys@frame@unbrokeninner % 内线 + \ys@frame@unbrokencorner % 四角 + } + }, + ys/frame/first/.style={ + interior code={% + \ys@frame@firstouter + \foreach \ii/\jj/\kk in \ys@frame@star@list@t {\ys@frame@star{\ii}{\jj}{\kk}} + \ys@frame@firstinner + \ys@frame@firstcorner}, + interior titled code={% + \ys@frame@firstouter + \foreach \ii/\jj/\kk in \ys@frame@star@list@t {\ys@frame@star{\ii}{\jj}{\kk}} + \ys@frame@firstinner + \ys@frame@firstcorner}, + }, + ys/frame/middle/.style={ + interior code={% + \ys@frame@middleouter + \ys@frame@middleinner + \ys@frame@middlecorner} + }, + ys/frame/last/.style={ + interior code={% + \ys@frame@lastouter + \foreach \ii/\jj/\kk in \ys@frame@star@list@b {\ys@frame@star{\ii}{\jj}{\kk}} + \ys@frame@lastinner + \ys@frame@lastcorner} + }, + ys/frame style/unbroken/.style={ + boxsep=2\ys@frame@sep, + left={.8\ys@frame@radius},right={.8\ys@frame@radius}, + ys/frame/unbroken,title hidden, + segmentation code=\ys@frame@segmentation + }, + ys/frame style/first/.style={ys/frame/first,title hidden,segmentation code=\ys@frame@segmentation}, + ys/frame style/middle/.style={ys/frame/middle,segmentation code=\ys@frame@segmentation}, + ys/frame style/last/.style={ys/frame/last,segmentation code=\ys@frame@segmentation}, + ys style/.style={frame hidden, + ys/frame style/unbroken, + extras first={ys/frame style/first}, + extras middle={ys/frame style/middle}, + extras last={ys/frame style/last}, + }, +} +\makeatother +\newtcolorbox{fancybox}{enhanced,ys style,breakable,pad at break=2mm, + ys/frame/not at break,ys/frame/fill opacity=0} +%% End The Most Beautiful Box +\makeatletter +\definecolor{CyaN}{HTML}{dbe1e5} +\colorlet{OrangE}{yellow!20!orange} +\colorlet{BluE}{cyan!70!blue} +\colorlet{ReD}{red!20!orange} +\colorlet{GreeN}{yellow!40!green} + +% 第一种定理 +\tcbset{my@basic@thm/.style={enhanced jigsaw, breakable, + enlarge left by=-3.5mm, width=\textwidth+3.5mm, boxrule=0pt, + top=2pt, bottom=2pt, left=2.5mm, frame hidden}} +\newcommand{\@my@newtheorem@n}[1]{\ERROR} +\newcommand{\@my@newtheorem@nn}[2]{% + \@ifundefined{#1}{\@my@newtheorem{#1}#2}{\@my@renewtheorem{#1}#2}} +\NewDocumentCommand{\@my@newtheorem}{ m m o +m } + {\IfNoValueTF{#3}{\newtheorem{#1}{#2}}{\newtheorem{#1}{#2}[#3]}% + \tcbset{my@#1@thmstyle/.style={#4}}% + \tcolorboxenvironment{#1}{my@basic@thm, my@#1@thmstyle}} +\NewDocumentCommand{\@my@renewtheorem}{ m m o +m } + {\IfNoValueTF{#3}{\renewtheorem{#1}{#2}}{\renewtheorem{#1}{#2}[#3]}% + \tcbset{my@#1@thmstyle/.style={#4}}} +% +% ---------------------------------------------------------------------------------- % +% 第二种定理 +\tcbset{my@basic@tcbthm/.style={detach title,}} +\newcommand{\@my@newtcbtheorem@n}[1]{\ERROR} +\newcommand{\@my@newtcbtheorem@nn}[2]{% + \@ifundefined{#1}{\@my@newtcbtheorem{#1}{#2}}{\@my@renewtcbtheorem{#1}{#2}}} +\newcommand{\@my@newtcbtheorem}[2]{% + \edef\my@curr@thmenvname{#1}% 它保存当前定理环境的名称 + \mytcbtheoremset{#2}% + \NewTColorBox{#1}{ O{} O{} o } + {my@basic@tcbthm, my@#1@tcbthmstyle, title={##2}, IfNoValueF={##3}{label={##3}}, ##1}} +\newcommand{\@my@renewtcbtheorem}[2]{\edef\my@curr@thmenvname{#1}\mytcbtheoremset{#2}} + +% 键值设置 +\pgfkeys{/mytcbtheorem/.is family} +\newcommand{\mytcbtheoremset}{\pgfqkeys{/mytcbtheorem}} +\mytcbtheoremset{ + name/.code=\@namedef{\my@curr@thmenvname @name}{#1}, %无效 + counter/.code=\@namedef{my@\my@curr@thmenvname @counter}{#1}\newcounter{#1}[chapter], % 计数器遇到subsection就会自动归零 % https://zhuanlan.zhihu.com/p/57454848#circle=on + the counter/.code=\@namedef{the\@nameuse{my@\my@curr@thmenvname @counter}}{#1}, + autoref name/.code=\@namedef{\@nameuse{my@\my@curr@thmenvname @counter}autorefname}{#1}, + style/.code=\tcbset{my@\my@curr@thmenvname @tcbthmstyle/.style={#1}}, + thmcolor/.code=\@namedef{\my@curr@thmenvname @thmcolor}{#1}, %无效 + lemcolor/.code=\@namedef{\my@curr@thmenvname @lemcolor}{#1}, %无效 +} +% 存储键值 (LaTeX3) +\ExplSyntaxOn +\cs_new_protected:Npn \mynewtheorem + { \keyval_parse:NNn \@my@newtheorem@n \@my@newtheorem@nn } +\cs_new_protected:Npn \mynewtcbtheorem + { \keyval_parse:NNn \@my@newtcbtheorem@n \@my@newtcbtheorem@nn } +\ExplSyntaxOff +\makeatother + +% 第二种定理 +\makeatletter +%% Overlay Settings +\newcommand{\my@theorem@overlay@unbroken}[2]{ + %%============== First ==============%% + \fill[black!60] ([xshift=1cm,yshift=5pt]frame.north west)-- ([xshift=0.8cm,yshift=0cm]frame.north west)--([xshift=1.2cm,yshift=0cm]frame.north west)--cycle; + \node[rectangle, text=white, drop shadow={opacity=.3, shadow xshift=0.1cm}, inner sep=1.5mm,fill=#2, +anchor=west,rounded corners=3pt,font=\bfseries\normalsize] at ([xshift=0cm,yshift=-3.mm]frame.north west) {\hspace*{1.5em}#1.\ \ifdefvoid{\tcbtitletext}{}{(\tcbtitletext)}}; + \fill[color=#2,drop shadow={opacity=0.3,shadow xshift=.3pt}] + ([xshift=1cm,yshift=5pt]frame.north west) {[rounded corners=3pt]--++(-1cm-5pt,0)}--++(0,-1cm-5pt)--cycle; + \fill[color=black!60] ([xshift=-5pt,yshift=-1cm]frame.north west)--([xshift=0cm,yshift=-0.8cm]frame.north west)-- ([xshift=0cm,yshift=-1.2cm]frame.north west)--cycle; + %%============== End ==============%% + \fill[#2,drop shadow={opacity=0.3,shadow xshift=-0.008\linewidth,shadow yshift=0.0016\linewidth}] + ([xshift=-0.05\linewidth,yshift=-5pt]frame.south east) {[rounded corners=3pt]--++(0.05\linewidth+5pt,0)}--++(0,0.05\linewidth+5pt)--cycle; + \fill[black!60] ([xshift=-0.05\linewidth,yshift=-5pt]frame.south east) -- ([xshift=-0.04\linewidth,yshift=0pt]frame.south east)-- ([xshift=-0.06\linewidth,yshift=0pt]frame.south east)--cycle; + \fill[black!60] ([xshift=5pt,yshift=0.05\linewidth]frame.south east)-- ([yshift=0.04\linewidth]frame.south east) -- ([yshift=0.06\linewidth]frame.south east)--cycle; +} +\newcommand{\my@theorem@overlay@first}[2]{ + \fill[black!60] ([xshift=1cm,yshift=5pt]frame.north west)-- ([xshift=0.8cm,yshift=0cm]frame.north west)--([xshift=1.2cm,yshift=0cm]frame.north west)--cycle; + \node[rectangle, text=white, drop shadow={opacity=.3, shadow xshift=0.1cm}, inner sep=1.5mm,fill=#2, anchor=west,rounded corners=3pt,font=\bfseries\normalsize] at ([xshift=0cm,yshift=-3.mm]frame.north west) {\hspace*{1.5em}#1.\ \ifdefvoid{\tcbtitletext}{}{(\tcbtitletext)}}; + \fill[color=#2,drop shadow={opacity=0.3,shadow xshift=.3pt}] + ([xshift=1cm,yshift=5pt]frame.north west) {[rounded corners=3pt]--++(-1cm-5pt,0)}--++(0,-1cm-5pt)--cycle; + \fill[color=black!60] ([xshift=-5pt,yshift=-1cm]frame.north west)--([xshift=0cm,yshift=-0.8cm]frame.north west)-- ([xshift=0cm,yshift=-1.2cm]frame.north west)--cycle; +} +\newcommand{\my@theorem@overlay@last}[1]{ + \fill[#1,drop shadow={opacity=0.3,shadow xshift=-0.008\linewidth,shadow yshift=0.0016\linewidth}] + ([xshift=-0.05\linewidth,yshift=-5pt]frame.south east) {[rounded corners=3pt]--++(0.05\linewidth+5pt,0)}--++(0,0.05\linewidth+5pt)--cycle; + \fill[black!60] ([xshift=-0.05\linewidth,yshift=-5pt]frame.south east) -- ([xshift=-0.04\linewidth,yshift=0pt]frame.south east)-- ([xshift=-0.06\linewidth,yshift=0pt]frame.south east)--cycle; + \fill[black!60] ([xshift=5pt,yshift=0.05\linewidth]frame.south east)-- ([yshift=0.04\linewidth]frame.south east) -- ([yshift=0.06\linewidth]frame.south east)--cycle; +} +% Second theorem style overlay settings +\newcommand{\my@lemma@overlay@unbroken}[2]{ + %%============== First ==============%% + \def\Rad{3.5pt} + \def\theight{0.57cm} + \def\rad{7pt}% + \path[fill=#2,drop shadow={opacity=0.3,shadow xshift=.05cm,shadow yshift=-.05cm}]node[append after command={ + ([xshift=-1.5*\rad]thmname.north west) to[out=0,in=180,looseness=1] ([xshift=2.5*\rad]thmname.south west) --([xshift=-\rad]thmname.south east) to[out=0,in=180,looseness=1] ([xshift=3*\rad]thmname.north east) --cycle}, + text=white,font=\bfseries,align=center,inner ysep=1.5mm,minimum height=0.6cm,right] (thmname) at ([xshift=\rad,yshift=-\rad]frame.north west) {\hspace*{10pt}#1.\ \ifdefvoid{\tcbtitletext}{}{(\tcbtitletext)}}; + \begin{pgfonlayer}{bottom} + \fill[#2,opacity=0.5] + ([xshift=-1.5*\rad]thmname.north west) to[out=-90,in=0,looseness=1.5] +(3pt,-6pt) -| +(10pt,0)--cycle; + \fill[#2,opacity=0.5] + ([xshift=3*\rad]thmname.north east) to[out=0,in=-90] +(5pt,-5pt) -| ++(-10pt,0) --cycle; + \end{pgfonlayer} + %%============== End ==============%% + \def\tlen{1.5cm} + \path[fill=#2,drop shadow={opacity=0.3,shadow xshift=.3pt}] + ([xshift=-2*\rad,yshift=-5pt]frame.south east) coordinate (SE) to[out=0,in=180] +(4*\rad,5pt+\theight) --([shift={(-\tlen+4*\rad,5pt+\theight)}]SE) to[out=180,in=0] +(-4*\rad,-5pt-\theight) --cycle; + \begin{pgfonlayer}{bottom} + \fill[color=#2!80!black] ([xshift=-1.35*\tlen+\Rad,yshift=-5pt]frame.south east) to[out=180,in=90,looseness=0.7] ([xshift=-1.35*\tlen-0.5*\Rad]frame.south east) coordinate (NWl)--([xshift=2*\rad]NWl) to[out=-90,in=-180,looseness=0.7] ([xshift=-1.35*\tlen+\Rad,yshift=-5pt]frame.south east)--cycle; + \end{pgfonlayer} + } +\newcommand{\my@lemma@overlay@first}[2]{ + %%============== First ==============%% + \def\Rad{3.5pt} + \def\theight{0.57cm} + \def\rad{7pt}% + \path[fill=#2,drop shadow={opacity=0.3,shadow xshift=.05cm,shadow yshift=-.05cm}]node[append after command={ + ([xshift=-1.5*\rad]thmname.north west) to[out=0,in=180,looseness=1] ([xshift=2.5*\rad]thmname.south west) --([xshift=-\rad]thmname.south east) to[out=0,in=180,looseness=1] ([xshift=3*\rad]thmname.north east) --cycle}, + text=white,font=\bfseries,align=center,inner ysep=1.5mm,minimum height=0.6cm,right] (thmname) at ([xshift=\rad,yshift=-\rad]frame.north west) {\hspace*{10pt}#1.\ \ifdefvoid{\tcbtitletext}{}{(\tcbtitletext)}}; + \begin{pgfonlayer}{bottom} + \fill[#2,opacity=0.5] + ([xshift=-1.5*\rad]thmname.north west) to[out=-90,in=0,looseness=1.5] +(3pt,-6pt) -| +(10pt,0)--cycle; + \fill[#2,opacity=0.5] + ([xshift=3*\rad]thmname.north east) to[out=0,in=-90] +(5pt,-5pt) -| ++(-10pt,0) --cycle; + \end{pgfonlayer} + } +\newcommand{\my@lemma@overlay@last}[1]{ + %%============== End ==============%% + \def\Rad{3.5pt} + \def\rad{7pt}% + \def\theight{0.57cm} + \def\tlen{1.5cm} + \path[fill=#1,drop shadow={opacity=0.3,shadow xshift=.3pt}] + ([xshift=-2*\rad,yshift=-5pt]frame.south east) coordinate (SE) to[out=0,in=180] +(4*\rad,5pt+\theight) --([shift={(-\tlen+4*\rad,5pt+\theight)}]SE) to[out=180,in=0] +(-4*\rad,-5pt-\theight) --cycle; + \begin{pgfonlayer}{bottom} + \fill[color=#1!80!black] ([xshift=-1.35*\tlen+\Rad,yshift=-5pt]frame.south east) to[out=180,in=90,looseness=0.7] ([xshift=-1.35*\tlen-0.5*\Rad]frame.south east) coordinate (NWl)--([xshift=2*\rad]NWl) to[out=-90,in=-180,looseness=0.7] ([xshift=-1.35*\tlen+\Rad,yshift=-5pt]frame.south east)--cycle; + \end{pgfonlayer} + } +\makeatother +%% + +% proof +\declaretheoremstyle[ + spaceabove=3pt,spacebelow=3pt, + headfont=\normalfont\bfseries, + notefont=\normalfont\bfseries,notebraces={(}{)}, + bodyfont=\normalfont, + postheadspace=1em, + headpunct={.}, + qed=\qedsymbol +]{Proofstyle} +\declaretheorem[style=Proofstyle,numbered=no,name={ Proof}]{Proof} +\renewenvironment{proof}{\begin{Proof} }{\end{Proof}} +\declaretheorem[style=Proofstyle,numbered=no,name={ Solution}]{solution} +%% --------参考文献 +\RequirePackage[ +backend=biber, +style=gb7714-2015, +sorting=nty +]{biblatex} +\addbibresource{ref.bib} +\indexsetup{level=\chapter*,noclearpage} +\makeindex[title={ References},columns=3,columnsep=15pt,columnseprule] +\makeindex +\newcommand{\Diff}[2][]{\frac{\partial #1}{\partial #2}} +\newcommand{\Dif}[2]{\frac{\dd #1}{\dd #2}} +%%%%%%%%%%%%%%% 计数器知识 %%%%%%%%%%%%%%%%%%%%%% +% 每次用 \newcounter{foo} 定义新计数器,内部都会定义这几个命令 + +% \c@foo,储存计数器的值,初始值为 0 +% \thefoo,储存计数器输出时的格式,初始定义为 \arabic{foo} +% \p@foo,储存计数器被引用时的前缀,初始定义为空 +% \cl@foo,储存「子计数器」列表(此处有简化),foo 自增时它的每个「子计数器」都会归零(详见「自动归零」一节),初始定义为空 +%% 关于计数器的自动归零 +% 如果还定义了计数器 \newcounter{bar}[foo],那么 \cl@foo 里就有了 bar +% \@addtoreset{child}{parent} 和 \@removefromreset{child}{parent} 可以把计数器 child 移入/移出 \cl@parent +% \counterwithin* 和 \counterwithout* 和上一条里两个命令的功能类似,但它们在执行前会检查接受的两个参数是否为已定义的计数器。不加星号的版本会修改 \thechild,详见「输出格式」一节 +% 在使用 \stepcounter{parent} 和 \refstepcounter{parent} 时,parent 自增,同时归零\cl@parent 里的「子计数器」 +% \addtocount{parent}{1} 只自增 parent,没有归零其「子计数器」的效果 +% 归零实现为「对每个子计数器,先设为 -1,然后使用 \stepcounter 自增」,这样实现的「归零」功能是递归的 +% 递归的意思是,如果还有 \newcounter{grandchild}[child],那么 \stepcounter{parent} 会将 child 和 grandchild 都归零 diff --git a/macros/latex/contrib/beautybook/Beautybook-introduction-chinese.pdf b/macros/latex/contrib/beautybook/Beautybook-introduction-chinese.pdf Binary files differnew file mode 100644 index 0000000000..4504ef36d9 --- /dev/null +++ b/macros/latex/contrib/beautybook/Beautybook-introduction-chinese.pdf diff --git a/macros/latex/contrib/beautybook/Beautybook-introduction-chinese.tex b/macros/latex/contrib/beautybook/Beautybook-introduction-chinese.tex new file mode 100644 index 0000000000..2357391c39 --- /dev/null +++ b/macros/latex/contrib/beautybook/Beautybook-introduction-chinese.tex @@ -0,0 +1,703 @@ +%% This work is released under the LaTeX Project Public License, v1.3c or later. +% This template is made by Ethan Lu. +% Please use XeLaTeX engine! +\documentclass[zihao=-4,fontset=windows]{Beautybook-V6.1-CN} +\coverstyle={ % 封面键值列表 + cover-choose=cn, % cn (需新增项\entitle{#}); en ; enfig ; birkar +} +\mathstyle={ % 数学字体键值列表 + math-font=plain, %plain (默认数学字体); mtpro2 +} +\usepackage{rotating} +\tikzset{>=Stealth} +\setlist{nosep,font=\upshape} % 取消所有列表默认距离 +% 浮动环境设置 +% 默认情况下, \LaTeX{} 要求每页的文字至少占据 20%,否则该页就只单独放置一个浮动环境, +% 而这通常不是我们想要的, 我们将这个要求降低到 5%. +\renewcommand*{\textfraction}{0.05} +% 有时如果多个浮动环境连续放在一起, +% 会将它们分在几个不同页,即使它们可在同一页放 +% 得下. 我们可以通过修改 |\topfraction| 和 |\bottomfraction| 分别设置顶端和底端的浮 +% 动环境的最大比例. +\renewcommand*{\topfraction}{0.9} +\renewcommand*{\bottomfraction}{0.8} +% 有时\LaTeX{}会把一个浮动环境单独放在一页, +% 我们要求这个环境至少要占据 85% 才能单独放在一页. +% 注意: |\floatpagefraction| 的数值必须小于 |\topfraction|. +\renewcommand*{\floatpagefraction}{0.85} +% 关于图片 graphicx +% 如果图片没有指定后缀, 依次按下列顺序搜索 +\DeclareGraphicsExtensions{.pdf,.eps,.jpg,.png} +% 设置图表搜索路径, 可以给图表文件夹取如下名字 +\graphicspath{{figures/}{figure/}{pictures/}{picture/}{pic/}{pics/}{image/}{images/}} +\usepackage{amsfonts} +%% 定义第一种定理 +\mynewtheorem{ + defi={\textbf{定义}}[section]{interior style={left color=ReD!8,right color=ReD!5!CyaN!50}, borderline west={1.5mm}{0mm}{ReD}}, + thm={\textbf{定理}}[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{引理}}[section]{interior style={left color=BluE!8,right color=BluE!5!CyaN!50}, borderline west={1.5mm}{0mm}{BluE}}, + prop={\textbf{命题}}[section]{interior style={left color=OrangE!8,right color=OrangE!5!CyaN!50}, borderline west={1.5mm}{0mm}{OrangE}}, + exam={\textbf{题}}[chapter]{interior style={left color=DarkGreen!8,right color=DarkGreen!5!CyaN!50}, borderline west={1.5mm}{0mm}{DarkGreen}}, + cor={\textbf{推论}}[chapter]{interior style={left color=violet!8,right color=violet!5!CyaN!50}, borderline west={1.5mm}{0mm}{violet}}, +} +\newtheorem*{remark}{\textbf{注}} +%% 定义第二种定理 +% overlay unbroken=\my@theorem@overlay@unbroken{\theorem@name\ \thetcbthm}{额外的选项} +% overlay first=\my@theorem@overlay@first{\theorem@name\ \thetcbthm}{额外的选项} +%% 用户接口区 +\definecolor{examback}{HTML}{e3e6e8} +\makeatletter +\mynewtcbtheorem{ + % 这个 theorem 是环境名 + theorem={ + counter=tcbthm, + the counter=\thesection.\arabic{tcbthm}, + name=定理, % 它保存到 \theorem@name 里 + thmcolor=高粱红, + autoref name=\bfseries 定理, + style={ + arc=3pt,breakable,enhanced,interior style={top color=高粱红!12 ,middle color=高粱红!9, bottom 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={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{\theorem@thmcolor}, + } + }, + proposition={ + counter=tcbprop, + the counter=\thesection.\arabic{tcbprop}, + autoref name=\bfseries 命题, + style={ + arc=3pt,breakable,enhanced,interior style={top color=高粱红!12 ,middle color=高粱红!9, bottom 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={tcbprop}, + before pre=\smallskip, after app=\smallskip, + overlay unbroken=\my@theorem@overlay@unbroken{命题\ \thetcbprop}{高粱红}, + overlay first=\my@theorem@overlay@first{命题\ \thetcbprop}{高粱红}, + overlay last=\my@theorem@overlay@last{高粱红}, + } + }, + definition={ + counter=tcbdefi, + the counter=\thesection.\arabic{tcbdefi}, + autoref name=\bfseries 定义, + style={ + arc=3pt,breakable,enhanced,interior style={top color=紫棠!12 ,middle color=紫棠!9, bottom 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={tcbdefi}, + before pre=\smallskip, after app=\smallskip, + overlay unbroken=\my@theorem@overlay@unbroken{定义\ \thetcbdefi}{紫棠}, + overlay first=\my@theorem@overlay@first{定义\ \thetcbdefi}{紫棠}, + overlay last=\my@theorem@overlay@last{紫棠}, + } + }, + lemma={ + counter=tcblem, + the counter=\thesection.\arabic{tcblem}, + name=引理, + lemcolor=靛蓝, + autoref name=\bfseries 引理, + style={ + arc=0mm,breakable,enhanced,interior style={top color=靛蓝!12 ,middle color=靛蓝!9, bottom 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={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 推论, + style={ + arc=0mm,breakable,enhanced,interior style={top color=茶色!12 ,middle color=茶色!9, bottom 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={tcbcor}, + before pre=\smallskip, after app=\smallskip, + overlay unbroken=\my@lemma@overlay@unbroken{推论\ \thetcbcor}{茶色}, + overlay first=\my@lemma@overlay@first{推论\ \thetcbcor}{茶色}, + overlay last=\my@lemma@overlay@last{茶色}, + } + }, + example={ + counter=tcbexam, + the counter=\thesection.\arabic{tcbexam}, + autoref name=\bfseries 例题, + style={ + arc=0mm,breakable,enhanced,interior style={top color=黛绿!12 ,middle color=黛绿!9, bottom 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={tcbexam}, + before pre=\smallskip, after app=\smallskip, + overlay unbroken=\my@lemma@overlay@unbroken{例题\ \thetcbexam}{黛绿}, + overlay first=\my@lemma@overlay@first{例题\ \thetcbexam}{黛绿}, + overlay last=\my@lemma@overlay@last{黛绿}, + } + }, +} +\makeatother +\newenvironment{note}[1][\bf 笔记:]{\Line\uuline{#1} }{\Line} +\renewcommand{\Line}{\noindent\\\tikz\draw[line width=0.65pt,gray!80,dashed] (0,0)--++(.99\linewidth,0);\par} +\newenvironment{key}[1][]{\begin{fancybox}{#1}}{\end{fancybox}} +\newcommand{\Diff}[2][]{\frac{\partial #1}{\partial #2}} +\newcommand{\Dif}[2]{\frac{\dd #1}{\dd #2}} +\newcommand{\pr}{^\prime} +\usepackage{extarrows} +\usetikzlibrary{tikzmark} +% \arrowname{super-script} +% \arrowname[sub-script]{super-script} +\usepackage{appendix} % 附录 +% 代码环境 +\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, % 左侧显示行号往左靠, 还可以为right ,或none,即不加行号 + numberstyle=\footnotesize\itshape, % 行号的样式 + firstnumber=1, + stepnumber=1, % 若设置为2,则显示行号为1,3,5 + numbersep=7pt, % 行号与代码之间的间距 + aboveskip=.25em, % 代码块边框 + showspaces=false, % 显示添加特定下划线的空格 + showstringspaces=false, % 不显示代码字符串中间的空格标记 + keepspaces=true, + showtabs=false, % 在字符串中显示制表符 + tabsize=2, % 默认缩进2个字符 + captionpos=b, % 将标题位置设置为底部 + flexiblecolumns=true, % + breaklines=true, % 设置自动断行 + breakatwhitespace=false, % 设置自动中断是否只发生在空格处 + breakautoindent=true, % + breakindent=1em, % + title=\lstname, % + escapeinside=``, % 在``里显示中文 + xleftmargin=1em, xrightmargin=1em, % 设定listing左右的空白 + aboveskip=1ex, belowskip=1ex, + framextopmargin=1pt, framexbottommargin=1pt, + abovecaptionskip=-2pt,belowcaptionskip=3pt, + % 设定中文冲突,断行,列模式,数学环境输入,listing数字的样式 + extendedchars=false, columns=flexible, mathescape=true, + texcl=true, + fontadjust +}% +\begin{document} +\thispagestyle{empty} +\entitle{The introduction to Beautybook Template} % cncover专用 +\title{Beautybook 说明文档} +\subtitle{Beautybook 说明文档} +\edition{First Edition} +\bookseries{Illustrated by Ethan Lu} +\author{Ethan Lu} +\pressname{logo} +\presslogo{inner_pics/logo.png} +\coverimage{inner_pics/coverimage.jpg} % cncover专用 +%\coverimage{inner_pics/ivy-ge998908f8_1280.jpg} +\makecover % 封面生成命令 + +% 主题色调 +\definecolor{bg}{HTML}{e0e0e0} +\definecolor{fg}{HTML}{203A43} +\colorlet{outermarginbgcolor}{bg} +\colorlet{outermarginfgcolor}{fg} +\colorlet{framegolden}{fg} +\colorlet{framegray}{黛绿!5} +% +\thispagestyle{empty}\newpage % left blank +% +\frontmatter % 前置材料 +\pagenumbering{Roman} +% preface +\thispagestyle{empty} +\addcontentsline{toc}{chapter}{前言} +\chapter*{前言} +怀着复杂的心情写下了这本不算是笔记的笔记,大差不离就是抄写本吧! + + +\hfill +\begin{tabular}{lr} + &----- 作者\\ +&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} \textbf{Beautybook} 模板的使用说明,这里是每一个部分 (Part) 的简介区域, 您可以在此处书写下您对该部分的一个简明扼要的概述, 当然,倘若无话可说,此处可以留空.} +\part{\textbf{Beautybook} 模板使用说明} + +\chapter{Beautybook模板的简要介绍} +Beauty\LaTeX{} 系列模板是由我--一位名不见经传的小人物所做的书籍模板系列,说是系列其实就两个, 一个是致力于清新淡雅风格的自定义较少的书籍模板 \textbf{Fancybook} (这个已经永久停更, 原因是本人审美观问题,更钟爱"美人",见谅!), 另一个则是我主打的旗舰级产品----\textbf{Beautybook}! 关于为何起这么奇怪的名字? 我的答案是, 本来我是想起名elegantboook的,但是奈何已经有了大名鼎鼎的elegantbook系列, 所以鄙人只能退而求其次,命名为同样是美丽意思的名词与书籍相组合,古人云:书中自有颜如玉,这不, 美女配书籍,岂不美哉! 故而,这就是 \textbf{Beautybook} 的由来! + +本人致力于打造一系列美观、优雅、简便的模板以方便用户和我自己 (主要是服务于自己的,但是耐不住大伙的赏识,遂毛遂自荐一番,望谅解!) 使用。版本经常有所更迭,请关注版本信息,在未开始使用模板前,建议直接选择最新正式版本!最新测试版通常会发布在QQ群内,诸君可自取, 取完后是留是去随意. + + +本文将介绍本模板的一些设置内容以及基本使用方法。如果您有其他问题,建议或者意见,欢迎在 GitHub 上给我提交 \href{https://github.com/BeautyLaTeX/latex-template/issues}{issues} 或者邮件\href{h1479840692@163.com}{163邮箱}或者\href{1479840692@qq.com}{qq邮箱}联系我。我的联系方式如下,建议加入用户 QQ 群提问,这样能更快获得准确的反馈,加群时请备注 \LaTeX{} 或者 Beauty\LaTeX{} 相关内容。 +\begin{itemize} + \item GitHub 地址:\href{https://github.com/BeautyLaTeX/latex-template}{https://github.com/BeautyLaTeX/latex-template} + \item 下载地址:\href{https://github.com/BeautyLaTeX/latex-template/releases}{正式发行版} + \item 用户 QQ 群:809237593 +\end{itemize} +\textbf{This work is released under the LaTeX Project Public License, v1.3c or later.} + +\section{模板安装与更新} + +你需要通过下载然后编译的方式使用本模板,仅有本地(文件夹内)使用一种方式。 + +\subsection{在线使用模板} +本模板可以直接上传到overleaf上使用,但需要注意的是, 需要注释掉 \textbf{mtpro2}宏包和使用xelatex引擎或者lualatex引擎编译! + +\subsection{本地安装使用} + +\textbf{本地安装}使用方法如下:从 GitHub 或者 QQ群下载最新版,严格意义上只需要类文件 \lstinline{cls}。然后将模板文件放在你的工作目录下并且同步复制这几个文件夹: fonts,stys,figures以及\lstinline{preface.tex},\lstinline{titlpage.tex}, 即可使用。这样使用的好处是,相比在线使用,可以通过自行安装mtpro2字体实现更加精美的效果,当然如何选择交给用户本身,此处不作评价. + +以下是最小工作示例: +\begin{lstlisting} + \documentclass[zihao=-4,fontset=none]{Beautybook-V6.1-CN} % 不想用自定义字体,记得改为fontset=windows/mac/ubuntu,并注释掉stys/settings-CN.sty中最后面的中文字体设定相关内容!如果想学习使用第三方字体,也可以参考着自己配置! + \coverstyle={ % 封面键值列表 + cover-choose=cn, % cn (需新增项\entitle{#}); en ; enfig ; birkar + } + \mathstyle={ % 数学字体键值列表 + math-font=mtpro2, %plain (默认数学字体); mtpro2 % !! 没安装mtpro2字体的不要使用该键值!! + } + \usepackage{stys/settings-CN} + \begin{document} + \thispagestyle{empty} + \entitle{entitle,only when you use cncover} % cncover专用 + \title{Title here} + \subtitle{XX} + \edition{First Edition} + \bookseries{Series} + \author{your name here} + \pressname{press name} + \presslogo{inner_pics/Springer-logo.png} + \coverimage{inner_pics/coverimage.jpg} % cncover专用 + %\coverimage{inner_pics/ivy-ge998908f8_1280.jpg} + \makecover % 封面生成命令 + + % 主题色调 + \definecolor{bg}{HTML}{e0e0e0} + \definecolor{fg}{HTML}{203A43} + \colorlet{outermarginbgcolor}{bg} + \colorlet{outermarginfgcolor}{fg} + \colorlet{framegolden}{fg} + \colorlet{framegray}{高粱红!15} + % + \input{frontmatter/titlepage-cn} % 内封面页 + % + \frontmatter % 前置材料 + \pagenumbering{Roman} + \input{frontmatter/preface-cn} % 前言 + \thispagestyle{empty} + \tableofcontents\let\cleardoublepage\clearpage % 目录 + + \mainmatter % 正文 + \pagenumbering{arabic} % 阿拉伯数字页码 + \partimage{inner_pics/part.png} % part图片,必须有,只需要写一次即可,后续只需要写简介和标题 + \partabstract{\hspace{2em} XX} % Part简介,没有可以不写 + \part{XX} + % \input{XX} + \backmatter + \appendix % 附录章节 + % + + + \normalem + \printbibliography[ + heading=bibintoc, + title={参考文献} + ] + \printindex + \thispagestyle{empty} + \bottomimage{inner_pics/ivy-ge998908f8_1280.jpg} + \ISBNcode{\EANisbn[ISBN=您的书对应的ISBN号]} % + \summary{封底信息} + \makebottomcover + \end{document} +\end{lstlisting} +\subsection{发行版安装与更新} + +本模板测试环境为 +\begin{enumerate} +\item Win11 22H2 + \TeX{} Live 2023; +\end{enumerate} + +\TeX Live/Mac\TeX{} 的安装请参考知乎的文章,此处略过。 + +安装 \TeX{} Live 之后,安装后建议升级全部宏包,升级方法:使用 cmd 或 terminal 运行 \lstinline{tlmgr update --all},如果 tlmgr 需要更新,请使用 cmd 运行 \lstinline{tlmgr update --self},如果更新过程中出现了中断,请改用 \lstinline{tlmgr update --self --all --reinstall-forcibly-removed} 更新,也即 + +\begin{lstlisting} +tlmgr update --self +tlmgr update --all +tlmgr update --self --all --reinstall-forcibly-removed +\end{lstlisting} + +更多的内容请参考 \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \TeX{} distribution?} + +\subsection{其他发行版本} + +由于宏包版本问题,本模板不支持 C\TeX{} 套装,请务必安装 TeX Live/Mac\TeX{}。更多关于 \TeX{} Live 的安装使用以及 C\TeX{} 与 \TeX{} Live 的兼容、系统路径问题,请参考官方文档以及啸行的\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/releases/}{一份简短的关于安装 \LaTeX{} 安装的介绍}。 + + + +\chapter{Beautybook 设置说明} + +本模板英文版基于基础的 book 文类, 中文版则基于ctexbook文类,所以 book或者ctexbook 的选项对于本模板也是有效的。默认编码为 UTF-8,推荐使用 \TeX{} Live 编译。 + +\section{语言模式} +本模板内含两套基础语言环境, 分别为 中文的\lstinline{Beautybook-V6.1.cls}、英文的\lstinline{Beautybook-V6.1-EN.cls}。改变语言环境会改变图表标题的引导词(图,表),文章结构词(比如目录,参考文献等),以及定理环境中的引导词(比如定理,引理等)。不同语言模式的启用如下: +\begin{lstlisting} +\documentclass{Beautybook-V6.1-CN} % 中文 +\documentclass{Beautybook-V6.1-EN} % 英文 +\end{lstlisting} + +除模板自带的两套语言设定之外,如果您需要使用其他语言, 可以通过更改cls文件中这几处解决, 分别为 + +\begin{enumerate} + \item 更改 part环境的名称 \lstinline{Part \thepart}为 \lstinline{(你的语言中part的翻译) \thepart} + \item 主文件,即当前文件导言区中的定理引导词 + \item 更改chapter环境中的part名称如第一条所示 + \item 记住, 仅有亚洲语言环境可以使用ctexbook文类, 即基于\lstinline{Beautybook-V6.1.cls}更改, 其他西语环境需要基于\lstinline{Beautybook-V6.1-EN.cls}更改. +\end{enumerate} + + +\section{颜色主题} + +本模板的颜色是可以自由配置的,可以配置的颜色参数如下: +\begin{lstlisting} + \definecolor{bg}{HTML}{e0e0e0} % 整体风格的背景色 % 即浅色 + \definecolor{fg}{HTML}{455a64} % 整体风格的前景色 % 即深色 + %% 下面颜色位于 stys/bottompage.sty文件中 + \definecolor{coverbgcolor}{HTML}{f9b868} % 封面及封底背景色 + \definecolor{coverfgcolor}{HTML}{503D4B} % 封面及封底前景色 + \definecolor{coverbar}{HTML}{BF8E6F} % 封面竖条颜色 + \definecolor{bottomcolor}{HTML}{B3686A} % 封底说明背景颜色 + %%%%%%%%%%%%%%%%%%%%%%%% + \colorlet{framegolden}{fg} % 古风盒子线条颜色 + \colorlet{framegray}{黛绿!5} % 古风盒子背景色 +\end{lstlisting} +还有定理环境颜色可以在此文件的导言区设置,下面数学环境部分会展开讲. + +这里推荐使用林莲枝开发的cncolours宏包的颜色配置,可以对照选取适合的颜色. + +\section{封面} + +\subsection{封面个性化} + +本模板拥有多套封面可随意取用, 其中使用方法如下: +\begin{enumerate} + \item Springer经典封面--对应宏包 \lstinline{cover-choose=cn} (中文默认), + \item Springer经典封面之二--对应宏包 \lstinline{cover-choose=en} (英文默认), + \item Springer经典封面之三--对应宏包 \lstinline{cover-choose=enfig} (图片背景), + \item 中文书籍经典封面--对应宏包\lstinline{cover-choose=birkar} (三角几何风)。 + 注意, 使用该封面所对应的信息不太一样, 看好上面的示例,按照要求操作即可。 +\end{enumerate} + +\begin{table}[htbp] + \centering + \caption{封面元素信息} + \begin{tabular}{cccccc} + \hline + 信息 & 命令 & 信息 & 命令 & 信息 & 命令 \\ + \hline + 标题 & \lstinline|\title| & 副标题 & \lstinline|\subtitle| & 作者 & \lstinline|\author| \\ + 出版社 & \lstinline|\pressname| & 版本 & \lstinline|\edition| & 封面图 & \lstinline|\coverimage|\\ + 徽标 & \lstinline|\presslogo| & 英文标题(cn)&\lstinline|\entitle|&&\\ + \hline + \end{tabular} +\end{table} + + +\subsection{封面图} +封面图片可以自行去找. + +\subsection{徽标} + +本文用到的 Logo 为wiki随意找的springer经典马标, 可以自己查询下载出版社logo, 为免侵权,在更换图片的时候请选择合适合法的图片进行替换。 + +\subsection{自定义封面} + +另外,如果使用自定义的封面,比如 Adobe illustrator 或者其他软件制作的 A4 PDF 文档,请把 \lstinline{\makecover} 注释掉,然后借助 \lstinline{pdfpages} 宏包将自制封面插入即可。如果使用 \lstinline{titlepage} 环境,也是类似。 + +\section{章标题} + +本模板自定义了一套标题样式, 主要是 part、chapter、section 这三个标题,具体代码见cls。可能不适合所有人的审美,可以注释掉就会回归默认ctexbook的标题样式。 + +\section{数学环境简介} + +在我们这个模板中,我们定义了四种不同的定理模式,包括简单模式(默认的定理样式amsthm) 、有点自定义的thmtools、彩色强调盒子、以及本人开发的专有版权盒子,当然,由雾月老师给我定制的古风盒子您也可以是用来作为定理盒子,只需要在本文件导言区第一种定理样式里面加上\lstinline{ys style}即可. + + +\subsection{定理类环境的使用} +以下是使用效果展示 +\subsubsection{amsthm} +\begin{remark} + 这是基于amsthm的注释环境 +\end{remark} +\subsubsection{thmtools} +\begin{proof}[证明的说明] + 证明环境 +\end{proof} + +\begin{solution}[解的说明] + 解环境 +\end{solution} +\subsubsection{彩色强调盒子} +\begin{defi}[名称]\label{defi:def test} + 第一种定义环境 +\end{defi} + +\begin{thm}[名称]\label{thm:thm test} + 第一种定理环境 +\end{thm} + +\begin{cor}[名称]\label{cor:cor test} + 第一种推论环境 +\end{cor} + +\begin{prop}[名称]\label{prop:prop test} + 第一种命题环境 +\end{prop} + +\begin{exam}[名称]\label{exam:exam test} + 第一种例题环境 +\end{exam} + +\begin{lem}[名称]\label{lem:lem test} + 第一种引理环境 +\end{lem} +\clearpage +\subsubsection{个人版权的盒子共两种} + +\begin{definition}[][名称][def label] + 这是个人定制的盒子定制的定理环境,这是其中定义环境示例。注意:使用方法如下 + + \begin{itemize} + \item 如果你没有名称和标签,使用方法为 + \begin{lstlisting} + \begin{definition} + 定义环境内容 + \end{definition} + \end{lstlisting} + \item 如果你没有标签但有名称,使用方法为 + \begin{lstlisting} + \begin{definition}[][名称] + 定义环境内容 + \end{definition} + \end{lstlisting} + \item 如果你有标签,那么无论是否有名称,使用方法为 + \begin{lstlisting} + \begin{definition}[][有就填,没有空着][标签] + 定义环境内容 + \end{definition} + \end{lstlisting} + \item 如果你想更改盒子的一些设定选项,比如加框线等之类的,使用方法为 + \begin{lstlisting} + \begin{definition}[tcolorbox选项][名称有就写,没有就连带外面括号删掉][标签 (有标签下就这样子,没有标签可以把这个标签连带外面的括号删掉)] + 定义环境内容 + \end{definition} + \end{lstlisting} + \end{itemize} + +\end{definition} + +\begin{theorem} + 用法同上,引用下上面的标签 \ref{def label}或者可以\autoref{def label}. +\end{theorem} + +\begin{lemma} + 用法同上,引用下上面的标签 \ref{def label}或者可以\autoref{def label}. +\end{lemma} + +\begin{corollary} + 用法同上,引用下上面的标签 \ref{def label}或者可以\autoref{def label}. +\end{corollary} + +\begin{example} + 用法同上,引用下上面的标签 \ref{def label}或者可以\autoref{def label}. +\end{example} + +古风盒子 +\begin{fancybox} +古风盒子测试,可以任意嵌套其他环境! +\end{fancybox} + +\subsection{修改计数器} + +当前定理等环境计数器按章计数,如果想修改定理类环境按节计数,可以修改计数器选项 \lstinline{ counter/.code}中的\lstinline{chapter},可用选项为 \lstinline{chapter} (默认)与 \lstinline{section}、 \lstinline{subsection}等 + +\subsection{自定义定理类环境} +用户可以采用四种方式定义自己的定理环境,分别为amsthm与thmtools, 这两种看宏包说明文档即可; 后面两种定理的定义方式为 +如本文件导言区: +\begin{lstlisting} + % 这是第一种 + \mynewtheorem{ + defi={\textbf{定义}}[section]{interior style={left color=ReD!8,right color=ReD!5!CyaN!50}, borderline west={1.5mm}{0mm}{ReD}}, % 类似模仿即可 + } + + % 下面是第二种 + \mynewtcbtheorem{ + % 这个 theorem 是环境名 + theorem={ % 第一种 : 圣诞礼盒风格 + counter=tcbthm, + the counter=\thesection.\arabic{tcbthm}, + name=定理, % 它保存到 \theorem@name 里 + thmcolor=purple5, + autoref name=\bfseries 定理, + style={ + arc=3pt,breakable,enhanced,interior style={top color=purple5!5 ,middle color=purple5!1!nuanbai, bottom color=nuanbai},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={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{\theorem@thmcolor}, + } + }, + lemma={ % 第二种 : 丝带风格 + counter=tcblem, + the counter=\thesection.\arabic{tcblem}, + name=引理, + lemcolor=靛蓝, + autoref name=\bfseries 引理, + style={ + arc=0mm,breakable,enhanced,interior style={top color=靛蓝!5 ,middle color=靛蓝!1!nuanbai, bottom color=nuanbai},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}, + } + }, +} +\end{lstlisting} +\begin{remark} + 解释一下, 其中的overlay部分更改需要看中文修改,定理名称改成你想要的,颜色也是,然后别忘了给最外面的example之类的环境名改成你的,比如axiom之类,还有就是tcbexam这个计数器名称要换成你新定义的,如tcbaxiom之类,其他就不用动了。至于说第一种定理样式看上面例子相信您能学会的。 +\end{remark} + +\section{列表环境} +本模板借助于 \lstinline{enumitem} 实现了可定制化,具体见enumitem宏包说明文档,这里示例如下\\[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{参考文献} + +\subsection{打印文献} + +\lstinline{ref.bib} 为参考文献存放的文件,需要放在项目文件夹下。 + +\subsection{修改文献格式} + +此外,本模板调用了 biblatex 宏包,并提供了 biber引擎编译参考文献,当然您也可以直接删除cls中的biblatex宏包(cls最后几行)来使用bibtex. + +关于文献条目(bib item),你可以在谷歌学术,Mendeley,Endnote 中取,然后把它们添加到 \lstinline{ref.bib} 中。在文中引用的时候,引用它们的键值(bib key)即可。 + +文献样式默认为国标 GB7714-2015, 参考文献示例:\cite{Huybrechts2010Complex}。 + +如果需要设置为数字样式,需要将biblatex宏包选项中的国标改为numerical. +\begin{lstlisting} +\usepackage[ +backend=biber, % 可改为bibtex (或者直接删掉就是bibtex) +style=gb7714-2015, % 可改为 numerical +sorting=nty +]{biblatex} +\addbibresource{ref.bib} +\end{lstlisting} + +\chapter{字体选项} +字体选项独立成章的原因是,我们希望本模板的用户关心模板使用的字体,知晓自己使用的字体以及遇到字体相关的问题能更加便捷地找到答案。 + +本模板默认使用ctex的windows选项提供的字体, 如非必要,字体不应改动,当然,如果确实需要,可按照下面代码操作: +\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} + %设置新的中文字体命令 + \newCJKfontfamily[song]\songti{XX.TTF}[Path=fonts/] %宋体 + %设置新的英文字体命令 + \newfontfamily\largetitlestyle[Path=fonts/]{XX.TTF} +\end{lstlisting} +!必须全部使用英文字体名称进行导入,否则报错找不到的!!切记!! + +\section{数学字体选项} +本模板使用的是mtpro2字体,需要用户自行安装,安装教程见\href{https://www.latexstudio.net/archives/51742.html}{mtpro2字体安装教程}。当然也可以删除本文件导言区的mtpro2字体换回默认数学字体,诸君随意。 + + +\appendix % 附录章节 +% +\chapter{封面效果展示} +\section{封面cn如本文件所示} +\section{其他封面见文件夹内附件} + +\normalem +\printbibliography[ +heading=bibintoc, +title={参考文献} +] +\printindex +\thispagestyle{empty} +\bottomimage{inner_pics/ivy-ge998908f8_1280.jpg} +\ISBNcode{\EANisbn[ISBN=978-80-7340-097-2]} % +\summary{本书是复分析学的结课期考复习资料总结,主要包括了考试的证明题型以及各类的识记知识点,如黎曼映射定理、广义Schwarz引理等等.本书由本人期末写成, 仅用于复习. 本书是复分析学的结课期考复习资料总结,主要包括了考试的证明题型以及各类的识记知识点,如黎曼映射定理、广义Schwarz引理等等.本书由本人期末写成, 仅用于复习. 本书是复分析学的结课期考复习资料总结,主要包括了考试的证明题型以及各类的识记知识点,如黎曼映射定理、广义Schwarz引理等等.本书由本人期末写成, 仅用于复习.} +\makebottomcover +\end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/beautybook/Beautybook-introduction-english.pdf b/macros/latex/contrib/beautybook/Beautybook-introduction-english.pdf Binary files differnew file mode 100644 index 0000000000..48c2a402d0 --- /dev/null +++ b/macros/latex/contrib/beautybook/Beautybook-introduction-english.pdf diff --git a/macros/latex/contrib/beautybook/Beautybook-introduction-english.tex b/macros/latex/contrib/beautybook/Beautybook-introduction-english.tex new file mode 100644 index 0000000000..2f83a3a3a5 --- /dev/null +++ b/macros/latex/contrib/beautybook/Beautybook-introduction-english.tex @@ -0,0 +1,675 @@ +%% 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-V6.1-EN} +\coverstyle={ + cover-choose=en, % cn (Need \entitle{#}); en ; enfig ; birkar +} +\mathstyle={ + math-font=plain, % plain; mtpro2 +} +\usepackage{rotating} +\tikzset{>=Stealth} +\setlist{nosep,font=\upshape} +\renewcommand*{\textfraction}{0.05} +\renewcommand*{\topfraction}{0.9} +\renewcommand*{\bottomfraction}{0.8} +\renewcommand*{\floatpagefraction}{0.85} +\DeclareGraphicsExtensions{.pdf,.eps,.jpg,.png} +\graphicspath{{figures/}{figure/}{pictures/}{picture/}{pic/}{pics/}{image/}{images/}} +\usepackage{amsfonts} +\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} +\thispagestyle{empty} +\title{An Introduction to Complex Geometry} +\subtitle{} +\edition{First Edition} +\bookseries{UniversiText} +\author{Ethan Lu} +\pressname{logo} +\presslogo{inner_pics/logo.png} +\coverimage{inner_pics/ivy-ge998908f8_1280.jpg} +\makecover + +\definecolor{bg}{HTML}{e0e0e0} +\definecolor{fg}{HTML}{203A43} +\colorlet{outermarginbgcolor}{bg} +\colorlet{outermarginfgcolor}{fg} +\colorlet{framegolden}{fg} +\colorlet{framegray}{bg!50} +% +\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{The template usage introduction of \textbf{Beautybook}} +\chapter{A short introduction of \textbf{Beautybook}} +Beauty \LaTeX{} series of templates is a book series made by me, an unknown little person. In fact, there are only two series, one is the custom book template \textbf{fancybook } , which is dedicated to the fresh and elegant style. (this has been changed permanently, because of my aesthetic problem, I prefer “Beauty”, forgive me!) , the other is my flagship product-\textbf{ Beautybook } ! About why they have such strange names? My answer is, originally I wanted to name it elegantboook, but there is already the famous elegantbook series, so I can only settle for the next best thing and name it a combination of a noun and a book with the same meaning of beauty, the Ancients Cloud: the book has its own Yan Ruyu, this is not, the beauty with books, is not beautiful! Therefore, this is the origin of \textbf{beauty book } ! + +I am committed to creating a series of beautiful, elegant, simple template to facilitate the use of users and myself (mainly for their own, but can not stand the appreciation of everyone, I would like to introduce myself, please understand!) . 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 take it, after taking it is to stay at will.But unfortunately, I will be on July 5 in 2023 to stop maintenance and updates, so I can no longer solve the problem for you in the Q Group, Sorry! + + +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 template address are +\begin{itemize} + \item GitHub address: \href{https://github.com/BeautyLaTeX/latex-template}{https://github.com/BeautyLaTeX/latex-template}, + \item Download frome here: \href{https://github.com/BeautyLaTeX/latex-template/releases}{Official release}, + \item User QQ Group: 809237593. +\end{itemize} +\textit{This work is released under the LaTeX Project Public License, v1.3c or later.} +\section{Template Installation and Update} + +You will need to use this template by downloading it and compiling it. Only use it locally (within a folder) . + +\subsection{Use template online} + +This template can be uploaded directly to overleaf for use, but note that you need to write \lstinline{math-font=plain} in the premble and compile with the XeLaTeX engine! + +\subsection{Local Installation} + +\textbf{Local Installation} use the following method: download the latest version from GitHub or QQ group, strictly need only class file \lstinline {.cls} and some folders. Then place the template files in your working directory and synchronously copy these folders: \texttt{fonts}, \texttt{stys}, \texttt{figures}, and \texttt{inner\_pics}, \texttt{frontmatter} to use. (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 are examples of minimal work: +\begin{lstlisting} + \documentclass[zihao=-4,fontset=none]{Beautybook-V6.1-CN} % Instead of using a custom font, change it to fontset = Windows/Mac/Ubuntu and comment out stys/Settings-CN. Chinese font settings at the end of this sty! If you want to learn to use third-party fonts, you can also refer to their own configuration! + \coverstyle={ % List of covers key values + cover-choose=cn, % cn (A new entry is required \entitle{#}); en ; enfig ; birkar + } + \mathstyle={ % List of math fonts key values + math-font=mtpro2, %plain (Default mathematical font); mtpro2 % !! Do not use the key value if the mtpro2 font isn't installed! + } + \usepackage{stys/settings-CN} + \begin{document} + \thispagestyle{empty} + \entitle{entitle,only when you use cncover} % cn + \title{Title here} + \subtitle{XX} + \edition{First Edition} + \bookseries{Series} + \author{your name here} + \pressname{press name} + \presslogo{inner_pics/Springer-logo.png} + \coverimage{inner_pics/coverimage.jpg} % cn + %\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}{red!15} + % + \input{frontmatter/titlepage-cn} % Titlepage + % + \frontmatter + \pagenumbering{Roman} + \input{frontmatter/preface-cn} % preface + \thispagestyle{empty} + \tableofcontents\let\cleardoublepage\clearpage + + \mainmatter + \pagenumbering{arabic} + \partimage{inner_pics/part.png} % Part Pictures is needed,which is only need to write once. + \partabstract{\hspace{2em} XX} % Part introduction. If you don't want to write, it can be left blank. + \part{XX} + % \input{XX} + \backmatter + \appendix + % + + + \normalem + \printbibliography[ + heading=bibintoc, + title={Reference} + ] + \printindex + \thispagestyle{empty} + \bottomimage{inner_pics/ivy-ge998908f8_1280.jpg} + \ISBNcode{\EANisbn[ISBN=ISBN Number here]} % + \summary{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 method: 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 contains two basic locales, \lstinline{Beautybook-V6.1.cls} in Chinese and \lstinline{Beautybook-V6.1-EN.cls} in English. Changing the locales will change the leading words (include figures, tables) of the chart title, the structure of the article (e.g. table of contents, references, etc.), and the leading words in the context of the theorem (e.g. Theorem, lemma, etc.). The different language modes are enabled as follows: +\begin{lstlisting} +\documentclass{Beautybook-V6.1-CN} % chinese +\documentclass{Beautybook-V6.1-EN} % english +\end{lstlisting} + +In addition to the two sets of language settings that come with the template, if you need to use other languages, you can solve these problems by changing the \texttt{.cls} file + +\begin{enumerate} + \item Change the name of the part environment \lstinline{Part\ \thepart} to \lstinline{(translation of part in your language)\ \thepart} + \item Main file, which is the theorem guide word in the introduction area of the current file + \item Change the name of the part in the chapter environment as shown in the first article + \item Keep in mind that only Asian locales can use the ctexbook class, i.e. based on \lstinline{Beautybook-V6.1-CN.cls} changes, other Spanish environments need to be changed based on \lstinline{Beautybook-V6.1-EN.cls}. +\end{enumerate} +\section{Color Theme} + +The color of this template is freely configurable, and the color parameters that can be configured are as follows: + +\begin{lstlisting} + \definecolor{bg}{HTML}{e0e0e0} % Overall style background color % i.e. light color + \definecolor{fg}{HTML}{455a64} % Overall style foreground color % i.e. dark + %% The colors below are in the stys/bottompage.sty file + \definecolor{coverbgcolor}{HTML}{f9b868} % Cover and back cover 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 back cover indicates the background color + %%%%%%%%%%%%%%%%%%%%%%%% + \colorlet{framegolden}{fg} % Antique box line color + \colorlet{framegray}{Dilu!5} % Antique box background color +\end{lstlisting} +There are also theorem environment colors that can be set in the introduction area of this file, which will be expanded on in the following section on the mathematical environment. + +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{Cover} +\subsection{Cover personalization} +This template has multiple sets of covers that can be used at will, and the use of them is as follows: +\begin{enumerate} + \item Springer classic cover --corresponding macro package \lstinline{cover-choose=cn} (Chinese default), + \item Springer Classic Cover 2 - corresponding to the macro package \lstinline{cover-choose=en} (English default), + \item Springer Classic Cover No. 3 - corresponding to macro package \lstinline{cover-choose=enfig} (image background), + \item Chinese classic cover of the book - corresponding to the macro package \lstinline{cover-choose=birkar} (triangular geometric wind). + + 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{cover image} +The cover image can be found by yourself. + +\subsection{logo} + +The logo used in this article is the springer classic horse logo that the wiki finds at random, you can query and download the publisher logo by yourself, in order to avoid infringement, please choose a suitable and legal picture to replace when replacing the picture. + +\subsection{custom cover} + +In addition, if you use a custom cover, such as an A4 PDF document made by Adobe illustror or other software, comment out \lstinline{makecover}, and then insert the custom cover with the help of the \lstinline{pdfpages} macro package. It is similar if you use the \lstinline{titlepage} environment. + +\section{chapter title} + +This template customizes a set of heading styles, mainly Part, Chapter, Section three headings, see CLS for specific code. It may not suit everyone's aesthetic, and commenting it out will return to the default ctexbook heading style. + +\section{Introduction to the Mathematical Environment} + +In our template, we have defined four different theorem modes, including simple mode (default theorem style amsthm), a little custom thmtools, a color emphasis box, and an exclusive copyright box developed by me, of course, the ancient style box customized by Mr. Kirigetsu You can also use it as a theorem box, just add lstinline{ys style} to the first theorem style in the introduction area of this document. +\subsection{Use of theorem class environment} +The following is a demonstration of the use effect +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}[test sol.] + Solution environment +\end{solution} +\subsubsection{color accent box} +\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 +\subsubsection{There are two types of boxes for personal copyright} + +\begin{definition}[][Name][def label] + This is a custom box custom theorem environment, which is an example of where the environment is defined. Note: Use as follows + +\begin{itemize} + \item If you don't have a name and label, use it as \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 + \begin{lstlisting} + \begin{definition}[tcolorbox option][write the name if it has, delete it with the outer parentheses if it does not][tag (there is a tag under the tag, there is no tag can delete the label with the outer parentheses)] + 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} + +Antique box +\begin{fancybox} +Antique box test, you can nest other environments arbitrarily! +\end{fancybox} + +\subsection{modify counter} + +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{custom theorem class environment} +Users can define their own theorem environment in four ways, namely amsthm and thmtools, which can be seen in the macro package documentation; The latter two theorems are defined in the following way. + +For example, in the introduction to this document: +\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}}, + } + + % This is the second one. + \mynewtcbtheorem{ + theorem={ % Christmas gift box style + counter=tcbthm, + the counter=\thesection.\arabic{tcbthm}, + name=Theorem, % It is saved to \theorem@name. + thmcolor=purple5, + autoref name=\bfseries Theorem, + style={ + arc=3pt,breakable,enhanced,interior style={top color=purple5!5 ,middle color=purple5!1!nuanbai, bottom color=nuanbai},boxrule=0pt,top=8mm, + fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},% shadow up + fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},% shadow 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{\theorem@thmcolor}, + } + }, + lemma={ % Ribbon style + counter=tcblem, + the counter=\thesection.\arabic{tcblem}, + name=Lemma, + lemcolor=(color), + autoref name=\bfseries Lemma, + style={ + arc=0mm,breakable,enhanced,interior style={top color=(color)!5 ,middle color=(color)!1!nuanbai, bottom color=nuanbai},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm, + fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},% shadow up + fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},%shadow down + 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}, + } + }, +} +\end{lstlisting} +\begin{remark} + To explain, the overlay part needs to be changed Chinese seen, the theorem name is changed to what you want, and the color is also, and then don't forget to change the outermost environment name such as example to yours, such as axiom and the like, and the counter name of tcbexam should be replaced with your new definition, such as tcbaxiom and the like, and the rest does not need to be moved. As for the first theorem style, look at the above example, I believe you can learn. +\end{remark} + +\section{list environment} +This template is customizable with the help of lstinline{enumitem}, see the enumitem macro package documentation, here the example is as follows\\[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 document} + +\lstinline{ref.bib} is a file stored in the reference and needs to be placed in the project folder. + +\subsection{modify document format} + +In addition, this template calls the Biblatex macro package and provides Biber engine compilation 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 document style defaults to GB GB7714-2015, reference example: \cite{Huybrechts2010Complex}. + +If you need to set to a numeric style, you need to change the GB 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} +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 the fonts provided by Ctex's Windows options by default, if not necessary, the font should not be changed, of course, if you really need to, you can follow the following code: +\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 +\chapter{cover effect display} +\section{cover en as shown in this document} +\section{See attachment in folder for other covers} + + + +\normalem +\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}
\ No newline at end of file diff --git a/macros/latex/contrib/beautybook/README.md b/macros/latex/contrib/beautybook/README.md new file mode 100644 index 0000000000..7d494cc581 --- /dev/null +++ b/macros/latex/contrib/beautybook/README.md @@ -0,0 +1,20 @@ +<!-- Author : Ethan Lu--> +<!-- Program Email: h1479840692@outlook.com --> + + | [Github](https://github.com/BeautyLaTeX/latex-template) | + + +------- + +# An beautiful LaTeX Template for Books + + + +Beautybook is designed for writing books, created by [Ethan Lu](https://github.com/BeautyLaTeX/latex-template) , and maintained by [Ethan Lu](https://github.com/BeautyLaTeX/latex-template). Just enjoy it! If you have any questions, suggestions or bug reports, you can create issues or contact me at h1479840692@outlook.com. + +If you are an English user, then please use a cls file with the "-EN" suffix and compile the english tex file with pdfLaTeX, and conversely, if you are a Chinese user, then remember, use a cls file with the "-CN" suffix and compile the chinese tex file with the XeLaTeX engine! + +## License + +This work is released under the LaTeX Project Public License, v1.3c or later. + diff --git a/macros/latex/contrib/beautybook/inner_pics/coverimage.jpg b/macros/latex/contrib/beautybook/inner_pics/coverimage.jpg Binary files differnew file mode 100644 index 0000000000..0d9a06a0a1 --- /dev/null +++ b/macros/latex/contrib/beautybook/inner_pics/coverimage.jpg diff --git a/macros/latex/contrib/beautybook/inner_pics/flower.png b/macros/latex/contrib/beautybook/inner_pics/flower.png Binary files differnew file mode 100644 index 0000000000..92675d0a56 --- /dev/null +++ b/macros/latex/contrib/beautybook/inner_pics/flower.png diff --git a/macros/latex/contrib/beautybook/inner_pics/ivy-ge998908f8_1280.jpg b/macros/latex/contrib/beautybook/inner_pics/ivy-ge998908f8_1280.jpg Binary files differnew file mode 100644 index 0000000000..b9269e6078 --- /dev/null +++ b/macros/latex/contrib/beautybook/inner_pics/ivy-ge998908f8_1280.jpg diff --git a/macros/latex/contrib/beautybook/inner_pics/logo.png b/macros/latex/contrib/beautybook/inner_pics/logo.png Binary files differnew file mode 100644 index 0000000000..470edd8a51 --- /dev/null +++ b/macros/latex/contrib/beautybook/inner_pics/logo.png diff --git a/macros/latex/contrib/beautybook/inner_pics/part.png b/macros/latex/contrib/beautybook/inner_pics/part.png Binary files differnew file mode 100644 index 0000000000..504bf1c33f --- /dev/null +++ b/macros/latex/contrib/beautybook/inner_pics/part.png diff --git a/macros/latex/contrib/beautybook/inner_pics/song.png b/macros/latex/contrib/beautybook/inner_pics/song.png Binary files differnew file mode 100644 index 0000000000..b9a46ab0d7 --- /dev/null +++ b/macros/latex/contrib/beautybook/inner_pics/song.png diff --git a/macros/latex/contrib/beautybook/inner_pics/song2.png b/macros/latex/contrib/beautybook/inner_pics/song2.png Binary files differnew file mode 100644 index 0000000000..a3a1129384 --- /dev/null +++ b/macros/latex/contrib/beautybook/inner_pics/song2.png diff --git a/macros/latex/contrib/beautybook/ref.bib b/macros/latex/contrib/beautybook/ref.bib new file mode 100644 index 0000000000..19a6e769a1 --- /dev/null +++ b/macros/latex/contrib/beautybook/ref.bib @@ -0,0 +1,15 @@ +@book{Huybrechts2010Complex, + title={Complex geometry:an introduction}, + author={Huybrechts and Daniel}, + publisher={Springer}, + year={2010}, +} + + + + + + + + + diff --git a/macros/latex/contrib/beautybook/stys/Beautybook-birkar.sty b/macros/latex/contrib/beautybook/stys/Beautybook-birkar.sty new file mode 100644 index 0000000000..605d71877c --- /dev/null +++ b/macros/latex/contrib/beautybook/stys/Beautybook-birkar.sty @@ -0,0 +1,124 @@ +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{stys/Beautybook-birkar}[2022/05/21,v1.0] +\usepackage{anyfontsize} +\usepackage[dvipsnames,svgnames,x11names,table]{xcolor}% Driver-independent color extensions +\usepackage{tikz} +\usetikzlibrary{intersections, positioning, fit, backgrounds, shapes, fadings, +decorations.pathmorphing, graphs, quotes, angles, calc, through, backgrounds} +\usepackage{graphicx} +\usetikzlibrary{calc,fadings,patterns} +\usepackage{adjustbox} + +% Define the layers to be used in document. +% ***************************************************** +\pgfdeclarelayer{background} +\pgfdeclarelayer{foreground} +\pgfdeclarelayer{top} +\pgfdeclarelayer{bottom} +\pgfsetlayers{bottom,background,main,foreground,top} +\definecolor{RED}{RGB}{220, 41, 26} +\definecolor{arc color}{HTML}{546E7A} + +\tikzfading[name=fade right, + right color =transparent!100, + left color=transparent!0] +\tikzfading[name=fade left, + left color =transparent!100, + right color=transparent!50] +\tikzfading[name=fade up, + top color =transparent!100, + bottom color=transparent!50] +\tikzfading[name=fade down, + bottom color =transparent!100, + top color=transparent!50] +\makeatletter +\newcommand*\makecover{ + %% Use the Tikz library positioning and clear the page header and footer + \usetikzlibrary{positioning} + \thispagestyle{empty} + \begin{tikzpicture}[remember picture,overlay] + \begin{pgfonlayer}{bottom} + \fill[coverfgcolor] + (current page.north west) rectangle (current page.south east); + \fill[RED] + ([shift={(2.05cm,0)}]current page.north west) rectangle ([shift={(2.35cm,-6cm)}]current page.north west); + \fill[coverfgcolor!80,opacity=0.5] + ([shift={(0,-2cm)}]current page.north west) arc (90:-90:.3\paperheight) --cycle; + \fill[coverfgcolor!80,opacity=0.5] + ([shift={(0,-4cm)}]current page.north east) arc (90:270:.2\paperheight) --cycle; + \fill[coverfgcolor!80] + (current page.north west) rectangle ([shift={(2cm,0)}]current page.south west); + \begin{scope}[opacity=0.8] + \coordinate (triangleA) at ([shift={(1cm,-1cm)}]current page.north); + \coordinate (triangleB) at ([shift={(-.85\linewidth,-.46\paperheight)}]triangleA); + \coordinate (triangleC) at ([shift={(.52\linewidth,-.46\paperheight)}]triangleA); + \draw[name path=triangle,very thick,coverfgcolor!70!white] + (triangleA)--(triangleB)--(triangleC)--cycle; + \draw[name path=circle,very thick,coverfgcolor!70!white] + ([shift={(-1.6cm,-7.3cm)}]triangleA) coordinate (O) circle(6cm); + %标注每个交点坐标 + \fill [name intersections={of=triangle and circle, name=i, total=\t}] + [coverbar,opacity=0.5, every node/.style={above left, white, opacity=1}] + \foreach \s in {1,...,\t}{(i-\s) circle (1em) node {}}; + \draw[name path=l,very thick,coverfgcolor!70!white] (i-1) -- (triangleC); + \draw[very thick,coverfgcolor!70!white] (i-6) -- (triangleB); + \draw[name path=l2,very thick,coverfgcolor!70!white] (i-4) -- (triangleA); + \fill[name intersections={of=l and circle,name=j,total=\l}] + [coverbar,opacity=0.5, every node/.style={above left, white, opacity=1}] + \foreach \c in {1,...,\l}{(j-\c) circle (1em) node {}}; + + \fill[name intersections={of=l2 and l,name=jj,total=\ll}] + [coverbar,opacity=0.5, every node/.style={above left, white, opacity=1}] + \foreach \cc in {1,...,\ll}{(jj-\cc) circle (1em) node {}}; + \end{scope} + \end{pgfonlayer} + \begin{pgfonlayer}{foreground} + \fill[coverbar,opacity=.5] + ([yshift=2\outermarginwidth]current page.west) rectangle ([xshift=\outermarginwidth,yshift=-.2\outermarginwidth]current page.west); + \end{pgfonlayer} + \shade[left color=coverfgcolor,right color=coverfgcolor!60,opacity=.3] + ([xshift=\outermarginwidth,yshift=2\outermarginwidth]current page.west) rectangle (current page.south east); + \node[anchor=south] at ([xshift=.3\outermarginwidth,yshift=-.4\covershift]current page.north) {% + \parbox{.8\paperwidth}{ + \filright + \color{white}\fontsize{20}{23}\selectfont\@bookseries} + }; + \node[ anchor=south] at ([xshift=.3\outermarginwidth,yshift=-.57\paperheight]current page.north) + {\parbox{.8\paperwidth}{% + \raggedright% + {\renewcommand\baselinestretch{1.1}\selectfont \color{white}\bfseries\fontsize{40}{40}\selectfont\@title\\[0.5ex] + \color{white}\fontsize{30}{30}\selectfont + \ifdefvoid{\@subtitle}{}{\@subtitle}\par} + }}; + \node[anchor=west,font=\fontsize{23}{23}\selectfont,text=white] at ([xshift=1.8\outermarginwidth,yshift=-.6\covershift]current page.west) {\@edition}; + \node[anchor=west,font=\Huge,text=white] at ([xshift=1.8\outermarginwidth,yshift=\covershift]current page.west) {\@author}; + \node[left,text=white,font=\rmfamily\Large,] at + ([shift={(-1cm,2cm)}]current page.south east) % + {\raisebox{-1.1cm}{\includegraphics[width=0.2\linewidth]{\@presslogo}}\hspace*{-3.5ex}\begin{varwidth}{.4\textwidth}\tikz\draw[white,line width=1.25pt] (0,0)--++(0,1cm);\,\raisebox{.25cm}{\@pressname} \end{varwidth}};% + \end{tikzpicture}% + \newpage +} +\makeatother + +\endinput + + + + + + + + + + + + + + + + + + + + + diff --git a/macros/latex/contrib/beautybook/stys/Beautybook-bottompage.sty b/macros/latex/contrib/beautybook/stys/Beautybook-bottompage.sty new file mode 100644 index 0000000000..5d6241e407 --- /dev/null +++ b/macros/latex/contrib/beautybook/stys/Beautybook-bottompage.sty @@ -0,0 +1,83 @@ +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{stys/Beautybook-bottompage}[2023/01/18,v2.0] +\usepackage[ISBN=978-80-85955-35-4,SC0]{ean13isbn} +\makeatletter +\newcommand\summary[1]{\def\@summary{#1}} +\newcommand\ISBNcode[1]{\def\@ISBNcode{#1}} +\newcommand\bottomimage[1]{\def\@bottomimage{#1}} +\makeatother +% Define the layers to be used in document. +% ***************************************************** +\pgfdeclarelayer{background} +\pgfdeclarelayer{foreground} +\pgfdeclarelayer{top} +\pgfdeclarelayer{bottom} +\pgfsetlayers{bottom,background,main,foreground,top} +\definecolor{coverbgcolor}{HTML}{e0e0e0} +\definecolor{coverfgcolor}{HTML}{455a64} +\definecolor{coverbar}{HTML}{c02c38} +\definecolor{bottomcolor}{HTML}{24661c} +\makeatletter +\newcommand*\makebottomcover{ + %% Use the Tikz library positioning and clear the page header and footer + \newpage + \thispagestyle{empty} + \phantom{s} + \clearpage + \newpage + \usetikzlibrary{positioning} + \thispagestyle{empty} + \begin{tikzpicture}[remember picture,overlay] + \begin{pgfonlayer}{bottom} + \node[opacity=0.85,inner sep=0pt] at (current + page.center){\includegraphics[width=\paperwidth,height=\paperheight]{\@bottomimage}}; + \path[fill=bottomcolor!50] + (current page.north east) coordinate (E) --++(-.6\paperwidth,0) coordinate (B) [bend right=30] to ([yshift=-.2\paperheight]E)--cycle; + \path[fill=bottomcolor!75,opacity=0.8] + (current page.north east) coordinate (E) --++(-.6\paperwidth,0) coordinate (B) [bend right=30] to ([yshift=-.25\paperheight]E)--cycle; + \end{pgfonlayer} + \ifdefvoid{\@summary}{}{ + \begin{pgfonlayer}{foreground} + \fill[color=bottomcolor!80,opacity=.6]node[append after command={ + ([yshift=0.5cm]bottominfo.north west) rectangle ([yshift=-0.5cm]bottominfo.south east)},font=\large\bfseries,text=white,minimum width=\paperwidth,opacity=1] (bottominfo) at (current page.center) {\begin{varwidth}{\linewidth}\baselineskip=3ex\@summary\end{varwidth}}; + \end{pgfonlayer} + } + \node[text=white,left] at ([xshift=0cm,yshift=-.25\covershift]current page.north east) {% + \parbox{.6\linewidth}{\baselineskip=22.5pt + \raggedright + \fontsize{20}{23}\selectfont\@bookseries} + }; %系列丛书名称 + \node[right,text=white,font=\rmfamily\Large,] at + ([shift={(-.5cm,1.5cm)}]current page.south west) % + {\raisebox{-1cm}{\includegraphics[width=2cm]{\@presslogo}}\hspace*{0ex}\begin{varwidth}{.4\textwidth}\tikz\draw[white,line width=1.25pt] (0,0)--++(0,1cm);\,\raisebox{.25cm}{\@pressname} \end{varwidth}};% + \ifdefvoid{\@ISBNcode}{}{ + \node[scale=1.5] (isbn) at ([shift={(-1.85\outermarginwidth,.5\covershift)}]current page.south east) {\@ISBNcode};% + \begin{pgfonlayer}{bottom} + \fill[white] (isbn.north west) rectangle (isbn.south east);% + \end{pgfonlayer} + } +\end{tikzpicture}% +} +\makeatother +\endinput + + + + + + + + + + + + + + + + + + + + + diff --git a/macros/latex/contrib/beautybook/stys/Beautybook-cn.sty b/macros/latex/contrib/beautybook/stys/Beautybook-cn.sty new file mode 100644 index 0000000000..04542e7a1f --- /dev/null +++ b/macros/latex/contrib/beautybook/stys/Beautybook-cn.sty @@ -0,0 +1,102 @@ +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{stys/Beautybook-cn}[2023/05/10,v1.0] +\usetikzlibrary{calc,fadings,patterns} +\usepackage{adjustbox} +\makeatletter +\newcommand\entitle[1]{\def\@entitle{#1}} +\makeatother +\tikzfading[name=fade right, + right color =transparent!100, + left color=transparent!50] +\tikzfading[name=fade left, + left color =transparent!100, + right color=transparent!50] +\tikzfading[name=fade up, +top color =transparent!100, +bottom color=transparent!50] +\tikzfading[name=fade down, + bottom color =transparent!100, + top color=transparent!50] +\makeatletter +\newcommand*\makecover{ + %% Use the Tikz library positioning and clear the page header and footer + \usetikzlibrary{positioning} + \thispagestyle{empty} + \begin{tikzpicture}[remember picture,overlay] + \fill[coverfgcolor!75] + (current page.north west) rectangle (current page.south east); + \fill[coverfgcolor!50] + ([xshift=-3\covershift,yshift=-.4\covershift]current page.east) rectangle ([yshift=-1.35\covershift]current page.east); + \fill[coverfgcolor] + ([xshift=\outermarginwidth]current page.north west) rectangle ([xshift=-\outermarginwidth,yshift=1.5\covershift]current page.south east); + \fill[coverbar] + ([yshift=.44\covershift]current page.west) rectangle ([xshift=\outermarginwidth,yshift=-.4\covershift]current page.west); + \node[left] at ([xshift=-1.8cm,yshift=-1.5cm]current page.north east) {% + \parbox{3\covershift}{ + \raggedleft + \color{white}\bfseries\fontsize{18}{22}\selectfont\@bookseries} + }; + \node[right] at ([xshift=\outermarginwidth,yshift=1.5*\covershift]current page.west) + {\parbox{.8\paperwidth}{% + \filright% + \color{white}\bfseries\fontsize{30}{30}\selectfont\@entitle\\[-1.6ex] + \begin{tikzpicture} + \draw[white,line width=1pt] (0,0) --++ (\paperwidth-3\outermarginwidth,0); + \end{tikzpicture}\\[-.5ex] + \color{white}\bfseries\fontsize{30}{30}\selectfont + \ifdefvoid{\@title}{}{\@title} + }}; + \node[left,inner sep=0pt,outer sep=0pt] at ([xshift=1.2\outermarginwidth,yshift=1.8cm]current page.east) + {% + \adjustbox{valign=t}{ + \begin{minipage}{.25\textwidth} + \begin{tikzpicture} + \foreach \x/\r in {1.2/6,.8/4} { + \draw[white,line width=\x pt] (0,0) circle [radius=\r pt];} + \fill[white] (0,0) circle [radius=2.5pt]; + \end{tikzpicture} + \hspace{2pt}\color{white}\fontsize{20}{25}\selectfont Editors + \end{minipage}} + \hfill + \adjustbox{valign=t}{\begin{minipage}{.45\textwidth} + \raggedright\color{white}\fontsize{20}{25}\selectfont\@author + \end{minipage}} + };% 封面作者信息栏 + \fill [path picture={ \node at (path picture bounding box.center) + {\includegraphics[height=.92\linewidth]{\@coverimage}};}] + ([xshift=\outermarginwidth]current page.south west) rectangle ++(1.8*\covershift,.58\paperheight); + \fill[pattern color=coverfgcolor!70,pattern=horizontal lines,opacity=0.8] + ([xshift=\outermarginwidth,yshift=.2\covershift]current page.south west) rectangle ([xshift=-\outermarginwidth,yshift=1.43\covershift]current page.south east); + \fill [coverfgcolor!80,path fading=fade right]% + ([xshift=\outermarginwidth+.5\linewidth+.2cm,yshift=.2\covershift]current page.south west) rectangle ([xshift=-\outermarginwidth,yshift=1.43\covershift]current page.south east); + \fill [coverfgcolor!80,path fading=fade left]% + ([xshift=\outermarginwidth+.5\linewidth+.2cm,yshift=.2\covershift]current page.south west) rectangle ([xshift=-\outermarginwidth,yshift=1.43\covershift]current page.south east); + \node[left,text=white,font=\rmfamily\Large,] at + ([shift={(-2cm,2cm)}]current page.south east) % + {\raisebox{-1cm}{\includegraphics[width=2cm]{\@presslogo}}\hspace*{0ex}\begin{varwidth}{.4\textwidth}\tikz\draw[white,line width=1.25pt] (0,0)--++(0,1cm);\,\raisebox{.25cm}{\@pressname} \end{varwidth}}; + \end{tikzpicture} + \newpage +} +\makeatother +\endinput + + + + + + + + + + + + + + + + + + + + + diff --git a/macros/latex/contrib/beautybook/stys/Beautybook-en.sty b/macros/latex/contrib/beautybook/stys/Beautybook-en.sty new file mode 100644 index 0000000000..51998fdb92 --- /dev/null +++ b/macros/latex/contrib/beautybook/stys/Beautybook-en.sty @@ -0,0 +1,83 @@ +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{stys/Beautybook-en}[2022/05/21,v1.0] +\usepackage{anyfontsize} +\usepackage[dvipsnames,svgnames,x11names,table]{xcolor}% Driver-independent color extensions +\usepackage{tikz} +\usetikzlibrary{calc,fadings,patterns} +\usepackage{adjustbox} +\tikzfading[name=fade right, + right color =transparent!100, + left color=transparent!50] +\tikzfading[name=fade left, + left color =transparent!100, + right color=transparent!50] +\tikzfading[name=fade up, + top color =transparent!100, + bottom color=transparent!50] +\tikzfading[name=fade down, + bottom color =transparent!100, + top color=transparent!50] +\makeatletter +\newcommand*\makecover{ + %% Use the Tikz library positioning and clear the page header and footer + \usetikzlibrary{positioning} + \thispagestyle{empty} + \begin{tikzpicture}[remember picture,overlay] + \fill[coverfgcolor] + (current page.north west) rectangle (current page.south east);% (coverbgcolor) + \coordinate (start) at ($(current page.east)!0.5!(current page.north east)+(1,-1)$); + \coordinate (end) at (current page.north west); + \foreach \i in {0,0.01,...,1} + { + \coordinate (point) at ($(start)!\i!(end)$); + \draw[coverfgcolor!50] + ($(point)+(310*\i:6)$)-- + ($(point)+(310*\i+120:6)$)-- + ($(point)+(310*\i+240:6)$)-- + ($(point)+(310*\i:6)$); + } + \coordinate (start) at (current page.south west); + \coordinate (end) at (current page.east); + \foreach \i in {0,0.02,...,1} + { + \coordinate (point) at ($(start)!\i!(end)$); + \draw[coverfgcolor!50] + ($(point)+(310*\i:10)$)-- + ($(point)+(310*\i+120:10)$)-- + ($(point)+(310*\i+240:10)$)-- + ($(point)+(310*\i:10)$); + } + \shade[bottom color=coverfgcolor,top color=coverfgcolor!70,opacity=0.7] + ([xshift=.5\outermarginwidth]current page.north west) rectangle (current page.south east); + \shade[left color=coverfgcolor,right color=coverfgcolor!60,opacity=0.5] + ([xshift=\outermarginwidth,yshift=2\outermarginwidth]current page.west) rectangle (current page.south east); + \fill[coverbar!90,opacity=0.8] + ([yshift=2\outermarginwidth]current page.west) rectangle ([xshift=\outermarginwidth,yshift=-.2\outermarginwidth]current page.west); + \foreach \lx/\rx/\ry/\bc/\tc in { + 1/1.5/1.75/70/80,1.5/2/1.6/65/75,2/2.5/1.3/60/70,2.5/3/1/55/65,3/3.5/.7/50/60,3.5/4/1.2/60/70,4/4.5/1.9/75/85,4.5/5/1.1/55/65,5/5.5/1.2/60/70,6/6.5/1.6/65/75,6.5/7/1.3/60/70,7/7.5/1.87/70/80,7.5/8/1/55/65,8/8.5/.9/50/60,8.5/9/1.8/70/80,9/9.5/1.6/65/75,9.5/10/1.4/60/70,10/10.5/1/55/65,10.5/11/.7/50/60,11/11.5/1.3/55/65,11.5/12/1/70/80,12/12.5/1.3/65/75,12.5/13/1.6/60/70,13/13.5/1.75/55/65,13.5/14/1.6/65/75,14/14.5/1.3/60/70 + }{ + \shade[bottom color=coverfgcolor!\bc,top color=coverfgcolor!\tc,opacity=.5] + ([xshift=\lx\outermarginwidth]current page.north west) rectangle ([xshift=\rx\outermarginwidth,yshift=-\ry\covershift]current page.north west); + } + \node[anchor=south] at ([xshift=.3\outermarginwidth,yshift=-.4\covershift]current page.north) {% + \parbox{.8\paperwidth}{ + \filright + \color{white}\fontsize{20}{23}\selectfont\@bookseries} + }; + \node[ anchor=south] at ([xshift=.3\outermarginwidth,yshift=-.57\paperheight]current page.north) + {\parbox{.8\paperwidth}{% + \raggedright% + {\renewcommand\baselinestretch{1.1}\selectfont \color{white}\bfseries\fontsize{40}{40}\selectfont\@title\\[0.5ex] + \color{white}\fontsize{30}{30}\selectfont + \ifdefvoid{\@subtitle}{}{\@subtitle}\par} + }}; + \node[anchor=west,font=\fontsize{23}{23}\selectfont,text=white] at ([xshift=1.8\outermarginwidth,yshift=-.6\covershift]current page.west) {\@edition}; + \node[anchor=west,font=\Huge,text=white] at ([xshift=1.8\outermarginwidth,yshift=\covershift]current page.west) {\@author}; + \node[left,text=white,font=\rmfamily\Large,] at + ([shift={(-1cm,2cm)}]current page.south east) % + {\raisebox{-1.1cm}{\includegraphics[width=2cm]{\@presslogo}}\hspace*{0ex}\begin{varwidth}{.4\textwidth}\tikz\draw[white,line width=1.25pt] (0,0)--++(0,1cm);\,\raisebox{.25cm}{\@pressname} \end{varwidth}};% + \end{tikzpicture}% + \newpage +} +\makeatother +\endinput
\ No newline at end of file diff --git a/macros/latex/contrib/beautybook/stys/Beautybook-enfig.sty b/macros/latex/contrib/beautybook/stys/Beautybook-enfig.sty new file mode 100644 index 0000000000..b5c6bbe523 --- /dev/null +++ b/macros/latex/contrib/beautybook/stys/Beautybook-enfig.sty @@ -0,0 +1,55 @@ +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{stys/Beautybook-enfig}[2023/02/03,v1.0] +\definecolor{coverbgcolor}{HTML}{004183} +\definecolor{coverfgcolor}{HTML}{00744F} +\definecolor{coverbar}{HTML}{00744F} +\tikzfading[name=fade right, + right color =transparent!100, + left color=transparent!0] +\tikzfading[name=fade left, + left color =transparent!100, + right color=transparent!50] +\tikzfading[name=fade up, + top color =transparent!100, + bottom color=transparent!50] +\tikzfading[name=fade down, + bottom color =transparent!100, + top color=transparent!50] +\makeatletter +\newcommand*\makecover{ + %% Use the Tikz library positioning and clear the page header and footer + \usetikzlibrary{positioning} + \thispagestyle{empty} + \begin{tikzpicture}[remember picture,overlay] + \begin{pgfonlayer}{bottom} + \node[opacity=0.8,inner sep=0pt] at (current + page.center){\includegraphics[width=\paperwidth,height=\paperheight]{\@coverimage}}; + \end{pgfonlayer} + \shade[left color=coverbgcolor!70,right color=coverbgcolor!50,path fading=fade right,opacity=.6] + ([xshift=.5\outermarginwidth]current page.north west) rectangle ([xshift=4\outermarginwidth]current page.south west); + \shade[left color=coverfgcolor,right color=coverfgcolor!60,opacity=.8] + ([xshift=\outermarginwidth,yshift=2\outermarginwidth]current page.west) rectangle (current page.south east); + \fill[coverbar] + ([yshift=2\outermarginwidth]current page.west) rectangle ([xshift=\outermarginwidth,yshift=-.2\outermarginwidth]current page.west); + \node[anchor=south] at ([xshift=.3\outermarginwidth,yshift=-.4\covershift]current page.north) {% + \parbox{.8\paperwidth}{ + \filright + \color{white}\sansa\fontsize{20}{23}\selectfont\@bookseries} + }; + \node[ anchor=south] at ([xshift=.3\outermarginwidth,yshift=-.57\paperheight]current page.north) + {\parbox{.8\paperwidth}{% + \raggedright% + {\renewcommand\baselinestretch{1.1}\selectfont \color{white}\bfseries\fontsize{40}{40}\selectfont\@title\\[0.5ex] + \color{white}\sansa\fontsize{30}{30}\selectfont + \ifdefvoid{\@subtitle}{}{\@subtitle}\par} + }}; + \node[anchor=west,font=\itshape\fontsize{23}{23}\selectfont,text=white] at ([xshift=1.8\outermarginwidth,yshift=-.6\covershift]current page.west) {\@edition}; + \node[anchor=west,font=\Huge,text=white] at ([xshift=1.8\outermarginwidth,yshift=\covershift]current page.west) {\@author}; + \node[left,text=white,font=\rmfamily\Large,] at + ([shift={(-1cm,2cm)}]current page.south east) % + {\raisebox{-1.1cm}{\includegraphics[width=0.2\linewidth]{\@presslogo}}\hspace*{-3.5ex}\begin{varwidth}{.4\textwidth}\tikz\draw[white,line width=1.25pt] (0,0)--++(0,1cm);\,\raisebox{.25cm}{\@pressname} \end{varwidth}}; + \end{tikzpicture} + \newpage +} +\makeatother +\endinput diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf Binary files differindex 8d0ef77e24..188e150a29 100644 --- a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf +++ b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex index 31cdc19f5e..b967adb55c 100644 --- a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex +++ b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex @@ -5,8 +5,8 @@ % arara: lualatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') \documentclass[a4paper,french,11pt]{article} -\def\PLversion{2.6.7} -\def\PLdate{2 juin 2023} +\def\PLversion{2.7.0} +\def\PLdate{15 juin 2023} \usepackage{amsfonts} \usepackage{ProfLycee} \useproflyclib{piton,minted,pythontex} @@ -137,12 +137,12 @@ keywordstyle={\color{violet}},% classoffset=2,% alsoletter={-},% - morekeywords={\ResolutionApprochee,\SolutionTVI,\CalculTermeRecurrence,\ToileRecurrence,\SolutionSeuil,\IntegraleApprochee,\GrilleTikz,\AxesTikz,\AxexTikz,\AxeyTikz,\FenetreTikz,\FenetreSimpleTikz,\DeclareFonctionTikz,\CourbeTikz,\OrigineTikz,\SplineTikz,\TangenteTikz,\MiniSchemaSignes,\MiniSchemaSignesTkzTab,\IntegraleApprocheeTikz,\CartoucheCapytale,\PaveTikz,\TetraedreTikz,\CercleTrigo,\AffPoint,\AffVecteur,\TrouveEqCartPlan,\TrouveEqParamDroite,\TrouveEqCartDroite,\TrouveNorme,\TrouveDistancePtPlan,\EquationReduite,\CalculsRegLin,\PointsRegLin,\NuagePointsTikz,\PointMoyenTikz,\BoiteMoustaches,\BoiteMoustachesAxe,\Histogramme,\CalcBinomP,\CalcBinomC,\BinomP,\BinomC,\CalcPoissP,\CalcPoissC,\PoissonP,\PoissonC,\CalcGeomP,\CalcGeomC,\GeomP,\GeomC,\CalcHypergeomP,\CalcHypergeomP,\HypergeomP,\HypergeomC,\CalcNormC,\NormaleC,\CalcExpoC,\ExpoC,\ArbreProbasTikz,\LoiNormaleGraphe,\LoiExpoGraphe,\NbAlea,\VarNbAlea,\TirageAleatoireEntiers,\Arrangement,\Combinaison,\ConversionDecBin,\ConversionBinHex,\ConversionVersDec,\ConversionBaseDix,\ConversionDepuisBaseDix,\PresentationPGCD,\EquationDiophantienne,\ConversionFraction,\SimplificationRacine,\EcritureEnsemble,\EcritureTrinome,\MesurePrincipale,\LigneTrigo,\SudoMaths + morekeywords={\ResolutionApprochee,\SolutionTVI,\CalculTermeRecurrence,\ToileRecurrence,\SolutionSeuil,\IntegraleApprochee,\GrilleTikz,\AxesTikz,\AxexTikz,\AxeyTikz,\FenetreTikz,\FenetreSimpleTikz,\DeclareFonctionTikz,\CourbeTikz,\OrigineTikz,\SplineTikz,\TangenteTikz,\MiniSchemaSignes,\MiniSchemaSignesTkzTab,\IntegraleApprocheeTikz,\CartoucheCapytale,\PaveTikz,\TetraedreTikz,\CercleTrigo,\AffPoint,\AffVecteur,\TrouveEqCartPlan,\TrouveEqParamDroite,\TrouveEqCartDroite,\TrouveNorme,\TrouveDistancePtPlan,\EquationReduite,\CalculsRegLin,\PointsRegLin,\NuagePointsTikz,\PointMoyenTikz,\BoiteMoustaches,\BoiteMoustachesAxe,\Histogramme,\CalcBinomP,\CalcBinomC,\BinomP,\BinomC,\CalcPoissP,\CalcPoissC,\PoissonP,\PoissonC,\CalcGeomP,\CalcGeomC,\GeomP,\GeomC,\CalcHypergeomP,\CalcHypergeomP,\HypergeomP,\HypergeomC,\CalcNormC,\NormaleC,\CalcExpoC,\ExpoC,\ArbreProbasTikz,\LoiNormaleGraphe,\LoiExpoGraphe,\NbAlea,\VarNbAlea,\TirageAleatoireEntiers,\Arrangement,\Combinaison,\ConversionDecBin,\ConversionBinHex,\ConversionVersDec,\ConversionBaseDix,\ConversionDepuisBaseDix,\PresentationPGCD,\EquationDiophantienne,\ConversionFraction,\SimplificationRacine,\EcritureEnsemble,\EcritureTrinome,\MesurePrincipale,\LigneTrigo,\SudoMaths,\FonctionRepartTikz },% keywordstyle={\color{green!75!black}},% classoffset=3,% alsoletter={-},% - morekeywords={minimum-decimal-digits,scale,nonamssymb,build,Precision,Intervalle,Variable,NomFct,NomSol,va,vb,Stretch,Balayage,Calculatrice,Majuscule,No,UNo,NomSuite,Simple,Exact,Conclusion,Sens,ResultatBrut,Methode,NbSubDiv,AffFormule,Expr,Signe,Variables,Affp,Affs,Epaisseur,Police,ElargirOx,ElargirOy,Labelx,Labely,AffLabel,PosLabelx,PosLabely,EchelleFleche,TypeFleche,PosGrad,HautGrad,AffGrad,AffOrigine,Annee,Trigo,Dfrac,Style,Coeffs,AffPoints,TaillePoints,xl,xr,Code,Racines,Largeur,Hauteur,Cadre,Fct,Nom,PosLabel,DecalLabel,TailleLabel,AffTermes,RemplirbOpacite,CouleurRemplissage,Lignes,Gobble,Alignement,Filigrane,BarreTitre,CouleurNombres,Centre,EspacementVertical,Label,Titre,Profondeur,Angle,Fuite,Sommets,Math,Aff,Plein,Cube,Alpha,Beta,Rayon,Marge,TailleValeurs,TailleAngles,CouleurFond,Decal,MoinsPi,AffAngles,AffTraits,AffValeurs,Equationcos,Equationsin,sin,cos,AffTraitsEq,CouleurSol,OptionCoeffs,SimplifCoeffs,Facteur,OptionCoeffs,Reel,Oppose,Rgras,SimplifCoeffs,VectDirecteur,NomCoeffa,NomCoeffb,NomCoeffr,NomCoeffrd,NomXmin,NomXmax,Ox,Oy,xg,yg,AffNom,Elevation,Moyenne,AffMoyenne,Pointilles,Valeurs,Elargir,Min,Max,DebutOx,FinOx,ListeCouleurs,ElargirX,ElargirY,LabelX,LabelY,GradX,GradY,AffEffectifs,PosEffectifs,Opacite,AffBornes,GrilleV,PoliceAxes,PoliceEffectifs,EpaisseurTraits,Unite,EspaceNiveau,EspaceFeuille,Type,PoliceProbas,InclineProbas,Fleche,StyleTrait,EpaisseurTrait,CouleurAire,CouleurCourbe,AfficheM,AfficheCadre,ValMin,ValMax,NbVal,Sep,Tri,Repetition,Notation,NotationAncien,Formule,AffBase,Details,BaseDep,Zeros,DecalH,DecalV,Noeud,Rect,CouleurRes,DecalRect,Rectangle,CouleurResultat,AfficheConclusion,AfficheDelimiteurs,Lettre,Inconnues,Entier,Cadres,PresPGCD,Mathpunct,Option,Alea,Anegatif,Crochets,Brut,Etapes,Epaisseurg,CouleurCase,CouleurTexte,NbSubCol,NbLig,NbCol,Legendes,PoliceLeg,ListeLegV,ListeLegH,DecalLegende,Couleur,Uno},% + morekeywords={minimum-decimal-digits,scale,nonamssymb,build,Precision,Intervalle,Variable,NomFct,NomSol,va,vb,Stretch,Balayage,Calculatrice,Majuscule,No,UNo,NomSuite,Simple,Exact,Conclusion,Sens,ResultatBrut,Methode,NbSubDiv,AffFormule,Expr,Signe,Variables,Affp,Affs,Epaisseur,Police,ElargirOx,ElargirOy,Labelx,Labely,AffLabel,PosLabelx,PosLabely,EchelleFleche,TypeFleche,PosGrad,HautGrad,AffGrad,AffOrigine,Annee,Trigo,Dfrac,Style,Coeffs,AffPoints,TaillePoints,xl,xr,Code,Racines,Largeur,Hauteur,Cadre,Fct,Nom,PosLabel,DecalLabel,TailleLabel,AffTermes,RemplirbOpacite,CouleurRemplissage,Lignes,Gobble,Alignement,Filigrane,BarreTitre,CouleurNombres,Centre,EspacementVertical,Label,Titre,Profondeur,Angle,Fuite,Sommets,Math,Aff,Plein,Cube,Alpha,Beta,Rayon,Marge,TailleValeurs,TailleAngles,CouleurFond,Decal,MoinsPi,AffAngles,AffTraits,AffValeurs,Equationcos,Equationsin,sin,cos,AffTraitsEq,CouleurSol,OptionCoeffs,SimplifCoeffs,Facteur,OptionCoeffs,Reel,Oppose,Rgras,SimplifCoeffs,VectDirecteur,NomCoeffa,NomCoeffb,NomCoeffr,NomCoeffrd,NomXmin,NomXmax,Ox,Oy,xg,yg,AffNom,Elevation,Moyenne,AffMoyenne,Pointilles,Valeurs,Elargir,Min,Max,DebutOx,FinOx,ListeCouleurs,ElargirX,ElargirY,LabelX,LabelY,GradX,GradY,AffEffectifs,PosEffectifs,Opacite,AffBornes,GrilleV,PoliceAxes,PoliceEffectifs,EpaisseurTraits,Unite,EspaceNiveau,EspaceFeuille,Type,PoliceProbas,InclineProbas,Fleche,StyleTrait,EpaisseurTrait,CouleurAire,CouleurCourbe,AfficheM,AfficheCadre,ValMin,ValMax,NbVal,Sep,Tri,Repetition,Notation,NotationAncien,Formule,AffBase,Details,BaseDep,Zeros,DecalH,DecalV,Noeud,Rect,CouleurRes,DecalRect,Rectangle,CouleurResultat,AfficheConclusion,AfficheDelimiteurs,Lettre,Inconnues,Entier,Cadres,PresPGCD,Mathpunct,Option,Alea,Anegatif,Crochets,Brut,Etapes,Epaisseurg,CouleurCase,CouleurTexte,NbSubCol,NbLig,NbCol,Legendes,PoliceLeg,ListeLegV,ListeLegH,DecalLegende,Couleur,Uno,Grille,ExtraGrilleY,PosLegende,Pointilles,Extremite,Frac},% keywordstyle={\color{orange!75!black}} } } @@ -825,6 +825,9 @@ Elles sont présentées de manière \textit{succincte}, mais elles sont présent %schémas lois continues \LoiNormaleGraphe[options]<options tikz>{m}{s}{a}{b} \LoiExpoGraphe[options]<options tikz>{l}{a}{b} + +%fonction de répartition discrète, dans une environnement tikz +\FonctionRepartTikz[clés]{probas,borneinf,bornesup / probas,borneinf,bornesup / ...} \end{PresCodeTexPL} \begin{PresCodeTexPL}{listing only} @@ -1382,7 +1385,9 @@ Les commandes ont -- pour certaines -- pas mal de \Cle{clés} pour des réglages Cette commande permet de tracer une grille principale et/ou une grille secondaire : \begin{itemize} - \item les premières \Cle{clés} sont les booléens \Cle{Affp} et \Cle{Affs} qui affichent ou non les grilles ;\hfill~défaut \Cle{true} + \item les premières \Cle{clés} sont les booléens \Cle{Affp} et \Cle{Affs} qui affichent ou non les grilles ; + + \hfill~défaut \Cle{true} \item les options des grilles sont en \TikZ. \hfill~défaut \Cle{thin,lightgray} et \Cle{very thin,lightgray} \end{itemize} \vspace*{-\baselineskip}\leavevmode @@ -1514,7 +1519,10 @@ Ces commande permet de tracer les graduations des axes, avec des \Cle{clés} ide \item \cmaj{2.5.6} le booléen \Cle{Trigo} (uniquement pour l'axe $(Ox)$) pour des graduations libres en radians ; \hfill~défaut \Cle{false} - \item \cmaj{2.5.6} le booléen \Cle{Dfrac} (uniquement pour l'axe $(Ox)$ en \Cle{Trigo}) pour forcer les fractions en \textit{grand}. + \item \cmaj{2.5.6} le booléen \Cle{Dfrac} (uniquement pour l'axe $(Ox)$ en \Cle{Trigo}) pour forcer les fractions en \textit{grand} ; + + \hfill~défaut \Cle{false} + \item \cmaj{2.7.0} le booléen \Cle{Frac} (uniquement pour l'axe $(Oy)$) pour forcer les graduations en fraction (taille normale). \hfill~défaut \Cle{false} \end{itemize} @@ -2745,7 +2753,7 @@ Plusieurs \Cle{clés} sont disponibles : \end{cautionblock} \begin{noteblock} -Du fait du paramétrage des boîtes \ctex{tcolorbox}, il se peut que le rendu soit non conforme si elle doit être insérée dans une autre \ctex{tcolorbox}\ldots{} ! +Du fait du paramétrage des boîtes \ctex{tcolorbox}, il se peut que le rendu soit non conforme si elle doit être insérée dans une autre \ctex{tcolorbox}\ldots{} (normalement corrigé en \cmaj{2.6.9}) ! \end{noteblock} \begin{noteblock} @@ -5384,6 +5392,8 @@ La commande fonctionne avec des données classe/effectif, qui seront à traduire \begin{cautionblock} Contrairement aux autres commandes graphiques, qui sont souvent à intégrer dans un environnement \TikZ, la commande \ctex{\textbackslash Histogramme} aura besoin de connaître les dimensions finales du graphique pour fonctionner ! + +Les dimensions correspondent à celles des rectangles avec les éventuelles modifications horizontales et/ou verticales spécifiées. \end{cautionblock} \subsection{Clés et options} @@ -5403,7 +5413,9 @@ Le premier argument, optionnel et entre \ctex{[...]} propose les \Cle{clés} pri \hfill{}défaut : \Cle{vide} \item \Cle{Largeur} : largeur en cm du graphique créé (entre \Cle{DebutOx} et \Cle{FinOx}) ; \hfill{}défaut : \Cle{10} - \item \Cle{Hauteur} : hauteur en cm du graphique créé (par rapport à l'effectif maximal) ; \hfill{}défaut : \Cle{5} + \item \Cle{Hauteur} : hauteur en cm du graphique créé (par rapport à l'effectif maximal ou la grille éventuelle) ; + + \hfill{}défaut : \Cle{5} \item \Cle{ListeCouleurs} : liste des couleurs des rectangles (unique ou sous la forme \ctex{\{CoulA,CoulB,...\}}) ; \hfill{}défaut : \Cle{orange} @@ -5425,9 +5437,19 @@ Le premier argument, optionnel et entre \ctex{[...]} propose les \Cle{clés} pri \item \Cle{EpaisseurTraits} : épaisseur des traits (langage \ctex{tikz}). \hfill{}défaut : \Cle{semithick} \end{itemize} +\cmaj{2.6.8} Quelques clés sont spécifiques à la grille (éventuelle) des histogrammes non réguliers (avec ajustement vertical et légende) : + +\begin{itemize} + \item \Cle{Grille} : création de la grille, sous la forme \Cle{GradX/UniteAire} ; \hfill{}défaut : \Cle{vide} + \item \Cle{ExtraGrilleY} : pour rajouter une \textit{ligne à la grille en vertical} ; \hfill{}défaut : \Cle{0} + \item \Cle{PosLegende} : pour préciser le \textit{carreau} de la légende éventuelle. \hfill{}défaut : \Cle{vide} +\end{itemize} + Le second argument, obligatoire et entre \ctex{\{...\}} permet de préciser les données utilisées sous la forme \ctex{BorneInf/BorneSup/Effectif BorneInf/BorneSup/Effectif ...}. \end{cautionblock} +\pagebreak + \subsection{Exemple avec des classes régulières} \begin{tipblock} @@ -5444,25 +5466,22 @@ Avec la série suivante : \end{tipblock} \begin{PresCodePL}{} -\Histogramme[% - ListeCouleurs={white},Opacite=1,% - GradX={7,8,...,15},LabelX={données},% - GradY={0,25,...,175},LabelY={effectifs},% +\Histogramme[ListeCouleurs={white},Opacite=1,% + GradX={7,8,...,15},LabelX={données},GradY={0,25,...,175},LabelY={effectifs},% PoliceEffectifs=\small\sffamily,PosEffectifs=dessus]% {7/9/130 9/11/175 11/13/182 13/15/95} \end{PresCodePL} \begin{PresCodePL}{} -\Histogramme[% - Largeur=11,Hauteur=8,% +\Histogramme[Largeur=11,Hauteur=7,% ListeCouleurs={yellow,blue,pink,red},% - DebutOx=5,FinOx=17,% - GradX={5,6,...,17},% - GradY={0,25,...,175},% + DebutOx=5,FinOx=17,GradX={5,6,...,17},GradY={0,25,...,175},% AffEffectifs=false]% {7/9/130 9/11/175 11/13/182 13/15/95} \end{PresCodePL} +\pagebreak + \subsection{Exemple avec des classes non régulières} \begin{tipblock} @@ -5494,6 +5513,32 @@ Avec la série suivante : {0/20/15 20/50/34 50/60/8 60/85/10 85/100/13} \end{PresCodePL} +\pagebreak + +\begin{tipblock} +Avec la série suivante : + +\medskip + +\hfill +\begin{tblr}{hlines,vlines,width=14cm,colspec={Q[l,m]*{6}{X[m,c]}},cell{1}{2-Z}={font=\footnotesize}} + Classes & $[900\mathpunct{};1\,200[$ & $[1\,200\mathpunct{};1\,400[$ & $[1\,400\mathpunct{};1\,600[$ & $[1\,600\mathpunct{};1\,800[$ & $[1\,800\mathpunct{};2\,000[$ & $[2\,000\mathpunct{};2\,400]$ \\ + Effectifs & 30 & 30 & 60 & 40 & 20 & 20 \\ +\end{tblr} +\hfill~ +\end{tipblock} + +\begin{PresCodePL}{} +%choix des unités 0.85cm par petit carreau avec 17H et 5V + +\Histogramme*[% + Largeur=13.6,Hauteur=4.25,FinOx=2500,% + PosLegende=0/3,Grille=100/10,ExtraGrilleY=1,% + ListeCouleurs=lightgray,% + AffBornes,PosEffectifs=dessus] + {900/1200/30 1200/1400/30 1400/1600/60 1600/1800/40 1800/2000/20 2000/2400/20} +\end{PresCodePL} + \newpage \phantom{t}\par\vfill\par @@ -6180,6 +6225,72 @@ On a $\displaystyle\Combinaison[NotationAncien,Formule]{3}{20}$. %ancienne notat \newpage +\section{Fonction de répartition}\label{fctrepart} + +\subsection{Idée} + +\begin{tipblock} +\cmaj{2.7.0} L'idée est de proposer une commande (en accord avec les commandes de repérage, page \pageref{reperagetikz}) pour tracer la représentation graphique d'une fonction de répartition discrète. +\end{tipblock} + +\begin{PresCodeTexPL}{listing only} +\begin{tikzpicture}[paramètres de la fenêtre] + %commandes pour al fenêtre graphique + \FonctionRepartTikz[clés]{liste des probas,borneinf,bornesup} +\end{tikzpicture} +\end{PresCodeTexPL} + +\subsection{Utilisation} + +\begin{cautionblock} +Le premier argument, optionnel et entre \ctex{[...]} propose les clés suivantes : + +\begin{itemize} + \item la clé \Cle{Couleur} pour la couleur du tracé ; \hfill~défaut \Cle{red} + \item la clé \Cle{Epaisseur} pour gérer l'épaisseur des tracés (en \textit{raccourci} \TikZ) ; \hfill~défaut \Cle{thick} + \item le booléen \Cle{Pointilles} pour afficher les pointillés horizontaux ; \hfill~défaut \Cle{true} + \item la clé \Cle{Extremite} parmi \Cle{crochet/point} pour gérer les extrémités des segments. + + \hfill~défaut \Cle{crochet} +\end{itemize} + +L'argument obligatoire et entre \ctex{\{...\}} permet de spécifier la liste des \texttt{probas-intervalles} : + +\begin{itemize} + \item avec \ctex{*} pour remplacer $\infty$ ; + \item sous la forme \ctex{proba,borneinf,bornesup / proba,borneinf,bornesup / ...}. +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{cautionblock} + +\begin{importantblock} +Le code \textit{remplace} \ctex{*} par les valeurs stockées dans \ctex{\textbackslash xmin} ou \ctex{\textbackslash xmax}, d'où l'intérêt d'utiliser la commande en \textit{partenariat} des commandes de repérage de \ctex{Proflycee}. +\end{importantblock} + +\begin{PresCodePL}{} +\begin{tikzpicture}[y=4cm,xmin=-2,xmax=10,ymin=0,ymax=1.1, xgrille=1,xgrilles=0.5,ygrille=0.5,ygrilles=0.125] + \GrilleTikz %grille + \AxesTikz %axes + \AxexTikz{0,2,4,6,8} %graduations de (Ox) + \AxeyTikz[AffGrad=false]{0,0.25,...,1} %graduations de (Oy) sans valeurs + \AxeyTikz[Frac]{1/3,1/2,2/3,1} %valeurs des probas, en fraction + %les probas étant données en fraction, on protège par des {...} + \FonctionRepartTikz{0,*,0 / {1/3},0,2 / {1/2},2,4 / {2/3},4,6 / 1,6,*} +\end{tikzpicture} +\end{PresCodePL} + +\begin{PresCodePL}{} +\begin{tikzpicture}[y=4cm,xmin=-1,xmax=13,ymin=0,ymax=1.1, xgrille=1,xgrilles=0.5,ygrille=0.2,ygrilles=0.125] + \GrilleTikz[Affs=false] + \AxesTikz + \AxeyTikz{0,0.25,...,1} + \AxexTikz{0,1,...,12} + \FonctionRepartTikz[Extremite=point,Couleur=blue,Pointilles=false]% + {0,*,2 / {1/36},2,3 / {3/36},3,4 / {6/36},4,5 / {10/36},5,6 / {15/36},6,7 / {21/36},7,8 / {26/36},8,9 / {30/36},9,10 / {33/36},10,11 / {35/36},11,12 / 1,12,*} +\end{tikzpicture} +\end{PresCodePL} +\newpage + \phantom{t}\par\vfill\par \begin{PART} \begin{center} @@ -7333,6 +7444,14 @@ La grille, créée en \TikZ, est portée par le rectangle de \og coins \fg{} $(0 \part{Historique} +{\small \bverb|v 2.7.0|~:~~~~Ajout de la clé \Cle{Frac} pour les axes verticaux (\pageref{reperagetikz}) + +{\small \bverb| |~:~~~~Fonction de répartition discrète (\pageref{fctrepart}) + +{\small \bverb|v 2.6.9|~:~~~~Amélioration de le présentation de code \textsf{Piton} (page \pageref{pythonpiton}) + +{\small \bverb|v 2.6.8|~:~~~~Ajout d'une grille pour les histogrammes non réguliers (page \pageref{histo}) + {\small \bverb|v 2.6.7|~:~~~~Histogramme à classes régulières ou non (page \pageref{histo}) + Correction de bugs mineurs {\small \bverb|v 2.6.6|~:~~~~Style \textsf{mainlevee} en \TikZ{} désormais dans le package \textsf{tikz2d-fr} diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-exemples-pyluatex.pdf b/macros/latex/contrib/proflycee/doc/ProfLycee-exemples-pyluatex.pdf Binary files differindex 3d0d3e043b..d9a165fe28 100644 --- a/macros/latex/contrib/proflycee/doc/ProfLycee-exemples-pyluatex.pdf +++ b/macros/latex/contrib/proflycee/doc/ProfLycee-exemples-pyluatex.pdf diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-exemples-pyluatex.tex b/macros/latex/contrib/proflycee/doc/ProfLycee-exemples-pyluatex.tex index dc7c4cbf98..c993ade44c 100644 --- a/macros/latex/contrib/proflycee/doc/ProfLycee-exemples-pyluatex.tex +++ b/macros/latex/contrib/proflycee/doc/ProfLycee-exemples-pyluatex.tex @@ -2,7 +2,7 @@ % !TeX TXS-program:compile = txs:///lualatex/[--shell-escape] \documentclass[french,a4paper,10pt]{article} -\def\PLver{2.6.0} +\def\PLver{2.6.9} \usepackage[margin=1.5cm]{geometry} \usepackage{ProfLycee} \useproflyclib{piton} diff --git a/macros/latex/contrib/proflycee/tex/ProfLycee.sty b/macros/latex/contrib/proflycee/tex/ProfLycee.sty index 3e3d3cd558..bed6473cca 100644 --- a/macros/latex/contrib/proflycee/tex/ProfLycee.sty +++ b/macros/latex/contrib/proflycee/tex/ProfLycee.sty @@ -3,7 +3,10 @@ % or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ProfLycee}[2023/06/02 2.6.7 Aide pour l'utilisation de LaTeX en lycee] +\ProvidesPackage{ProfLycee}[2023/06/15 2.7.0 Aide pour l'utilisation de LaTeX en lycee] +% 2.7.0 Ajout de la clé [Frac] pour \AxeyTikz + \FonctionRepartTikz +% 2.6.9 Correction de bugs et améliorations des boîtes de codes +% 2.6.8 Ajout d'une grille (manuelle) pour les histogrammes non réguliers % 2.6.7 Correction de bugs mineurs + Histogramme (classes régulières ou non) % 2.6.6 Externalisation du style Tikz mainlevee (dans tikz2d-fr) % 2.6.5 Ajout d'une option[noamssymb] pour éviter les clashs avec fourier (merci PfC) + Corections de bugs diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-graphiques.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-graphiques.tex index fbcc1910e1..200461710b 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-graphiques.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-graphiques.tex @@ -255,7 +255,8 @@ HautGrad=4pt,% AffGrad=true,% AffOrigine=true,% - Annee=false + Annee=false,% + Frac=false } \DeclareDocumentCommand\AxeyTikz{ O{} m }{% @@ -264,26 +265,42 @@ \IfSubStr{\axeytickwidth}{/} {\StrCut{\axeytickwidth}{/}{\axeytickwidthA}{\axeytickwidthB}} {\def\axeytickwidthA{\axeytickwidth}\def\axeytickwidthB{\axeytickwidth}} - \foreach \y in {#2}{% - \draw[line width=\axeywidth] ({\axeytickwidthA},{\y-\axeyOy}) -- ({-\axeytickwidthB},{\y-\axeyOy})% - \ifboolKV[PLaxeytkz]{AffGrad}%on affiche les graduations + \ifboolKV[PLaxeytkz]{Frac}% {% - \ifboolKV[PLaxeytkz]{AffOrigine}%si on demande d'afficher l'origine - {node[\axeyposlabel,font=\axeyfont] - {\ifboolKV[PLaxeytkz]{Annee}% - {\num[group-digits=none]{\y}}% - {\num[text-family-to-math=true,text-series-to-math=true]{\y}}% - } - } - {\xintifboolexpr{\y==\axeyOy}{}{node[\axeyposlabel,font=\axeyfont] {\ifboolKV[PLaxeytkz]{Annee}% - {\num[group-digits=none]{\y}}% - {\num[text-family-to-math=true,text-series-to-math=true]{\y}}% - } - } - } - } - {} - ;} + \ifboolKV[PLaxeytkz]{AffGrad}%on affiche les graduations + {% + \foreach \y in {#2} + {\draw[line width=\axeywidth] ({\axeytickwidthA},{\y-\axeyOy}) -- ({-\axeytickwidthB},{\y-\axeyOy}) % + \xintifboolexpr{\y==\axeyOy}{}{node[\axeyposlabel,font=\axeyfont] {\ConversionFraction{\y}}} ;} + }% + {% + \foreach \y in {#2} + {\draw[line width=\axeywidth] ({\axeytickwidthA},{\y-\axeyOy}) -- ({-\axeytickwidthB},{\y-\axeyOy}) ;} + }% + }% + {% + \foreach \y in {#2}{% + \draw[line width=\axeywidth] ({\axeytickwidthA},{\y-\axeyOy}) -- ({-\axeytickwidthB},{\y-\axeyOy})% + \ifboolKV[PLaxeytkz]{AffGrad}%on affiche les graduations + {% + \ifboolKV[PLaxeytkz]{AffOrigine}%si on demande d'afficher l'origine + {node[\axeyposlabel,font=\axeyfont] + {% + \ifboolKV[PLaxeytkz]{Annee}% + {\num[group-digits=none]{\y}}% + {\num[text-family-to-math=true,text-series-to-math=true]{\y}}% + }% + } + {\xintifboolexpr{\y==\axeyOy}{}{node[\axeyposlabel,font=\axeyfont] {\ifboolKV[PLaxeytkz]{Annee}% + {\num[group-digits=none]{\y}}% + {\num[text-family-to-math=true,text-series-to-math=true]{\y}}% + } + } + }% + }% + {} + ;} + }% } %axes diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-listings.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-listings.tex index 5a098314f7..228639439a 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-listings.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-listings.tex @@ -136,7 +136,7 @@ listing options={style=PLpython,xleftmargin=16pt,numbers=left},% underlay={% \begin{tcbclipinterior} - \filldraw[lightgray!25] (interior.south west) rectangle ([xshift=1.3em]interior.north west) ; + \draw[draw=none,fill=lightgray!25] (interior.south west) rectangle ([xshift=1.3em]interior.north west) ; \end{tcbclipinterior}% } } diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-minted.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-minted.tex index 4fcf8b8c92..9f8e2735b1 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-minted.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-minted.tex @@ -63,7 +63,7 @@ minted options={tabsize=4,fontsize=\footnotesize,autogobble,xleftmargin=16pt,linenos,numbersep=10pt}, underlay={% \begin{tcbclipinterior} - \filldraw[lightgray!25] (interior.south west) rectangle ([xshift=1.3em]interior.north west) ; + \draw[draw=none,fill=lightgray!25] (interior.south west) rectangle ([xshift=1.3em]interior.north west) ; \end{tcbclipinterior}% } } diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-piton.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-piton.tex index 8456b1601e..89f363b943 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-piton.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-piton.tex @@ -8,6 +8,7 @@ % and version 1.3 or later is part of all distributions of LaTeX % version 2005/12/01 or later. +%2.6.9 Amalioration de la gestion des style := intégration directe dans la tcbox ! %2.5.9 Ajout d'une clé pour la couleur des nombres %2.5.8 Modification des marges %2.5.7 Style alternatif @@ -74,13 +75,13 @@ thonnystyle,% underlay={% \begin{tcbclipinterior} - \filldraw[lightgray!25] (interior.south west) rectangle ([xshift=1.3em]interior.north west) ; + \draw[draw=none,fill=lightgray!25] (interior.south west) rectangle ([xshift=1.3em]interior.north west) ; \end{tcbclipinterior}% } } } -%==Création de la boîte +%==Création de la boîte (essai v2 ?) \ifluatex \RequirePackage{piton} \NewPitonEnvironment{CodePiton}{ O{} m }% @@ -100,38 +101,40 @@ %------les styles tcbox \IfEq{\CODPITstyle}{Moderne}%style Moderne (défaut) {% - \tcbset{stylepiton,colframe=Green,colback=ForestGreen!5,width=\CODPITlargeur,fontupper=\CODPITfonte,fontlower=\CODPITfonte,\CODPITalign,leftupper=0.75em} + \tcbset{cadre/.style={}} + \tcbset{titre/.style={}} + \tcbset{stylebase/.style={stylepiton,colframe=Green,colback=ForestGreen!5,width=\CODPITlargeur,fontupper=\CODPITfonte,fontlower=\CODPITfonte,\CODPITalign,leftupper=0.75em}} \ifboolKV[envpiton]{Filigrane}%si filigrane - {\tcbset{watermark text={\faPython},watermark opacity=0.175,watermark zoom=0.50}}% - {}% + {\tcbset{filigrane/.style={watermark text={\faPython},watermark opacity=0.175,watermark zoom=0.50}}}% + {\tcbset{filigrane/.style={}}}% } {}% \IfEq{\CODPITstyle}{Classique}%style Classique {% \ifboolKV[envpiton]{Lignes}%si lignes=true - {\tcbset{thonnystylelineos,leftupper=0.75em}}% - {\tcbset{thonnystyle,leftupper=0.4em}}% - \tcbset{width=\CODPITlargeur,colframe=DarkGray!50!Black,fontupper=\CODPITfonte,fontlower=\CODPITfonte,\CODPITalign} + {\tcbset{stylebase/.style={thonnystylelineos,leftupper=0.75em,width=\CODPITlargeur,colframe=DarkGray!50!Black,fontupper=\CODPITfonte,fontlower=\CODPITfonte,\CODPITalign}}}% + {\tcbset{stylebase/.style={thonnystyle,leftupper=0.4em,width=\CODPITlargeur,colframe=DarkGray!50!Black,fontupper=\CODPITfonte,fontlower=\CODPITfonte,\CODPITalign}}}% + %\tcbset{width=\CODPITlargeur,colframe=DarkGray!50!Black,fontupper=\CODPITfonte,fontlower=\CODPITfonte,\CODPITalign} \ifboolKV[envpiton]{Filigrane}%si filigrane - {\tcbset{watermark text={\faPython},watermark opacity=0.25,watermark zoom=0.50}}% - {}% + {\tcbset{filigrane/.style={watermark text={\faPython},watermark opacity=0.25,watermark zoom=0.50}}}% + {\tcbset{filigrane/.style={}}}% \ifboolKV[envpiton]{BarreTitre}% {% \ifboolKV[envpiton]{Cadre} - {} - {\tcbset{boxrule=0pt,frame hidden}} - \tcbset{lefttitle=0.4em,title={\CODPITtitre},fonttitle=\bfseries\footnotesize\sffamily,colbacktitle=DarkGray!50!Black} + {\tcbset{cadre/.style={}}}% + {\tcbset{cadre/.style={boxrule=0pt,frame hidden}}}% + \tcbset{titre/.style={lefttitle=0.4em,title={\CODPITtitre},fonttitle=\bfseries\footnotesize\sffamily,colbacktitle=DarkGray!50!Black}} }% {% - \tcbset{notitle} + \tcbset{titre/.style={notitle}} \ifboolKV[envpiton]{Cadre} - {} - {\tcbset{boxrule=0pt,frame hidden}} + {\tcbset{cadre/.style={}}} + {\tcbset{cadre/.style={boxrule=0pt,frame hidden}}} } } {}% %on crée la boîte - \begin{tcolorbox}[#2] + \begin{tcolorbox}[stylebase,filigrane,cadre,titre] }% {% \end{tcolorbox}% @@ -185,9 +188,15 @@ \PitonOptions{#1} \PyLTVerbatimEnv \ifboolKV[consolepyluatex]{Logo} - {\tcbset{consolepyluatexlogo,width=\ConsPyluaLarg,\ConsPyluaAlign,#3}} - {\tcbset{consolepyluatex,width=\ConsPyluaLarg,\ConsPyluaAlign,#3}} - \begin{tcolorbox} + {% + \begin{tcolorbox}[consolepyluatexlogo,width=\ConsPyluaLarg,\ConsPyluaAlign,#3] + }% + {% + \begin{tcolorbox}[consolepyluatex,width=\ConsPyluaLarg,\ConsPyluaAlign,#3] + }% +% {\tcbset{consolepyluatexlogo,width=\ConsPyluaLarg,\ConsPyluaAlign,#3}} +% {\tcbset{consolepyluatex,width=\ConsPyluaLarg,\ConsPyluaAlign,#3}} + %\begin{tcolorbox} \begin{pythonrepl} } { diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex index 2d7e0716e6..b66996a7a6 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex @@ -745,4 +745,75 @@ {\num{\xinteval{\CalculCnp{#3}{#4}}}}%formaté } +%%------Fonction de répartition +\NewDocumentCommand\CrochetFctRepart{ m m }{ + \draw[red,\FctRepartThickness] ({#1 + 0.1}, {#2 + 0.025}) -- (#1,#2 + 0.025) -- (#1,#2 - 0.025) -- ({#1 + 0.1}, {#2 - 0.025}); +} + +\defKV[fctrepart]{% + Couleur=\def\FctRepartColor{#1},% + Epaisseur=\def\FctRepartThickness{#1},% + Extremite=\def\FctRepartExtremite{#1} +} + +\setKVdefault[fctrepart]{% + Couleur=red,% + Epaisseur=thick,% + Pointilles=true,% + Extremite=crochet +} + +\NewDocumentCommand\FonctionRepartTikz{ O{} m }{% + \restoreKV[fctrepart]% + \setKV[fctrepart]{#1}% + \setsepchar[.]{/.,}% + \readlist*\ListeFonctRepart{#2}% + \def\NbPortions{\ListeFonctRepartlen} + \foreach \i in {1,2,...,\ListeFonctRepartlen} + {% + \IfStrEq{\ListeFonctRepart[\i,2]}{*}% + {% + \def\valxdeb{\xmin}% + }% + {% + \itemtomacro\ListeFonctRepart[\i,2]\valxdeb% + \IfStrEq{\FctRepartExtremite}{crochet}% + { + \CrochetFctRepart{\ListeFonctRepart[\i,2]}{\ListeFonctRepart[\i,1]}% + }{}% + \IfStrEq{\FctRepartExtremite}{point}% + { + \filldraw[\FctRepartColor] ({\valxdeb},{\ListeFonctRepart[\i,1]}) circle[radius=1.5pt] ;% + }{}% + }% + \IfStrEq{\ListeFonctRepart[\i,3]}{*}% + {% + \def\valxfin{\xmax}% + }% + {% + \itemtomacro\ListeFonctRepart[\i,3]\valxfin% + \IfStrEq{\FctRepartExtremite}{crochet}% + { + \CrochetFctRepart{\ListeFonctRepart[\i,3]}{\ListeFonctRepart[\i,1]}% + }{}% + \IfStrEq{\FctRepartExtremite}{point}% + { + \draw[\FctRepartColor,fill=white] ({\valxfin},{\ListeFonctRepart[\i,1]}) circle[radius=1.5pt] ;% + }{}% + }% + \ifboolKV[fctrepart]{Pointilles}% + {% + \xintifboolexpr{\valxdeb * \valxfin > 0 'and' \valxdeb > 0}% + {% + \draw[semithick,dashed] (0,{\ListeFonctRepart[\i,1]})--({\valxdeb},{\ListeFonctRepart[\i,1]}) ;% + }{}% + \xintifboolexpr{\valxdeb * \valxfin > 0 'and' \valxdeb < 0}% + {% + \draw[semithick,dashed] (0,{\ListeFonctRepart[\i,1]})--({\valxfin},{\ListeFonctRepart[\i,1]}) ;% + }{}% + }{}% + \draw[\FctRepartThickness,\FctRepartColor] ({\valxdeb},{\ListeFonctRepart[\i,1]})--({\valxfin},{\ListeFonctRepart[\i,1]}) ;% + }% +} + \endinput
\ No newline at end of file diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-pythontex.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-pythontex.tex index 1394813fdf..e58bdf2901 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-pythontex.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-pythontex.tex @@ -151,7 +151,7 @@ stylepythontexalt,leftupper=1.35em, underlay={% \begin{tcbclipinterior} - \filldraw[lightgray!25] (interior.south west) rectangle ([xshift=1.3em]interior.north west) ; + \draw[draw=none,fill=lightgray!25] (interior.south west) rectangle ([xshift=1.3em]interior.north west) ; \end{tcbclipinterior}% } } diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-stats.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-stats.tex index 519783285a..26c12c2c13 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-stats.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-stats.tex @@ -8,6 +8,7 @@ % and version 1.3 or later is part of all distributions of LaTeX % version 2005/12/01 or later. +%2.6.8 Grille histogrammes non réguliers %2.6.7 Histogrammes %%------RegressionLinéaire @@ -214,7 +215,10 @@ Opacite=\def\HistoOpac{#1},% DebutOx=\def\HistoDebX{#1},% FinOx=\def\HistoFinX{#1},% - EpaisseurTraits=\def\HistoEptraits{#1} + EpaisseurTraits=\def\HistoEptraits{#1},% + Grille=\def\HistoGrille{#1},% + ExtraGrilleY=\def\HistoExtraGridY{#1},% + PosLegende=\def\HistoPosLeg{#1} } \setKVdefault[histostats]{% @@ -237,7 +241,10 @@ GrilleV=true,% DebutOx={},% FinOx={},% - EpaisseurTraits=semithick + EpaisseurTraits=semithick,% + Grille={},% + ExtraGrilleY=0,% + PosLegende={} } \NewDocumentCommand\Histogramme{ s O{} m }{% @@ -255,16 +262,48 @@ \IfBooleanTF{#1}%étoilé := classe d'amplitudes différentes {% - \xdef\ListeHauteurs{\fpeval{(\LISTDONNEES[1,3])/(\LISTDONNEES[1,2]-\LISTDONNEES[1,1])}} + \xdef\ListeHauteurs{\xintfloateval{(\LISTDONNEES[1,3])/(\LISTDONNEES[1,2]-\LISTDONNEES[1,1])}} \foreach \i in {2,...,\LISTDONNEESlen} {% - \xdef\ListeHauteurs{\ListeHauteurs,\fpeval{(\LISTDONNEES[\i,3])/(\LISTDONNEES[\i,2]-\LISTDONNEES[\i,1])}}% + \xdef\ListeHauteurs{\ListeHauteurs,\xintfloateval{(\LISTDONNEES[\i,3])/(\LISTDONNEES[\i,2]-\LISTDONNEES[\i,1])}}% }% - \xdef\maxhauteurs{\xinteval{round(max(\ListeHauteurs),3)}}% - \xdef\HistoUniteY{\xinteval{round(\HistoHauteur/max(\ListeHauteurs),3)}}% - \xdef\HistoUniteX{\xinteval{round(\HistoLargeur/(\HistoFinX-\HistoDebX),3)}}% + \IfEq{\HistoGrille}{}%on lit les infos de la grille PasX/UniteAire + {}% + {% + \StrCut{\HistoGrille}{/}{\HistoPasX}{\HistoUnAire}% + \def\HistoPasY{\xintfloateval{\HistoUnAire/\HistoPasX}}% + }% + \xdef\maxhauteurs{\xintfloateval{round(max(\ListeHauteurs),3)}}% + + \IfEq{\HistoGrille}{}% + {% + \xdef\HistoUniteY{\xintfloateval{round(\HistoHauteur/max(\ListeHauteurs),3)}}% + }% + {% + \xdef\maxhauteurgrille{\xinteval{(floor((\maxhauteurs)/(\HistoPasY))+1+\HistoExtraGridY)*\HistoPasY}}% + \xdef\HistoUniteY{\xintfloateval{round((\HistoHauteur)/(\maxhauteurgrille),3)}}% + }% + \xdef\HistoUniteX{\xintfloateval{round(\HistoLargeur/(\HistoFinX-\HistoDebX),3)}}% %fenêtre graphique \begin{tikzpicture}[x=\HistoUniteX cm,y=\HistoUniteY cm] + %Essai de grille + \IfEq{\HistoGrille}{}% + {}% + {% + \draw[line width=0.4pt,lightgray,xstep=\HistoPasX,ystep=\HistoPasY] ({\HistoDebX},0) grid ({\HistoFinX},{\xinteval{floor((\maxhauteurs)/(\HistoPasY))+1+\HistoExtraGridY}*\HistoPasY}) ; + \IfSubStr{\HistoPosLeg}{/}% + {% + \StrCut{\HistoPosLeg}{/}{\HistoPosLegX}{\HistoPosLegY}% + \draw[\HistoEptraits,fill=lightgray,fill opacity=\HistoOpac] ({\HistoDebX+(\HistoPosLegX)*(\HistoPasX)},{(\HistoPasY)*(\HistoPosLegY)}) rectangle++ ({\HistoPasX},{\HistoPasY}) ; % + \draw ({\HistoDebX+(\HistoPosLegX+1)*(\HistoPasX)},{(\HistoPasY)*(\HistoPosLegY+0.5)}) node[right,font=\HistoFonteEff] {\num{\HistoUnAire}} ;% + }% + {}% + %\draw ({\HistoDebX},{0}) node[below left] {\xinteval{floor((\maxhauteurs)/(\HistoPasY))+1}} ; + %\draw ({\HistoDebX},{\HistoPasY}) node[left] {\num{\HistoPasY}} ; + %\draw ({\HistoDebX},{\maxhauteurs}) node[left] {\num{\maxhauteurs}} ; + + }% + %rectangles \foreach \i in {1,...,\LISTDONNEESlen} {% \xintifboolexpr{\LISTCOULlen == 1}% |