
Estoy intentando crear un documento que, en algún momento arbitrario, repita el título de la página principal.
\documentclass[a4paper,anonymous]{lipics-v2021}
\title{My Paper}
\titlerunning{paper}
\author{Me}{}{}{}{}
\begin{document}
% Generate title
\maketitle
% Any amount of text/sections
lorem ipsum...
% I now want to show exactly the same title again
\maketitle
\end{document}
Este código, sin embargo, genera texto completamente sin formato del título y los parámetros del autor indicados anteriormente.
Algunos enlaces [1,2] sugiere usar el titling
paquete, aunque aquí hay dos problemas:
- Parece que no puedo lograr que use
\maketitle
como se define en el.cls
archivo de mi proyecto (labios, en mi caso) - El
titling
paquete requiere que repita todos los parámetros de\maketitle
. (por ejemplo\title{..}
,\author{}
, etc.).
Respuesta1
En su clase, así como en las clases estándar, \maketitle
se desactiva y también vacía las \@title
macros \@author
que contienen los metadatos definidos por los comandos \title{...}
y \author{...}
(consulte las líneas 304 y siguientes en [clase lipic-v2021 de github][1]). Por lo tanto, podría \renewcomnand
(en el preámbulo) el \maketitle
comando con el mismo código (comenzando en la línea 287), excepto las líneas 304 a 314.
Una ADVERTENCIA estándar: puede hacerlo para uso personal. Pero nunca haga este tipo de cambios si su documento está destinado a ser enviado a la revista/conferencia/editor correspondiente (aquí a las conferencias de la serie LIPIcs). [1]:https://github.com/prosysscience/lipics/blob/master/lipics-v2021.cls
Respuesta2
Mirando a ladefinición de clase, encontrarás (líneas 287-315)
\renewcommand\maketitle{\par
\begingroup
\thispagestyle{plain}
\renewcommand\thefootnote{\@fnsymbol\c@footnote}%
\if@twocolumn
\ifnum \col@number=\@ne
\@maketitle
\else
\twocolumn[\@maketitle]%
\fi
\else
\newpage
\global\@topnum\z@ % Prevents figures from going at top of page.
\@maketitle
\fi
\thispagestyle{plain}\@thanks
\endgroup
\global\let\thanks\relax
\global\let\maketitle\relax
\global\let\@maketitle\relax
\global\let\@thanks\@empty
\global\let\@author\@empty
\global\let\@date\@empty
\global\let\@title\@empty
\global\let\title\relax
\global\let\author\relax
\global\let\date\relax
\global\let\and\relax
}
El segundo \maketitle
falla por culpa de todos \global\let...\relax
y \global\let...\@empty
.
Puede intentar redefinirlo (dentro \makeatletter
y \makeatother
para manejar el carácter @
en los nombres de las macros).
\makeatletter
\renewcommand\maketitle{\par
\begingroup
\thispagestyle{plain}
\renewcommand\thefootnote{\@fnsymbol\c@footnote}%
\if@twocolumn
\ifnum \col@number=\@ne
\@maketitle
\else
\twocolumn[\@maketitle]%
\fi
\else
\newpage
\global\@topnum\z@ % Prevents figures from going at top of page.
\@maketitle
\fi
\thispagestyle{plain}\@thanks
\endgroup
}
\makeatother
Se vuelve a imprimir la página de título completa, incluido el pie de página. Si solo desea el título en sí, debe consultar la \@maketitle
definición y copiar las partes que necesita.
Ejemplo:
\documentclass[a4paper,anonymous]{lipics-v2021}
\makeatletter
\renewcommand\maketitle{\par
\begingroup
\thispagestyle{plain}
\renewcommand\thefootnote{\@fnsymbol\c@footnote}%
\if@twocolumn
\ifnum \col@number=\@ne
\@maketitle
\else
\twocolumn[\@maketitle]%
\fi
\else
\newpage
\global\@topnum\z@ % Prevents figures from going at top of page.
\@maketitle
\fi
\thispagestyle{plain}\@thanks
\endgroup
}
\makeatother
\title{My Paper}
\titlerunning{paper}
\author{Me}{}{}{}{}
\begin{document}
% Generate title
\maketitle
% Any amount of text/sections
lorem ipsum...
% I now want to show exactly the same title again
\maketitle
\end{document}