summaryrefslogtreecommitdiff
path: root/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-nameref.html
blob: 29a8976f320f1e08be80e1a555b12cb442e5fc2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<head>
<title>UK TeX FAQ -- question label nameref</title>
</head><body>
<h3>Referring to things by their name</h3>
<p>LaTeX&rsquo;s labelling mechanism is designed for the impersonal world of
the academic publication, in which everything has a number: an
extension is necessary if we are to record the <em>name</em> of things
we&rsquo;ve labelled.  The two packages available extend the LaTeX
sectioning commands to provide reference by the name of the section.
<p>The <i>titleref</i> package is a simple extension which provides
the command <code>\</code><code>titleref</code>; it is a stand-alone package &mdash; don&rsquo;t use it
in a document in which you also need to use <i>hyperref</i>.
<p>The <i>byname</i> package is part of the <i>smartref</i> bundle
and works well with <i>smartref</i>, and works (to an extent) with
<i>hyperref</i>, but the links it defines are not hyperlinks.
<p>The <i>memoir</i> class incorporates the functionality of
<i>titleref</i>, but doesn&rsquo;t work with <i>byname</i> (though a
search of <i>comp.text.tex</i> on <a href="groups.google.com">groups.google.com</a> will
find a patch to <i>byname</i> to remedy the problem).
<p>The <i>hyperref</i> bundle includes a package <i>nameref</i>,
which will work standing alone (i.e., without <i>hyperref</i>: of
course, in this mode its references are not hyperlinked).  If you load
<i>hyperref</i> itself, <i>nameref</i> is automatically loaded.
<i>Memoir</i> requires the <i>memhfixc</i> when running with
<i>hyperref</i>; however, following the sequence
<blockquote>
<pre>
\documentclass[...]{memoir}
...
\usepackage[...]{hyperref}
\usepackage{memhfixc}
</pre>
</blockquote><p>
<i>nameref</i> commands may be used in a <i>memoir</i> document.
<p>Each of the name-reference packages defines a reference command
with the same name as the package: <code>\</code><code>titleref</code>, <code>\</code><code>byname</code> and
<code>\</code><code>nameref</code>. The <i>nameref</i> package also defines a command
<code>\</code><code>byshortnameref</code>, which uses the optional &lsquo;short&rsquo; title argument
to the chapter and section commands.
<dl>
<dt><tt><i>byname.sty</i></tt><dd>Distributed with <a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/smartref.zip">macros/latex/contrib/smartref</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/smartref.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/smartref/">browse</a>)
<dt><tt><i>hyperref.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/hyperref.zip">macros/latex/contrib/hyperref</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/hyperref.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/hyperref/">browse</a>)
<dt><tt><i>memoir.cls</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/memoir.zip">macros/latex/contrib/memoir</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/memoir.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/memoir/">browse</a>)
<dt><tt><i>nameref.sty</i></tt><dd>Distributed with <a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/hyperref.zip">macros/latex/contrib/hyperref</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/hyperref.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/hyperref/">browse</a>)
<dt><tt><i>smartref.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/smartref.zip">macros/latex/contrib/smartref</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/smartref.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/smartref/">browse</a>)
<dt><tt><i>titleref.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/misc/titleref.sty">macros/latex/contrib/misc/titleref.sty</a>
</dl>
<p><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=nameref">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=nameref</a>
</body>