> ## 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.

# Bibliography and Citations in LaTeX

> Master bibliography management and citations in LaTeX. Learn BibTeX, BibLaTeX, citation styles, and reference management for academic writing.

Learn to manage references and citations professionally in LaTeX. This comprehensive guide covers both traditional BibTeX and modern BibLaTeX approaches.

<Info>
  **Quick start**: LaTeX Cloud Studio supports both BibTeX and BibLaTeX. Choose BibLaTeX for new projects as it offers more features and flexibility.
</Info>

## Bibliography Systems Overview

### BibTeX vs BibLaTeX Comparison

| Feature                     | BibTeX          | BibLaTeX             |
| --------------------------- | --------------- | -------------------- |
| **Age**                     | Older (1985)    | Modern (2006+)       |
| **Backend**                 | bibtex          | biber (recommended)  |
| **Languages**               | Limited         | Full Unicode support |
| **Styles**                  | Fixed styles    | Highly customizable  |
| **Sorting**                 | Basic           | Advanced options     |
| **Multiple bibliographies** | Difficult       | Easy                 |
| **Customization**           | Limited         | Extensive            |
| **Recommendation**          | Legacy projects | New projects         |

<Tip>
  **For new documents**: Use BibLaTeX with Biber backend for the best experience and most features.
</Tip>

## BibLaTeX: Modern Bibliography Management

### Basic Setup

<CodeGroup>
  ```latex biblatex-setup.tex theme={null}
  \documentclass{article}
  \usepackage[
    backend=biber,        % Use biber (recommended)
    style=authoryear,     % Citation style
    sorting=nyt,          % Sort by name, year, title
    maxbibnames=10,       % Max names in bibliography
    maxcitenames=2,       % Max names in citations
    hyperref=true,        % Clickable links
    backref=true         % Back references
  ]{biblatex}

  % Add bibliography file
  \addbibresource{references.bib}

  \begin{document}

  \section{Introduction}
  This research builds on \textcite{smith2020} and \textcite{jones2021}.
  Multiple studies \parencite{brown2019,wilson2022,taylor2023} confirm...

  \printbibliography

  \end{document}
  ```
</CodeGroup>

### Citation Commands

<CodeGroup>
  ```latex biblatex-citations.tex theme={null}
  % In-text citations
  \textcite{smith2020}           % Smith (2020) argues...
  \parencite{smith2020}          % Recent studies (Smith 2020) show...
  \cite{smith2020}               % Basic citation

  % Multiple citations
  \parencite{smith2020,jones2021,brown2019}
  \textcite{smith2020,jones2021} % Smith (2020) and Jones (2021)

  % Author and year separately
  \citeauthor{smith2020} (\citeyear{smith2020})  % Smith (2020)
  \citeauthor{smith2020}                         % Smith
  \citeyear{smith2020}                           % 2020

  % Page numbers and prenotes
  \parencite[15]{smith2020}                      % (Smith 2020, 15)
  \parencite[see][15-20]{smith2020}              % (see Smith 2020, 15-20)
  \parencite[cf.][]{smith2020}                   % (cf. Smith 2020)

  % Footnote citations
  \footcite{smith2020}           % Footnote with full citation
  \footcitetext{smith2020}       % Only footnote text

  % Full citations in text
  \fullcite{smith2020}           % Complete reference inline
  ```
</CodeGroup>

### Bibliography File (.bib)

