Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Somewhere in my document, I have a

\newcommand{\macomm}{blabla}

Later, I would like to define a TeX macro with the same name:

\def\macomm{blabla} 

So my questions:

  1. Is it possible?
  2. Will this make any problem?
  3. Should/can I "kill" the definition of the command, before defining the TeX macro?
share|improve this question
3  
If you do \def\macomm{...} inside a group, when the group ends the previous definition will be restored. –  egreg Jun 12 '12 at 8:29
1  
\def overwrites an existing definition. No need to kill it before. –  cgnieder Jun 12 '12 at 8:30
5  
TeX macros and LaTeX commands are the same thing, in that \newcommand{\foo}{bar} and \def\foo{bar} both create a macro called \foo with expansion bar. See What is the difference between \def and \newcommand? –  Joseph Wright Jun 12 '12 at 8:30
add comment

1 Answer

up vote 6 down vote accepted
  1. Yes

  2. The \def will overwrite without warning the previous meaning of \macomm. Only you can decide if this is a problem.

  3. The \def already "kills" the previous definition.

The main question is why you want to use TeX-syntax in the second case. Why don't you use \renewcommand\macomm{blub}?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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