[OS X TeX] using variables in text via references or labels
schremmer.alain at gmail.com
Tue Mar 31 00:28:53 CEST 2009
On Mar 30, 2009, at 4:09 PM, Ross Moore wrote:
> Hello Gert,
> On 31/03/2009, at 5:31 AM, Gert van Oss wrote:
>> dear all,
>> I've had some problem making up a clear subject line and stil am
>> in doubt whether I've succeded. What I'm trying to achieve is the
>> My documents have often various tables and charts embedded via the
>> While explaining my tables/charts I'm mentioning actual numbers
>> (as listed in the tables) in my text. Is it somehow possible to
>> create a list of numbers in my latex document and have them called
>> via a reference in my text? This would enable me to run a somewhat
>> related scenario in my numbers and udpate both my tables with
>> numbers and have all numbers changed in the text as well.
> If I understand you correctly, you have tables with numbers
> in (some of) the cells, but these values may change with updates
> of the table data. You want your document to refer to these values
> by showing the actual numbers, rather than by their location.
>> I was thinking this should be possible while using \labels, \ref
>> but for the moment can't stretch my mind to find a solution.
> Not easily, as the contents of a cell is not the kind
> of thing that establishes a destination for a cross-reference.
> You could simply enter the values in the table as the
> expansion of a macro; e.g.,
> .... & .... & \specValue & .... & .... \\
> Then refer to the value in the main document using \specValue .
> Of course updating the table is no longer as simple
> as just changing the numbers within the cells.
> You'll have to ensure that the \newcommand definition gets
> properly updated, and its usage not clobbered.
> Any other approach would require some tricky macro definitions
> anyway; e.g., making table cells automatically cause their values
> to be recorded as the expansion of a macro specific to the row,
> column and particular table.
I don't have the time to think this through but I recently had a
similar problem and got help from this list. Here is what I ended up
doing using arrayjob:
In a stylesheet called RAFv3-0_CheckableItems, I enter the data, e.g.
"alpha", "beta", "gamma", etc:
-%this is an empty cell
Then, in the document I have
which automatically shows alpha, beta, gamma, where it should. It
makes things reasonably foolproof.
I hope this is comprehensible but, if not, I can send the complete
files off list to anyone interested.
More information about the macostex-archives