Citations & Bibliography¶
papersmith includes a full citation management system supporting multiple academic styles and BibTeX import.
Supported Styles¶
| Style | Format |
|---|---|
ieee |
[1] Author, "Title," Journal, year. |
apa |
Author (Year). Title. Journal. |
harvard |
Author (Year) Title. Journal. |
mla |
Author. "Title." Journal, Year. |
chicago |
Author. Title. Publisher, Year. |
Adding Sources¶
from papersmith import SmithDocument
doc = SmithDocument(preset="academic")
doc.citations.style = "ieee"
doc.citations.add_source(
"knuth1997",
author="Donald E. Knuth",
title="The Art of Computer Programming",
year=1997,
publisher="Addison-Wesley",
)
doc.citations.add_source(
"dijkstra1959",
author="Edsger W. Dijkstra",
title="A note on two problems in connexion with graphs",
year=1959,
journal="Numerische Mathematik",
volume="1",
pages="269-271",
)
Citing in Text¶
Use {cite:key} syntax in your text:
doc.add_text(
"The foundational work on graph algorithms {cite:dijkstra1959} "
"remains influential today."
)
Importing BibTeX¶
Generating Bibliography¶
This resolves all cited keys and formats them according to the active citation style.
Complete Example¶
from papersmith import SmithDocument
doc = SmithDocument(preset="academic")
doc.citations.style = "apa"
doc.citations.add_source(
"smith2024",
author="John Smith",
title="Modern Document Generation",
year=2024,
journal="Journal of Software Engineering",
)
doc.add_heading("Literature Review", level=1)
doc.add_text("Recent advances in document generation {cite:smith2024} have simplified academic workflows.")
doc.add_heading("References", level=1)
doc.add_bibliography()
doc.save("cited_paper.docx")