[OS X TeX] References across files

Chris Goedde cgg.lists at gmail.com
Mon Jan 12 18:31:09 CET 2009


On Jan 12, 2009, at 11:22 AM, Peter Vamos wrote:

> At 17:11 +0000 12/1/09, Alain Schremmer wrote:
>> Suppose you are writing a novel about a family but you have not yet
>> decided what the names of the various characters are.
>>
>> The obvious idea is to create a separate file with a genealogical
>> tree, in which you would have, say, "Tom" so that, as you write the
>> various included chapters of the novel, instead of typing "Tom", you
>> would type the reference of "Tom" in the genealogical tree. Then, as
>> you would typeset, all the occurrences of the reference would be
>> replaced by "Tom".
>>
>> Now the equally obvious question: Is there actually a way to do this?
>> (in LaTeX)
>
> How about just creating for each family member/character a macro e.g.
> \newcommand{\tom}{Tom}
>
> Then just change these macros at will e.g
>
> \newcommand{\tom}{Dick} or \newcommand{\tom}{Harry}
> and all references will be changed at the next typeset.

The only caveat with this is that in normal usage TeX will happily eat  
the space after the command, so that

See \tom run!

will get typeset as "See Tomrun". This can be worked around by adding  
braces after the command:

See \tom{} run!

Are there easier work arounds?

-- 
Chris




More information about the macostex-archives mailing list