# Missing $inserted: Cannot find my error I am getting the following error message: Missing$ inserted. ...bord, le premier phaseur U1 est égal à Ue^

… but I cannot find my mistake. I would therefore appreciate your help !

% !TeX program = lualatex
\documentclass{article}%

\usepackage[utf8x]{inputenc}%
\usepackage{lmodern}%
\usepackage{textcomp}%
\usepackage{lastpage}%
\usepackage{hyperref}%
\usepackage{bm}
%
\usepackage{needspace}%
\usepackage{textcomp}%
\usepackage{graphicx, array}%
\usepackage{textalpha} % <--- Greek letters in text
%
\usepackage{geometry}
\usepackage{babel}
\usepackage{fontspec}
\usepackage{amssymb} % <----  for real number symbol (R)
\setmainfont{DejaVu Serif}
\setsansfont{DejaVu Sans}
\setmonofont{DejaVu Sans Mono}

\begin{document}%

Ue^{(j$\alpha$ )}. Je laisse volontairement l'angle $\alpha$

\end{document}


EDIT:

I have this:

Ue^(jα)


And I want to automatically transcribe it to Latex code... so I replace all greec letters with their math mode equivalent (i.e. $\alpha$)

• Ue^(j$\alpha$ ) is not allowed, try $Ue^{(j\alpha )}$ instead. There is some room for further improvement. – marmot May 2 at 19:40
• \dots should be in math mode, isn't it? – manooooh May 2 at 19:40
• @marmot It's actually like that in my text ? Ue^(j$\alpha$ ) – henry May 2 at 19:41
• @manooooh I tried to add $ but it does not change it. – henry May 2 at 19:42 • Then load amsmath and do $\text{Ue}^{(\text{j}\alpha )}$. – marmot May 2 at 19:42 ## 1 Answer Most likely this is a duplicate of something but since you explicitly asked to write an answer, here it is. ^ is not allowed in text mode, but \textsuperscript is. So you could (with your preamble) either do  Ue\textsuperscript{(j$\alpha$)}. Je laisse volontairement l'angle$\alpha\$


or, since you load textgreek, avoid math mode altogether

Ue\textsuperscript{(j\textalpha )}. Je laisse volontairement l'angle \textalpha


• Very nice answer ! Thank you for also mentioning textgreek. – henry May 2 at 20:01