[texhax] labeling things

Ross Moore ross at ics.mq.edu.au
Sun Sep 21 10:59:30 CEST 2003

Hello Joe,

On Sat, 20 Sep 2003, Joe Corneli wrote:

> I would like these lines to be numbered. I would be happy to dispense
> with the bullets if there were numbers instead (and I'm sure I could
> figure out how to do this with the list environment), but both bullets
> to the left and numbers to the right seems like an even more attractive
> option, and I'm not so sure I could figure out how to do that one.  My
> guess is to base the new environment on tabular instead of list.

You should be able to keep it based upon a list-environment.
All the required mark-up points are available:

 ...coding to affect the environment layout and counter
  incl.  \usecounter{myfancycounter} ...
  increase the \rightmargin to allow room for stuff to be put there
  re-define \item to act in a special way, within this env.
 {.... close-off the last item, and then the whole env...}

hack the \item  command to:
 1. check the value of {myfancycounter} and close-off the previous
    item, if there is one (i.e counter > 0);
 2. increment {myfancycounter}    (should happen anyway in 3.)
 3. do what \item normally does

By "close-off the previous item", I mean that
 \item can be redefined to insert something like:
   \hfill\rlap{ ...representation of counter-value...}

where stuff is now put nicely aligned on the right, and
where \realitem has been established by   \let\realitem\item
before you impose a new definition for \item .

> Also I would like to have each item be automatically labelled with
> something meaningful, like topology1, topology2, etc.  This is probably
> as easy as changing the definition of the environment something like
> this:
> \defn{topology}{
> \item $X$ set \\
> \item $t = \{U_{\alpha} \pipe U_{\alpha} \subset X\}$\\
> \item $\phi \in t$
> \item $X \in t$
> \item $\{V_i\}_{i=1}^n \subset t \Rightarrow \cap_1^n V_i \in t$ \\
> \item $\{V_{\alpha}\}_{\alpha \in I} \subset t \Rightarrow \cup_{\alpha} V_{\alpha} \in t$}

Why do you need \defn to have 2 arguments here ?
The style adjustments needed for the contents of the 2nd argument
should have been imposed by the outer environment;
  e.g. {myfancycounter} -->  \myfancycounter
which closes with
       \endmyfancycounter  to clean-up anything that remains
to be done at the end.

> and then fiddling around with counters.
> Anyway, it looks like if I want to do this I will have some happy
> hours  figuring out how -- but if you have thoughts about it that
> may give me a head start!

Hopefully this will help you find an elegant solution.

Best regards

	Ross Moore

> Cheers,
> Joe
> _______________________________________________
> TeX FAQ: http://faq.tug.org/
> TeX newsgroup: http://groups.google.com/groups?group=comp.text.tex
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org

More information about the texhax mailing list