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

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

Standard Naming Convention

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

Equation References

Subfigure References

The cleveref Package

Smart Automatic References

Customizing cleveref

Advanced cleveref Features

Hyperref Integration

Clickable References

PDF Bookmarks and Metadata

Special Reference Types

Theorem Environments

Algorithm References

Cross-document References

External References with xr Package

Managing Large Documents

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

Custom Reference Macros

Quick Reference

Essential Commands

Compilation Order


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