
答案1
使用titlesec
和tcolorbox
。看看這個解決方案:使用 tcolorbox 的章節樣式?它使用不同的框佈局,但您可以調整tcolorbox
選項以獲得所需的佈局。
以下是此解決方案針對編號章節的初步調整:您需要透過調整顏色、尺寸等來調整它。
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}
{}
{20pt}
{%
\begin{tcolorbox}[
enhanced,
rounded corners,
shadow={1mm}{-1mm}{-2.2mm}{black!20!white},
colback=white,
boxrule=0mm,
arc=3mm,
leftrule=0pt,
rightrule=0pt,
fontupper=\color{blueish}\sffamily\bfseries\huge,
width=\textwidth-3.2mm, % account for shadow width.
top=0.6cm,
bottom=0.6cm,
overlay={
\node[
fill=blueish,
line width=0cm,
inner sep=0pt,
text width=13mm,
minimum height=16mm,
align=center,
anchor=south east,
xshift=2.2mm, yshift=9mm,
font=\color{white}\sffamily\bfseries\fontsize{30}{36}\selectfont
]
(chapname) at (frame.north east) {\thechapter};
\node[color=gray,font=\large,anchor=base east,inner sep=1mm] at (chapname.base west)
{\chaptertitlename};
}
]
\MakeUppercase{#1}
\end{tcolorbox}%
}
這給了