
¿Hay alguna razón por la cual el apéndice produce 2 títulos?
\documentclass[12pt,oneside]{report}
\begin{document}
test
\appendix
\chapter{\textrm\bfseries Appendixtest2}\label{append}
\end{document}
¿Puedo forzar que el título del apéndice (usando \chapter, no \section) tenga este formato?
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\huge}
Respuesta1
(1) \appendix
no genera ningún título, solo cambia el \chapter
comportamiento para imprimir "Apéndice A" en lugar de "Capítulo 1".
(2) Solo hay un título, elaborado por \chapter
, con \chaptertitlename
(Apéndice) y \thechapter
(A) en una línea, y el argumento del capítulo (Apéndicetest2) en la otra.
(3) puede forzar el formato del título del capítulo con ese \titleformat
comando usando el paquete usando el paquetetitlesec
:
\documentclass[12pt,oneside]{report}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\huge}
\begin{document}
\appendix
\chapter{The title of the appendix}
\end{document}
Pero tenga en cuenta que está intentando forzar el formato predeterminado a... ¡el formato predeterminado!Entonces no verás ningún efecto.
Puedes notar que realmente funciona usando cualquier otro formato, por ejemplo, solo con un título en una línea:
\documentclass[12pt,oneside]{report}
\usepackage{titlesec}
\titleformat{\chapter}{\Large}{\chaptertitlename\ \thechapter:}{1em}{\bfseries}
\begin{document}
\appendix
\chapter{The title of the appendix}
\end{document}
O con dos líneas y más...
\documentclass[12pt,oneside]{report}
\usepackage{titlesec}
\titleformat{\chapter}{\huge}{\chaptertitlename\ \thechapter}{0pt}{\hrule\bigskip\hfill\bfseries\sffamily}
\begin{document}
\appendix
\chapter{The title of the appendix}
\end{document}
O incluso es así, un poco más complicado:
\documentclass[12pt,oneside]{report}
\usepackage[explicit]{titlesec}
\titleformat{\chapter}{\Large}{}{1em}{\bfseries #1 (\chaptertitlename\ \thechapter)}
\begin{document}
\appendix
\chapter{The title of the appendix}
\end{document}