Skip to main content
Learn to create professional cross-references in LaTeX documents. This guide covers the complete referencing system from basic labels to advanced automated references.
Why cross-references matter: They maintain consistency automatically, update numbering when you reorganize content, and provide clickable navigation in PDF documents.

Basic Cross-referencing System

Labels and References

basic-references.tex
Ready to use this syntax? Continue in the browser editor when you want to adapt the example in a real project.Open LaTeX Cloud Studio

The Label-Reference Workflow

  1. Create labels with \label{prefix:name}
  2. Reference labels with \ref{prefix:name}
  3. Compile twice to resolve all references
label-reference-workflow.tex

Standard Naming Convention

label-conventions.tex

Label Naming Best Practices

Label naming tips:
  • Use descriptive names: fig:sales-growth not fig:1
  • Keep it concise but meaningful
  • Use hyphens for multi-word labels
  • Be consistent throughout your document

Advanced Reference Commands

Page References

page-references.tex

Equation References

equation-references.tex

Subfigure References

subfigure-references.tex

The cleveref Package

Smart Automatic References

cleveref-setup.tex

Customizing cleveref

cleveref-customization.tex

Advanced cleveref Features

cleveref-advanced.tex

Hyperref Integration

Clickable References

hyperref-setup.tex

PDF Bookmarks and Metadata

pdf-bookmarks.tex

Special Reference Types

Theorem Environments

theorem-references.tex

Algorithm References

algorithm-references.tex

Cross-document References

External References with xr Package

external-references.tex

Managing Large Documents

large-document-refs.tex

Best Practices

Cross-referencing best practices:
  1. Consistent labeling: Use standard prefixes and descriptive names
  2. Non-breaking spaces: Always use ~ before \ref{} commands
  3. Meaningful labels: Choose names that describe content, not position
  4. Compile multiple times: Run LaTeX twice to resolve all references
  5. Use cleveref: Automate reference types and formatting
  6. Check broken refs: Look for ”??” in output indicating unresolved references
  7. Hyperref last: Load hyperref before cleveref but after most other packages
  8. Backup strategy: Keep label conventions documented for large projects

Troubleshooting

Common cross-referencing issues:
  1. ”??” in output: Reference not found - check label spelling and compile twice
  2. Wrong reference numbers: Labels may have moved - recompile completely
  3. Missing hyperlinks: Ensure hyperref is loaded before cleveref
  4. Broken subfigure refs: Check subcaption package and label placement
  5. cleveref not working: Load after hyperref and other reference packages
  6. External refs failing: Ensure external documents compiled first
  7. Theorem refs wrong: Check theorem numbering and cleveref configuration
  8. PDF bookmarks broken: Check special characters in section titles

Advanced Tips

Conditional References

conditional-references.tex

Custom Reference Macros

custom-ref-macros.tex

Quick Reference

Essential Commands

Compilation Order


Next: Learn about Package management to understand how to find, install, and use LaTeX packages effectively.