Skip to content

← Back to articles

Configuring Pandoc CSL Citation Styles in the Browser: APA, Chicago, Vancouver

Pandoc can turn a document full of bare citation keys into a finished paper with formatted in-text citations and a bibliography. The machinery is citeproc, now built into pandoc itself, and the styles it follows are written in CSL, the Citation Style Language. Both behave identically whether pandoc runs on a command line or compiled to WebAssembly inside a browser tab.

This walkthrough covers what CSL is and where to get style files, how to prepare a BibTeX bibliography that citeproc can trust, what actually changes between APA, Chicago, and Vancouver output for the same input, and which mistakes leave literal citation keys in the finished text.

What CSL is

CSL stands for Citation Style Language, an XML format that describes exactly how a citation and a bibliography entry should look: where the year goes, whether titles are italicized, how page ranges collapse. Every major style exists as a CSL file, and the Zotero Style Repository alone hosts thousands of them, from APA and Chicago to the house styles of individual journals.

Because the style lives in a file rather than in code, switching conventions means swapping the file, not editing the document. Journals that mandate a specific format usually say so by name, and the matching CSL file can be downloaded from the repository without any configuration on your side.

How citeproc resolves a citation

In the source document, citations are written inline with the at sign. A bracketed key becomes a parenthetical citation, while a key used directly in a sentence becomes a narrative citation where the author name is part of the prose. Locators travel with the key, so page and chapter references ride along inside the brackets.

At conversion time, citeproc reads each key, looks it up in the bibliography file, and hands the resolved entry to the CSL style for formatting. The same pass collects every cited entry and appends a reference list at the end of the document, or wherever a division with the id refs marks the spot. Keys are labels you choose, and they never appear in the output unless something went wrong.

Getting the style file

The Zotero Style Repository lets you search by publisher or keyword and download a .csl file in one click. Read style names carefully: Chicago ships as a note-bibliography variant that produces footnotes and as an author-date variant that produces parenthetical citations, and they are two different files.

When a journal publishes formatting instructions instead of a file, search the repository for the journal name first. The repository tracks thousands of journals, and a maintained file beats a hand-edited one. If nothing matches, the closest parent style is usually acceptable for drafts.

Preparing the .bib file

The bibliography file maps keys to metadata. In BibTeX format each entry begins with a type such as article, book, or inproceedings, followed by a key you invent, then fields like author, title, year, journal, and DOI. The key is what you type in the text, so short and memorable beats long and precise, and a stable scheme such as author, year, and a word keeps drafts readable years later.

Field completeness shows up directly in the output. A missing year leaves an empty slot in an APA citation, and a missing DOI drops the link readers would follow. Wrapping proper nouns in double braces inside the title field protects their capitalization, because BibTeX may otherwise downcase titles to satisfy style rules.

One input, three outputs

Take a single line with one bracketed key and one narrative key. Under APA, an author-date style, the bracketed citation becomes a parenthetical name and year, the narrative one becomes the author followed by the year in parentheses, and the bibliography is sorted alphabetically with hanging indents. Under Chicago note-bibliography, the same citations become numbered footnotes, full on first mention and shortened afterward.

Under Vancouver, common in medicine, citations turn into sequential numbers in square brackets ordered by first appearance rather than alphabetically. Across all three, nothing in your text changes: the keys, the file, and the document stay identical while only the CSL file swaps, which is the whole point of the format and the reason to set it up early.

Running citations in the browser

On this site, the Pro citation options accept two uploads: a .bib file with the references and a .csl file with the chosen style. Everything runs inside the browser worker, where citeproc is part of the same Pandoc engine that performs the conversion, so keys resolve exactly as they would on a command line.

The workflow is short: write the document with at-keys as usual, keep one .bib file per project, drop in the style file the target journal requires, and convert. Changing journals later then means uploading a different .csl file, not rewriting any of your citations.

Common errors and fixes

The most frequent failure is a key mismatch: the text cites a key the .bib file does not define, and pandoc leaves the raw bracketed text in the output while logging a warning about the missing reference. Check the spelling of the key and confirm the intended file was actually uploaded.

Case problems trace back to the title field, where acronyms and proper nouns arrive lowercased when the style demands it; the double-brace protection in the .bib file exists to prevent that. Missing fields surface as blanks or incomplete citations, so a spot check of one rendered bibliography entry catches most issues before submission.

Browser output versus the command line

Because the browser version runs the same citeproc implementation inside the same Pandoc engine, formatted citations and the bibliography come out identical to what the command line would produce from the same inputs and versions. There is no simplified formatter in between.

That equivalence makes the browser a legitimate place to prepare a submission draft: apply the style, check the rendered references, and hand reviewers a document whose citations already match the target journal. The converter on this site keeps .bib and .csl handling inside your browser, so unpublished manuscripts stay on your machine too.

Keep reading

Convert with citations