The accents
package defines command that are not robust: for instance we find
\newcommand\underaccent[2]{%
\begingroup
\def\cc@a{#2}% Stores the nucleous...
\cc@palette\cc@underaccent{#1}% ...and the accent is passed
#2%
\endgroup}
A command like this will not survive being found in a “moving argument” (the argument to \caption
, \chapter
, \section
and similar commands). Defining \ubar
in terms of \underaccent
makes \ubar
share the same fragility.
The package really ought to do
\DeclareRobustCommand\underaccent[2]{%
\begingroup
\def\cc@a{#2}% Stores the nucleous...
\cc@palette\cc@underaccent{#1}% ...and the accent is passed
#2%
\endgroup}
so the problem would disappear.
There are various fixes. The first is putting \protect
in front of the command when it appears in a moving argument:
\caption{$\protect\ubar{\pi}$}
A better fix would be providing the protection to your command
\DeclareRobustCommand{\ubar}[1]{\underaccent{\bar}{#1}}
instead of using \newcommand
.
An even better fix would be to remedy to the glitch in accents
:
\documentclass{article}
\usepackage{fixltx2e}
\usepackage{accents}
\MakeRobust{\underaccent} % make \underaccent not fragile in moving arguments
\newcommand{\ubar}[1]{\underaccent{\bar}{#1}}
\begin{document}
\begin{figure}
\caption{$\ubar{\pi}$}
\end{figure}
\end{document}
Instead of fixltx2e
you can use etoolbox
:
\usepackage{etoolbox}
\usepackage{accents}
\robustify{\underaccent}
would do the same (in a different way).
In the following part of your input,
então deduz que os ângulos $\widehat{\left (OA,AA' \right )}$ e ̂$\widehat{\left ( AA,A'O \right )}$ são iguais
specifically this part:
)}$ e ̂$\widehat
the sequence of Unicode characters between the dollar signs (inclusive) is:
U+0024 DOLLAR SIGN
U+0020 SPACE
U+0065 LATIN SMALL LETTER E
U+0020 SPACE
U+0302 COMBINING CIRCUMFLEX ACCENT
U+0024 DOLLAR SIGN
You may not be able to see it in your editor or here, but if you copy and paste it into a Unicode character viewer like this one, you will be able to see it.
That U+0302 COMBINING CIRCUMFLEX ACCENT is meaningless there, and you probably don't want it. What you want there between (strictly) the dollar signs is probably just e
. With just this change to your input, it works:
\documentclass{article}
\usepackage[utf8]{inputenc}
\begin{document}
Sendo que as tensões de entrada $U_{OA}$ e a de saída $U_{OA'}$ são constantes e iguais e o ângulo projetado entre essas tensões é igual a $7,5^{\circ}$, então deduz que os ângulos $\widehat{\left (OA,AA' \right )}$ e $\widehat{\left ( AA,A'O \right )}$ são iguais a $86,25^{\circ}$, mostrado na figura \ref{diagramafasauto}. Note-se que Co representa a extensão de C (fase c) e OCo a bissetriz do ângulo $\widehat{\left ( OA,AB \right )}$, então o valor do ângulo $\widehat{\left ( OA,OCo \right )}$ é igual a $60^{\circ}$. Deduz-se então o ângulo $\widehat{\left ( OA',OCo \right )}$.
\end{document}
producing:
That solves the problem, but note that without the fix, TeX actually tells you everything you need to know, pointing out the exact character at which there is a problem:
l.5 ...los $\widehat{\left (OA,AA' \right )}$ e ̂
$\widehat{\left ( AA,A'O \...
— the top line is everything that was read before the error happened, and the bottom line is what is not yet read.
A word of advice: you can avoid such super-long lines in your input. TeX (by default) treats a single newline character as equivalent to a space, so you may have an easier time debugging errors (if you don't take time to learn the error-line format) if you have shorter lines. (Of course, long lines are not a problem if you know how to deal with them.)
Best Answer
How about using
{\"u}
instead of\"{u}
?