Generalexpex | Preceding Reference to Examples

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
jkw74
Posts: 4
Joined: Thu Nov 15, 2012 2:44 pm

expex | Preceding Reference to Examples

Post by jkw74 »

I am very impressed by the flexibility of the expex package for numbering examples, particularly for interlinear glossing in linguistics.

However, I cannot seem to find a specific way to refer to an example with a specific name at a position in the text before the example has been declared.

For instance I have this code.

Code: Select all

In the following example \getref{littleDog}, one can see that this is true
\ex<littleDog>
bednagatj
\xe
As the previous example in \getref{littleDog} shows, this is true.
The code results in this output:
In the following example [littleDog], one can see that this is true.
(1) bednagatj
As the previous example in 1 shows, this is true.
Does anyone know how to be able to refer to named examples at a location in the source file before the examples have occurred in the source?

PS: I'm aware of the \nextx command, but this is only useful for one example, and only for the immediately following example, and cannot refer to an example by its label tag. My current workaround is just with the standard \label and \ref commands, but that doesn't allow for the flexibility in referring to examples and parts of examples.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

jkw74
Posts: 4
Joined: Thu Nov 15, 2012 2:44 pm

expex | Preceding Reference to Examples

Post by jkw74 »

Tags have to be explicitly written to a auxiliary file using the macro \gathertags.

This macro can be commented out so that the auxiliary file is not overwritten (but still accessible), thus preserving earlier work or work done on other sections in a multi-section document.

See page 51 of the User's Guide for more details.

(many thanks to John Frampton for his assistance!!)
Post Reply