Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Dernière révision Les deux révisions suivantes
5_fichiers:ecrire_un_fichier_texte_a_partir_de_tex [2018/06/03 16:25]
joseph.wright
5_fichiers:ecrire_un_fichier_texte_a_partir_de_tex [2018/12/04 01:08]
jejust
Ligne 1: Ligne 1:
---- +====== ​Writing (text) files from TeX ====== 
-title: ​Writing (text) files from TeX +
-category: concepts +
-permalink: /​FAQ-write +
----+
  
 TeX allows you to write to output files from within your document. TeX allows you to write to output files from within your document.
Ligne 10: Ligne 7:
 TeX-based macro package) does for you. TeX-based macro package) does for you.
  
-The basic uses of writing to an external file are "​obvious"​&​nbsp;&​mdash;​+The basic uses of writing to an external file are "​obvious" ​---
 remembering titles of sections for a table of contents, remembering remembering titles of sections for a table of contents, remembering
 label names and corresponding section or figure numbers, all for a label names and corresponding section or figure numbers, all for a
 later run of your document. ​ However, the "​non-obvious"​ thing is later run of your document. ​ However, the "​non-obvious"​ thing is
 easy to forget: that page numbers, in TeX, are slippery beasts, and easy to forget: that page numbers, in TeX, are slippery beasts, and
-have to be captured with some care.  The trick is that `\write`+have to be captured with some care.  The trick is that ''​\write''​
 operations are only executed as the page is sent to the DVI operations are only executed as the page is sent to the DVI
 or PDF file.  Thus, if you arrange that your page-number macro or PDF file.  Thus, if you arrange that your page-number macro
-(`\thepage`, in LaTeX) is not expanded until the page is+(''​\thepage''​, in LaTeX) is not expanded until the page is
 written, then the number written is correct, since that time is where written, then the number written is correct, since that time is where
 TeX guarantees the page number tallies with the page being sent TeX guarantees the page number tallies with the page being sent
Ligne 25: Ligne 22:
 Now, there are times when you want to write something straight away: Now, there are times when you want to write something straight away:
 for example, to interact with the user.  TeX captures that for example, to interact with the user.  TeX captures that
-requirement,​ too, with the primitive command ​`\immediate`+requirement,​ too, with the primitive command ​''​\immediate''​
-```latex+ 
 +<​code ​latex>
 \immediate\write\terminal{I'​m waiting...} \immediate\write\terminal{I'​m waiting...}
-```+</​code>​
 writes a "​computer-irritates-user"​ message, to the terminal. writes a "​computer-irritates-user"​ message, to the terminal.
  
-Which brings us to the reason for that `\terminal`.  TeX can +Which brings us to the reason for that ''​\terminal''​.  TeX can 
-`\writeup to 16 streams simultaneously,​ and that argument to +''​\write'' ​up to 16 streams simultaneously,​ and that argument to 
-`\writesays which is to be used.  Macro packages provide the+''​\write'' ​says which is to be used.  Macro packages provide the
 means of allocating streams for your use: Plain TeX provides a macro means of allocating streams for your use: Plain TeX provides a macro
-`\newwrite(used as `\newwrite\streamname`, which sets +''​\newwrite'' ​(used as ''​\newwrite\streamname''​, which sets 
-`\streamnameas the stream number). ​ In fact, `\terminal(or+''​\streamname'' ​as the stream number). ​ In fact, ''​\terminal'' ​(or
 its equivalent) is the first output stream ever set up (in most macro its equivalent) is the first output stream ever set up (in most macro
 packages): it is never attached to a file, and if TeX is asked to packages): it is never attached to a file, and if TeX is asked to
-write to _any_ stream that isn't attached to a file it will send+write to //​any// ​stream that isn't attached to a file it will send
 the output to the terminal (and the log). the output to the terminal (and the log).
  
 +
 +-----
 +
 +//Source:// [[faquk>​FAQ-write|Writing (text) files from TeX]]
 +
 +{{htmlmetatags>​metatag-keywords=(LaTeX,​concepts)
 +metatag-og:​title=(Writing (text) files from TeX)
 +metatag-og:​site_name=(FAQ LaTeX francophone)
 +}}
  
5_fichiers/ecrire_un_fichier_texte_a_partir_de_tex.txt · Dernière modification: 2021/03/29 12:24 par jejust
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0