![左侧为章节号,右侧为章节标题](https://linux22.com/image/356070/%E5%B7%A6%E4%BE%A7%E4%B8%BA%E7%AB%A0%E8%8A%82%E5%8F%B7%EF%BC%8C%E5%8F%B3%E4%BE%A7%E4%B8%BA%E7%AB%A0%E8%8A%82%E6%A0%87%E9%A2%98.png)
我曾尝试过标题安全,但我对结果并不满意:
\documentclass{book}
\usepackage{titlesec}
%Chapter Headers%
\titleformat{\chapter}[display]{}{\Large{\chaptertitlename}\enspace{\thechapter}\filright} {1ex}{\Huge\filleft}[{\titlerule[1pt]}]
\titlespacing*{\chapter}{0pt}{30pt}{20pt}
\begin{document}
\chapter{Lorem}
\end{document}
答案1
\documentclass{book}
\usepackage{titlesec}
%Chapter Headers%
\titleformat{\chapter}[display]
{\vspace*{-10ex}\Large}
{\thispagestyle{empty}\titleline[l]{\chaptertitlename\ \thechapter}\vspace{6pt}\titlerule[.8pt]} {\dimexpr-\baselineskip+6pt\relax}
{\bfseries\filleft}
\begin{document}
\chapter{Lorem}
\end{document}