Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I try to add a center dot with \circ but it fails to compile. How to use maths symbol in text mode? The error message is

ovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian, 
welsh, loaded.
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/size10.clo))
(./untitled-1.aux)
! Missing $ inserted.
<inserted text> 
            $
share|improve this question

migrated from stackoverflow.com Mar 11 '13 at 11:20

This question came from our site for professional and enthusiast programmers.

4  
Welcome to TeX.sx! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. –  Torbjørn T. Mar 11 '13 at 11:25

3 Answers 3

By default LaTeX is in text mode. In LaTeX all mathematics needs to be inside some maths mode contruction and many symbols, including \circ, are defined to only work in maths mode.

As the other anwsers show the standard way to cope with this is to place \circ between dollar signs: $\circ$. An alternative, that may become the default in future, is to use \( \circ \). Single dollar $ toggles between math and text mode; \( switches to maths mode from text mode and issues an error otherwise. See Are \( and \) preferable to dollar signs for math mode? for some discussion.

(Another choice that could be useful is \ensuremath{\circ}, but this is more a programming construction.)

On the other hand \circ may not be producing the symbol you wish. A simple dot that is vertically centered is produced by \cdot:

Sample output

\documentclass{article}

\begin{document}
Some text \( \circ \) and more and a centered dot \( \cdot \) and more.
\end{document}

See How to look up a symbol? for discussion on finding symbols. Note that you will find that some symbols have variants starting with \text... that can be legitimately used in text mode.

share|improve this answer
    
Why can the \ldots work in text mode while \cdots cannot? –  In PSTricks we trust Mar 11 '13 at 15:19
1  
In standard LaTeX \ldots is \dots is \ifmmode\mathellipsis\else\textellipsis\fi so has a text and math version. On the other hand \cdots is \mathinner{\cdotp\cdotp\cdotp} a math only construction. (Additionally \cdotp is {\mathpunct}{symbols}{"01}, \cdot is {\mathbin}{symbols}{"01}, also math constructions.) –  Andrew Swann Mar 11 '13 at 15:35
    
OK. Thank you.. –  In PSTricks we trust Mar 11 '13 at 15:59
    
With the textcomp package there is \textperiodcenter –  egreg Mar 11 '13 at 18:41
    
@egreg Oh, yes - and \textopenbullet - I which one the poster wanted.? –  Andrew Swann Mar 11 '13 at 18:48

You can enclose math in between dollar signs, like this:

some text $\circ$ more text.

or

some text $E=MC^2$ more text.

or

some text $\hat x$ more text.
share|improve this answer

You need to enclose it in $...$. Try $\circ$.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.