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

export const RenderedOutput = ({title = "Rendered output", ctaHref, ctaLabel = "Open LaTeX Cloud Studio", children}) => {
  const [isExpanded, setIsExpanded] = useState(false);
  const trackEditorCta = () => {
    const target = new URL(ctaHref, window.location.href);
    globalThis.posthog?.capture?.("docs_app_cta_clicked", {
      source_page: window.location.pathname,
      source_section: "rendered_output",
      cta_variant: "first_compiled_example",
      target_url: target.toString(),
      target_utm_source: target.searchParams.get("utm_source"),
      target_utm_medium: target.searchParams.get("utm_medium"),
      target_utm_campaign: target.searchParams.get("utm_campaign"),
      target_utm_content: target.searchParams.get("utm_content")
    }, {
      transport: "sendBeacon",
      send_instantly: true
    });
  };
  return <details className="rendered-output" onToggle={event => setIsExpanded(event.currentTarget.open)}>
      <summary className="rendered-output__summary">
        <span className="rendered-output__title">{title}</span>
        <span className="rendered-output__hint" aria-hidden="true">View compiled result</span>
      </summary>
      {isExpanded && <div className="rendered-output__content">
          {children}
          {ctaHref && <aside className="rendered-output__cta" aria-label="Continue in the LaTeX editor">
              <span>
                <strong>Ready to use this syntax?</strong>
                Continue in the browser editor when you want to adapt the example in a real project.
              </span>
              <a href={ctaHref} onClick={trackEditorCta}>{ctaLabel}<span aria-hidden="true"> →</span></a>
            </aside>}
        </div>}
    </details>;
};

export const LatexSource = ({filename, source}) => {
  const [copyStatus, setCopyStatus] = useState("Copy");
  const copySource = async () => {
    try {
      await navigator.clipboard.writeText(source);
      setCopyStatus("Copied");
    } catch {
      setCopyStatus("Select and copy");
    }
  };
  return <figure className="latex-source">
      <figcaption className="latex-source__header">
        <span className="latex-source__filename">{filename}</span>
        <button type="button" className="latex-source__copy" onClick={copySource} aria-live="polite">
          {copyStatus}
        </button>
      </figcaption>
      <pre className="latex-source__pre" aria-label={`LaTeX source: ${filename}`} tabIndex="0">
        <code className="language-latex">{source}</code>
      </pre>
    </figure>;
};

export const LatexPreview = ({src, alt, caption, width, height}) => {
  const minZoom = 1;
  const maxZoom = 3;
  const zoomStep = 0.5;
  const measureSvgContent = async (assetSrc, pageWidth, pageHeight) => {
    const cacheKey = "__latexCloudSvgContentBoxCache";
    const contentBoxCache = globalThis[cacheKey] ?? new Map();
    globalThis[cacheKey] = contentBoxCache;
    if (contentBoxCache.has(assetSrc)) return contentBoxCache.get(assetSrc);
    const measurement = (async () => {
      const assetUrl = new URL(assetSrc, window.location.href);
      if (assetUrl.origin !== window.location.origin) {
        throw new Error("Rendered output must use a same-origin SVG asset.");
      }
      const response = await fetch(assetUrl, {
        credentials: "same-origin"
      });
      if (!response.ok) throw new Error(`Rendered output request failed with ${response.status}.`);
      const source = await response.text();
      const documentNode = new DOMParser().parseFromString(source, "image/svg+xml");
      if (documentNode.querySelector("parsererror")) throw new Error("Rendered output is not valid SVG.");
      const sourceSvg = documentNode.documentElement;
      sourceSvg.querySelectorAll("script, foreignObject").forEach(node => node.remove());
      [sourceSvg, ...sourceSvg.querySelectorAll("*")].forEach(node => {
        [...node.attributes].forEach(attribute => {
          if ((/^on/i).test(attribute.name)) node.removeAttribute(attribute.name);
          if ((attribute.name === "href" || attribute.name === "xlink:href") && !attribute.value.startsWith("#")) {
            node.removeAttribute(attribute.name);
          }
        });
      });
      const measurementHost = document.createElement("div");
      measurementHost.className = "latex-preview__measurement-host";
      const measuredSvg = document.importNode(sourceSvg, true);
      measuredSvg.setAttribute("aria-hidden", "true");
      measurementHost.appendChild(measuredSvg);
      document.body.appendChild(measurementHost);
      try {
        const measuredElements = [...measuredSvg.children].filter(node => !["defs", "desc", "metadata", "style", "title"].includes(node.tagName.toLowerCase()));
        const elementBounds = measuredElements.map(node => node.getBBox()).filter(box => [box.x, box.y, box.width, box.height].every(Number.isFinite) && box.width > 0 && box.height > 0);
        if (elementBounds.length === 0) {
          throw new Error("Rendered output has no measurable visible content.");
        }
        const sortedBounds = [...elementBounds].sort((left, right) => left.y - right.y);
        const clusterGap = pageHeight * 0.045;
        const clusters = [];
        sortedBounds.forEach(box => {
          const current = clusters[clusters.length - 1];
          if (!current || box.y - current.bottom > clusterGap) {
            clusters.push({
              boxes: [box],
              bottom: box.y + box.height
            });
            return;
          }
          current.boxes.push(box);
          current.bottom = Math.max(current.bottom, box.y + box.height);
        });
        const contentClusters = clusters.filter(cluster => {
          const clusterBox = cluster.boxes.reduce((combined, box) => {
            const right = Math.max(combined.x + combined.width, box.x + box.width);
            const bottom = Math.max(combined.y + combined.height, box.y + box.height);
            const x = Math.min(combined.x, box.x);
            const y = Math.min(combined.y, box.y);
            return {
              x,
              y,
              width: right - x,
              height: bottom - y
            };
          });
          const centerY = clusterBox.y + clusterBox.height / 2;
          const isMarginFurniture = cluster.boxes.length <= 2 && clusterBox.width < pageWidth * 0.2 && clusterBox.height < pageHeight * 0.04 && (centerY < pageHeight * 0.08 || centerY > pageHeight * 0.8);
          return !isMarginFurniture;
        });
        const visibleBounds = (contentClusters.length > 0 ? contentClusters : clusters).flatMap(cluster => cluster.boxes);
        const bounds = visibleBounds.reduce((combined, box) => {
          const right = Math.max(combined.x + combined.width, box.x + box.width);
          const bottom = Math.max(combined.y + combined.height, box.y + box.height);
          const x = Math.min(combined.x, box.x);
          const y = Math.min(combined.y, box.y);
          return {
            x,
            y,
            width: right - x,
            height: bottom - y
          };
        });
        const clampValue = (value, minimum, maximum) => Math.min(maximum, Math.max(minimum, value));
        const padding = Math.max(8, Math.min(pageWidth, pageHeight) * 0.025);
        const x = clampValue(bounds.x - padding, 0, pageWidth);
        const y = clampValue(bounds.y - padding, 0, pageHeight);
        const right = clampValue(bounds.x + bounds.width + padding, 0, pageWidth);
        const bottom = clampValue(bounds.y + bounds.height + padding, 0, pageHeight);
        return {
          x,
          y,
          width: right - x,
          height: bottom - y
        };
      } finally {
        measurementHost.remove();
      }
    })();
    contentBoxCache.set(assetSrc, measurement);
    measurement.catch(() => contentBoxCache.delete(assetSrc));
    return measurement;
  };
  const renderPreviewAsset = ({contentBox: assetContentBox, loading}) => {
    if (!assetContentBox) {
      return <img className="latex-preview__asset" src={src} alt={alt} width={width} height={height} loading={loading} draggable="false" />;
    }
    return <svg className="latex-preview__asset" viewBox={`${assetContentBox.x} ${assetContentBox.y} ${assetContentBox.width} ${assetContentBox.height}`} preserveAspectRatio="xMidYMid meet" role="img" aria-label={alt}>
        <image href={src} x="0" y="0" width={width} height={height} />
      </svg>;
  };
  const [isOpen, setIsOpen] = useState(false);
  const [frameMode, setFrameMode] = useState("content");
  const [viewMode, setViewMode] = useState("fit");
  const [zoom, setZoom] = useState(minZoom);
  const [contentBox, setContentBox] = useState(null);
  const [measurementStatus, setMeasurementStatus] = useState("loading");
  const dialogRef = useRef(null);
  const closeButtonRef = useRef(null);
  const viewportRef = useRef(null);
  const previousFocusRef = useRef(null);
  const dragRef = useRef(null);
  useEffect(() => {
    let isCurrent = true;
    setMeasurementStatus("loading");
    measureSvgContent(src, width, height).then(box => {
      if (!isCurrent) return;
      setContentBox(box);
      setMeasurementStatus("ready");
    }).catch(() => {
      if (!isCurrent) return;
      setContentBox(null);
      setFrameMode("page");
      setMeasurementStatus("error");
    });
    return () => {
      isCurrent = false;
    };
  }, [height, src, width]);
  const closeViewer = useCallback(() => {
    setIsOpen(false);
  }, []);
  const openViewer = () => {
    previousFocusRef.current = document.activeElement;
    setFrameMode(contentBox ? "content" : "page");
    setViewMode("fit");
    setZoom(minZoom);
    setIsOpen(true);
  };
  const applyZoom = useCallback(nextZoom => {
    const boundedZoom = Math.min(maxZoom, Math.max(minZoom, nextZoom));
    setViewMode("custom");
    setZoom(boundedZoom);
  }, []);
  const zoomIn = useCallback(() => {
    applyZoom(viewMode === "fit" ? minZoom + zoomStep : zoom + zoomStep);
  }, [applyZoom, viewMode, zoom]);
  const zoomOut = useCallback(() => {
    applyZoom(viewMode === "fit" ? minZoom : zoom - zoomStep);
  }, [applyZoom, viewMode, zoom]);
  useEffect(() => {
    if (!isOpen) return undefined;
    const previousOverflow = document.body.style.overflow;
    document.body.style.overflow = "hidden";
    closeButtonRef.current?.focus();
    return () => {
      document.body.style.overflow = previousOverflow;
      previousFocusRef.current?.focus?.();
    };
  }, [isOpen]);
  useEffect(() => {
    if (!isOpen) return undefined;
    const handleKeyDown = event => {
      if (event.key === "Escape") {
        event.preventDefault();
        closeViewer();
        return;
      }
      if ((event.key === "+" || event.key === "=") && !event.metaKey && !event.ctrlKey) {
        event.preventDefault();
        zoomIn();
        return;
      }
      if (event.key === "-" && !event.metaKey && !event.ctrlKey) {
        event.preventDefault();
        zoomOut();
        return;
      }
      if (event.key !== "Tab" || !dialogRef.current) return;
      const focusable = [...dialogRef.current.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];
      if (focusable.length === 0) return;
      const first = focusable[0];
      const last = focusable[focusable.length - 1];
      if (event.shiftKey && document.activeElement === first) {
        event.preventDefault();
        last.focus();
      } else if (!event.shiftKey && document.activeElement === last) {
        event.preventDefault();
        first.focus();
      }
    };
    window.addEventListener("keydown", handleKeyDown);
    return () => {
      window.removeEventListener("keydown", handleKeyDown);
    };
  }, [closeViewer, isOpen, zoomIn, zoomOut]);
  const startDrag = event => {
    if (event.button !== 0 || !viewportRef.current) return;
    const viewport = viewportRef.current;
    dragRef.current = {
      pointerId: event.pointerId,
      x: event.clientX,
      y: event.clientY,
      scrollLeft: viewport.scrollLeft,
      scrollTop: viewport.scrollTop
    };
    viewport.setPointerCapture(event.pointerId);
    viewport.dataset.dragging = "true";
  };
  const continueDrag = event => {
    const drag = dragRef.current;
    const viewport = viewportRef.current;
    if (!drag || !viewport || drag.pointerId !== event.pointerId) return;
    viewport.scrollLeft = drag.scrollLeft - (event.clientX - drag.x);
    viewport.scrollTop = drag.scrollTop - (event.clientY - drag.y);
  };
  const stopDrag = event => {
    const viewport = viewportRef.current;
    if (viewport?.hasPointerCapture(event.pointerId)) viewport.releasePointerCapture(event.pointerId);
    if (viewport) delete viewport.dataset.dragging;
    dragRef.current = null;
  };
  const activeContentBox = frameMode === "content" ? contentBox : null;
  const activeWidth = activeContentBox?.width ?? width;
  const activeHeight = activeContentBox?.height ?? height;
  const activeRatio = activeWidth / activeHeight;
  const inlineContentBox = measurementStatus === "ready" ? contentBox : null;
  const inlineWidth = inlineContentBox?.width ?? width;
  const inlineHeight = inlineContentBox?.height ?? height;
  const inlineGeometry = {
    aspectRatio: `${inlineWidth} / ${inlineHeight}`,
    maxWidth: `${30 * inlineWidth / inlineHeight}rem`
  };
  const imageStyle = viewMode === "fit" ? {
    aspectRatio: `${activeWidth} / ${activeHeight}`,
    width: "100%",
    maxWidth: `${Math.max(16, activeRatio * 78)}dvh`
  } : {
    aspectRatio: `${activeWidth} / ${activeHeight}`,
    width: `${zoom * 100}%`,
    maxWidth: "none"
  };
  const zoomLabel = viewMode === "fit" ? frameMode === "content" ? "Fit content" : "Full page" : `${Math.round(zoom * 100)}%`;
  return <figure className="latex-preview">
      <button type="button" className="latex-preview__trigger" onClick={openViewer} aria-haspopup="dialog" aria-label={`Open zoomable preview: ${alt}`}>
        <span className="latex-preview__page" style={inlineGeometry}>
          {measurementStatus === "loading" ? <span className="latex-preview__loading" role="status">Preparing compiled output…</span> : renderPreviewAsset({
    src,
    alt,
    width,
    height,
    contentBox: inlineContentBox,
    loading: "lazy"
  })}
        </span>
        <span className="latex-preview__trigger-label" aria-hidden="true">
          <span className="latex-preview__trigger-icon">⌕</span>
          Open viewer
        </span>
      </button>
      <figcaption className="latex-preview__caption">
        <span>
          {caption}
          {measurementStatus === "error" && <span className="latex-preview__status" role="status"> Content fit is unavailable; the complete vector page is shown.</span>}
        </span>
        <a href={src} target="_blank" rel="noreferrer" className="latex-preview__source-link">Open SVG</a>
      </figcaption>

      {isOpen && <div className="latex-preview__backdrop" onMouseDown={event => {
    if (event.target === event.currentTarget) closeViewer();
  }}>
          <section ref={dialogRef} className="latex-preview__dialog" role="dialog" aria-modal="true" aria-label={`Rendered LaTeX viewer: ${alt}`}>
            <header className="latex-preview__toolbar">
              <div className="latex-preview__identity">
                <span className="latex-preview__eyebrow">Compiled LaTeX</span>
                <span className="latex-preview__filename">{alt}</span>
              </div>
              <div className="latex-preview__controls" aria-label="Preview controls">
                <button type="button" className={frameMode === "content" && viewMode === "fit" ? "is-active" : undefined} disabled={!contentBox} onClick={() => {
    setFrameMode("content");
    setViewMode("fit");
    setZoom(minZoom);
  }}>
                  Fit content
                </button>
                <button type="button" className={frameMode === "page" && viewMode === "fit" ? "is-active" : undefined} onClick={() => {
    setFrameMode("page");
    setViewMode("fit");
    setZoom(minZoom);
  }}>
                  Full page
                </button>
                <span className="latex-preview__zoom-group">
                  <button type="button" onClick={zoomOut} disabled={viewMode === "fit" || zoom <= minZoom} aria-label="Zoom out">−</button>
                  <output aria-live="polite" aria-label="Current zoom">{zoomLabel}</output>
                  <button type="button" onClick={zoomIn} disabled={viewMode !== "fit" && zoom >= maxZoom} aria-label="Zoom in">+</button>
                </span>
                <a href={src} target="_blank" rel="noreferrer">Open SVG</a>
                <button ref={closeButtonRef} type="button" className="latex-preview__close" onClick={closeViewer} aria-label="Close rendered LaTeX viewer">
                  Close
                </button>
              </div>
            </header>
            <div ref={viewportRef} className="latex-preview__viewport" data-view-mode={viewMode} onPointerDown={startDrag} onPointerMove={continueDrag} onPointerUp={stopDrag} onPointerCancel={stopDrag}>
              <span className="latex-preview__dialog-page" style={imageStyle}>
                {renderPreviewAsset({
    src,
    alt,
    width,
    height,
    contentBox: activeContentBox
  })}
              </span>
            </div>
            <footer className="latex-preview__viewer-note">
              Compiler-generated vector output · Use +/− to zoom · Drag to pan · Esc to close
            </footer>
          </section>
        </div>}
    </figure>;
};

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

