[XeTeX] enumerating quotations

Zdenek Wagner zdenek.wagner at gmail.com
Mon Apr 2 22:37:32 CEST 2012


2012/4/2 Jacobo Myerston <jmyerston at gmail.com>:
> Hi,
>
> I'm writing a book in which I quote a significant number of ancient texts. I'm using the \quote environment for this as usual. Now, I would like to have a numbered label to refer back to these quotations along the book. So, I would like the \quote environment to behave somehow like \figure so that the quote is auto-numbered and labels located inside \quote get also an automatic number.
>
> Does anybody how to do this?
>
I would design my own macros. First you have to define an environment
that will be used to display the quotations, i.e. in your document you
will write \begin{something} ... \end{something}. This is important
because it constitutes a group and the counter used for labeling must
be used inside a group. You also have to allocate a counter. When
entering the environment you have to increment the counter by
\refstepcounter. It is not sufficient to use \stepcounter, it only
increments the counter, but \refstepcounter also sets other internal
macros used by the \label-\ref-\pageref machinery. \label must appear
inside the environment but after \refstepcounter. You should also
define the way how tha couter value will be displayed. For instance,
the definitions may be:

\newcounter{something}
\newcommand*\thesomething{\arabic{something}}

If you need hierarchical numbering (starting from 1 in each chapter),
you have to define a few more macros.

> I'm using memoir.
>
>
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex



-- 
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz



More information about the XeTeX mailing list