I need to display the symbol '^'

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

How do I do that?

up vote 222 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

  • 2
    As for me, in math-mode the best appearance has sequence ^\wedge. Other variants is mostly to small. – serkas Nov 3 '14 at 12:06
  • I have accented letters, but not the symbols ^ and ` on my keyboard. Is there an easy way to input them without switching keyboard (or copy-pasting the symbols from wikipedia)? – Pertinax Mar 24 '17 at 14:51
  • we aslo have $\land$= \land in math mode – Guy Fsone Jul 27 at 16:47

You could also try \textsuperscript{$\wedge$} which yields:

enter image description here

To put this into context, (\textsuperscript{$\wedge$}N225), will yield:

enter image description here

protected by Community Nov 13 '14 at 13:21

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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