[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?
This doesn't answer your question directly but it accomplishes
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
------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/
More information about the MacOSX-TeX
mailing list