
나는 많은 LaTeX 문서를 만들고 처음에 header.tex
사용하는 모든 선언을 에 넣습니다. \input{header.tex}
그러나 나는 그것을 a로 마이그레이션하여 지금 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}