
Con el paquete tocloft, puedo agregar texto bajo el título de una "Lista de Z" al comienzo de un documento de látex:
\renewcommand{\cftafterZtitle}{\par\noindent \textnormal{Z} \hfill \textnormal{PAGE}}
Usando lo siguiente puedo centrar el título "Lista de Z":
\renewcommand{\cftZtitlefont}{\hfill\bfseries}
\renewcommand{\cftafterZtitle}{\hfill}
Pero cuando intento combinar los dos comandos, mueve el texto al margen derecho en lugar del centro:
\renewcommand{\cftloftitlefont}{\hfill\bfseries}
\renewcommand{\cftafterloftitle}{\hfill\par\noindent \textnormal{Z} \hfill \textnormal{PAGE}}
¿Alguien sabe cómo centrar el título "Lista de Z" y tener texto debajo del título?
Respuesta1
Puede agregar un vacío \hbox
después del segundo \hfill
(Veregregla respuestaa¿Qué es \null y cuándo debemos usarlo?):
\documentclass{article}
\usepackage{tocloft}
\renewcommand{\cftloftitlefont}{\hfill\bfseries}
\renewcommand{\cftafterloftitle}{\hfill\null\par\noindent\textnormal{Z}\hfill \textnormal{PAGE}}
\begin{document}
\listoffigures
\noindent X\hrulefill Y% for coparison only
\end{document}
Otra opción es utilizar \hfil
en su lugar:
\renewcommand{\cftloftitlefont}{\hfil\bfseries}
\renewcommand{\cftafterloftitle}{\hfil\par\textnormal{Z}\hfill \textnormal{PAGE}}