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.

Maybe what I want is sinful, but let me explain:

I use aligned* environments, because I usually don't need equation numbers. When I need one, I use \addtocounter{equation}{1}\tag{\theequation} from align* but show one equation number at the end.

Furthermore, I don't use the proof environment, but just set my own tombstones at the end of equations. In align* this works nicely with \tag*{\qedsymbol}.

Now I need one equation number for a whole set of equations, like in How to get only one vertically centered equation number in align environment with two equations, but still want my self-made tombstone. I like the split solution, but all solutions clash with either my tombstone or my equation numbering.

Here is an MWE (or rather not, since the tombstone is missing):

\documentclass{article}
\usepackage{amsmath}
\newcommand\numberthis{\addtocounter{equation}{1}\tag{\theequation}}
\def\tombstone{\tag*{\qedsymbol}}
\begin{document}

\begin{align*}
\begin{split}
T(n)              = {} & 2T(n/2) + 3n/2  \\
                    {} & \vdots \\
                  = {} & 3n/2 \cdot \log_2n .   %\tombstone
\end{split} \label{fftcost} \numberthis 
\end{align*}

\end{document}

Can anybody tell me how to get one equation number for all equations and still have my tombstone?

share|improve this question

1 Answer 1

Takes a bit of work but I like this one better. Not a big fan of those home made tombstone constructions.

\documentclass{article}
\usepackage{amsmath,amssymb,mathtools}
\usepackage[ntheorem]{empheq}
\usepackage[amsmath,thmmarks]{ntheorem}
\theoremstyle{nonumberplain}
\theoremheaderfont{\normalfont\itshape}
\theorembodyfont{\normalfont}
\theoremsymbol{\ensuremath\square}
\newtheorem{proof}{Proof}
\begin{document}
\begin{proof}
\begin{empheq}{gather}
\begin{split}
T(n)              = {} & 2T(n/2) + 3n/2  \\
{} & \vdots \\
= {} & 3n/2 \cdot \log_2n .  %\tombstone
\end{split} \label{fftcost}
\end{empheq}
\end{proof}
\end{document}

enter image description here

ntheorem has some placing issues on some cases, but empheq fixes those. One cannot use \intertext inside empheq though

share|improve this answer
    
there's a reason why ams document classes default to having equation numbers on the left. –  barbara beeton Jun 21 '13 at 15:32
    
Sorry Barbara, but I don't know anyone who likes having the numbers on the left. It disrupts the natural reading flow. –  daleif Jun 24 '13 at 8:10

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.