
Estou tentando criar um documento que, em algum momento arbitrário, repita o título da primeira página.
\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, no entanto, gera texto completamente não formatado do título e dos parâmetros do autor fornecidos acima.
Alguns links [1,2] sugerem usar o titling
pacote, embora haja dois problemas aqui:
- Não consigo usar o
\maketitle
definido no.cls
arquivo do meu projeto (lipics, no meu caso) - O
titling
pacote exige que eu repita todos os parâmetros do\maketitle
. (por exemplo\title{..}
,\author{}
, , etc.).
Responder1
Na sua classe, assim como nas classes padrão, o \maketitle
se desabilita e também esvazia as \@title
macros \@author
e contendo os metadados definidos pelos comandos \title{...}
e \author{...}
(Veja as linhas 304 e seguintes na [classe lipic-v2021 do github] [1]). Daí você poderia \renewcomnand
(no preâmbulo) o \maketitle
comando com o mesmo código (começando na linha 287), exceto as linhas 304 a 314.
Um AVISO padrão: você pode fazer isso para uso pessoal. Mas nunca faça esse tipo de alteração se o seu documento for destinado à submissão ao periódico/conferência/editor correspondente (aqui para conferências da série LIPIcs). [1]:https://github.com/prosysscience/lipics/blob/master/lipics-v2021.cls
Responder2
Olhando para odefinição de classe, você encontrará (linhas 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
}
O segundo \maketitle
falha por causa de todos \global\let...\relax
e \global\let...\@empty
.
Você pode tentar redefini-lo (dentro \makeatletter
e \makeatother
para manipular o caractere @
nos nomes das 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
A página de título completa, incluindo o rodapé, é impressa novamente. Se você quiser apenas o título em si, terá que olhar a \@maketitle
definição e copiar as partes necessárias.
Exemplo:
\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}