323

I need to display the symbol '^'

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

How do I do that?

2

3 Answers 3

425

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

4
  • 5
    As for me, in math-mode the best appearance has sequence ^\wedge. Other variants is mostly to small.
    – serkas
    Commented Nov 3, 2014 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
    Commented Mar 24, 2017 at 14:51
  • we aslo have $\land$= \land in math mode
    – Guy Fsone
    Commented Jul 27, 2018 at 16:47
  • What is the documentclass standalone?
    – Someone
    Commented Apr 17, 2020 at 14:46
13

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

2
  • 1
    Or, simply, $^\wedge$
    – Dinei
    Commented Sep 24, 2020 at 23:27
  • 1
    @Dinei $^\wedge$ does not make it superscript Commented Dec 7, 2022 at 13:10
4

For those of you trying to do the ^^ smiley, here is a comparison of various methods (the first is \textsuperscript, the second is \^, the third is a scaled version of \wedge in superscript, and the last one is the second solution stretched on the y axis, with some fine tuning to have a better spacing: therefore it may need some tuning if you use different fonts):

enter image description here

Compare
\textasciicircum{}\textasciicircum{}
with
\^{}\^{}
or
\scalebox{.8}{\textsuperscript{$\wedge\wedge$}}
or the configurable % change the value in raisebox and in kern to change the spacing and the optional argument of scalebox to change the x/y ratio.
\raisebox{0pt}[\height][0pt]{\raisebox{-1.7ex}{\scalebox{1}[2]{\^{}\kern-.05em\^{}}}}.

You must log in to answer this question.

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