[OS X TeX] PrettyRef

Sergei Mariev serguei.mariev at campus.lmu.de
Thu Mar 10 15:07:29 EST 2005


I think I know the problem. I am working on a critical edition where 
I use hundreds (if not thousands) crossreferences. Thinking up a new 
lable is quite hard, and it is even harder to remember if you have 
already used the label or not, to avoid multiple labels. What I did 
in my dissertation was to write a perl script which generates random 
labels. Every time it generates a new label, it appends it to file. 
Every time it generates a lable itfirst  looks into the file to see 
if this number has been in use. Then I wrote a macro in the TexShop 
which asks the perl script to generate a label and pastes it at the 
current cursor position. This way I can generate a new label without 
thinking much about it and I know that this lablel is unique. Is this 
something you are looking for?

Regards,

sergei mariev

>I think this advice only applies in cases, where there are very few 
>crossreferences. However, in any (good) mathematical textbook there 
>are hundreds of crossreferences, theorems, equations, etc., so that 
>this advice will fail.
>
>Claus
>
>On Mar 10, 2005, at 13:44, John Peterson wrote:
>
>>Alain,
>>
>>I think that Herb was suggesting something like the following.
>>
>>\documentclass[11pt]{book}
>>        \usepackage{prettyref}
>>        \begin{document}
>>        \chapter{Addition}\label{Chap:Addition}
>>A little bit of text
>>        \section{Addition of Whole Numbers}\label{Sec:AddWholeNos}
>>A whole lot of text
>>        \section{Addition of Decimals}\label{Sec:AddDecimals}
>>A whole lot of text
>>        \section{Addition of  Fractions}\label{Sec:AddFractions}
>>A whole lot of text
>>        \chapter{Subtraction}\label{Chap:Subtraction}
>>Some words
>>        \section{Subtraction of Whole Numbers}\label{Sec:SubtractWholeNos}
>>A whole lot of text
>>        \section{Subtraction of Decimals}\label{Sec:SubtractDecimals}
>>A whole lot of text
>>        \section{Subtraction of  Fractions}\label{Sec:SubtractFractions}
>>A whole lot of text, see \prettyref{Sec:SubtractDecimals}, more 
>>text see \prettyref{Sec:AddDecimals}, even more text see 
>>\prettyref{Sec:AddFractions}.
>>\end{document}
>>
>>You will still have to remember what label you gave a chapter or 
>>section, but this is easier than using \label{Add1},  \label{Add2}, 
>>\label{Add3}, etc.  This way, if you decide to reorder the 
>>sections, say switch  \section{Addition of Decimals} and 
>>\section{Addition of Decimals} the labels are still "logical" 
>>rather than becoming numerically messed up, as in \label{Add1}, 
>>\label{Add3},  \label{Add2}.
>>
>>John
>>
>>
>>
>>On Mar 9, 2005, at 6:43 PM, Herb Schulz wrote:
>>
>>>On 3/9/05 5:06 PM, "Alain Schremmer" <Schremmer.Alain at verizon.net> wrote:
>>>
>>>>       \documentclass[11pt]{book}
>>>>       \usepackage{prettyref}
>>>>       \begin{document}
>>>>       \chapter{First}
>>>>       \section{little first}\label{sec:3}
>>>>       \section{little second}
>>>>       \section{little third}\label{sec:2}
>>>>       \chapter{Second}
>>>>       \section{little first}\label{sec:1}
>>>>       \section{little second}
>>>>       A whole lot of text, see \prettyref{sec:1}, more text see
>>>>\prettyref{sec:2}, even more text see \prettyref{sec:3}.
>>>>\end{document}
>>>
>>>Howdy,
>>>
>>>Why are you making things hard on yourself. Give the \label's names that
>>>mean something to you; e.g., based on the subject of that section. You
>>>shouldn't have to keep track of numbers; that's what LaTeX does for you.
>>>
>>>Good Luck,
>>>
>>>Herb Schulz
>>>(herbs at wideopenwest.com)
>>>
>>>--------------------- Info ---------------------
>>>Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>>>            & FAQ: http://latex.yauh.de/faq/
>>>TeX FAQ: http://www.tex.ac.uk/faq
>>>List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
>>>
>>
>>--------------------- Info ---------------------
>>Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>>           & FAQ: http://latex.yauh.de/faq/
>>TeX FAQ: http://www.tex.ac.uk/faq
>>List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
>>
>
>--------------------- Info ---------------------
>Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>           & FAQ: http://latex.yauh.de/faq/
>TeX FAQ: http://www.tex.ac.uk/faq
>List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>

--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the MacOSX-TeX mailing list