I am on overleaf where I can switch the compiler that I use. I am working on a poster and require the use of LuaLatex as a compiler. However, the line "\DeclareUnicodeCharacter{2212}{-}" causes "undefined control sequence" error.
I will give an example to illustrate my point.
\documentclass[pt]{beamer}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}
\usepackage{upgreek}
\usepackage{mathtools}
\usetheme{Berlin}
\DeclareUnicodeCharacter{2212}{-}
\begin{document}
\begin{frame}{Example}
The equation is
\begin{equation}
y=mx+c
\end{equation}
\end{frame}
\end{document}
It compiles fine when I choose the "pdfLatex" compiler but breaks when I use the "LuaLatex" compiler. Is there an alternative line (to \DeclareUnicodeCharacter{2212}{-}) that I can use for the LuaLatex compiler? Thanks.
inputenc
andfontenc
packages; instead, load thefontspec
package.−
directlyutf8
has been the default option for theinputenc
package for several years now. (BTW, it's "Mico", not "Micro"...)