[OS X TeX] Reflecting numbering in the source

Themis Matsoukas matsoukas at psu.edu
Wed Aug 15 09:47:45 EDT 2007

On Aug 14, 2007, at 12:40 PM, Alain Schremmer wrote:

> I am using
>
> 	\newcounter{eex}[chapter]
> 	\newenvironment{EEXAMPLE}{\textsf{\bfseries{E\smaller{XAMPLE}
> \hspace{1.5mm}}\refstepcounter{eex}\theeex.\hspace{2.5mm}}\small
> \sffamily}{\par}
>
> along with the macro
>
> 	\begin{EEXAMPLE}%
> 	#INS#
> 	\end{EEXAMPLE}
>
> where, for ease of editing, I reflect the example number (eex)
> after \begin{EEXAMPLE}%.
>
> But of course, when I add or remove example(s), I have to adjust
> the example number by hand.
>
> Would there be a way to do this automatically?

essentially what you want: for each example I use a a short tag that
summarizes that example, something like:

\begin{example}{Sample Integration} blah blah \end{example}

The string "Sample Integration", which is also printed in my output,
serves as a convenient tag to locate the example without having to
depend on example numbers, which can change all the time.

Themis