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 need many of my equations to have annotations stating their domain of validity, or certain conditions for which the equation is true. Preferably, these would be flush right against the equation number, and would otherwise not affect the alignment of the equation content. I would like to be able to write something like

\begin{equation}
  \sigma_{(j)}\, i = i\, \sigma_{(j)}
  \Domain{C_{1,3}}
\end{equation}

and have it set $C_{1,3}$ just before the equation number (maybe separated by a quad, say). I'm thinking maybe \Domain could temporarily redefine the \tag command (or whatever actually places the number on the line) in this equation, but I can't figure out how to do it. In particular, some equations won't have a \Domain command, and shouldn't set anything next to the equation number.

I found a very similar question in this forum, which suggested something that looks right in the equation itself:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
  \label{commutation}
  \sigma_{(j)}\, i = i\, \sigma_{(j)}
  \stepcounter{equation}
  \tag*{$C_{1,3}\quad$(\theequation)}
\end{equation}
References come out wrong, as when Eq.~\ref{commutation} is
referenced.
\end{document}

As the example points out, however, the reference to the equation number in the text comes out as $C_{1,3}\quad$(\theequation), rather than just (\theequation).

The amsmath documentation itself suggests using an align environment for this sort of thing, but that's unacceptable. (Also, if it makes any difference, I'm actually using revtex4-1, rather than article.)

share|improve this question
    
I believe that you should simply add the condition to the side of the equation, separated by two quads. –  egreg May 14 '13 at 15:47
    
But I'd like it to be set just before the equation number, and not affect the alignment of the equation itself. My reasoning is that I don't want the condition to distract from the content of the equation. With quads, it sort of gives equal weight to the content and the condition. –  Mike May 14 '13 at 15:49
    
Just an opinion, but the condition seems to make integral part of the equation, doesn't it? –  egreg May 14 '13 at 15:50
    
Yeah, but the reader should be in the mindset of working in $C_{1,3}$ for this entire section, and thus shouldn't be burdened with frequent distractions. On the other hand, if the reader refers back to this equation from the section on $C_{2,4}$, it needs to be made clear that the equation does not necessarily apply. –  Mike May 14 '13 at 15:54
    
I was even thinking that the text from \Domain should be slightly greyed out, so that the information is there if you need it, but doesn't make you feel like you need to read or think about it every time. –  Mike May 14 '13 at 16:07

1 Answer 1

up vote 4 down vote accepted

This will over-print the equation if the equation gets too big.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\makeatletter
\def\maketag@@@#1{\@Domain\hbox{\m@th\normalfont#1}}
\def\Domain#1{\def\@Domain{\llap{$#1$\quad}}}
\Domain{}
\makeatother

\begin{document}
\begin{equation}
  \label{commutation}
  \sigma_{(j)}\, i = i\, \sigma_{(j)}
  \Domain{C_{1,3}}
\end{equation}
References come out wrong, as when Eq.~\ref{commutation} is
referenced.
\end{document}
share|improve this answer
    
References come out right! :) I don't think I would have found \maketag@@@, even using \show. Did you just know that from experience, or is there some method to finding these things efficiently? –  Mike May 14 '13 at 17:51
1  
@Mike guess that is experience:-) see –  David Carlisle May 14 '13 at 18:01

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.