I have two documents, both starting with
\documentclass{article}
\usepackage{Macros}
\begin{document}
where Macros
is my own style file. There are no other packages or definitions in either of the documents. I have been using this for months without issue. Tonight, one of the documents, after compiling many times without any errors, started throwing
LaTeX Error: Command \G already defined.
Or name \end... illegal, see p.192 of the manual.
where I have \newcommand{\G}{\gamma}
in the file Macros
.
This error normally means that I have tried to use \newcommand
on a command that is already defined, which is very straightforward. The problem tonight is that I can compile the other document without the error, even though it uses exactly the same list of user defined commands. What could possibly cause this?
If I comment out the offending line of Macros.sty then the problem document gives the error
LaTeX Error: Command \G unavailable in encoding OT1.
while the normal document gives the expected
Undefined control sequence.
error.
EDIT: After TeXWorks crashed and I reopened the files, both compiled without any errors, so I believe the problem was within TeXWorks. I am accepting David's answer because it would be helpful if a similar problem appears again, and to show that the problem has been solved.