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 know that I can change the font for the equation numbers by redefining the \theequation command by, say,

\renewcommand{\theequation}{{\sffamily\arabic{equation}}}

I am wondering if there's a better way of doing this. The reason I ask is because if I include the section number to the equation numbers using the following amsmath command

\numberwithin{equation}{section}

then this will nullify the previous redefinition. Of course an obvious solution for this is to just use

\renewcommand{\theequation}{{\sffamily\thesection.\arabic{equation}}}

but I am curious if there's another way.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

I think your obvious solution is the right way to go. There's certainly no harm in it.

share|improve this answer
    
I agree; I read the amsmath package manual and it seems the "obvious solution" I mentioned is the most basic approach. Thanks. –  user11126 Aug 27 '10 at 2:05
    
Unfortunately this does not change the font of the brackets around the number. –  mritz_p Apr 8 at 16:45

You could use the \pretocmd command of the etoolbox package to insert code at the beginning of \theequation (and leave the rest of its definition unchanged).

\usepackage{etoolbox}
\pretocmd{\theequation}{\sffamily}{}{}

(The code snipped must be placed after using \numberwithin and the like.)

share|improve this answer

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.