It's as the title says. How can I write ^(caret) in Latex.
If I type something like [^set]
, then the s in set is raised to a power. How can I display [^set] the way it is?
$\wedge$
sorta works but it gives ∧ and not ^.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityUse \string^
that makes the argument category code 12 (other).
\documentclass{article}
\begin{document}
text mode: [\string^set]
math mode: $[\string^set]$
\end{document}
If you're using caret often enough, you can define a shorthand macro for that
\newcommand{\caret}{\string^}
In a simple way:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
this is a caret \^{}which is over a space. % space after \^ is not mandatory
$\hat{ }x+1$
\end{document}
$^{\wedge}\mathrm{set}$