Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
composition:texte:document:utiliser_le_nom_de_fichier_dans_le_document [2018/05/25 21:22] – joseph.wright | 3_composition:document:utiliser_le_nom_de_fichier_dans_le_document [2022/10/10 13:40] (Version actuelle) – Usage de ⟨...⟩ dbitouze | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | --- | + | ====== Comment afficher le nom du fichier compilé? ====== |
- | title: What's the name of this file | + | |
- | category: usage | + | |
- | permalink: / | + | |
- | date: 2014-06-10 | + | |
- | --- | + | |
- | # What's the name of this file | + | Vous souhaitez générer automatiquement un en-tête ou un pied de page intégrant le fichier en cours de traitement ? |
+ | Ce n'est pas toujours trivial, voici pourquoi... | ||
- | One might want this so as to automatically generate a page header or | + | < |
- | footer recording what file is being processed. | + | Il s'agit en général du nom du fichier passé à < |
+ | et de toute extension (telle que '' | ||
+ | * si aucun fichier n'a été passé (c' | ||
+ | * si vous avez utilisé l' | ||
- | TeX retains what it considers the name of the _job_, only, in | + | Si votre document est stocké dans un unique fichier, utiliser '' |
- | the primitive `\jobname`; this is the name of the file first | + | Mais les documents plus importants seront souvent stockés dans un ensemble de fichiers et |
- | handed to TeX, stripped of its directory name and of any extension | + | < |
- | (such as `tex`). If no file was passed (i.e., you're using | + | L' |
- | TeX interactively), | + | et à leur faire conserver les détails des noms de fichiers. |
- | (the name that's given to `log` files in this case). | + | Cette opération est particulièrement difficile dans le cas de Plain < |
+ | de la syntaxe particulière de la commande '' | ||
- | This is fine, for the case of a small document, held in a single file; | + | Dans le cas de < |
- | most significant documents will be held in a bunch of files, and | + | et les [[2_programmation: |
- | TeX makes no attempt to keep track of files input to the | + | Pour information, |
- | _job_. So the user has to keep track, himself& | + | Nos patchs s' |
- | is to patch the input commands and cause them to retain details of the | + | Ce type de manipulation reste cependant peu recommandé par rapport aux méthodes suivantes. |
- | file name. This is particularly difficult in the case of Plain TeX, | + | |
- | since the syntax of the `\input` command is so peculiar. | + | |
- | In the case of LaTeX, the input commands have pretty regular | + | ===== Avec l'extension “currfile” ===== |
- | syntax, and the simplest [patching techniques](/ | + | |
- | used on them. (Note that LaTeX's `\input` command is itself a | + | |
- | patch on top of the Plain TeX command. | + | |
- | LaTeX version of the command, which is used as `\input{file}`) | + | |
- | It is possible to keep track of the name of the file currently being | + | L' |
- | processed, but it's surprisingly difficult (these FAQs offered | + | (son nom dans '' |
- | code, for a long time, that just didn't work in many cases). | + | sans extension et son extension). Pour y arriver, elle utilise une deuxième extension, [[ctanpkg> |
+ | qui repère les opérations sur fichiers qui utilisent | ||
+ | ainsi que les chargements d' | ||
- | The [`currfile`](https:// | + | ===== Avec l' |
- | track of the details of the current file (its name in | + | |
- | `\currfilename`, | + | |
- | file '' | + | |
- | [`Currfile`](https:// | + | |
- | [`filehook`](https:// | + | |
- | `\InputIfFileExists` and `\include`, as well as package and | + | |
- | class loading. | + | |
- | The [`FiNK`](https:// | + | :!: L’extension [[ctanpkg> |
- | file name and extension, in a macro `\finkfile`. | + | Ce qui suit est informatif. |
- | now deprecated, in favour of [`currfile`](https:// | + | |
- | for use in old documents. | + | |
- | The [`FiNK`](https:// | + | |
- | support under `emacs` with AUC-TeX. | + | |
+ | L' | ||
+ | et de l' | ||
+ | mais reste disponible pour une utilisation dans les anciens documents. | ||
+ | En bonus, [[ctanpkg> | ||
+ | |||
+ | ----- | ||
+ | //Source:// [[faquk> | ||
+ | |||
+ | {{htmlmetatags> | ||
+ | metatag-og: | ||
+ | metatag-og: | ||
+ | }} | ||