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.

I am trying to restate a theorem environment using theomac.sty which floats around, following a suggestion I received here:

how do I refer back to counters?

The package I downloaded loads well, but whenever I run pdflatex I get the following error:

! You can't use `\spacefactor' in vertical mode.
\@->\spacefactor 
                 \@m 
l.199 \@
        newtheoremWithMacro{replemma}{lemma}

I am confused what it means. I tried following it a bit in google, but it still does not make much sense to me.

Here is the lemma environment my style file defines:

\def\lemmaname{Lemma}
\newtheorem{lemma}{\lemmaname}%[section]
\def\thelemma{\arabic{lemma}}
\def\lemmafont{}
\def\lemmaheadfont{\bfseries}

The theomac style file can be found in: http://cookp.com/thread/1500775/Equation%20kopieren%20referenzieren

can someone identify why I am getting this error? Just a hint as to what it means could be also helpful... I can't find the command spacefactor in either syle files (theomac.sty or the style file that defines theorems.)

share|improve this question
    
solved. had to use \makeatletter and \let command exactly as it appears in cookp.com/thread/1500775/Equation%20kopieren%20referenzieren. –  klew Oct 19 '10 at 4:14
    
please do try to check for this small syntax errors before posting questions. Trying to write down a complete minimal example is also always very helpful. –  Juan A. Navarro Oct 19 '10 at 9:18
add comment

1 Answer

klew commented on his question: had to use \makeatletter and \let command exactly as it appears in cookp.com/thread/1500775/Equation%20kopieren%20referenzieren., where the following snippet appears, in the context of a Latex file that uses packages hyperref and theomac:

% copy the equation-environment to the \myequation-environment:
\let\myequation=\equation
\let\endmyequation=\endequation

% transform the copied environment which also uses the equation-counter
% into such which takes optional argument for defining a macro:

\makeatletter
\@newtheoremWithMacro{myequation}{equation}%
\makeatother

By not expanding the macro \equation when assigning it to \myequation, it allows the macro to be reused in creating a new theorem style.

share|improve this answer
5  
I've posted an answer to this qn, which is one that the original qner solved in order to let it be taken off the Unanswered list. Summarising a solution that has sat in comments for ages is good for the site, since it makes the Unanswered list more useful and improves our site's statistics. –  Charles Stewart Oct 26 '10 at 13:18
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.