Skip to main content
LaTeX counters control all automatic numbering in your document. This guide covers how to create custom counters, modify existing ones, and implement sophisticated numbering schemes for any document element.
Key concept: LaTeX uses counters to track numbers for sections, figures, tables, equations, and more. Understanding counters lets you create custom numbering schemes and control how elements are numbered throughout your document.Related topics: Page numbering | Cross-referencing | Document structure

Understanding LaTeX Counters

Built-in Counters

LaTeX provides many predefined counters:
viewing-counters.tex

Counter Operations

counter-operations.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

Creating Custom Counters

Basic Counter Creation

custom-counters.tex

Counter Display Formats

counter-formats.tex

Advanced Counter Techniques

Conditional Counter Reset

conditional-reset.tex

Counter Dependencies

counter-dependencies.tex

Custom Numbering Environments

Creating Numbered Environments

numbered-environments.tex

Shared Counter Systems

shared-counters.tex

List Numbering Customization

Custom List Counters

custom-list-numbering.tex

Multi-Level Custom Numbering

multilevel-numbering.tex

Cross-Counter References

Referencing Custom Counters

counter-references.tex

Counter-Based Indexing

counter-indexing.tex

Specialized Numbering Systems

legal-numbering.tex

Scientific Paper Numbering

scientific-numbering.tex

Best Practices

Counter management guidelines:
  1. Plan your numbering scheme - Design consistent hierarchy before implementation
  2. Use descriptive counter names - problem is better than prob or p
  3. Reset appropriately - Child counters should reset when parent increments
  4. Document your system - Comment complex counter relationships
  5. Test thoroughly - Check numbering across document sections
  6. Consider references - Ensure counter formats work well with \ref{}

Professional Counter Setup

professional-counters.tex

Troubleshooting Counters

Common Counter Issues

counter-troubleshooting.tex

Quick Reference

Essential Counter Commands

Counter Display Formats


Next: Learn about Advanced code listings and minted for displaying source code, or explore Headers and footers for additional content placement.