Fancy page book design
Auteur:
Shilong Lu
Last Updated:
il y a 2 ans
License:
Creative Commons CC BY 4.0
Résumé:
It is a book with fancy page style
\begin
Discover why 18 million people worldwide trust Overleaf with their work.
\begin
Discover why 18 million people worldwide trust Overleaf with their work.
\documentclass[zihao=-4,fontset=ubuntu,twoside]{ctexbook}
\usepackage{stys/Titlepage}
\usepackage[dvipsnames,svgnames,x11names,table]{xcolor}
\definecolor{nuanbai}{HTML}{F5F5F5}
\pagecolor{nuanbai!10}
\usepackage{amsmath,amssymb}
\usepackage{fontspec}
\usepackage{zhlipsum}
\setmainfont{Times New Roman}
\usepackage[left=2cm,right=2cm,top=.8cm,bottom=3.3cm]{geometry}
\usepackage{xpatch}%修正章节编号
\usepackage[automark]{scrlayer-scrpage}%页面设置宏包,隶属于koma-script文档类
\usepackage[explicit,clearempty,pagestyles,newparttoc]{titlesec}%章节设计宏包
\usepackage{titletoc}%目录设计宏包
\setcounter{secnumdepth}{5}%增加编号深度
\setcounter{tocdepth}{2} %增加目录深度
\usepackage{hyperref}
\usepackage{fontawesome5}
\usepackage{tikz}
\usetikzlibrary{calc,shadows}
\usepackage[most]{tcolorbox}
\tcbuselibrary{breakable, skins,theorems}%TcolorBox Library
\usepackage{tabularx}
\usepackage{lastpage}
\usepackage{varwidth}
\usepackage{ninecolors}
\usepackage{colortbl} %彩色表格
\usepackage{tabularray}
\usepackage{pgfornament}
\usepackage{zhnumber}
\usepackage{adjustbox}
\RequirePackage{pgfplots} %画图 %%页面样式设计核心包 %提供\pgfonlayer命令以及下列图层指令
\pgfplotsset{compat=1.18}
\usepackage{graphicx}%修正minipage顶部对齐问题
%\definecolor{headstylecolor}{HTML}{}
% Define the layers to be used in document.
% *****************************************************
\pgfdeclarelayer{background} %背景%底层
\pgfdeclarelayer{foreground} %上层
\pgfdeclarelayer{top} %顶部
\pgfdeclarelayer{bottom} %底部
\pgfsetlayers{bottom,background,main,foreground,top}
%%%%===============================================================%%%%%
\makeatletter
\newcommand*\footimage[1]{\def\@footimage{#1}}
\newcommand*\foottext[1]{\def\@foottext{#1}}
\newcommand*\foottheme[1]{\def\@foottheme{#1}}
\definecolor{qing}{HTML}{26A69A}
\newcommand{\pageheadstyle}{%
\begin{tikzpicture}[remember picture,overlay]
\fill[qing!15] (current page.north west) rectangle ([yshift=-\headheight]current page.north east);
\coordinate (head decoration) at ([shift={(0,-.6\headheight)}]current page.north);
\makeatletter
\node[] at (head decoration) {\pgfornament[height=2cm,width=4cm,color=qing!20!black,opacity=0.5]{78}\hspace{.75\linewidth}\pgfornament[height=2cm,width=4cm,color=qing!20!black,symmetry=v,symmetry=h,opacity=0.5]{79}};
\makeatother
\node[text=black,font=\rmfamily\normalsize] at ([shift={(-.25\headheight,-.05\headheight)}]head decoration) {\begin{varwidth}{.75\linewidth}\ifodd\value{page}\rightmark\else\leftmark\fi\end{varwidth}};
% \coordinate (head table) at ([xshift=.05\linewidth,yshift=-\headheight]current page.north);
% \node at (head table) {
% \adjustbox{valign=t}{\begin{minipage}{.5\linewidth}
% \begin{tcolorbox}[enhanced jigsaw,colframe=teal,colback=white,colbacktitle=black!2,arc=5pt,title=\centering\textcolor{black}{\textbf{第 \zhnumber{1} 周\quad $\bullet$ \quad 周 \zhnumber{1} }}]
% \centering\sffamily\upshape 小数乘法
% \end{tcolorbox}
% \end{minipage}}\hspace*{2ex}\hfil
% \adjustbox{valign=t}{\begin{minipage}{.5\linewidth}
% \begin{tblr}{
% row{odd} = {bg=azure8},row{even} = {bg=black!2},
% row{1} = {bg=black!2, fg=black, font=\sffamily},|c|c|,rows = {abovesep=3pt,belowsep=3pt},
% columns = {leftsep=5pt,rightsep=5pt},
% }
% \hline
% 用时:\quad~~ 分 & 答对题数 \\\hline
% 建议完成时间: 10 分钟 & \rule{1.5cm}{1pt} $/22$ \\\hline
% \end{tblr}
% \end{minipage}}
% };
\end{tikzpicture}
}
\ihead{}
\ohead{}
\setlength{\headheight}{50pt}
\chead{\pageheadstyle}
% %%页脚
% \ifoot{}
% \cfoot{}
% \ofoot{\footstyle}
% \newlength\tipslen
% \setlength\tipslen{13mm}
% \setlength\footheight{50pt}
% \newcommand{\footstyle}{
% \begin{tikzpicture}[remember picture,overlay]
% \draw[line width=1pt,color=teal] ([xshift=10mm,yshift=\footheight]current page.south west) -- ([xshift=-5mm,yshift=\footheight]current page.south east);
% \coordinate (foottips) at ([xshift=\tipslen,yshift=.8\footheight]current page.south west);
% \node[anchor=west] at (foottips) {\textcolor{teal}{\textbf{错题整理\triangler[magenta]{5pt}}}};
% \coordinate (bottom) at ($(current page.south east) + (-13.50mm,6.80mm)$);
% \begin{pgfonlayer}{main}
% \filldraw [fill=DarkGreen, draw=DarkGreen,rounded corners=3pt,opacity=.7] (bottom) rectangle ++(8.00mm,8.00mm) coordinate (corner);
% \end{pgfonlayer}
% \begin{pgfonlayer}{foreground}
% \node [text=white, font=\rmfamily\upshape\bfseries\large](page_number) at ($(bottom)!0.5!(corner)$) {\thepage};
% \end{pgfonlayer}
% \begin{pgfonlayer}{background}
% \node[] (figure) at ([xshift=-30mm,yshift=.56\footheight]current page.south east) {\includegraphics[width=6cm]{figures/Transparent_Grass_with_White_Daisies_PNG_Clipart.png}};
% \end{pgfonlayer}
% \end{tikzpicture}
% }
%%页脚
\makeatletter
\ifoot{}
\cfoot{}
\ofoot{\footstyle}
\setlength\footheight{50pt}
\newcommand{\footstyle}{%
\begin{tikzpicture}[remember picture,overlay]
\def\Backcolor{qing}
\fill[\Backcolor!25]
([xshift=0cm]current page.south west) rectangle ([yshift=3cm]current page.south east);
\fill[\Backcolor!50] ([xshift=0cm,yshift=1cm]current page.south west) --++(0,2) -- ++(2,0)--cycle;
\fill[\Backcolor!50] ([xshift=-2cm]current page.south east) -- ++(2,0) -- ++(0,2)--cycle;
\node[anchor=west] at ([shift={(0.2,1.5)}]current page.south west){\includegraphics[width=1.8cm,height=2.4cm]{\@footimage}};
\node[font=\upshape\bfseries,text=white,rectangle,rounded corners,fill=\Backcolor!50] at ([shift={(-0.5,0.5)}]current page.south east){\thepage};
\node[anchor=north west] at ([shift={(2.3,2.8)}]current page.south west)
{
\begin{minipage}{\dimeval{\paperwidth-4.5cm}}
\textcolor{\Backcolor!50}{\faBook}\hspace{.5em}\tikz[baseline]{\node[anchor=base,rounded corners=2.5pt,text=black,fill=\Backcolor!50,inner sep=.3mm]{\@foottheme};}\hspace{.5em}\@foottext
\end{minipage}
};
\end{tikzpicture}
}
\makeatother
\newcommand{\triangler}[2][teal]{
\begin{tikzpicture}[remember picture]
\def\x{#2}
\filldraw[#1] (-\x,\x) -- (0,0) --(-\x,-\x)--cycle;
\filldraw[#1] (0,\x) -- (\x,0) -- (0,-\x)--cycle;
\filldraw[#1] (\x,\x) -- (2*\x,0) -- (\x,-\x)--cycle;
\end{tikzpicture}
}
\newcommand{\nonumsection}[1]{
\begin{tikzpicture}[remember picture,overlay]
\fill[orange!30,rounded corners=2pt] (0,0) rectangle ($(0,0)+(.9\linewidth,1.2em)$);
\node[font=\sffamily\Large] at (.45\linewidth,.6em) {#1};
\end{tikzpicture}
}
\titleformat{name=\section,numberless}
{\Large\sffamily}
{}{1em}{\nonumsection{#1}}
\titlespacing{\section}
{0pc}{2ex plus .1ex minus .2ex}{1.5ex minus .1ex}
\usepackage{enumitem}
\usepackage{lipsum}
\usepackage{multicol}
\usepackage{amsthm}
\usepackage{bclogo}
\newtheorem*{solution}{\textbf{解答:~}}
\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
}
\begin{document}
\title{书籍标题}
\subtitle{副标题}
\edition{版本号}
\bookseries{书籍系列}
\author{作者}
\pressname{Springer} %出版社名称
\presslogo{figures/Springer-logo.png} %出版社徽标
\makecover
\tableofcontents
\newpage
\foottheme{数学历史漫谈}
\footimage{figures/newton.jpg}
\foottext{爱情既是友谊的代名词,又是我们为共同的事业而奋斗的可靠保证,爱情是人生的良伴,你和心爱的女子同床共眠是因为共同的理想把两颗心紧紧系在一起。\hfill ------ 法拉第}
\chapter{模板命令介绍}
\section{模板命令分类}
首先是自定义的封面信息与页脚信息\newline
\exercise[\bccrayon]{练习应用} %练习标题
\newpage
\foottheme{数学历史漫谈} %页脚主题
\footimage{figures/faraday.jpg} %页脚图片
\foottext{爱情既是友谊的代名词,又是我们为共同的事业而奋斗的可靠保证,爱情是人生的良伴.\hfill ------ 爱因斯坦} %页脚文字
\section{超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题}
\zhlipsum[1-9]
\zhlipsum[2]
\end{document}