<LatexSource filename="biblatex-setup.tex" source={"\\documentclass{article}\n\\usepackage[\n  backend=biber,        % Use biber (recommended)\n  style=authoryear,     % Citation style\n  sorting=nyt,          % Sort by name, year, title\n  maxbibnames=10,       % Max names in bibliography\n  maxcitenames=2,       % Max names in citations\n  hyperref=true,        % Clickable links\n  backref=true         % Back references\n]{biblatex}\n\n% Add bibliography file\n\\addbibresource{references.bib}\n\n\\begin{document}\n\n\\section{Introduction}\nThis research builds on \\textcite{smith2020} and \\textcite{jones2021}.\nMultiple studies \\parencite{brown2019,wilson2022,taylor2023} confirm...\n\n\\printbibliography\n\n\\end{document}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.
  </Info>
</RenderedOutput>

### Citation Commands

<LatexSource filename="biblatex-citations.tex" source={"% In-text citations\n\\textcite{smith2020}           % Smith (2020) argues...\n\\parencite{smith2020}          % Recent studies (Smith 2020) show...\n\\cite{smith2020}               % Basic citation\n\n% Multiple citations\n\\parencite{smith2020,jones2021,brown2019}\n\\textcite{smith2020,jones2021} % Smith (2020) and Jones (2021)\n\n% Author and year separately\n\\citeauthor{smith2020} (\\citeyear{smith2020})  % Smith (2020)\n\\citeauthor{smith2020}                         % Smith\n\\citeyear{smith2020}                           % 2020\n\n% Page numbers and prenotes\n\\parencite[15]{smith2020}                      % (Smith 2020, 15)\n\\parencite[see][15-20]{smith2020}              % (see Smith 2020, 15-20)\n\\parencite[cf.][]{smith2020}                   % (cf. Smith 2020)\n\n% Footnote citations\n\\footcite{smith2020}           % Footnote with full citation\n\\footcitetext{smith2020}       % Only footnote text\n\n% Full citations in text\n\\fullcite{smith2020}           % Complete reference inline"} />

<RenderedOutput title="Expected effect">
  <Info>
    This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.
  </Info>
</RenderedOutput>

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

<LatexSource filename="citation-styles.tex" source={"% Author-year styles\n\\usepackage[style=authoryear]{biblatex}     % (Smith 2020)\n\\usepackage[style=authoryear-comp]{biblatex} % (Smith 2020; Jones 2021)\n\\usepackage[style=apa]{biblatex}            % APA style\n\n% Numeric styles\n\\usepackage[style=numeric]{biblatex}        % [1]\n\\usepackage[style=numeric-comp]{biblatex}   % [1-3,5]\n\\usepackage[style=ieee]{biblatex}           % IEEE style\n\n% Alphabetic styles\n\\usepackage[style=alphabetic]{biblatex}     % [Smi20]\n\\usepackage[style=alphabetic-verb]{biblatex} % [Smith2020]\n\n% Verbose styles (footnotes)\n\\usepackage[style=verbose]{biblatex}        % Full footnotes\n\\usepackage[style=verbose-ibid]{biblatex}   % With ibid.\n\n% Field-specific styles\n\\usepackage[style=nature]{biblatex}         % Nature journal\n\\usepackage[style=science]{biblatex}        % Science journal\n\\usepackage[style=chicago-authordate]{biblatex} % Chicago style"} />

<RenderedOutput title="Expected effect">
  <Info>
    This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.
  </Info>
</RenderedOutput>

### Advanced BibLaTeX Features

<LatexSource filename="advanced-biblatex.tex" source={"% Multiple bibliographies\n\\begin{refsection}\n\\section{Chapter 1}\nCitations for chapter 1 \\cite{ref1,ref2}.\n\\printbibliography[heading=subbibliography,title={Chapter 1 References}]\n\\end{refsection}\n\n\\begin{refsection}\n\\section{Chapter 2}\nCitations for chapter 2 \\cite{ref3,ref4}.\n\\printbibliography[heading=subbibliography,title={Chapter 2 References}]\n\\end{refsection}\n\n% Filtered bibliographies\n\\printbibliography[type=article,title={Journal Articles}]\n\\printbibliography[type=book,title={Books}]\n\\printbibliography[keyword=primary,title={Primary Sources}]\n\\printbibliography[nottype=online,title={Print Sources}]\n\n% Custom categories\n\\DeclareBibliographyCategory{primary}\n\\addtocategory{primary}{smith2020,jones2021}\n\\printbibliography[category=primary,title={Primary Sources}]\n\n% Split by language\n\\printbibliography[langid=english,title={English Sources}]\n\\printbibliography[langid=german,title={German Sources}]"} />

<RenderedOutput title="Expected effect">
  <Info>
    This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.
  </Info>
</RenderedOutput>

## Traditional BibTeX

### Basic BibTeX Setup

<LatexSource filename="bibtex-setup.tex" source={"\\documentclass{article}\n\\usepackage{natbib} % Enhanced citation commands\n\n\\begin{document}\n\n\\section{Introduction}\n\\citet{smith2020} argues that machine learning...\nMultiple studies \\citep{jones2021,brown2019} confirm...\n\n% Bibliography\n\\bibliographystyle{plainnat} % or apalike, unsrt, etc.\n\\bibliography{references}    % references.bib file\n\n\\end{document}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.
  </Info>
</RenderedOutput>

### BibTeX Citation Commands (with natbib)

<LatexSource filename="bibtex-citations.tex" source={"% Basic citations\n\\cite{smith2020}              % Smith et al. (2020) or [1]\n\\citep{smith2020}             % (Smith et al., 2020)\n\\citet{smith2020}             % Smith et al. (2020)\n\n% Multiple citations\n\\citep{smith2020,jones2021}   % (Smith et al., 2020; Jones, 2021)\n\n% Author/year separation\n\\citeauthor{smith2020}        % Smith et al.\n\\citeyear{smith2020}          % 2020\n\n% Alternative forms\n\\citealp{smith2020}           % Smith et al., 2020\n\\citealt{smith2020}           % Smith et al. 2020\n\n% Page numbers\n\\citep[p.~15]{smith2020}      % (Smith et al., 2020, p. 15)\n\\citep[see][pp.~10-15]{smith2020} % (see Smith et al., 2020, pp. 10-15)\n\n% Starred versions (full author list)\n\\citet*{multiauthor2020}      % All authors listed\n\\citep*{multiauthor2020}      % All authors in parentheses"} />

<RenderedOutput title="Expected effect">
  <Info>
    This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.
  </Info>
</RenderedOutput>

### BibTeX Styles

<LatexSource filename="bibtex-styles.tex" source={"% Standard styles (without natbib)\n\\bibliographystyle{plain}     % Numbered, sorted alphabetically\n\\bibliographystyle{unsrt}     % Numbered, order of citation\n\\bibliographystyle{alpha}     % Alphabetic labels [Smi20]\n\\bibliographystyle{abbrv}     % Abbreviated names/journals\n\n% With natbib package\n\\bibliographystyle{plainnat}  % Author-year, full names\n\\bibliographystyle{abbrvnat}  % Author-year, abbreviated\n\\bibliographystyle{unsrtnat}  % Author-year, citation order\n\\bibliographystyle{apalike}   % APA-like style\n\n% Field-specific styles\n\\bibliographystyle{ieeetr}    % IEEE Transactions\n\\bibliographystyle{acm}       % ACM style\n\\bibliographystyle{amsplain}  % AMS style\n\\bibliographystyle{chicago}   % Chicago style"} />

<RenderedOutput title="Expected effect">
  <Info>
    This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.
  </Info>
</RenderedOutput>

## Reference Management Integration

### Popular Reference Managers

<LatexSource filename="reference-managers.tex" source={"% Most reference managers can export BibTeX:\n\n% Zotero\n% 1. Select references\n% 2. File → Export Library\n% 3. Choose BibTeX format\n% 4. Include file in LaTeX project\n\n% Mendeley\n% 1. Select references\n% 2. File → Export\n% 3. Choose BibTeX format\n\n% EndNote\n% 1. Select references\n% 2. File → Export\n% 3. Choose BibTeX format\n\n% JabRef (dedicated BibTeX manager)\n% Native BibTeX editor with LaTeX integration\n\n% Example workflow with Zotero:\n\\addbibresource{zotero-export.bib} % In preamble\n\\cite{key-from-zotero}              % In document"} />

<RenderedOutput title="Expected effect">
  <Info>
    This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.
  </Info>
</RenderedOutput>

### Automated Bibliography Management

<LatexSource filename="automated-bib.tex" source={"% Better BibTeX for Zotero\n% - Automatic citation key generation\n% - Real-time sync with LaTeX projects\n% - Custom key patterns\n\n% Example citation keys:\n% [auth:lower][year] → smith2020\n% [authorsAlpha][year] → SJB20\n% [title:clean:select,1,1][year] → Advanced2020\n\n% In your .bib file generated by Better BibTeX:\n@article{smith2020advanced,\n  author = {Smith, John A.},\n  title = {Advanced Machine Learning},\n  journal = {AI Journal},\n  year = {2020}\n}"} />

<RenderedOutput title="Rendered output" ctaHref="https://app.latex-cloud-studio.com/?utm_source=resources&utm_medium=rendered_output&utm_campaign=docs_open_app&utm_content=learn_latex_bibliography_citations">
  <LatexPreview src="/images/rendered/learn-latex-bibliography-citations-09/page-1.svg" alt="Compiled PDF page 1 from automated-bib.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper." width={595.276} height={841.89} />
</RenderedOutput>

## Journal-Specific Styles

### Academic Journal Templates

<LatexSource filename="journal-styles.tex" source={"% Nature journals\n\\documentclass{nature}\n\\bibliographystyle{naturemag}\n\n% Science\n\\documentclass{sciencepaper}\n\\bibliographystyle{Science}\n\n% IEEE journals\n\\documentclass{IEEEtran}\n\\bibliographystyle{IEEEtran}\n\n% ACM journals\n\\documentclass{acmart}\n\\bibliographystyle{ACM-Reference-Format}\n\n% Elsevier journals\n\\documentclass{elsarticle}\n\\bibliographystyle{elsarticle-num}\n\n% Springer journals\n\\documentclass{svjour3}\n\\bibliographystyle{spbasic}\n\n% APA style (psychology)\n\\usepackage[style=apa]{biblatex}\n\\DeclareLanguageMapping{american}{american-apa}\n\n% Chicago style (history, literature)\n\\usepackage[style=chicago-authordate]{biblatex}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.
  </Info>
</RenderedOutput>

## Working with Bibliography Databases

### Organizing Large Bibliography Files

<LatexSource filename="organizing-bibs.tex" source={"% Split bibliographies by topic\n\\addbibresource{primary-sources.bib}\n\\addbibresource{secondary-sources.bib}\n\\addbibresource{methodology.bib}\n\\addbibresource{background.bib}\n\n% Or use categories within one file\n@article{smith2020,\n  author = {Smith, John},\n  title = {Primary Research},\n  journal = {Main Journal},\n  year = {2020},\n  keywords = {primary, experimental, machine-learning}\n}\n\n% Filter by keywords\n\\printbibliography[keyword=primary,title={Primary Sources}]\n\\printbibliography[keyword=methodology,title={Methodological References}]"} />

<RenderedOutput title="Expected effect">
  <Info>
    This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.
  </Info>
</RenderedOutput>

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

<LatexSource filename="custom-citations.tex" source={"% Define custom citation commands\n\\newcommand{\\citepos}[1]{\\citeauthor{#1}'s (\\citeyear{#1})}\n% Usage: \\citepos{smith2020} → Smith's (2020)\n\n\\newcommand{\\citeposs}[1]{\\citeauthor{#1}' (\\citeyear{#1})}\n% For plural possessive: \\citeposs{authors2020} → Authors' (2020)\n\n% Parenthetical citations with page ranges\n\\newcommand{\\citepp}[2]{\\citep[pp.~#2]{#1}}\n% Usage: \\citepp{smith2020}{15-20} → (Smith 2020, pp. 15-20)\n\n% Compare citations\n\\newcommand{\\citecf}[1]{\\citep[cf.][]{#1}}\n% Usage: \\citecf{smith2020} → (cf. Smith 2020)\n\n% See also citations\n\\newcommand{\\citesee}[1]{\\citep[see][]{#1}}\n% Usage: \\citesee{smith2020} → (see Smith 2020)"} />

<RenderedOutput title="Expected effect">
  <Info>
    This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.
  </Info>
</RenderedOutput>

### Handling Special Cases

<LatexSource filename="special-citations.tex" source={"% Anonymous authors\n@article{anonymous2020,\n  author = {{Anonymous}},\n  title = {Confidential Research Results},\n  journal = {Secret Journal},\n  year = {2020}\n}\n\n% Corporate authors\n@report{who2021,\n  author = {{World Health Organization}},\n  title = {Global Health Report 2021},\n  institution = {WHO},\n  year = {2021}\n}\n\n% Multiple works by same author, same year\n@article{smith2020a,\n  author = {Smith, John A.},\n  title = {First Paper in 2020},\n  journal = {Journal A},\n  year = {2020}\n}\n\n@article{smith2020b,\n  author = {Smith, John A.},\n  title = {Second Paper in 2020},\n  journal = {Journal B},\n  year = {2020}\n}\n\n% Forthcoming publications\n@article{jones2024,\n  author = {Jones, Mary},\n  title = {Future Research},\n  journal = {Future Journal},\n  year = {2024},\n  note = {forthcoming}\n}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-bibliography-citations-13/page-1.svg" alt="Compiled PDF page 1 from special-citations.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper." width={595.276} height={841.89} />
</RenderedOutput>

## Customizing Bibliography Appearance

### BibLaTeX Style Customization

<LatexSource filename="customize-biblatex.tex" source={"% Customize bibliography appearance\n\\usepackage[\n  backend=biber,\n  style=authoryear,\n  dashed=false,          % Repeat author names\n  maxnames=3,            % Show up to 3 names before et al.\n  minnames=1,            % At least 1 name before et al.\n  giveninits=true,       % Use initials\n  uniquename=init,       % Disambiguate by initials\n  uniquelist=false,      % Don't expand name lists\n  doi=true,              % Show DOIs\n  isbn=false,            % Hide ISBNs\n  url=false,             % Hide URLs (when DOI present)\n  eprint=false           % Hide eprint info\n]{biblatex}\n\n% Customize field formats\n\\DeclareFieldFormat{title}{\\mkbibemph{#1}} % Italicize titles\n\\DeclareFieldFormat[article]{title}{\\mkbibquote{#1}} % Quote article titles\n\\DeclareFieldFormat{journaltitle}{\\textit{#1}} % Italicize journal names\n\\DeclareFieldFormat{doi}{%\n  \\mkbibacro{DOI}\\addcolon\\space\n  \\href{https://doi.org/#1}{\\nolinkurl{#1}}}\n\n% Remove \"In:\" before journal names\n\\renewbibmacro{in:}{%\n  \\ifentrytype{article}{}{\n    \\printtext{\\bibstring{in}\\intitlepunct}}}\n\n% Custom name format\n\\DeclareNameAlias{sortname}{family-given}\n\\DeclareNameAlias{default}{family-given}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This code performs setup or defines reusable behavior without producing visible page content on its own. It must be used inside a complete document to have a rendered result.
  </Info>
</RenderedOutput>

### Creating Custom Bibliography Drivers

<LatexSource filename="custom-drivers.tex" source={"% Define a new entry type for preprints\n\\DeclareBibliographyDriver{preprint}{%\n  \\usebibmacro{bibindex}%\n  \\usebibmacro{begentry}%\n  \\usebibmacro{author/translator+others}%\n  \\setunit{\\printdelim{nametitledelim}}\\newblock\n  \\usebibmacro{title}%\n  \\newunit\\newblock\n  \\printfield{howpublished}%\n  \\newunit\\newblock\n  \\printfield{note}%\n  \\newunit\\newblock\n  \\usebibmacro{doi+eprint+url}%\n  \\newunit\\newblock\n  \\usebibmacro{addendum+pubstate}%\n  \\setunit{\\bibpagerefpunct}\\newblock\n  \\usebibmacro{pageref}%\n  \\newunit\\newblock\n  \\iftoggle{bbx:related}\n    {\\usebibmacro{related:init}%\n     \\usebibmacro{related}}\n    {}%\n  \\usebibmacro{finentry}}\n\n% Use in .bib file\n@preprint{arxiv2024,\n  author = {Researcher, Name},\n  title = {Preprint Title},\n  year = {2024},\n  eprint = {2401.12345},\n  eprinttype = {arXiv},\n  eprintclass = {cs.LG}\n}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.
  </Info>
</RenderedOutput>

### Bibliography Formatting Examples

<LatexSource filename="formatting-examples.tex" source={"% Numbered bibliography with custom labels\n\\defbibenvironment{bibliography}\n  {\\enumerate\n     {\\setlength{\\leftmargin}{\\bibhang}%\n      \\setlength{\\itemindent}{-\\leftmargin}%\n      \\setlength{\\itemsep}{\\bibitemsep}%\n      \\setlength{\\parsep}{\\bibparsep}}}\n  {\\endenumerate}\n  {\\item[\\printfield{labelnumber}.]}  % Add period after number\n\n% Custom bibliography heading\n\\defbibheading{bibliography}[\\bibname]{%\n  \\section*{#1}%\n  \\markboth{#1}{#1}%\n  \\addcontentsline{toc}{section}{#1}}\n\n% Split bibliography by decade\n\\defbibcheck{2020s}{\\iffieldint{year}\n  {\\ifnumless{\\thefield{year}}{2020}\n    {\\skipentry}{\\ifnumgreater{\\thefield{year}}{2029}\n      {\\skipentry}{}}}}\n  {\\skipentry}}\n\n\\defbibcheck{2010s}{\\iffieldint{year}\n  {\\ifnumless{\\thefield{year}}{2010}\n    {\\skipentry}{\\ifnumgreater{\\thefield{year}}{2019}\n      {\\skipentry}{}}}}\n  {\\skipentry}}\n\n% Print by decade\n\\printbibliography[check=2020s,title={2020s Publications}]\n\\printbibliography[check=2010s,title={2010s Publications}]"} />

<RenderedOutput title="Expected effect">
  <Info>
    This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.
  </Info>
</RenderedOutput>

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

<LatexSource filename="legal-citations.tex" source={"% Legal citation package\n\\usepackage[style=apa]{biblatex}\n\n% Case law\n@legal{brown1954,\n  title = {Brown v. Board of Education},\n  year = {1954},\n  volume = {347},\n  reporter = {U.S.},\n  pages = {483},\n  court = {Supreme Court}\n}\n\n% Statute\n@legislation{ada1990,\n  title = {Americans with Disabilities Act},\n  year = {1990},\n  volume = {42},\n  section = {12101},\n  code = {U.S.C.}\n}\n\n% Custom legal citation format\n\\DeclareFieldFormat[legal]{title}{\\textit{#1}}\n\\DeclareBibliographyDriver{legal}{%\n  \\usebibmacro{bibindex}%\n  \\usebibmacro{begentry}%\n  \\printfield{title}%\n  \\setunit{\\addcomma\\space}%\n  \\printfield{volume}%\n  \\setunit{\\space}%\n  \\printfield{reporter}%\n  \\setunit{\\space}%\n  \\printfield{pages}%\n  \\setunit{\\space}%\n  \\mkbibparens{\\printfield{year}}%\n  \\usebibmacro{finentry}}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.
  </Info>
</RenderedOutput>

### Citation Call-Outs and Annotations

<LatexSource filename="annotations.tex" source={"% Annotated bibliography\n@article{smith2020,\n  author = {Smith, John},\n  title = {Important Study},\n  journal = {Key Journal},\n  year = {2020},\n  annotation = {This seminal work established the foundation\n                for modern approaches to the problem. The author\n                uses innovative methodology to demonstrate...}\n}\n\n% Print with annotations\n\\renewbibmacro*{finentry}{%\n  \\finentrypunct\n  \\iffieldundef{annotation}\n    {}\n    {\\par\\vspace{0.5\\baselineskip}%\n     \\begin{quotation}\\small\n       \\printfield{annotation}%\n     \\end{quotation}}%\n  \\finentry}\n\n% In-text annotation references\n\\newcommand{\\citenote}[2]{%\n  \\cite{#1}\\footnote{#2}}\n\n% Usage: \\citenote{smith2020}{This study is particularly\n% relevant because it addresses our specific use case.}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.
  </Info>
</RenderedOutput>

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

<LatexSource filename="chapter-bibs.tex" source={"% Using refsection (BibLaTeX)\n\\documentclass{book}\n\\usepackage[style=authoryear,refsection=chapter]{biblatex}\n\\addbibresource{references.bib}\n\n\\begin{document}\n\n\\chapter{Introduction}\n\\begin{refsection}\nContent with citations \\cite{ref1,ref2}.\n\\printbibliography[heading=subbibliography]\n\\end{refsection}\n\n\\chapter{Methods}\n\\begin{refsection}\nMore content \\cite{ref3,ref4}.\n\\printbibliography[heading=subbibliography]\n\\end{refsection}\n\n% Global bibliography at end\n\\printbibliography[title={Complete Bibliography}]\n\\end{document}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.
  </Info>
</RenderedOutput>

### Topic-Based Bibliographies

<LatexSource filename="topic-bibs.tex" source={"% Categorize references by topic\n\\DeclareBibliographyCategory{theory}\n\\DeclareBibliographyCategory{experiments}\n\\DeclareBibliographyCategory{applications}\n\n% Assign categories\n\\addtocategory{theory}{einstein1905,bohr1913}\n\\addtocategory{experiments}{miller2020,jones2021}\n\\addtocategory{applications}{smith2022,brown2023}\n\n% Print categorized bibliographies\n\\printbibheading{\\section{References by Topic}}\n\n\\printbibliography[\n  category=theory,\n  title={Theoretical Foundations}]\n\n\\printbibliography[\n  category=experiments,\n  title={Experimental Studies}]\n\n\\printbibliography[\n  category=applications,\n  title={Practical Applications}]\n\n% Or filter by keywords in .bib entries\n\\printbibliography[\n  keyword={machine-learning},\n  title={Machine Learning References}]"} />

<RenderedOutput title="Expected effect">
  <Info>
    This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.
  </Info>
</RenderedOutput>

## Integration with LaTeX Features

### Hyperlinked Citations

<LatexSource filename="hyperref-citations.tex" source={"% Setup hyperref with biblatex\n\\usepackage{hyperref}\n\\hypersetup{\n  colorlinks=true,\n  citecolor=blue,\n  linkcolor=blue,\n  urlcolor=blue\n}\n\n% Custom link colors for different citation types\n\\DeclareFieldFormat{citehyperref}{%\n  \\DeclareFieldAlias{bibhyperref}{noformat}%\n  \\bibhyperref{#1}}\n\n\\DeclareFieldFormat{textcitehyperref}{%\n  \\DeclareFieldAlias{bibhyperref}{noformat}%\n  \\bibhyperref{\\textcolor{green}{#1}}}\n\n% Backref - show where each reference is cited\n\\usepackage[style=authoryear,backref=true]{biblatex}\n\n% Custom backref text\n\\DefineBibliographyStrings{english}{%\n  backrefpage = {cited on page},\n  backrefpages = {cited on pages}\n}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.
  </Info>
</RenderedOutput>

### Bibliography in Table of Contents

<LatexSource filename="bib-toc.tex" source={"% Add bibliography to TOC\n\\printbibliography[heading=bibintoc,title={References}]\n\n% Or manually\n\\printbibliography\n\\addcontentsline{toc}{chapter}{Bibliography}\n\n% For numbered sections\n\\printbibliography[heading=bibnumbered]\n\n% Custom heading with TOC\n\\defbibheading{custom}[\\bibname]{%\n  \\chapter*{#1}%\n  \\markboth{#1}{#1}%\n  \\addcontentsline{toc}{chapter}{#1}%\n  \\vspace{2em}%\n  \\center\\textit{All sources have been carefully verified.}%\n  \\vspace{1em}}\n\n\\printbibliography[heading=custom]"} />

<RenderedOutput title="Expected effect">
  <Info>
    This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.
  </Info>
</RenderedOutput>

### Glossary Integration with Citations

<LatexSource filename="glossary-citations.tex" source={"% Using glossaries package with citations\n\\usepackage{glossaries}\n\\makeglossaries\n\n% Define term with citation\n\\newglossaryentry{machinelearning}{\n  name={machine learning},\n  description={A subset of artificial intelligence\n    that enables systems to learn from data\n    \\cite{mitchell1997}}\n}\n\n% In text\nThe concept of \\gls{machinelearning} has evolved\nsignificantly since its inception.\n\n% Print glossary with citations\n\\printglossary[title={Glossary with References}]"} />

<RenderedOutput title="Expected effect">
  <Info>
    This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.
  </Info>
</RenderedOutput>

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