<CodeGroup>
  ```bibtex references.bib theme={null}
  % Journal article
  @article{smith2020,
    author = {Smith, John A. and Doe, Jane B.},
    title = {Advanced Machine Learning Techniques},
    journal = {Journal of Artificial Intelligence},
    year = {2020},
    volume = {45},
    number = {3},
    pages = {123--145},
    doi = {10.1234/jai.2020.45.123},
    url = {https://example.com/article},
    abstract = {This paper presents novel approaches to...}
  }

  % Book
  @book{jones2021,
    author = {Jones, Alice M.},
    title = {Introduction to Data Science},
    publisher = {Academic Press},
    year = {2021},
    edition = {3rd},
    address = {New York},
    isbn = {978-0123456789},
    pages = {450}
  }

  % Book chapter
  @incollection{brown2019,
    author = {Brown, Robert C.},
    title = {Statistical Methods in Research},
    booktitle = {Handbook of Research Methods},
    editor = {Wilson, Sarah D.},
    publisher = {Scientific Publishers},
    year = {2019},
    pages = {45--67},
    address = {London}
  }

  % Conference paper
  @inproceedings{wilson2022,
    author = {Wilson, Mark E. and Taylor, Lisa F.},
    title = {Neural Networks for Image Classification},
    booktitle = {Proceedings of the International Conference on Machine Learning},
    year = {2022},
    pages = {234--245},
    address = {Vienna, Austria},
    publisher = {PMLR},
    month = {July}
  }

  % PhD thesis
  @phdthesis{taylor2023,
    author = {Taylor, Emma R.},
    title = {Deep Learning Applications in Computer Vision},
    school = {Massachusetts Institute of Technology},
    year = {2023},
    type = {PhD thesis},
    address = {Cambridge, MA}
  }

  % Online source
  @online{website2024,
    author = {Organization Name},
    title = {Important Guidelines},
    url = {https://example.com/guidelines},
    urldate = {2024-01-15},
    year = {2024}
  }

  % Technical report
  @techreport{report2023,
    author = {Research Team},
    title = {Annual Technical Report},
    institution = {National Laboratory},
    year = {2023},
    number = {TR-2023-001},
    address = {Washington, DC}
  }
  ```
</CodeGroup>

### Citation Styles

<CodeGroup>
  ```latex citation-styles.tex theme={null}
  % Author-year styles
  \usepackage[style=authoryear]{biblatex}     % (Smith 2020)
  \usepackage[style=authoryear-comp]{biblatex} % (Smith 2020; Jones 2021)
  \usepackage[style=apa]{biblatex}            % APA style

  % Numeric styles
  \usepackage[style=numeric]{biblatex}        % [1]
  \usepackage[style=numeric-comp]{biblatex}   % [1-3,5]
  \usepackage[style=ieee]{biblatex}           % IEEE style

  % Alphabetic styles
  \usepackage[style=alphabetic]{biblatex}     % [Smi20]
  \usepackage[style=alphabetic-verb]{biblatex} % [Smith2020]

  % Verbose styles (footnotes)
  \usepackage[style=verbose]{biblatex}        % Full footnotes
  \usepackage[style=verbose-ibid]{biblatex}   % With ibid.

  % Field-specific styles
  \usepackage[style=nature]{biblatex}         % Nature journal
  \usepackage[style=science]{biblatex}        % Science journal
  \usepackage[style=chicago-authordate]{biblatex} % Chicago style
  ```
</CodeGroup>

### Advanced BibLaTeX Features

<CodeGroup>
  ```latex advanced-biblatex.tex theme={null}
  % Multiple bibliographies
  \begin{refsection}
  \section{Chapter 1}
  Citations for chapter 1 \cite{ref1,ref2}.
  \printbibliography[heading=subbibliography,title={Chapter 1 References}]
  \end{refsection}

  \begin{refsection}
  \section{Chapter 2}
  Citations for chapter 2 \cite{ref3,ref4}.
  \printbibliography[heading=subbibliography,title={Chapter 2 References}]
  \end{refsection}

  % Filtered bibliographies
  \printbibliography[type=article,title={Journal Articles}]
  \printbibliography[type=book,title={Books}]
  \printbibliography[keyword=primary,title={Primary Sources}]
  \printbibliography[nottype=online,title={Print Sources}]

  % Custom categories
  \DeclareBibliographyCategory{primary}
  \addtocategory{primary}{smith2020,jones2021}
  \printbibliography[category=primary,title={Primary Sources}]

  % Split by language
  \printbibliography[langid=english,title={English Sources}]
  \printbibliography[langid=german,title={German Sources}]
  ```
</CodeGroup>

## Traditional BibTeX

### Basic BibTeX Setup

<CodeGroup>
  ```latex bibtex-setup.tex theme={null}
  \documentclass{article}
  \usepackage{natbib} % Enhanced citation commands

  \begin{document}

  \section{Introduction}
  \citet{smith2020} argues that machine learning...
  Multiple studies \citep{jones2021,brown2019} confirm...

  % Bibliography
  \bibliographystyle{plainnat} % or apalike, unsrt, etc.
  \bibliography{references}    % references.bib file

  \end{document}
  ```
</CodeGroup>

### BibTeX Citation Commands (with natbib)

