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 was trying to add the symbol ^ in the document and getting error. How could I do that

\documentclass{article}
\begin{document}
Hello world
\^
\end{document}

I need to add \,$... to document

share|improve this question
add comment

5 Answers 5

up vote 7 down vote accepted

If you write \^, then tex assumes you’re trying to write a circumflex on top of something and looks for that something. The first thing it finds in your code is the \end of \end{document}, in which case, it doesn’t find an \end{document} command (just {document}).

You can get around this by giving \^ a “null” argument: \^{}. Or, more cumbersomely, you can write \textasciicircum, for a full-size circumflex (in T1, at least).

Different packages offer variants. For instance, the \upp of wsuipa is a little more pointed, from memory.

share|improve this answer
1  
This is incorrect. \end is a single token which would be the argument of \^ in this case. –  David Carlisle Aug 10 '12 at 12:38
2  
\textasciicircum and \^{} are not the same character (given suitable font encoding such as T1) one is a small raised accent character over a null base, The other is (should be) the full sized ascii character –  David Carlisle Aug 10 '12 at 13:20
    
@DavidCarlisle. Thanks very much for those corrections. I’ve worked them into the answer. –  Daniel Harbour Aug 10 '12 at 15:25
add comment

depending what you want to do

\verb|^|   \verb|\|   

or

 \textasciicircum
 \textasciibackslash
 \$

Note \textasciibackslash works better after \usepackage[T1]{fontenc} as the default OT1 encoded fonts do not have this character (except tt) so the character is taken from the math fonts in that case).

share|improve this answer
add comment

You can insert most of the symbols by escaping them with the \: \$, \&, \%, etc. Some have special instructions: \textbackslash for the backslash.

Are you sure you need the ^? Maybe the \wedge is more suitable.

For more symbols, have a look at The Comprehensive LaTeX Symbol List

share|improve this answer
add comment

The "circumflex" accent, ^, is generally meant to be placed above some other character, e.g., e or E. If you want to display it by itself, you must add something like a "null" (empty) group:

\^{}, \^\null 

On methods for displaying some of TeX's other "special-meaning" symbols, see, e.g., Table 1 of the Comprehensive LaTeX symbol list.

share|improve this answer
add comment
\documentclass{article}
\begin{document}
Hello world
$\wedge$,  \textbackslash\, \$
\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.