答案1
您可以使用以下格式格式化章节标题titlesec
以及页眉和章节号fancyhdr
。以下是章节标题如下所示的示例:
另一页的页眉如下所示:
\documentclass{book}
\usepackage{titlesec}
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{lipsum}
\titleformat{\chapter}[display]%
{\bfseries\LARGE}%
{\hfill\itshape\fontsize{50}{60}\selectfont\thechapter}%
{0pt}%
{\makebox[0pt][l]{\rule[-.2\baselineskip]{\textwidth}{1pt}}\MakeUppercase}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markright{\scshape\thesection.\ #1}{}}
\newcommand*{\pagenumberinmargin}{%
\begin{tikzpicture}[overlay, x=\dimexpr1in+\oddsidemargin]
\fill[black!80] (1,-1) -- (1,-2) {[rounded corners] -- (.5,-2) -- (.5,-1)} -- cycle;
\node[white] at (.65,-1.5) {\LARGE\bfseries\thechapter};
\end{tikzpicture}%
}
\fancyhead{}
\fancyhead[L]{\rightmark}
\fancyhead[R]{\thepage\pagenumberinmargin}
\begin{document}
\chapter{Introducción}
\section{Preface}
\lipsum
\end{document}