[OS X TeX] PrettyRef

John Peterson john.peterson20 at comcast.net
Thu Mar 10 07:44:38 EST 2005


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>





More information about the MacOSX-TeX mailing list