1

I would like to write .^ in latex, in a math expression. I tried using \texttt{.^} but I get

^ only allowed in math mode.

So I tried escaping it \texttt{.^} but this didn't work either. Essentially I would like to write something like a.^ but in latex.

1 Answers1

1

Since .^ seems to be input syntax for the Julia programming language, this may not be the ideal notation in mathematical typesetting. (Mainly because it consists of two symbols next to each other.) If there is no common symbol to represent this operation in mathematical equations, I would recommend inventing an appropriate one. For example

\documentclass{article}

\newcommand\elempow{\mathbin{\hat\cdot}}

\begin{document}

(a \elempow b)

\end{document}

MWE output

schtandard
  • 14,892
  • I would assume that OP is looking to type "In Julia, one would type a.^b". Your example wouldn't make sense to me if I saw it in that context. – Teepeemm Nov 11 '21 at 14:26
  • @Teepeemm in that case it wouldn't, you're right. However, using math mode at all wouldn't make sense then. This would call for a listing package or at the very least \verb. Since OP specified that this should go into math mode, I assume their application is about the mathematics, not the syntax. – schtandard Nov 11 '21 at 15:51