Repita \maketitle exatamente com o mesmo estilo e parâmetros

Repita \maketitle exatamente com o mesmo estilo e parâmetros

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 titlingpacote, embora haja dois problemas aqui:

  1. Não consigo usar o \maketitledefinido no .clsarquivo do meu projeto (lipics, no meu caso)
  2. O titlingpacote 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 \maketitlese desabilita e também esvazia as \@titlemacros \@authore 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 \maketitlecomando 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 \maketitlefalha por causa de todos \global\let...\relaxe \global\let...\@empty.

Você pode tentar redefini-lo (dentro \makeatlettere \makeatotherpara 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 \@maketitledefiniçã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}

informação relacionada