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.

This question already has an answer here:

I'm using amsmath and amsfonts to typeset my homework, and since it will be read on a screen, I would like to make \tag{comments inside equations} differently colored, and optimally downsize them by a few points.

While I could put \color and font instructions in every \tag instance, I've got them scattered all over the place and would like a unified way to change it globally. I have figured out how to use the sectsty package to color all section fonts to make them stand out on-screen slightly, is there a similar method for amsmath's align environment and tags?

Forgive my extreme TeX ignorance. Also forgive my math ignorance... here's some sample stuff:

\begin{align*}
A &= B
\\ &=
\frac{B}{\text{sometimes the equation gets really long so the tag goes on the next line}}
\tag{Here is where I say something stupid}
\\ &=
\frac{1}{0} = \infty
\tag{Tags often include math, like $\frac{\sin \theta}{\theta}$}
\end{align*}
share|improve this question

marked as duplicate by Andrew Swann, cmhughes, karlkoeller, Claudio Fiandrino, Thorsten Oct 1 '13 at 7:11

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.

2  
This question is very similar to Formatting equation numbers. The idea would be to redefine \tagform@ and insert something like \color{red}. Does this answer your question? –  Werner Sep 20 '13 at 17:12
2  
You really should not be using \tag for comments. That is not considered proper style on paper. It is fine in pen and paper or on a blackboard but should be avoided in typeset form. –  daleif Sep 20 '13 at 18:34
    
@daleif: In this case, what would you recommend for annotating long chains of aligned equations then? –  Dan Fitch Sep 20 '13 at 20:12
    
@Werner: I'm not enough of a wizard to understand the redefine solution, but I think the other post there about mathtools is going to lead to an easy solution - thanks! –  Dan Fitch Sep 20 '13 at 20:14
1  
You might see tex.stackexchange.com/q/27283/15925 for putting side comments on calculations –  Andrew Swann Sep 23 '13 at 18:01

1 Answer 1

Despite this not being "proper style", Werner's comment led me to mathtools, which lets you do:

\usepackage{mathtools}
\newtagform{blue}[\color{blue}]{(}{)}
\usetagform{blue}

Works well enough, less confusing to a newbie like me than redefining tagform:

\makeatletter
\def\tagform@#1{\maketag@@@{\color{blue}(\ignorespaces#1\unskip\@@italiccorr)}}
\makeatother

which also works.

(I'm actually just attempting to ape the little blue right-margin comments in the Thomas' Calculus text.)

share|improve this answer

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