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.

Possible Duplicate:
Changing the apperance of equation numbers with amsmath

I need to be able to make the labels of equations bold, but at the same time I need the citations to those equations to have normal style in the rest of the text.

Here is what I tried:

\let\theoldequation\theequation 
\renewcommand*{\theequation}{\textbf{\theoldequation}} % bold equation numbers

and this (using etoolbox package)

\pretocmd{\theequation}{\textbf}{}{}

Output:

enter image description here

To solve this, I googled a lot, and could only come up with the following trials:

\renewcommand{\eqref}[1]{\textnormal{(\ref{#1})}}

and

\let\oldeqref\eqref
\renewcommand*{\eqref}{\textnormal{\oldeqref}} % bold equation numbers

and

\pretocmd{\eqref}{\textnormal}{}{}

and the last one:

\patchcmd{\eqref}{\textbf}{\textnormal}{}{}

But none yielded what I am required to do. Can you give a solution to this problem?

share|improve this question

marked as duplicate by Joseph Wright Sep 1 '12 at 7:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
@cmhughes Thank you for pointing out the other related question. With the last statement in that question added, mine looks pretty much like a duplicate. Even though I did a thorough search, it seems I had failed to find that. Should I do anything for this? –  ciuncan Aug 30 '12 at 20:57
    
no harm done. You might approach one of the moderators in the chat room; I'll flag it for one of them to view –  cmhughes Aug 30 '12 at 21:02
1  
@cmhughes I've closed as a duplicate here as requested. I can merge if you want: that will move the answer here to the duplicate question, and this question will 'vanish'. We don't normally do that, as the OP then looses the rep they get from the question part. So I'm minded to leave this as-is. –  Joseph Wright Sep 1 '12 at 7:45
    
@JosephWright Thank you for your consideration. I don't mind removing my question. Please feel free to take necessary actions. But this question seems to be more direct to the topic and could be useful. So I think, it might be left as-is as well. –  ciuncan Sep 3 '12 at 11:09

2 Answers 2

up vote 7 down vote accepted

If you are using amsmath and \eqref, you need to redefine \tagform@ and \eqref to have both the label and parentheses in bold face:

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\def\tagform@#1{\maketag@@@{\bfseries(\ignorespaces#1\unskip\@@italiccorr)}}
\renewcommand{\eqref}[1]{\textup{{\normalfont(\ref{#1}}\normalfont)}}
\makeatother

\begin{document}

\begin{equation}\label{eq:test}
a + b = c.
\end{equation}

See equation~\eqref{eq:test}

\end{document}

enter image description here

If only the label needs to be boldfaced, then you can say:

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\def\tagform@#1{\maketag@@@{(\ignorespaces\textbf{#1}\unskip\@@italiccorr)}}
\renewcommand{\eqref}[1]{\textup{{\normalfont(\ref{#1}}\normalfont)}}
\makeatother

\begin{document}

\begin{equation}\label{eq:test}
a + b = c.
\end{equation}

See equation~\eqref{eq:test}

\end{document}

enter image description here

share|improve this answer
    
Thank you very much for this solution, it worked like a charm! I wish I could give up vote, need 4 to go. :) –  ciuncan Aug 29 '12 at 22:18
1  
@ciuncan there was a little mistake in the redefinitions, but now I've corrected it in my updated answer. –  Gonzalo Medina Aug 29 '12 at 22:29
    
Thanks again, I saw the correction, and applied it. Went with your second code fragment. –  ciuncan Aug 29 '12 at 22:54
1  
The package mathtools offers a convenient user-command for this: \newtagform{bold}[\textbf]{(}{)}\usetagform{bold} –  cgnieder Aug 30 '12 at 6:40

Redefine \@eqnnum. (EDIT: As Torbjørn T. points out, this doesn't work if, as the OP, one uses amsmath.)

\documentclass{article}

\makeatletter
\def\@eqnnum{{\normalfont\normalcolor\bfseries(\theequation)}}
\makeatother

\begin{document}

\begin{equation}\label{eq:test}
a^2 + b^2 = c^2
\end{equation}

See equation~\ref{eq:test}.

\end{document}

enter image description here

share|improve this answer
2  
Considering \eqref, the OP is perhaps using amsmath, in which case this doesn't seem to work. –  Torbjørn T. Aug 29 '12 at 21:54
    
Thank you for your answer. But as @TorbjørnT. stated, unfortunately nothing changed. Is there an `amsmath' way to do this? –  ciuncan Aug 29 '12 at 21:57

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