2

I have a package conflict resulting from a custom command in an .sty file I am using. The command looks like this:

`\newcommand\NG[1]{Gram.: {#1}}%Note Grammar

Now, if I run pdflatex it gives me the following error message:!

LaTeX Error: Command \NG already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.38 \newcommand\NG[1]{Gram.: {#1}}
                                   %Note Grammar
? 

Obviously, because \NG already gives me the large hooked N symbol. Is there a fast and simple way to deactivate the symbol command. I don't need the symbol, I do; however, need the custom command. Unfortunately; I don't know which package the clash is caused by, although I would guess either babel, inputenc, or tipa. Here's a list of what I use:

\documentclass[12pt]{article}

\usepackage[a4paper, margin=1.3cm, twocolumn, columnsep=.3cm, driver=dvips]{geometry}

\usepackage{dict}%use the style file
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tipa}
\usepackage[T1]{fontenc}
\usepackage{paralist}%for the \compactdesc environment
\usepackage{tgtermes}
\usepackage{pdfpages}

Thanks in advance

  • Don't use \NG for that, change the name for your macro. You'll regret disabling the standard \NG command as soon as an author of a paper you cite has a name containing Ŋ. – egreg Apr 15 '15 at 11:06
  • The \NG marker comes from a perl script, I could change it there, but I don't want to, for reasons of consistency. I can determine; however, that I will not be needing Ŋ. – Lucas Apr 15 '15 at 11:15
1

If you know you want your command simply use

\renewcommand\NG

instead of

\newcommand\NG

\NG is defined in the latex format, not in any of the packages you load, so apply some caution before defining standard latex commands....

  • This gives me an output without an errormessage. But unfortunately with Ŋ, rather than with what I defined \NG to be (namely: Gram.: {#1}). Are we talking about changing \newcommand into \renewcommand within the .sty file? – Lucas Apr 15 '15 at 11:21
  • @Lucas Hard to say without a usable example, but if you load your dict.sty after fontenc I don't see why it shouldn't work – David Carlisle Apr 15 '15 at 11:23
  • Loading it after fontenc did the trick. Thanks a lot David! Solved! – Lucas Apr 15 '15 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.