I need to display the symbol '^'
d <- dist(fascores, method = "euclidean")^2
How do I do that?
I need to display the symbol '^'
d <- dist(fascores, method = "euclidean")^2
How do I do that?
\textrm
or similar in math-mode)
\textasciicircum
or\^{}
,\hat{}
(only this produces a circumflex),\widehat{}
, or\wedge
(∧).in a verb-like manner
\string^
,\char`\^
,\verb!^!
:
\verb!d <- dist(fascores, method = "euclidean")^2!
\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}
^\wedge
. Other variants is mostly to small.
You could also try
\textsuperscript{$\wedge$}
which yields:
To put this into context, (\textsuperscript{$\wedge$}N225),
will yield:
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):
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\^{}}}}.