Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
3_composition:texte:renvois:se_referer_aux_sections_par_leur_titre [2018/05/23 15:58] d.p.carlisle |
3_composition:texte:renvois:se_referer_aux_sections_par_leur_titre [2021/11/30 00:08] yannick.tanguy Correction de la mise en forme. |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | # Referring to things by their name | + | ====== Comment obtenir des références intégrant des noms? ====== |
- | LaTeX's labelling mechanism is designed for the impersonal world of | + | 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. |
- | 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 [`titleref`](https://ctan.org/pkg/titleref) package is a simple extension which provides | + | ===== Avec l'extension “titleref” ===== |
- | the command `\titleref`; it is a stand-alone package — don't use it | + | |
- | in a document in which you also need to use [`hyperref`](https://ctan.org/pkg/hyperref). | + | |
- | The [`byname`](https://ctan.org/pkg/byname) package is part of the [`smartref`](https://ctan.org/pkg/smartref) bundle | + | 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]]. |
- | and works well with [`smartref`](https://ctan.org/pkg/smartref), and works (to an extent) with | + | |
- | [`hyperref`](https://ctan.org/pkg/hyperref), but the links it defines are not hyperlinks. | + | |
- | The [`memoir`](https://ctan.org/pkg/memoir) class incorporates the functionality of | + | ===== Avec l'extension “byname” ===== |
- | [`titleref`](https://ctan.org/pkg/titleref), but doesn't work with [`byname`](https://ctan.org/pkg/byname) (though a | + | |
- | search of `comp.text.tex` on [groups.google.com] will | + | |
- | find a patch to [`byname`](https://ctan.org/pkg/byname) to remedy the problem). | + | |
- | The [`hyperref`](https://ctan.org/pkg/hyperref) bundle includes a package [`nameref`](https://ctan.org/pkg/nameref), | + | 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. |
- | which will work standing alone (i.e., without [`hyperref`](https://ctan.org/pkg/hyperref): of | + | |
- | course, in this mode its references are not hyperlinked). If you load | + | ===== Avec la classe “memoir” ===== |
- | [`hyperref`](https://ctan.org/pkg/hyperref) itself, [`nameref`](https://ctan.org/pkg/nameref) is automatically loaded. | + | |
- | [`Memoir`](https://ctan.org/pkg/Memoir) requires the [`memhfixc`](https://ctan.org/pkg/memhfixc) when running with | + | 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. // |
- | [`hyperref`](https://ctan.org/pkg/hyperref); following the sequence: | + | |
- | ```latex | + | ===== Avec l'extension “nameref” (et “hyperref”) ===== |
+ | |||
+ | 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> | ||
\documentclass[...]{memoir} | \documentclass[...]{memoir} | ||
... | ... | ||
\usepackage[...]{hyperref} | \usepackage[...]{hyperref} | ||
\usepackage{memhfixc} | \usepackage{memhfixc} | ||
- | ``` | + | </code> |
- | [`nameref`](https://ctan.org/pkg/nameref) commands may be used in a [`memoir`](https://ctan.org/pkg/memoir) document. | + | |
- | [`Zref`](https://ctan.org/pkg/Zref) defines a proposed replacement for all of the LaTeX | + | ===== Avec l'extension “zref” ===== |
- | reference mechanisms, and among other things provides | + | |
- | name-referencing mechanisms: | + | |
- | ```latex | + | |
- | \usepackage[user,titleref]{zref} | + | |
- | ... | + | |
- | \section{hello}\zlabel{sec:one} | + | |
- | The section name is: \ztitleref{sec:one}. | + | |
- | ``` | + | |
- | (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 [`titleref`](https://ctan.org/pkg/titleref), [`byname`](https://ctan.org/pkg/byname) and [`nameref`](https://ctan.org/pkg/nameref) | + | 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 : |
- | defines a reference command with the same name as the package: | + | |
- | `\titleref`, `\byname` and `\nameref`. The [`nameref`](https://ctan.org/pkg/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, [`zref`](https://ctan.org/pkg/zref) _doesn't_ | + | |
- | define a short-name variant.) | + | |
+ | <code latex> | ||
+ | \usepackage[user,titleref]{zref} | ||
+ | ... | ||
+ | \section{Un titre}\zlabel{sec:un} | ||
+ | Le nom de la section est : \ztitleref{sec:un}. | ||
+ | </code> | ||
- | ---- | + | 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. |
- | Content last updated: 2014-06-10 | + | ----- |
+ | //Source:// [[faquk>FAQ-nameref|Referring to things by their name]] | ||
+ | {{htmlmetatags>metatag-keywords=(LaTeX,références croisées,nom,structure) | ||
+ | metatag-og:title=(Comment obtenir des références intégrant des noms) | ||
+ | metatag-og:site_name=(FAQ LaTeX francophone) | ||
+ | }} |