如何使用 latex tikz 包来设计图片中所见的风格?
答案1
titlesec
以下是使用、xcolor
、colortbl
和geometry
的解决方案 lettrine
(最后一个仅供我参考……)。我不确定是否还需要浅蓝色背景,所以我的代码中没有,但可以更改:
\documentclass[12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{microtype}
\usepackage[garamond]{mathdesign}
\usepackage{garamondx}%%
\usepackage[x11names]{xcolor}
\usepackage{tabularx, colortbl}
\usepackage{geometry}
\usepackage{titlesec}%
\usepackage{lettrine}
\renewcommand\LettrineFontHook{\fontfamily{EBGaramondInitials-TLF}\color{titlecolour}}
\colorlet{titlecolour}{Cyan4!85!}
\newlength\labelframewd
\settowidth{\labelframewd}{\lsstyle\scshape\small\MakeLowercase{\chaptername}}
\newsavebox\chaplabelbox%
\newcommand\chaplabel{\color{titlecolour}%
\begin{tabularx}{\linewidth}{c@{\enspace}X}
\lsstyle\scshape\small\MakeLowercase{\chaptername}\\
\cellcolor{titlecolour}\raisebox{-1ex}[5ex][20ex]{\color{black}\bfseries\fontsize{36}{40}\selectfont\thechapter} & \titlerule[3pt]
\end{tabularx}
}%
\titleformat{\chapter}[display]{\centering}
{\setlength{\tabcolsep}{0pt} \smash{\chaplabel}}%
{2ex}
{\thispagestyle{empty}\vskip-10ex\hskip\labelframewd\fontsize{28}{32}\selectfont\bfseries}%
\titlespacing{\chapter}{0pt}{1.25\baselineskip}{10\baselineskip}
\renewcommand*\thechapter{\arabic{chapter}}
\begin{document}
\chapter{Tweedledee \& Tweedledum}
\lettrine{T}{ext} text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
\end{document}