答案1
我已经接近使用书籍类了。排版程序是 LuaLaTeX,以便能够使用\fontsize{70}{60}\selectfont
章节号大于\Huge
。我创建了一个tcolorbox
名为的titlecolorbox
,它只是一个带有文本的黑框。我使用了titlesec
基于的显式选项这个答案titlesec
。可以找到该软件包的文档这里,其中titleformat
还解释了该功能。希望这对您有所帮助。
% !TEX TS-program = LuaLaTeX
\documentclass[12pt]{book}
\usepackage{geometry}
\usepackage{lipsum} %for dummy text
\usepackage{tcolorbox}
\newtcolorbox{titlecolorbox}[1]{ %the box around chapter
coltext=white,
colframe=black,
colback=black,
boxrule=0pt,
arc=0pt,
notitle,
width=4.8em,
height=2.4ex,
before=\hfill
}
\usepackage{xcolor}
\usepackage[explicit]{titlesec}
\titleformat{\chapter}[display]
{\sffamily\Huge}
{}
{0pt}
{\begin{titlecolorbox}{}
{\large\sffamily\MakeUppercase{\chaptername}}
\end{titlecolorbox}
\vspace*{-4.19ex}\noindent\rule{\textwidth}{0.4pt}
\parbox[b]{\dimexpr\textwidth-4.8em\relax}{\raggedright\MakeUppercase{#1}}{\hfill\fontsize{70}{60}\selectfont\thechapter}
}
[]
\titleformat{name=\chapter,numberless}[display]
{\sffamily\Huge}
{}
{0pt}
{\begin{titlecolorbox}{}
{\large\sffamily\MakeUppercase{\chaptername}}
\end{titlecolorbox}
\vspace*{-4.19ex}\noindent\rule{\textwidth}{0.4pt}
\parbox[b]{\dimexpr\textwidth-4.8em\relax}{\raggedright\MakeUppercase{#1}}
}
[]
\titleformat{\section}[display]
{\sffamily\large}
{}
{0pt}
{\hrule\vspace*{0.25ex}\parbox[b]{\dimexpr\textwidth\relax}{\textcolor{darkgray}{\thesection}\quad\raggedright\bfseries\MakeUppercase{#1}}}
[\hrule]
\begin{document}
\setcounter{chapter}{10}
\chapter{Modeling Event-Based Behaviour with State Machine}
\lipsum[3]
\section{Overview}
\lipsum[4]
\end{document}