
有沒有辦法(終端命令?)取得 TeX 檔案(可能帶有外部連結的巨集、bibstyle 檔案、bibTeX 來源等)並自動產生單一獨立的 TeX 檔案?例如,我可以產生 bbl 文件,複製並貼上其中的條目並添加到來源中,但這會變得乏味。有人解決這個問題嗎?
答案1
本文檔將本地 Latex 包和本地 bibtex 資料庫捆綁為一個文件, usimg filecontents
,生成
\begin{filecontents}{mypackage.sty}
\def\zzzz{Hello}
\end{filecontents}
\begin{filecontents}{zzz.bib}
@article{zz99,
title={something},
author={M. Eee and Y. Ouoo},
journal={TugBoat},
volume={14},
number={2},
pages={200--100},
year={1884},
publisher={example.org}
}
\end{filecontents}
\documentclass{article}
\usepackage{mypackage}
\begin{document}
\zzzz, \cite{zz99}
\bibliographystyle{plain}
\bibliography{zzz}
\end{document}