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 need to display the symbol '^'

d <- dist(fascores, method = "euclidean")^2

How do I do that?

share|improve this question
    
Answers from How to look up a symbol are valid in this case. However, there are more options for circumflex than for most symbols ;) –  tohecz Feb 25 '13 at 8:01

1 Answer 1

up vote 50 down vote accepted

You can use

  • in text-mode (needs \textrm or similar in math-mode)
    • \textasciicircum or
    • \^{},
  • in math-mode
    • \hat{} (only this produces a circumflex),
    • \widehat{}, or
    • \wedge (∧).
  • in a verb-like manner

    • \string^,
    • \char`\^,
    • \verb!^!:

      \verb!d <- dist(fascores, method = "euclidean")^2!
      

Overview

Code

\documentclass{standalone}
\usepackage{upquote}% getting the right grave ` (and not ‘)!
\begin{document}
\begin{tabular}{lcc}
    Input                   &       Text       &                 Math                  \\ \hline
    \verb|\string^|         &     \string^     &              $\string^$               \\
    \verb|\char`\^|         &     \char`\^     &              $\char`\^$               \\
    \verb|\verb!^!|         &     \verb!^!     &              $\verb!^!$               \\ \hline
    \verb|\textasciicircum| & \textasciicircum &                  ---                  \\
    \verb|\^{}|             & \^{} (e.g. \^a)  &                  ---                  \\ \hline
    \verb|\hat{}|           &       ---        &       $\hat{}$ (e.g. $\hat a$)        \\
    \verb|\wedge|           &       ---        &      $\wedge$ (e.g. $a\wedge b$)      \\
    \verb|\widehat{}|       &       ---        & $\widehat{\ }$ (e.g. $\widehat{abc}$) \\
\end{tabular}
\end{document}

Output

enter image description here

share|improve this answer

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.