Skip to main content
filecontents is useful for self-contained examples and reproducible templates.

Create Embedded Files

filecontents-example.tex
\begin{filecontents*}{references.bib}
@article{smith2024,
  author={Smith, John},
  title={Example Article},
  journal={Journal of Examples},
  year={2024}
}
\end{filecontents*}

\documentclass{article}
\usepackage[backend=biber,style=authoryear]{biblatex}
\addbibresource{references.bib}

\begin{document}
See \parencite{smith2024}.
\printbibliography
\end{document}

When To Use It

  • Compact tutorials and teaching snippets.
  • Reproducible examples in docs.
  • Quick test cases for bibliography workflows.