<CodeGroup>
  ```latex bibtex-citations.tex theme={null}
  % Basic citations
  \cite{smith2020}              % Smith et al. (2020) or [1]
  \citep{smith2020}             % (Smith et al., 2020)
  \citet{smith2020}             % Smith et al. (2020)

  % Multiple citations
  \citep{smith2020,jones2021}   % (Smith et al., 2020; Jones, 2021)

  % Author/year separation
  \citeauthor{smith2020}        % Smith et al.
  \citeyear{smith2020}          % 2020

  % Alternative forms
  \citealp{smith2020}           % Smith et al., 2020
  \citealt{smith2020}           % Smith et al. 2020

  % Page numbers
  \citep[p.~15]{smith2020}      % (Smith et al., 2020, p. 15)
  \citep[see][pp.~10-15]{smith2020} % (see Smith et al., 2020, pp. 10-15)

  % Starred versions (full author list)
  \citet*{multiauthor2020}      % All authors listed
  \citep*{multiauthor2020}      % All authors in parentheses
  ```
</CodeGroup>

### BibTeX Styles

<CodeGroup>
  ```latex bibtex-styles.tex theme={null}
  % Standard styles (without natbib)
  \bibliographystyle{plain}     % Numbered, sorted alphabetically
  \bibliographystyle{unsrt}     % Numbered, order of citation
  \bibliographystyle{alpha}     % Alphabetic labels [Smi20]
  \bibliographystyle{abbrv}     % Abbreviated names/journals

  % With natbib package
  \bibliographystyle{plainnat}  % Author-year, full names
  \bibliographystyle{abbrvnat}  % Author-year, abbreviated
  \bibliographystyle{unsrtnat}  % Author-year, citation order
  \bibliographystyle{apalike}   % APA-like style

  % Field-specific styles
  \bibliographystyle{ieeetr}    % IEEE Transactions
  \bibliographystyle{acm}       % ACM style
  \bibliographystyle{amsplain}  % AMS style
  \bibliographystyle{chicago}   % Chicago style
  ```
</CodeGroup>

## Reference Management Integration

### Popular Reference Managers

<CodeGroup>
  ```latex reference-managers.tex theme={null}
  % Most reference managers can export BibTeX:

  % Zotero
  % 1. Select references
  % 2. File → Export Library
  % 3. Choose BibTeX format
  % 4. Include file in LaTeX project

  % Mendeley
  % 1. Select references
  % 2. File → Export
  % 3. Choose BibTeX format

  % EndNote
  % 1. Select references
  % 2. File → Export
  % 3. Choose BibTeX format

  % JabRef (dedicated BibTeX manager)
  % Native BibTeX editor with LaTeX integration

  % Example workflow with Zotero:
  \addbibresource{zotero-export.bib} % In preamble
  \cite{key-from-zotero}              % In document
  ```
</CodeGroup>

### Automated Bibliography Management

<CodeGroup>
  ```latex automated-bib.tex theme={null}
  % Better BibTeX for Zotero
  % - Automatic citation key generation
  % - Real-time sync with LaTeX projects
  % - Custom key patterns

  % Example citation keys:
  % [auth:lower][year] → smith2020
  % [authorsAlpha][year] → SJB20
  % [title:clean:select,1,1][year] → Advanced2020

  % In your .bib file generated by Better BibTeX:
  @article{smith2020advanced,
    author = {Smith, John A.},
    title = {Advanced Machine Learning},
    journal = {AI Journal},
    year = {2020}
  }
  ```
</CodeGroup>

## Journal-Specific Styles

### Academic Journal Templates

<CodeGroup>
  ```latex journal-styles.tex theme={null}
  % Nature journals
  \documentclass{nature}
  \bibliographystyle{naturemag}

  % Science
  \documentclass{sciencepaper}
  \bibliographystyle{Science}

  % IEEE journals
  \documentclass{IEEEtran}
  \bibliographystyle{IEEEtran}

  % ACM journals
  \documentclass{acmart}
  \bibliographystyle{ACM-Reference-Format}

  % Elsevier journals
  \documentclass{elsarticle}
  \bibliographystyle{elsarticle-num}

  % Springer journals
  \documentclass{svjour3}
  \bibliographystyle{spbasic}

  % APA style (psychology)
  \usepackage[style=apa]{biblatex}
  \DeclareLanguageMapping{american}{american-apa}

  % Chicago style (history, literature)
  \usepackage[style=chicago-authordate]{biblatex}
  ```
</CodeGroup>

## Working with Bibliography Databases

### Organizing Large Bibliography Files

