
私はたくさんの 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}