Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente |
composition:texte:renvois:se_referer_aux_sections_par_leur_titre [2018/12/03 23:57] – jejust | 3_composition:texte:renvois:se_referer_aux_sections_par_leur_titre [2021/11/29 23:08] (Version actuelle) – Correction de la mise en forme. yannick.tanguy |
---|
====== Referring to things by their name ====== | ====== Comment obtenir des références intégrant des noms? ====== |
| |
| Le mécanisme de références croisées de <latex>\LaTeX</latex> est conçu pour le monde assez impersonnel de la publication académique, dans lequel tout a un numéro. Aussi, une extension est nécessaire si nous voulons afficher le //nom// des choses auxquelles nous faisons référence. Les deux extensions disponibles modifient les commandes de sectionnement pour obtenir ce résultat. |
| |
LaTeX's labelling mechanism is designed for the impersonal world of | ===== Avec l'extension “titleref” ===== |
the academic publication, in which everything has a number: an | |
extension is necessary if we are to record the //name// of things | |
we've labelled. The two packages available extend the LaTeX | |
sectioning commands to provide reference by the name of the section. | |
| |
The [[ctanpkg>titleref|titleref]] package is a simple extension which provides | L'extension [[ctanpkg>titleref]] fournit la commande ''\titleref''. Il convient cependant de ne pas l'utiliser dans un document dans lequel vous devez également utiliser l'extension [[ctanpkg>hyperref]]. |
the command ''\titleref''; it is a stand-alone package --- don't use it | |
in a document in which you also need to use [[ctanpkg>hyperref|hyperref]]. | |
| |
The [[ctanpkg>smartref|byname]] package is part of the [[ctanpkg>smartref|smartref]] bundle | ===== Avec l'extension “byname” ===== |
and works well with [[ctanpkg>smartref|smartref]], and works (to an extent) with | |
[[ctanpkg>hyperref|hyperref]], but the links it defines are not hyperlinks. | |
| |
The [[ctanpkg>memoir|memoir]] class incorporates the functionality of | L'extension [[ctanpkg>smartref|byname]] fait partie de l'ensemble [[ctanpkg>smartref]] et fonctionne d'ailleurs bien avec [[ctanpkg>smartref]]. Elle fonctionne (dans une certaine mesure) avec [[ctanpkg>hyperref]] mais les liens qu'elle définit ne sont pas des hyperliens. |
[[ctanpkg>titleref|titleref]], but doesn't work with [[ctanpkg>smartref|byname]] (though a | |
search of ''comp.text.tex'' on [groups.google.com] will | |
find a patch to [[ctanpkg>smartref|byname]] to remedy the problem). | |
| |
The [[ctanpkg>hyperref|hyperref]] bundle includes a package [[ctanpkg>nameref|nameref]], | ===== Avec la classe “memoir” ===== |
which will work standing alone (i.e., without [[ctanpkg>hyperref|hyperref]]: of | |
course, in this mode its references are not hyperlinked). If you load | La classe [[ctanpkg>memoir]] incorpore la fonctionnalité de [[ctanpkg>titleref]] mais ne fonctionne pas avec [[ctanpkg>smartref|byname]] (mais des correctifs existent). FIXME // Trouver ces correctifs. // |
[[ctanpkg>hyperref|hyperref]] itself, [[ctanpkg>nameref|nameref]] is automatically loaded. | |
[[ctanpkg>Memoir|Memoir]] requires the [[ctanpkg>memhfixc|memhfixc]] when running with | ===== Avec l'extension “nameref” (et “hyperref”) ===== |
[[ctanpkg>hyperref|hyperref]]; following the sequence: | |
| L'ensemble [[ctanpkg>hyperref]] comprend une extension [[ctanpkg>nameref]], qui fonctionnera seule (c'est-à-dire sans [[ctanpkg>hyperref]] mais alors, bien sûr, les références ne sont pas hypertextes). Les commandes de l'extension [[ctanpkg>nameref]] peuvent être utilisées dans un document de classe [[ctanpkg>memoir]]. |
| |
| Si vous chargez l'extension [[ctanpkg>hyperref]] elle-même, alors [[ctanpkg>nameref]] est automatiquement chargée. La classe [[ctanpkg>memoir]] nécessite l'extension [[ctanpkg>memhfixc]] lors de l'exécution avec [[ctanpkg>hyperref]], comme suit : |
| |
<code latex> | <code latex> |
\usepackage{memhfixc} | \usepackage{memhfixc} |
</code> | </code> |
[[ctanpkg>nameref|nameref]] commands may be used in a [[ctanpkg>memoir|memoir]] document. | |
| |
[[ctanpkg>Zref|Zref]] defines a proposed replacement for all of the LaTeX | ===== Avec l'extension “zref” ===== |
reference mechanisms, and among other things provides | |
name-referencing mechanisms: | L'extension [[ctanpkg>zref]] propose un remplacement complet des mécanismes de références croisées de <latex>\LaTeX</latex> et offre en particulier une fonctionnalité de référence avec le nom : |
| |
<code latex> | <code latex> |
\usepackage[user,titleref]{zref} | \usepackage[user,titleref]{zref} |
... | ... |
\section{hello}\zlabel{sec:one} | \section{Un titre}\zlabel{sec:un} |
The section name is: \ztitleref{sec:one}. | Le nom de la section est : \ztitleref{sec:un}. |
</code> | </code> |
(One might hope that something of this sort would be the | |
"way of the future", but things move slowly in the LaTeX world: don't hold | |
your breath.) | |
| |
Each of [[ctanpkg>titleref|titleref]], [[ctanpkg>smartref|byname]] and [[ctanpkg>nameref|nameref]] | |
defines a reference command with the same name as the package: | |
''\titleref'', ''\byname'' and ''\nameref''. The [[ctanpkg>nameref|nameref]] | |
package also defines a command ''\byshortnameref'', which uses the | |
optional "short" title argument to the chapter and section commands. | |
(Although it comes from the same author, [[ctanpkg>zref|zref]] //doesn't// | |
define a short-name variant.) | |
| |
| Chacune des extensions [[ctanpkg>titleref]], [[ctanpkg>smartref|byname]] et [[ctanpkg>nameref]] définit une commande de référence avec le même nom que l'extension : ''\titleref'', ''\byname'' et ''\nameref''. L'extension [[ctanpkg>nameref]] définit également une commande ''\byshortnameref'', qui utilise l'argument optionnel court des commandes de chapitre et de section. Par contre, l'extension [[ctanpkg>zref]], pour du même auteur (Heiko Oberdiek), // ne définit pas // une telle variante. |
| |
----- | ----- |
| |
//Source:// [[faquk>FAQ-nameref|Referring to things by their name]] | //Source:// [[faquk>FAQ-nameref|Referring to things by their name]] |
| |
{{htmlmetatags>metatag-keywords=(LaTeX,formatting,labels,references) | {{htmlmetatags>metatag-keywords=(LaTeX,références croisées,nom,structure) |
metatag-og:title=(Referring to things by their name) | metatag-og:title=(Comment obtenir des références intégrant des noms) |
metatag-og:site_name=(FAQ LaTeX francophone) | metatag-og:site_name=(FAQ LaTeX francophone) |
}} | }} |
| |