<CodeGroup>
  ```latex organizing-bibs.tex theme={null}
  % Split bibliographies by topic
  \addbibresource{primary-sources.bib}
  \addbibresource{secondary-sources.bib}
  \addbibresource{methodology.bib}
  \addbibresource{background.bib}

  % Or use categories within one file
  @article{smith2020,
    author = {Smith, John},
    title = {Primary Research},
    journal = {Main Journal},
    year = {2020},
    keywords = {primary, experimental, machine-learning}
  }

  % Filter by keywords
  \printbibliography[keyword=primary,title={Primary Sources}]
  \printbibliography[keyword=methodology,title={Methodological References}]
  ```
</CodeGroup>

### Bibliography Entry Fields Reference

<Tabs>
  <Tab title="Required Fields">
    ```bibtex theme={null}
    % Article - Required: author, title, journal, year
    @article{key,
      author = {Last, First and Coauthor, Name},
      title = {Article Title},
      journal = {Journal Name},
      year = {2024}
    }

    % Book - Required: author/editor, title, publisher, year
    @book{key,
      author = {Author, Name},
      title = {Book Title},
      publisher = {Publisher Name},
      year = {2024}
    }

    % InProceedings - Required: author, title, booktitle, year
    @inproceedings{key,
      author = {Author, Name},
      title = {Paper Title},
      booktitle = {Conference Proceedings Title},
      year = {2024}
    }
    ```
  </Tab>

  <Tab title="Optional Fields">
    ```bibtex theme={null}
    % Comprehensive article entry
    @article{complete2024,
      author = {Author, First and Second, Author},
      title = {Complete Article Example},
      journal = {Journal of Examples},
      year = {2024},
      volume = {12},
      number = {3},
      pages = {123--145},
      month = {March},
      doi = {10.1234/example.2024.123},
      url = {https://doi.org/10.1234/example.2024.123},
      abstract = {This abstract describes...},
      keywords = {latex, bibliography, example},
      note = {Special issue on bibliography management}
    }
    ```
  </Tab>

  <Tab title="Special Fields">
    ```bibtex theme={null}
    % Electronic sources
    @online{web2024,
      author = {Organization},
      title = {Web Resource},
      url = {https://example.com},
      urldate = {2024-01-15},
      year = {2024},
      note = {Accessed: January 15, 2024}
    }

    % Datasets
    @dataset{data2024,
      author = {Researcher, Name},
      title = {Research Dataset v1.0},
      year = {2024},
      publisher = {Data Repository},
      version = {1.0},
      doi = {10.5281/zenodo.123456},
      url = {https://doi.org/10.5281/zenodo.123456}
    }

    % Software
    @software{software2024,
      author = {Developer, Name},
      title = {Software Package},
      year = {2024},
      publisher = {GitHub},
      version = {2.1.0},
      url = {https://github.com/user/repo}
    }
    ```
  </Tab>
</Tabs>

### Managing Cross-References

<CodeGroup>
  ```bibtex crossref-example.bib theme={null}
  % Parent entry (conference proceedings)
  @proceedings{conference2024,
    title = {Proceedings of the International Conference},
    year = {2024},
    editor = {Editor, Name},
    publisher = {ACM},
    address = {New York}
  }

  % Child entries using crossref
  @inproceedings{paper1_2024,
    author = {First, Author},
    title = {First Paper Title},
    pages = {1--10},
    crossref = {conference2024}
  }

  @inproceedings{paper2_2024,
    author = {Second, Author},
    title = {Second Paper Title},
    pages = {11--20},
    crossref = {conference2024}
  }

  % The crossref field automatically inherits:
  % - booktitle from title
  % - publisher, year, editor, address from parent
  ```
</CodeGroup>

## Advanced Citation Techniques

### Custom Citation Commands

<CodeGroup>
  ```latex custom-citations.tex theme={null}
  % Define custom citation commands
  \newcommand{\citepos}[1]{\citeauthor{#1}'s (\citeyear{#1})}
  % Usage: \citepos{smith2020} → Smith's (2020)

  \newcommand{\citeposs}[1]{\citeauthor{#1}' (\citeyear{#1})}
  % For plural possessive: \citeposs{authors2020} → Authors' (2020)

  % Parenthetical citations with page ranges
  \newcommand{\citepp}[2]{\citep[pp.~#2]{#1}}
  % Usage: \citepp{smith2020}{15-20} → (Smith 2020, pp. 15-20)

  % Compare citations
  \newcommand{\citecf}[1]{\citep[cf.][]{#1}}
  % Usage: \citecf{smith2020} → (cf. Smith 2020)

  % See also citations
  \newcommand{\citesee}[1]{\citep[see][]{#1}}
  % Usage: \citesee{smith2020} → (see Smith 2020)
  ```
