我正在尝试解决我遇到的一个问题。我希望颜色框能够适合一页,而不会超出页脚或页面的范围,也不会从下一页重新开始。有什么方法可以做到这一点吗?
提前感谢您的建议和解决方案
\documentclass{report}
\usepackage[dvipsnames,table,xcdraw]{xcolor}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{siunitx}
\usepackage{setspace}
\usepackage{mathrsfs}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{eurosym}
\usepackage{amstext}
\usepackage{hyperref}
\usepackage{grffile} %Stops the file name of figures appearing
\usepackage{color}
\usepackage{mathabx}
\usepackage{float}
\usepackage{pdfpages}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
\DeclareRobustCommand{\officialeuro}{%
\ifmmode\expandafter\text\fi
{\fontencoding{U}\fontfamily{eurosym}\selectfont e}}
\usepackage{url}
\usepackage{background}
\usepackage{lastpage}
\usepackage[most]{tcolorbox}
\title{Business Plan}
\author{}
\onehalfspacing
\usepackage{algorithmic}
\renewcommand{\familydefault}{\sfdefault}
\textheight=23cm \textwidth=16cm \topmargin=-2cm \oddsidemargin=0cm
\parindent=0mm
\pretolerance=2000 \tolerance=3000
\usepackage{glossaries}
\makenoidxglossaries %glossaries
\backgroundsetup{
scale=1,
color=black,
opacity=1,
angle=0,
position=current page.south,
vshift=60pt,
contents={%
\small\sffamily%
\begin{minipage}{.8\textwidth}
\parbox[b]{.6\textwidth}{%
Page \thepage\ of \pageref{LastPage}}\hfill
\parbox[b]{.4\textwidth}{%
\raggedleft xxxx \\ xxx, xxx}\ \textcolor{red}{\rule{\textwidth}{1.5pt}}\ \url{www.xxx.co.uk}
\end{minipage}\hspace{.02\textwidth}%
\begin{minipage}{.18\textwidth}
\includegraphics[width=\linewidth,height=70pt,keepaspectratio]{iPhone app}
\end{minipage}%
}
}
\tcbset{rawlings/.style={width=\textwidth,colback={white},colbacktitle=SkyBlue,coltitle=black,colupper=black}}
\newtcolorbox[auto counter,list inside=rawlings]{rawlingsbox}[1][]{rawlings,#1}%
\begin{document}
\begin{rawlingsbox}[width=\textwidth,colback={white},colbacktitle=red,coltitle=white,colupper=black,title={\textbf{Executive Summary}},title={\textbf{Conclusions}}]
a\\
a\\
a\\
a\\
a\\
a\\
a\\
aa\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
aa\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
aa\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
a\\
\end{rawlingsbox}
\end{document}
答案1
您只需添加所需的breakable
选项,如
\tcbset{rawlings/.style={breakable,width=\textwidth,colback={white},colbacktitle=SkyBlue,coltitle=black,colupper=black}}
更新:对于休息后的标题,请title after break
添加
\begin{rawlingsbox}[width=\textwidth,colback={white},colbacktitle=red,coltitle=white,colupper=black,title={\textbf{Conclusions}},title after break={\textbf{Conclusions}}]
您确实应该至少阅读一次文档来了解一下 tcb 的功能。