[OS X TeX] Automatic labeling for references

Jan Anderssen jan at linguist.umass.edu
Sat Apr 5 04:18:54 CEST 2008


Hello.

>> But then you've still got to get the \ref commands right so you  
>> need to know what the labels are. Or do I have this wrong?
>
> I assume you mean that before I can write "We already saw in  
> \titleref{314} that …" in the source, I have to know that 314 is the  
> label of the section I want to reference. Well, I could look up the  
> section in the toc and then the label number at the given page  
> number. In fact, why coulnd't the label be the chapter number  
> followed by some symbol and then by the section number? Then I would  
> just have to look up the toc!
>
> The reason I would like this to be automatic is that last year I  
> gave up on references altogether because I got completely confused  
> even though someone on this list had written a macro that would  
> generate random label numbers. This way, it would be just a matter  
> of looking up an already existing label.

I often change the order of things around as I go along (sometimes  
quite dramatically), so what was section 2.3 might become section 2.7  
etc. So you (I?) would either need to live with a mismatch of label  
and actual section number then (making it kind of arbitrary), or  
change the label and all depending \ref's all the time, which seems  
quite tedious and error-prone unless automated.

What I imagine could be more feasible is to create a label that looks  
more like \label{sec:SomeWordsFromSectionTitle}. I usually do that  
manually, but I imagine it might be automated - probably through some  
sort of autocompletion mechanism, or applescript that grabs hold of an  
immediately preceding \section{}, rather than in (La)TeX.

Since I don't use TexShop myself, and are rather a novice at  
AppleScript, maybe other people could be more helpful with the  
specifics.

Cheers,
Jan




More information about the macostex-archives mailing list