</CodeGroup>

### Handling Special Cases

<CodeGroup>
  ```latex special-citations.tex theme={null}
  % Anonymous authors
  @article{anonymous2020,
    author = {{Anonymous}},
    title = {Confidential Research Results},
    journal = {Secret Journal},
    year = {2020}
  }

  % Corporate authors
  @report{who2021,
    author = {{World Health Organization}},
    title = {Global Health Report 2021},
    institution = {WHO},
    year = {2021}
  }

  % Multiple works by same author, same year
  @article{smith2020a,
    author = {Smith, John A.},
    title = {First Paper in 2020},
    journal = {Journal A},
    year = {2020}
  }

  @article{smith2020b,
    author = {Smith, John A.},
    title = {Second Paper in 2020},
    journal = {Journal B},
    year = {2020}
  }

  % Forthcoming publications
  @article{jones2024,
    author = {Jones, Mary},
    title = {Future Research},
    journal = {Future Journal},
    year = {2024},
    note = {forthcoming}
  }
  ```
</CodeGroup>

## Customizing Bibliography Appearance

### BibLaTeX Style Customization

<CodeGroup>
  ```latex customize-biblatex.tex theme={null}
  % Customize bibliography appearance
  \usepackage[
    backend=biber,
    style=authoryear,
    dashed=false,          % Repeat author names
    maxnames=3,            % Show up to 3 names before et al.
    minnames=1,            % At least 1 name before et al.
    giveninits=true,       % Use initials
    uniquename=init,       % Disambiguate by initials
    uniquelist=false,      % Don't expand name lists
    doi=true,              % Show DOIs
    isbn=false,            % Hide ISBNs
    url=false,             % Hide URLs (when DOI present)
    eprint=false           % Hide eprint info
  ]{biblatex}

  % Customize field formats
  \DeclareFieldFormat{title}{\mkbibemph{#1}} % Italicize titles
  \DeclareFieldFormat[article]{title}{\mkbibquote{#1}} % Quote article titles
  \DeclareFieldFormat{journaltitle}{\textit{#1}} % Italicize journal names
  \DeclareFieldFormat{doi}{%
    \mkbibacro{DOI}\addcolon\space
    \href{https://doi.org/#1}{\nolinkurl{#1}}}

  % Remove "In:" before journal names
  \renewbibmacro{in:}{%
    \ifentrytype{article}{}{
      \printtext{\bibstring{in}\intitlepunct}}}

  % Custom name format
  \DeclareNameAlias{sortname}{family-given}
  \DeclareNameAlias{default}{family-given}
  ```
</CodeGroup>

### Creating Custom Bibliography Drivers

<CodeGroup>
  ```latex custom-drivers.tex theme={null}
  % Define a new entry type for preprints
  \DeclareBibliographyDriver{preprint}{%
    \usebibmacro{bibindex}%
    \usebibmacro{begentry}%
    \usebibmacro{author/translator+others}%
    \setunit{\printdelim{nametitledelim}}\newblock
    \usebibmacro{title}%
    \newunit\newblock
    \printfield{howpublished}%
    \newunit\newblock
    \printfield{note}%
    \newunit\newblock
    \usebibmacro{doi+eprint+url}%
    \newunit\newblock
    \usebibmacro{addendum+pubstate}%
    \setunit{\bibpagerefpunct}\newblock
    \usebibmacro{pageref}%
    \newunit\newblock
    \iftoggle{bbx:related}
      {\usebibmacro{related:init}%
       \usebibmacro{related}}
      {}%
    \usebibmacro{finentry}}

  % Use in .bib file
  @preprint{arxiv2024,
    author = {Researcher, Name},
    title = {Preprint Title},
    year = {2024},
    eprint = {2401.12345},
    eprinttype = {arXiv},
    eprintclass = {cs.LG}
  }
  ```
</CodeGroup>

### Bibliography Formatting Examples

