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:inclusion_depuis_un_autre_repertoire [2018/06/02 14:45] – d.p.carlisle | 2_composition:texte:document:inclusion_depuis_un_autre_repertoire [2021/02/23 13:06] (Version actuelle) – Correction de coquilles et ajout d'un lien. yannick.tanguy | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | --- | + | ====== Pourquoi |
- | title: | + | |
- | category: errors | + | |
- | permalink: / | + | |
- | date: 2014-06-10 | + | |
- | --- | + | |
- | # LaTeX won't include | + | Vous voulez inclure un fichier avec la commande |
- | You wanted to `\include{../ | + | < |
- | ```latex | + | |
latex: Not writing to ../ | latex: Not writing to ../ | ||
- | ! I can't write on file `../ | + | ! I can't write on file `../ |
- | ``` | + | </ |
- | The error comes from TeX's protection against writing to | + | |
- | directories that aren't descendents of the one where your document | + | |
- | resides. | + | |
- | LaTeXing someone else's malicious, or merely broken, document. | + | |
- | such a document overwrites something you wanted kept, there is obvious | + | |
- | potential for havoc.) | + | |
- | Document directory structures that can lead to this problem will look | + | Autrement dit, il ne peut pas écrire dans le dossier que vous avez ciblé. L' |
- | like the fictional `mybook`: | + | |
- | ```latex | + | Les structures de dossiers qui peuvent conduire à ce problème ressembleront à ceci : |
- | ./base/mybook.tex | + | |
+ | <code bash> | ||
+ | ./base/monlivre.tex | ||
./ | ./ | ||
- | ./preface/ | + | ./chapitre1/ |
- | ./chapter1/ | + | </code> |
- | ... | + | |
- | ``` | + | |
- | With such a structure, any document directory (other than the one | + | |
- | where `mybook.tex` lives), seems '' | + | |
- | base directory. | + | |
- | `\include{../preface/ | + | |
- | hint.) | + | |
- | But why did it want to write at all?& | + | Ici, le dossier |
- | '' | + | |
- | how `\include` works, among other things by writing an | + | |
- | `aux` file for every `\includ`ed file. | + | |
- | Solutions to the problem tend to be drastic: | + | Mais, au fait, pourquoi veut-il y écrire ? La question « [[3_composition:document: |
+ | |||
+ | Les solutions au problème tendent à être drastiques. | ||
+ | |||
+ | ===== En restructurant vos dossiers ===== | ||
+ | |||
+ | La réorganisation des dossiers doit amener votre document à se trouver à la racine de votre arborescence de dossier contenant tous les éléments qui vous sont utiles : | ||
+ | |||
+ | <code bash> | ||
+ | ./ | ||
+ | ./ | ||
+ | ./ | ||
+ | </ | ||
+ | |||
+ | ===== En remplaçant les commandes \include ===== | ||
+ | |||
+ | Si vous n'avez pas particulièrement besoin des commandes '' | ||
+ | |||
+ | ===== En modifiant le fichier texmf.cnf ===== | ||
| | ||
+ | Vous // | ||
+ | |||
+ | ----- | ||
- | 1. Restructure the directories that hold your document so that the | + | //Source:// [[faquk> |
- | master file is at the root of the tree: | + | |
- | ```latex | + | |
- | ./mybook.tex | + | |
- | ./mybook/preface/Preface.tex | + | |
- | ./ | + | |
- | ./ | + | |
- | ... | + | |
- | ``` | + | |
- | and so on. | + | |
- | 2. Did you actually _need_ `\include`?& | + | |
- | replace `\include` by `\input` throughout. | + | |
- | if you don' | + | |
- | 3. You _could_ patch your system' | + | |
- | know what you're doing, the error message should be enough of a | + | |
- | hint; this action is definitely not recommended, | + | |
- | those who can '' | + | |
+ | {{htmlmetatags> | ||
+ | metatag-og: | ||
+ | metatag-og: | ||
+ | }} | ||