6

I would like to make some equation numbers (that will be defined ad hoc) bold, while others are not. I can only figure out how to make all bold or unbold, not what I am looking for.

\documentclass[leqno]{book}
\usepackage{amsmath,amssymb,amsthm, amscd}
\usepackage[a4paper, textwidth=39cm, margin=1.2in, vmargin=3cm, marginparsep=20pt, marginparwidth=.6in,]{geometry} 
\usepackage{fancyhdr}
%\renewcommand\theequation{\bfseries\thesection.\arabic{equation}}
\begin{document}

\begin{equation}
x-y=z
\end{equation}

\begin{equation}
a+b=c
\end{equation}

\end{document}
Werner
  • 603,163
Valutone
  • 61
  • 1
  • 3
  • How do you want to deal with cross-references to various equations: should the cross=refs also appear in bold in case the equation numbers of the corresponding equations happened to be set in bold? – Mico Sep 04 '14 at 00:44

2 Answers2

5

As far as I am aware, the only way to do this is to keep on turning bold off and on every time that you want to do this. The cleanest solution would be to define a new version of equation that automatically makes the equation number bold:

\documentclass{article}
\begin{document}

\renewcommand\theequation{\thesection.\arabic{equation}}
\newenvironment{boldequation}{\renewcommand\theequation{\textbf{\thesection.\arabic{equation}}}\equation}
   {\endequation}

\begin{boldequation} 1+1=2 \end{boldequation}

\begin{equation} 1+1=2 \end{equation}

\end{document}

which gives:

enter image description here

Alternatively, a cruder way of doing this is using "switches" like:

\documentclass{article}
\begin{document}

\newcommand\boldequations{\renewcommand\theequation{\textbf{\thesection.\arabic{equation}}}}
\newcommand\normalequations{\renewcommand\theequation{\thesection.\arabic{equation}}}

\boldequations
\begin{equation} 1+1=2 \end{equation}

\normalequations
\begin{equation} 1+1=2 \end{equation}

\end{document}

The output is the same.

  • 2
    You also can define a \newtagform{bold} that define equation numbers as bold, and write in your equation \usetagform{bold}. This requires only the mathtools package that you may already use. – Bernard Sep 03 '14 at 23:44
  • @Bernard Yours is more than a comment – egreg Sep 04 '14 at 06:54
4

Let me detail my comment: the mathtools package defines \(re)newtagform commands that help define tag ‘styles’. Then \usetagform{name} is a switch to be used outside a math environment. You may go back to the usual style with \usetagform{default}.

In addition, I define a command that allows to change the tag style for one equation of a multiline group of equations in order to, say, emphasize that particular equation. The definition of this command is not generic, as \usetagstyle will not work in this context, so that you will have to change its definition if you want to change the style.

Here is an example:

\documentclass[12pt,a5paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{xcolor}

\newtagform{coloured}[\bfseries]{\color{red}(}{\mdseries)}
\newcommand\boldtag{\refstepcounter{equation}\tag*{(\textbf{\color{red}\theequation})}}

\begin{document}

\usetagform{coloured}
\begin{align}
 a & = b + c \\
 a^2 & = b^2 + c^2
\end{align}

\usetagform{default}

\begin{align}
 a & = b + c \\
 a^2 & = b^2 + c^2 \boldtag \\
 a^3 & =b^3 + c^3
\end{align}

\end{document} 

enter image description here

Bernard
  • 271,350