<CodeGroup>
  ```latex formatting-examples.tex theme={null}
  % Numbered bibliography with custom labels
  \defbibenvironment{bibliography}
    {\enumerate
       {\setlength{\leftmargin}{\bibhang}%
        \setlength{\itemindent}{-\leftmargin}%
        \setlength{\itemsep}{\bibitemsep}%
        \setlength{\parsep}{\bibparsep}}}
    {\endenumerate}
    {\item[\printfield{labelnumber}.]}  % Add period after number

  % Custom bibliography heading
  \defbibheading{bibliography}[\bibname]{%
    \section*{#1}%
    \markboth{#1}{#1}%
    \addcontentsline{toc}{section}{#1}}

  % Split bibliography by decade
  \defbibcheck{2020s}{\iffieldint{year}
    {\ifnumless{\thefield{year}}{2020}
      {\skipentry}{\ifnumgreater{\thefield{year}}{2029}
        {\skipentry}{}}}}
    {\skipentry}}

  \defbibcheck{2010s}{\iffieldint{year}
    {\ifnumless{\thefield{year}}{2010}
      {\skipentry}{\ifnumgreater{\thefield{year}}{2019}
        {\skipentry}{}}}}
    {\skipentry}}

  % Print by decade
  \printbibliography[check=2020s,title={2020s Publications}]
  \printbibliography[check=2010s,title={2010s Publications}]
  ```
</CodeGroup>

## Handling Complex Citation Scenarios

### Multi-Volume Works

<CodeGroup>
  ```bibtex multivolume.bib theme={null}
  % Multi-volume book set
  @mvbook{encyclopedia2024,
    author = {Editor, Chief},
    title = {Encyclopedia of Computer Science},
    year = {2024},
    volumes = {5},
    publisher = {Academic Press}
  }

  % Individual volume
  @book{encyclopedia2024_vol2,
    author = {Editor, Chief},
    title = {Encyclopedia of Computer Science},
    year = {2024},
    volume = {2},
    maintitle = {Encyclopedia of Computer Science},
    mainsubtitle = {Complete Edition},
    publisher = {Academic Press}
  }

  % Reference within multi-volume work
  @inbook{smith2024_encyclopedia,
    author = {Smith, John},
    title = {Machine Learning Fundamentals},
    booktitle = {Encyclopedia of Computer Science},
    year = {2024},
    volume = {3},
    pages = {234--267},
    publisher = {Academic Press},
    crossref = {encyclopedia2024}
  }
  ```
</CodeGroup>

### Legal Citations

<CodeGroup>
  ```latex legal-citations.tex theme={null}
  % Legal citation package
  \usepackage[style=apa]{biblatex}

  % Case law
  @legal{brown1954,
    title = {Brown v. Board of Education},
    year = {1954},
    volume = {347},
    reporter = {U.S.},
    pages = {483},
    court = {Supreme Court}
  }

  % Statute
  @legislation{ada1990,
    title = {Americans with Disabilities Act},
    year = {1990},
    volume = {42},
    section = {12101},
    code = {U.S.C.}
  }

  % Custom legal citation format
  \DeclareFieldFormat[legal]{title}{\textit{#1}}
  \DeclareBibliographyDriver{legal}{%
    \usebibmacro{bibindex}%
    \usebibmacro{begentry}%
    \printfield{title}%
    \setunit{\addcomma\space}%
    \printfield{volume}%
    \setunit{\space}%
    \printfield{reporter}%
    \setunit{\space}%
    \printfield{pages}%
    \setunit{\space}%
    \mkbibparens{\printfield{year}}%
    \usebibmacro{finentry}}
  ```
</CodeGroup>

### Citation Call-Outs and Annotations

<CodeGroup>
  ```latex annotations.tex theme={null}
  % Annotated bibliography
  @article{smith2020,
    author = {Smith, John},
    title = {Important Study},
    journal = {Key Journal},
    year = {2020},
    annotation = {This seminal work established the foundation
                  for modern approaches to the problem. The author
                  uses innovative methodology to demonstrate...}
  }

  % Print with annotations
  \renewbibmacro*{finentry}{%
    \finentrypunct
    \iffieldundef{annotation}
      {}
      {\par\vspace{0.5\baselineskip}%
       \begin{quotation}\small
         \printfield{annotation}%
       \end{quotation}}%
    \finentry}

  % In-text annotation references
  \newcommand{\citenote}[2]{%
    \cite{#1}\footnote{#2}}

  % Usage: \citenote{smith2020}{This study is particularly
  % relevant because it addresses our specific use case.}
  ```
</CodeGroup>

## Best Practices

