Videos
mathematical notation
You can use
- in text-mode (needs
\textrmor similar in math-mode)\textasciicircumor\^{},
- 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
You could also try
\textsuperscript{$\wedge$}
which yields:
To put this into context, (\textsuperscript{$\wedge$}N225), will yield:
I am currently trying to type this using Latex onto my Notion page. I found out how to do the vector arrow and the subscript. But how do I do the hats on the i and j?
I am sorry if a little more research could have prevented me from posting this. Thanks in advance.
An alternative (and very simple) solution consists in using the package yhmath (which, as far as I was able to understand from its documentation, requires the amsmath package).
With such a package (i.e. the yhmath) a "really" wide hat can be obtained by simply using the very same command
\widehat{}
As a beginner in LaTeX, I find this other possibility a little bit more friendly.
The question wasn't "should it be done?" But, for the same reason men climb mountains, "could it be done?" The answer, with the scalerel package, is yes. Thus, we introduce \reallywidehat [EDITED to add phantom rule below argument, so that baseline of result matches baseline of original argument. RE-EDITED to \ensuremath on the \widthof calculation (thanks to Thruston)]
See also my answer at Serious problem with \widebar for a related approach.
NEW ANSWER WITH stackengine
This answer is an improvement because it handles vertical space much better than the earlier solution.
\documentclass{article}
\usepackage{scalerel,stackengine}
\stackMath
\newcommand\reallywidehat[1]{%
\savestack{\tmpbox}{\stretchto{%
\scaleto{%
\scalerel*[\widthof{\ensuremath{#1}}]{\kern-.6pt\bigwedge\kern-.6pt}%
{\rule[-\textheight/2]{1ex}{\textheight}}%WIDTH-LIMITED BIG WEDGE
}{\textheight}%
}{0.5ex}}%
\stackon[1pt]{#1}{\tmpbox}%
}
\parskip 1ex
\begin{document}
$\reallywidehat{zbcdefghijklm}$
$\reallywidehat{zbcdefghijk}$
$\reallywidehat{zbcdefghi}$
$\reallywidehat{zbcdefg}$
$\reallywidehat{zbcde}$
$\reallywidehat{zbc}$
$\reallywidehat{zb}$
$x\cdot\reallywidehat{a_1+a_2}\cdot y$
\end{document}
ALTERNATE ANSWER USING \mathchar"0362 (the \widehat accent) RATHER THAN \bigwedge
EDITED to use \mathchar"0362 rather than the normal carat accent (\mathchar"305E)
A comment requested this alternate form, which is perhaps superior to the given form above.
\documentclass{article}
\usepackage{scalerel,stackengine}
\stackMath
\newcommand\reallywidehat[1]{%
\savestack{\tmpbox}{\stretchto{%
\scaleto{%
\scalerel*[\widthof{\ensuremath{#1}}]{\kern.1pt\mathchar"0362\kern.1pt}%
{\rule{0ex}{\textheight}}%WIDTH-LIMITED CIRCUMFLEX
}{\textheight}%
}{2.4ex}}%
\stackon[-6.9pt]{#1}{\tmpbox}%
}
\parskip 1ex
\begin{document}
$\reallywidehat{zbcdefghijklm}$
$\reallywidehat{zbcdefghijk}$
$\reallywidehat{zbcdefghi}$
$\reallywidehat{zbcdefg}$
$\reallywidehat{zbcde}$
$\reallywidehat{zbc}$
$\reallywidehat{zb}$
$x\cdot\reallywidehat{a_1+a_2}\cdot y$
$\widehat{zb}$ is actual widehat
\end{document}
EARLIER ANSWER WITH array
\documentclass{article}
\usepackage{scalerel}
\newcommand\reallywidehat[1]{\arraycolsep=0pt\relax%
\begin{array}{c}
\stretchto{
\scaleto{
\scalerel*[\widthof{\ensuremath{#1}}]{\kern-.5pt\bigwedge\kern-.5pt}
{\rule[-\textheight/2]{1ex}{\textheight}} %WIDTH-LIMITED BIG WEDGE
}{\textheight} %
}{0.5ex}\\ % THIS SQUEEZES THE WEDGE TO 0.5ex HEIGHT
#1\\ % THIS STACKS THE WEDGE ATOP THE ARGUMENT
\rule{-1ex}{0ex}
\end{array}
}
\begin{document}
$\reallywidehat{zbcdefghijklm}$
$\reallywidehat{zbcdefghijk}$
$\reallywidehat{zbcdefghi}$
$\reallywidehat{zbcdefg}$
$\reallywidehat{zbcde}$
$\reallywidehat{zbc}$
$\reallywidehat{zb}$
$x\cdot\reallywidehat{a_1+a_2}\cdot y$
\end{document}
