- 阅读权限
- 255
- 威望
- 7 级
- 论坛币
- 272091 个
- 通用积分
- 31269.1753
- 学术水平
- 1435 点
- 热心指数
- 1554 点
- 信用等级
- 1345 点
- 经验
- 383778 点
- 帖子
- 9599
- 精华
- 66
- 在线时间
- 5466 小时
- 注册时间
- 2007-5-21
- 最后登录
- 2024-3-21
|
今天分享的章节设计带有裁剪线的设计,整个设计比较突出的部分是section的设计做成了前文的mdframed的样式。
- \documentclass[a4paper]{book} %
- %
- \usepackage[fleqn]{amsmath} %
- \usepackage{amsthm,amssymb} %
- \usepackage[explicit]{titlesec} %
- \usepackage{titletoc} %
- \usepackage[english]{babel} %
- \usepackage{txfonts} %
- \usepackage{xcolor}
- \usepackage{colortbl} %
- \usepackage[format=plain,listformat=empty,labelsep=space,position=below,width=\linewidth, labelfont={normal},font={normal}]{caption} %
- \usepackage[margin=6pt,justification=raggedright]{subcaption} %
- \usepackage[paperwidth=170mm, paperheight=240mm, textwidth=132mm,verbose, driver=none, showcrop, showframe]{geometry}
- %
- \usepackage[a4,frame,center]{crop}
- \usepackage[most]{tcolorbox}
- \usepackage{bookmark} % %
- %
- \setlength{\unitlength}{1mm} %
- \definecolor{ThemeColour}{rgb}{0.45,0.00,0.45} %
- \definecolor{DarkGrey}{rgb}{0.92,0.92,0.92}
- \definecolor{DarkRed}{rgb}{0.45,0.00,0.00} %
- \definecolor{LightCream}{rgb}{1.00,1.00,0.90} %
- \newcommand\Hrule{\noindent\color{ThemeColour}{\rule{\linewidth}{3pt}}} %
- \newcommand\hseprule{\color{DarkRed}{\rule{\linewidth}{0.7pt}}} %
- \titleformat{\chapter}[display]
- {\color{ThemeColour}\bfseries\itshape\fontsize{30}{30}\selectfont} %
- {\Hrule\vspace*{6pt}\\ {\color{black}\,\chaptername\hspace{8pt}\normalfont\fontsize{42}{45}\selectfont{\thechapter}}} %
- {0pt}{\bfseries\normalfont\fontsize{15}{18}\selectfont{#1} \\ \vspace*{-9pt}\Hrule}[\vspace{18pt}] %
- \titlespacing{\chapter}{0pt}{12pt}{6pt}[0pt] %
- \renewcommand{\thechapter}{\arabic{chapter}} %
- \newtcolorbox{sectionbox}[2][]{nobeforeafter, boxsep=4.2pt,boxrule=1.2pt,arc=3pt,outer arc=3.2pt,width=\linewidth,
- coltitle=white,colbacktitle=ThemeColour,after=\hfill,colframe=black,colback=DarkGrey,title={#2},fonttitle=\bfseries,#1}
- \titleformat{\section} %
- {\normalfont\bfseries\itshape\fontsize{12}{14}\selectfont}
- {}{0pt}
- {\begin{sectionbox}
- {\fontsize{14}{16}\selectfont{Section\hspace{5.6pt}\thetitle}}{#1}
- \end{sectionbox}}
- \titlespacing{\section}{0pt}{10pt}{6pt}[0pt] % 0, 10, 6, 0
- \renewcommand{\thesection}{\arabic{section}} % make-up of number
- %
- \def\figtab{\kern 0.8pt}
- \addto\captionsenglish{ % this seems to work
- \renewcommand{\figurename}{Fig\hspace{0.7pt}.} %
- \renewcommand{\thefigure}{\thechapter{\figtab.\figtab}\arabic{figure}} % good
- \renewcommand{\thesubfigure}{\hspace{0.5pt}\alph{subfigure}\hspace{0.4pt}} %
- }
- \raggedbottom
- \begin{document}
- \pagestyle{plain}
- \chapter{Introduction to number}
- \section{Section one - only small gap above (ok)}
- \section{Section two - directly follows section one - gap ok}
- \section{Section three - directly follows section two}
- \clearpage
- \section{Section four - shows 40mm gap at the top of the page (far too much)}
- \section{Section five - directly follows section four - gap ok}
- \section{Section six} \vspace{50mm}
- \noindent Even though the page is nearly full.\vspace{50mm}
- \noindent Even though the page is nearly full.
- \end{document}
复制代码
|
|