<Tip>
  **Bibliography best practices:**

  1. **Consistent formatting**: Use a reference manager for consistency
  2. **Complete information**: Include all required fields (DOI, pages, etc.)
  3. **Verification**: Double-check all citations against original sources
  4. **Style compliance**: Follow your target journal's requirements exactly
  5. **Backup**: Keep backup copies of your .bib files
  6. **Organization**: Use meaningful citation keys
  7. **Updates**: Keep reference information current
  8. **Permissions**: Ensure you have rights to cite all sources
</Tip>

### Citation Key Best Practices

<CodeGroup>
  ```bibtex citation-keys.bib theme={null}
  % Good citation key patterns
  @article{smith2020ml,          % author + year + topic
    author = {Smith, John},
    title = {Machine Learning Advances},
    year = {2020}
  }

  @book{johnson2021deeplearning, % author + year + keywords
    author = {Johnson, Mary},
    title = {Deep Learning Fundamentals},
    year = {2021}
  }

  @inproceedings{lee2024cvpr,    % author + year + venue
    author = {Lee, David},
    title = {Computer Vision Paper},
    booktitle = {CVPR},
    year = {2024}
  }

  % Avoid these patterns
  @article{1,                    % Too generic
  @article{ml_paper,             % No year/author info
  @article{my_favorite_paper,    % Personal references
  @article{temp,                 % Temporary names
  ```
</CodeGroup>

### Managing Bibliography Errors

<Accordion title="Common BibTeX/BibLaTeX Errors">
  **Error: Citation undefined**

  * Check spelling of citation key
  * Ensure .bib file is included
  * Run compilation sequence completely

  **Error: Empty bibliography**

  * Verify \cite commands exist in document
  * Check .bib file path
  * Ensure bibliography style is defined

  **Error: I found no \citation commands**

  * At least one \cite must appear before \bibliography
  * Check for typos in \cite commands
  * Verify .aux file is being generated

  **Error: Repeated entry**

  * Check for duplicate keys in .bib file
  * Look for entries in multiple .bib files
  * Use unique keys for each entry
</Accordion>

## Troubleshooting

<Warning>
  **Common issues and solutions:**

  1. **Missing references**: Check citation keys match .bib entries exactly
  2. **Style errors**: Ensure you're using the correct bibliography style
  3. **Compilation order**: Run LaTeX → Biber/BibTeX → LaTeX → LaTeX
  4. **Unicode issues**: Use BibLaTeX with UTF-8 encoding
  5. **Multiple authors**: Use `and` to separate authors in .bib files
  6. **Special characters**: Use LaTeX escape sequences or UTF-8
  7. **Page ranges**: Use `--` for page ranges (123--145)
  8. **URLs**: Use `\url{}` command or proper URL fields
</Warning>

## Working with Multiple Bibliographies

### Chapter-Based Bibliographies

<CodeGroup>
  ```latex chapter-bibs.tex theme={null}
  % Using refsection (BibLaTeX)
  \documentclass{book}
  \usepackage[style=authoryear,refsection=chapter]{biblatex}
  \addbibresource{references.bib}

  \begin{document}

  \chapter{Introduction}
  \begin{refsection}
  Content with citations \cite{ref1,ref2}.
  \printbibliography[heading=subbibliography]
  \end{refsection}

  \chapter{Methods}
  \begin{refsection}
  More content \cite{ref3,ref4}.
  \printbibliography[heading=subbibliography]
  \end{refsection}

  % Global bibliography at end
  \printbibliography[title={Complete Bibliography}]
  \end{document}
  ```
</CodeGroup>

### Topic-Based Bibliographies

<CodeGroup>
  ```latex topic-bibs.tex theme={null}
  % Categorize references by topic
  \DeclareBibliographyCategory{theory}
  \DeclareBibliographyCategory{experiments}
  \DeclareBibliographyCategory{applications}

  % Assign categories
  \addtocategory{theory}{einstein1905,bohr1913}
  \addtocategory{experiments}{miller2020,jones2021}
  \addtocategory{applications}{smith2022,brown2023}

  % Print categorized bibliographies
  \printbibheading{\section{References by Topic}}

  \printbibliography[
    category=theory,
    title={Theoretical Foundations}]

  \printbibliography[
    category=experiments,
    title={Experimental Studies}]

  \printbibliography[
    category=applications,
    title={Practical Applications}]

  % Or filter by keywords in .bib entries
  \printbibliography[
    keyword={machine-learning},
    title={Machine Learning References}]
  ```
</CodeGroup>

## Integration with LaTeX Features

### Hyperlinked Citations

