TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What follows is my example doofus.sty:

[2014/01/01 v0.01a LaTeX doofus package]%\filedate\space\fileversion\space 
\typeout{Package doofus, \csname ver@doofus.sty\endcsname%
^^ Copyright (C) 2014 ^^J}




Now the original doofus.tex with multiple commands:


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.

This is a test document for the the doofus boolean example;

Which one appears when I type $\doofus   \doofustwo $?

This returns the following error:

! LaTeX Error: Command \doofus 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.19 ...d{\doofus2}{\textcolor{red}{6\heartsuit}}}
? X
share|improve this question
You can't have numbers in macro names. Well, not easily anyway, so better not to use them. So instead of \newcommand{\doofus2}{...}, use \newcommand{\doofusTwo}{...} and that should work. – Peter Grill Aug 6 '14 at 22:23
@daemondave: Do you really want to write a package? Perhaps you should get the basics first ;-) – Christian Hupfer Aug 6 '14 at 22:28
Hi. thank you, no I really don't want to do packages first but that's what I need to do... – daemondave Aug 6 '14 at 23:56
It would still be more effective not to start by trying to create packages. (Quicker, more efficient, better results if you start simpler.) Note that you do not need \makeatletter for \usepackage commands. – cfr Aug 7 '14 at 1:43

Your Answer


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

Browse other questions tagged or ask your own question.