[OS X TeX] Referring to arbitrary labels?

Will Robertson will at guerilla.net.au
Fri Nov 19 04:49:48 EST 2004

On 19 Nov 2004, at 8:09 PM, Mohinish Shukla wrote:

> -> Is it possible to have a kind of \refer{sectionlabel} which, 
> instead of returning the section NUMBER, returns the section NAME or 
> SHORTNAME? Because then I could create arbitrary labels to those 
> sections that are Experiments (which, btw, could run into several 
> pages; also for all the subsections)

Check out the prettyref package. I *think* it'll do what you want.

Alternatively, download and install the fancyref package (which 
definitely will with some customisation --- read its manual), and then 
save my appended refer.sty file below which gets it working (fancyref 
is broken and the author is too busy to fix it, so you need my file 
below and then \usepackage{refer}, only, in your document) which 
coincidentally enough defines a command called "\refer" that does 
exactly what you want!

Sorry to be brief, gotta run!

Good luck,

% REFER.STY 2004/07/06
%   Redefines fancyref.sty commands to prevent conflict with memoir.cls
%    \fref becomes \refer
%    \Fref becomes \Refer
%   Fixes bug in fancyref 0.9c introduced with varioref 1.3c.
%   Fixes typo in fancyref when calling the [tight] package option
%   fancyref is still to be customised as described by its own 
%    and package options given to refer will be passed on to fancyref.
% Will Robertson  2004
% will at guerilla.net.au
% This material is subject to the LaTeX Project Public License. See
%  http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
% for the details of that license.

\ProvidesPackage{refer}[2004/07/06 Alters and fixes the fancyref 

\let\figref\fref   % save memoir's \fref in \figref
\let\fref\relax    % Undefine memoir's \fref

% fix bug in fancyref 0.9c for the [tight] option:
    \AtEndOfPackage{% delay until after fancyref is loaded

% load fancyref: (all options are passed through except [tight], 
because it is defined above)

% fix bug in fancyref 0.9c due to updated varioref (v1.3c):
\renewcommand*{\@fancyref at page@ref}{%
   \let\vref at space\space

\let\refer\fref   % rename fancyref's \fref to \refer
\let\Refer\Fref   % etc
\let\fref\figref  % restore memoir's \fref to its original name
\let\figref\relax % clean up


--------------------- 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