2

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.

3
  • Could we have a pair of minimal (non)working examples?
    – Bernard
    Oct 12, 2014 at 0:33
  • I sent the full files to a friend in the meantime, and they both worked for him. I unplugged my external monitor to get a better screenshot of the error message I had, and my LaTeX editor crashed. When I reloaded it everything works fine. I will edit my question appropriately.
    – Zach
    Oct 12, 2014 at 0:43
  • 4
    This question appears to be off-topic because the error appears to be caused by hardware issue not related to TeX and friends.
    – Mico
    Oct 12, 2014 at 0:49

1 Answer 1

3

Something is defining \G so you can insert

\show\G

at several points in your document or package and at each tex will stop and show the definition.

The error message indicates that \G has an encoding specific command definition. My local tex tree has the following possibilities

allrunes/ara.fd:\DeclareTextSymbol{\G}{LRA}{167}
fc/t4enc.def:\DeclareTextAccent{\G}{T4}{'237}% double grave accent
hyperref/puenc.def:\DeclareTextCommand{\G}{PU}[1]{#1\83\017}% U+030F
teubner/teubner.sty:\DeclareTextCommand{\G}{\GRencoding@name}[1]{\lift@accent{96}{#1}}

So you must be loading a definition similar to one of these.

1
  • The error stopped on its own (see comment above), so I can't check that anymore. I will keep \show in mind though, thanks.
    – Zach
    Oct 12, 2014 at 0:43

Not the answer you're looking for? Browse other questions tagged .