Smartref package ReadMe ===================================================================== This package is distributed under the terms of the LaTeX Project Public License ===================================================================== This is the readme for the LaTeX Package ``smartref'', version 1.82 The purpose of this package is to extend the capability of the the \ref command; precisely, whenever a label is set, this package records, along with the label, the values of some other counters (which, can be selected by the user); then, the value of these counters can be recalled, with a command similar to \pageref; moreover, this package adds a command (\sref) for each counter added, that displays something only if the value of the counter is changed from when the label is set. For example, let's say that we are using the `amsbook' class, and we are numbering theorems within sections; when we want to refer to a theorem in another section, same chapter, we just say `as in theorem \ref{zorn}'; but if we want to refer to a theorem in another chapter, we have to set a label for that chapter and then say `as in theorem \ref{zorn}, in chapter \ref{chapterofzorn}'; if we, later on, move the referenced theorem (or the referencing line) in some other chapter, we might need to update the references; with this package, there's no need for that: you say, at the beginning of the document: \addtoreflist{chapter} and then, every \label is recorded alongside with the chapter in which it occurred. When we refer to the theorem, we might now say theorem \ref{zorn}, chapter \chapterref{zorn} if we are sure it will always be in another chapter, or theorem \ref{zorn}\schapterref{zorn} where the second command prints nothing if the chapter is the same as the current, or prints `, chap. \chapterref{zorn}' if the chapter has changed. Since this command sequence is supposed to be used with quite a frequency, it is not-so-short-handed by \srefchapterref (\srefref, in general). Here's a complete list of the commands made available by this package. \addtoreflist{} This is the first command called: it says that the counter is to be recorded alongside with all the (following) labels; please use it BEFORE defining any label, because the result is unknown if the SmartReference list changes during use (nothing special should happen, anyhow; it should work correctly). The previous command defines a few commands, whose name depends on the counter chosen. The commands are: \sgetval{\variable}{foo} This command gets the value of counter recorded with label `foo', and puts this value in the chosen \variable. \ref{foo} This command prints the value of the counter recorded with label `foo'. \ifchanged `If' construct for the next two commands: \ischanged{foo} Checks whether the counter is changed from value recorded with `foo', and sets \changed accordingly \sref{foo} This command prints nothing if the value of is not different, but prints `, \shortname \ref{foo}' if the value did change; the \shortname should be defined by the user. It queries by using the previous command. \srefref{foo} Equivalent of `\ref{foo}\sref{foo}'. The only options accepted, as for now, are `chapter' and `part'; `chapter' does the following: - adds the `chapter' counter to the smart list - defines \shortchaptername to be `Cap.' if babel is loaded with option `italian', `Chap.' otherwise - defines \smartref to be \srefchapterref `part' does the following: - adds the `part' counter to the smart list - defines \shortpartname to be `Parte' if babel is loaded with option `italian', `Part' otherwise - defines \smartref to be \srefpartref if previously undefined, or adds \spartref to previous definition of \smartref (saved in \nopart@smartref) otherwise (this is mainly to be used after the option `chapter'). As of version 1.6, the package comes with a small style file: byname.sty; it can be used alone, or within smartref, when the option `byname' is used; it adds the command \byname{