Degree Symbol in LaTeX

Complete guide to using degree symbols in LaTeX documents for scientific and mathematical writing

4 Methods • Code Examples • Best Practices • Troubleshooting
📖 12 min read 📝 2500 words

Quick Start Guide

$^\circ$

No Package

Quick & Universal

\degree

gensymb

Basic Scientific

\SI{25}{\degreeCelsius}

siunitx

Professional

\textdegree

textcomp

Text Mode

Quick Reference

Basic

$^\circ$

Produces: °

With Package

\degree

Requires: gensymb

SI Units

\degreeCelsius

Requires: siunitx

Methods

Method 1: Superscript Circle (No Package)

The simplest method doesn't require any additional packages:

$25^\circ$C

Produces: 25°C

You can also use it in math mode for angles:

$\theta = 90^\circ$

Produces: θ = 90°

Note: This method works in any LaTeX document without additional packages, but it creates a superscript symbol that may not align perfectly with text.

Method 2: gensymb Package

The gensymb package provides a dedicated degree symbol command:

\usepackage{gensymb}

25\degree C

Produces: 25°C

This method provides a properly aligned degree symbol that works well in both text and math modes.

Method 3: siunitx Package (Recommended)

The siunitx package is the most comprehensive solution for scientific units:

\usepackage{siunitx}

\SI{25}{\degreeCelsius}

Produces: 25°C

It also provides commands for other units:

\SI{90}{\degree}

For angles: 90°

\SI{77}{\degreeFahrenheit}

For Fahrenheit: 77°F

This package also handles proper spacing, automatic unit formatting, and is the recommended approach for scientific documents.

Method 4: textcomp Package

The textcomp package provides additional text symbols:

\usepackage{textcomp}

25\textdegree C

Produces: 25°C

This works well in text mode and provides good typographic quality.

Complete Examples

Basic Document Example

\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{document}

\section{Temperature Conversion}
The temperature is $25^\circ$C.

Water boils at $100^\circ$C and freezes at $0^\circ$C.

\end{document}

Scientific Document Example (siunitx)

\documentclass{article}
\usepackage{siunitx}

\begin{document}

\section{Experimental Results}
\begin{itemize}
    \item Initial temperature: \SI{25.3}{\degreeCelsius}
    \item Final temperature: \SI{98.6}{\degreeCelsius}
    \item Angle of incidence: \SI{45}{\degree}
    \item Angular velocity: \SI{90}{\degree\per\second}
\end{itemize}

\end{document}

Mathematical Example

\documentclass{article}
\usepackage{amsmath}
\usepackage{gensymb}

\begin{document}

\section{Trigonometry}
For a right triangle:
\begin{align}
    \sin(30^\circ) &= \frac{1}{2} \\
    \cos(60^\circ) &= \frac{1}{2} \\
    \tan(45^\circ) &= 1
\end{align}

\end{document}

Method Comparison

Method Package Command Best For
Superscript None $^\circ$ Quick usage, no setup
gensymb gensymb \degree Basic scientific documents
siunitx siunitx \SI{25}{\degreeCelsius} Professional scientific work
textcomp textcomp \textdegree Text mode usage

Common Issues and Solutions

Command Not Found

If you get an "undefined control sequence" error, make sure you've included the required package in your preamble.

\usepackage{gensymb} % or
\usepackage{siunitx} % or
\usepackage{textcomp}

Spacing Issues

The superscript method may create awkward spacing. Use siunitx or gensymb for better typographic quality and automatic spacing.

Font Compatibility

Some fonts may not display the degree symbol correctly. Try different font packages or use XeLaTeX/LuaLaTeX with system fonts if needed.

Best Practices

  • Use siunitx for scientific documents - it provides comprehensive unit handling and proper formatting
  • Use gensymb for basic documents when you don't need full unit formatting
  • Use superscript method only for quick, informal documents or when you can't add packages
  • Be consistent - choose one method and use it throughout your document

Interactive Examples

Common Temperature Expressions

Basic Temperature Range

Room temperature: $22^\circ$C
Body temperature: $37^\circ$C
Boiling point: $100^\circ$C
Freezing point: $0^\circ$C

Output: Room temperature: 22°C, etc.

Scientific Temperature Data

\SI{25.3}{\degreeCelsius}
\SI{98.6}{\degreeFahrenheit}
\SI{-40}{\degreeCelsius}
\SI{373.15}{\kelvin}

Professional formatting with siunitx

Mathematical Applications

% Trigonometry
$\sin(30^\circ) = \frac{1}{2}$
$\cos(60^\circ) = \frac{1}{2}$

% Geometry
$\angle ABC = 90^\circ$
$\theta = 45^\circ$

% Vector notation
$\vec{v} = |v| \angle 30^\circ$

Common mathematical expressions using degree symbols

Advanced Tips & Tricks

Spacing & Formatting

  • Use siunitx for automatic spacing between numbers and units
  • Add thin space with \, between values and degree symbols
  • Use \si{} for standalone units without values

Package Compatibility

  • siunitx works with most modern LaTeX distributions
  • gensymb may conflict with siunitx - choose one
  • textcomp is compatible with most document classes

Additional Resources

Related LaTeX Packages

amsmath

Enhanced math formatting, useful for complex mathematical expressions involving degrees.

amssymb

Additional mathematical symbols, though not specifically for degrees.

xcolor

Color support for highlighting temperature data and visualizations.

tikz

For creating diagrams involving angles and degree measurements.