<CodeGroup>
  ```latex hyperref-citations.tex theme={null}
  % Setup hyperref with biblatex
  \usepackage{hyperref}
  \hypersetup{
    colorlinks=true,
    citecolor=blue,
    linkcolor=blue,
    urlcolor=blue
  }

  % Custom link colors for different citation types
  \DeclareFieldFormat{citehyperref}{%
    \DeclareFieldAlias{bibhyperref}{noformat}%
    \bibhyperref{#1}}

  \DeclareFieldFormat{textcitehyperref}{%
    \DeclareFieldAlias{bibhyperref}{noformat}%
    \bibhyperref{\textcolor{green}{#1}}}

  % Backref - show where each reference is cited
  \usepackage[style=authoryear,backref=true]{biblatex}

  % Custom backref text
  \DefineBibliographyStrings{english}{%
    backrefpage = {cited on page},
    backrefpages = {cited on pages}
  }
  ```
</CodeGroup>

### Bibliography in Table of Contents

<CodeGroup>
  ```latex bib-toc.tex theme={null}
  % Add bibliography to TOC
  \printbibliography[heading=bibintoc,title={References}]

  % Or manually
  \printbibliography
  \addcontentsline{toc}{chapter}{Bibliography}

  % For numbered sections
  \printbibliography[heading=bibnumbered]

  % Custom heading with TOC
  \defbibheading{custom}[\bibname]{%
    \chapter*{#1}%
    \markboth{#1}{#1}%
    \addcontentsline{toc}{chapter}{#1}%
    \vspace{2em}%
    \center\textit{All sources have been carefully verified.}%
    \vspace{1em}}

  \printbibliography[heading=custom]
  ```
</CodeGroup>

### Glossary Integration with Citations

<CodeGroup>
  ```latex glossary-citations.tex theme={null}
  % Using glossaries package with citations
  \usepackage{glossaries}
  \makeglossaries

  % Define term with citation
  \newglossaryentry{machinelearning}{
    name={machine learning},
    description={A subset of artificial intelligence
      that enables systems to learn from data
      \cite{mitchell1997}}
  }

  % In text
  The concept of \gls{machinelearning} has evolved
  significantly since its inception.

  % Print glossary with citations
  \printglossary[title={Glossary with References}]
  ```
</CodeGroup>

## Quick Reference

### Compilation Process

```bash theme={null}
# For BibLaTeX (recommended)
pdflatex document.tex
biber document
pdflatex document.tex
pdflatex document.tex

# For BibTeX
pdflatex document.tex
bibtex document
pdflatex document.tex
pdflatex document.tex
```

### Essential Entry Types

| Type             | Purpose           | Required Fields                           |
| ---------------- | ----------------- | ----------------------------------------- |
| `@article`       | Journal articles  | author, title, journal, year              |
| `@book`          | Books             | author/editor, title, publisher, year     |
| `@incollection`  | Book chapters     | author, title, booktitle, publisher, year |
| `@inproceedings` | Conference papers | author, title, booktitle, year            |
| `@phdthesis`     | Dissertations     | author, title, school, year               |
| `@techreport`    | Technical reports | author, title, institution, year          |
| `@online`        | Web sources       | author, title, url, urldate               |

***

<Info>
  **Next**: Learn about [Cross-referencing systems](/learn/latex/cross-referencing) to create professional internal references in your documents.
</Info>

## Start in LaTeX Cloud Studio

<CardGroup cols={2}>
  <Card title="Open in LaTeX Cloud Studio" icon="cloud" href="https://app.latex-cloud-studio.com/?utm_source=resources&utm_medium=cta&utm_campaign=research_workflow&utm_content=bibliography_citations_open_app">
    Write, compile, and iterate directly in your browser.
  </Card>

  <Card title="Start from Article Template" icon="file-text" href="/templates/article">
    Use a ready-made template, then adapt it to your content.
  </Card>

  <Card title="Knowledge Base Docs" icon="book-open" href="/product/knowledge-base?utm_source=resources&utm_medium=internal_card&utm_campaign=research_workflow&utm_content=bibliography_citations">
    Keep source PDFs and reusable project context close to the manuscript.
  </Card>

  <Card title="AI Research Agent Docs" icon="magnifying-glass" href="/product/ai-research-agent?utm_source=resources&utm_medium=internal_card&utm_campaign=research_workflow&utm_content=bibliography_citations">
    Use accepted sources, follow-up literature, and citation handoff inside the same project.
  </Card>
</CardGroup>
