I wanted to find a simple way to made degree symbol ° and have tried textcomp and gensymb, but none of them works. I wanted to avoid using ^{\circ}, which isn't nice when you have a long document. I thought may be something easy can be achievable, e.g. \degree?

  • 1
    Have a look at “How to look up a math symbol?” for ideas how you can easily find a particular symbol. Commented Jul 1, 2011 at 21:19
  • 5
    You could define your own \degree using \newcommand{\degree}{$^{\circ}$} or better (using packages xspace and amsmath) \newcommand{\degree}{\ensuremath{{}^{\circ}}\xspace}. However, lockstep's answer might still be preferable. Commented Jul 1, 2011 at 21:24

5 Answers 5


Anything wrong with textcomp's \textdegree?

  • I updated yesterday (TexShop), and made sure my files were intact after that. In fact, even for the first time that I installed it didn't work. @ Martin - Do add the `\newcomand{}...' in the main '.cls' file?
    – BrettHarry
    Commented Jul 1, 2011 at 21:33
  • 2
    @BrettHarry: textcomp is not only a package but also provides fonts (I presume) which complicates the installation. I recommend to install it over the package manager of your TeX distribution. Commented Jul 1, 2011 at 21:37
  • @Martin: OK! Did you mean I install the package first then add the files to folders of the main package? I only get about 4 .sty files of textcomp. Sometimes I'm do wonder how to install different products but end up piling them in folders when they contain the same suffix .e.g all .sty files.
    – BrettHarry
    Commented Jul 1, 2011 at 21:44
  • @BrettHarry: Sorry, I can't help you. I never need to install any fonts by myself. Commented Jul 1, 2011 at 22:25
  • @BrettHarry You work on a mac, so do you install MacTex or BasicTeX? I recommend MacTeX if you begin with TeX. BasicTeX comes only with latin modern font. Commented Jul 2, 2011 at 5:39

Maybe it’s a good alternative to use siunitx

    Works in text \ang{45} an in math $\ang{2.4}$.
    Even with minutes and seconds: \ang{40;12;08}.

It also gives you the oportunity to set all numbers in the same style an change it globally if it’s requested, e. g. changing from period to comma: 1.234 --> 1,234

Edit: To type radians just use the \radian unit. One may likes to define an own macro.

  • For the sake of completeness, is there a way to insert an angle in radians?
    – Dror
    Commented Sep 16, 2012 at 5:12
  • 1
    @Dror: How do you mark radians? As far as I know they are simple decimal numbers (\num{3.14}) or multiples of π ($2\pi/3$), aren’t they?
    – Tobi
    Commented Sep 16, 2012 at 15:47
  • Well, you would like to add the "unit" at the end of the number, as you could just as well have the notion of \pi degrees. Any number can measure either radians or degrees. A more or less standard notation for radians would be something like \mathrm{rad} I guess.
    – Dror
    Commented Sep 18, 2012 at 13:46
  • @Dror: (Sorry for the late reply …) At my university we usually don’t mark radians we just write the number – normally the the context makes clear that an angle is meant. If you like to ad “rad” you may use siunitx’ \radian as shown in my edit.
    – Tobi
    Commented Oct 3, 2012 at 18:59
  • 2
    +1, you could also add \SI{20}{\celsius} as an example if the OP is asking for temperature.
    – quinmars
    Commented Oct 25, 2012 at 21:55

I prefer this solution


because it also works in math mode. (At least for me, \textdegree does not work in math mode, i.e.

$> 30\textdegree$

does not work, but

$> 30\deg$



Using answers from this question, I've had good results with the following code:

\usepackage[utf8]{inputenc} % interpret input as unicode
\usepackage[T1]{fontenc}    % choose main font encoding (Cork)
\usepackage{textcomp}       % additional symbols using companion encoding TS1
\usepackage{gensymb}        % provides macro \degree which works in text and math
\DeclareUnicodeCharacter{00B0}{\degree} % Allow entering ° instead of \degree

As your original question states that gensymb didn't work for you, I assume that either the fontenc or the textcomp lines were missing in your setup, or some part of your TeX installation was missing, as these packages are usually shipped with your TeX distribution. The gensymb package goes to great length to provide its symbols from various sources, so it will behave differently depending on which other packages are loaded. See its documentation for details.


You can cover math and text in one command using \ifmmode:

   {\ifmmode\text{\textdegree C}%
    \else\textdegree C\fi}\xspace%

where \textdegree could be instead be \symbol{"00B0} if you favor unicode.

It may be worth mentioning that \textdegree and $^\circ$ produce different glyphs. The first uses \textdegree (or \symbol{"00B0}) and the second $^\circ$.

The first uses <code>\textdegree</code> (or <code>\symbol{"00B0}</code>) and the second <code>$^\circ$</code>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .