文書の最後に内容を前文に追加する

文書の最後に内容を前文に追加する

私はたくさんの LaTeX ドキュメントを作成し、すべての宣言を に入れて、最初はheader.texで使用していました。しかし、それを に移行して、今は だけを使用しています。\input{header.tex}header.sty\usepackage{header}

いずれにしても、私の文書には常に参考文献を含む同じ最後の行が含まれています。私もそれを自分の文書に移動したいと思いますheader.sty。何らかの方法で文書の末尾のコンテンツを序文に追加する方法はありますか?

私が考えているコードは次のとおりです。

\IfFileExists{\bibliographyfile}{
    \printbibliography
}{}

\bibliographyfile前文ですでに定義されています。

答え1

おそらく、リクエストは次のようなもので、header.styファイル内のすべてを自動的にロードするものだったと思います。

\DefaultBibliographyStyle任意に変更してください。

\documentclass[12pt]{scrbook}
\usepackage{blindtext} % Not needed really


%%%% Content for `header.sty`
\newcommand*{\bibliographyfile}{biblio}%
\newcommand*{\DefaultBibliographyStyle}{alpha}%
\newcommand*{\DefaultBibFileExtension}{.bib}%

\AtEndDocument{%
\bibliographystyle{\DefaultBibliographyStyle}
\bibliography{\bibliographyfile}%
%
\IfFileExists{\bibliographyfile\DefaultBibFileExtension}{%
  \printbibliography%
}{}{}%
}%

%%%%%%%%%%% End stop copying it to the 'header.sty' file.


\begin{document}

\chapter{First}
\blindtext

\cite{Lam94} and \cite{GSM97} wrote fine books about \LaTeXe and other things.\par

\blindtext[5]

\end{document}

関連情報