まったく同じスタイルとパラメータで\maketitleを繰り返す

まったく同じスタイルとパラメータで\maketitleを繰り返す

任意の時点で、フロントページのタイトルを繰り返すドキュメントを作成しようとしています。

\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}

ただし、このコードは、上記のタイトルと著者のパラメータの完全にフォーマットされていないテキストを出力します。

いくつかのリンク [12] はtitlingパッケージの使用を提案していますが、次の 2 つの問題があります。

  1. 私のプロジェクト(私の場合はlipics)のファイル\maketitleで定義されているように使用できないようです.cls
  2. パッケージでは、titlingのすべてのパラメータを繰り返す必要があります\maketitle(例\title{..}: \author{}、 など)。

答え1

あなたのクラスでも、標準クラスでも、 は\maketitle自身を無効にし、コマンドとによって定義されたメタデータを含む および マクロを\@title空にします ([github の lipic-v2021 クラス][1] の 304 行目以降を参照)。したがって、(プリアンブルで) 304 行目から 314 行目を除いて、同じコード (287 行目から始まる) でコマンドを実行できます。\@author\title{...}\author{...}\renewcomnand\maketitle

標準的な警告: 個人使用であれば可能です。ただし、文書が対応するジャーナル/会議/編集者 (ここでは LIPIcs シリーズ会議) に提出されることを意図している場合は、このような変更を決して行わないでください。[1]:https://github.com/prosysscience/lipics/blob/master/lipics-v2021.cls

答え2

を見てクラス定義(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
}

2 番目は、すべてとが\maketitle原因で失敗します。\global\let...\relax\global\let...\@empty

\makeatletterそれを(内部で、マクロ名内の\makeatother文字を処理するために)再定義してみることができます。@

\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

フッターを含む完全なタイトル ページが再度印刷されます。タイトル自体だけが必要な場合は、\@maketitle定義を確認して必要な部分をコピーする必要があります。

例:

\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}

関連情報