> ## Documentation Index
> Fetch the complete documentation index at: https://resources.latex-cloud-studio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# filecontents Package in LaTeX

> Generate auxiliary files such as .bib files directly from your LaTeX source using filecontents.

`filecontents` is useful for self-contained examples and reproducible templates.

## Create Embedded Files

```latex filecontents-example.tex theme={null}
\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.

## Related Pages

* [BibLaTeX guide](/learn/latex/bibliography/biblatex-guide)
* [Multi-file projects](/learn/latex/document-structure/multi-file-projects)
