texlive[54255] Build/source/texk/web2c: \input{...} doc, other \input

commits+karl at tug.org commits+karl at tug.org
Thu Mar 12 18:55:09 CET 2020


Revision: 54255
          http://tug.org/svn/texlive?view=revision&revision=54255
Author:   karl
Date:     2020-03-12 18:55:08 +0100 (Thu, 12 Mar 2020)
Log Message:
-----------
\input{...} doc, other \input filename details

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/ChangeLog
    trunk/Build/source/texk/web2c/doc/web2c.info
    trunk/Build/source/texk/web2c/doc/web2c.texi

Modified: trunk/Build/source/texk/web2c/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog	2020-03-12 17:03:25 UTC (rev 54254)
+++ trunk/Build/source/texk/web2c/ChangeLog	2020-03-12 17:55:08 UTC (rev 54255)
@@ -1,3 +1,9 @@
+2020-03-12  Karl Berry  <karl at freefriends.org>
+
+	* doc/web2c.texi (\input quoted filename),
+	(\input braced filename),
+	(\input filename caveats): new subnodes of "\input filenames".
+
 2020-02-09  Phelype Oleinik  <phe.h.o1 at gmail.com>
 
 	* tex.ch (29.256, scan_file_name): new procedure to implement

Modified: trunk/Build/source/texk/web2c/doc/web2c.info
===================================================================
--- trunk/Build/source/texk/web2c/doc/web2c.info	2020-03-12 17:03:25 UTC (rev 54254)
+++ trunk/Build/source/texk/web2c/doc/web2c.info	2020-03-12 17:55:08 UTC (rev 54255)
@@ -1,10 +1,10 @@
-This is web2c.info, produced by makeinfo version 5.1 from web2c.texi.
+This is web2c.info, produced by makeinfo version 6.7 from web2c.texi.
 
 This file documents the installation and use of the programs in Web2c,
 an implementation of Donald Knuth's TeX system.
 
    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-2005, 2007, 2008, 2009 Karl Berry & Olaf Weber.
+2005, 2007, 2008, 2009, 2010-2020 Karl Berry & Olaf Weber.
 
    Permission is granted to make and distribute verbatim copies of this
 manual provided the copyright notice and this permission notice are
@@ -58,7 +58,7 @@
 
 This document describes how to install and use the programs in the Web2c
 implementation of the TeX system, especially for Unix systems.  It
-corresponds to Web2c version 2020, released in January 2020.
+corresponds to Web2c version 2020, released in March 2020.
 
 * Menu:
 
@@ -82,7 +82,7 @@
 1 Introduction
 **************
 
-This manual corresponds to version 2020 of Web2c, released in January
+This manual corresponds to version 2020 of Web2c, released in March
 2020.
 
    "Web2c" is the name of a TeX implementation, originally for Unix, but
@@ -634,7 +634,7 @@
 * Initial and virgin::          Making memory dumps vs. production runs.
 * Memory dumps::                .fmt/.base files for fast startup.
 * Editor invocation::           The 'e' response at errors.
-* \input filenames::            ~ and $ expansion in TeX/MF/MP.
+* \input filenames::            Filename delimiters and Kpathsea expansion.
 
 
 File: web2c.info,  Node: Initial and virgin,  Next: Memory dumps,  Up: Three programs
@@ -835,8 +835,35 @@
 macro packages provide other interfaces to '\input' that allow different
 notation; here we are concerned only with the primitive operation.)
 
-   As of Web2c version 7.5.3, double-quote characters can be used to
-include spaces or other special cases.  In typical use, the '"'
+   As (allowed) extensions to standard TeX, Web2c also supports
+specifying the filename in double quotes ('"some name"') and in braces
+('{"some name"}'), which is convenient for filenames containing spaces
+or other special characters, as described in the sections below.
+
+   In all cases, space tokens are ignored after the filename is read.
+
+   Also, double quote ('"') characters are ignored within the filename;
+there is no way to read files whose names contain a '"'.
+
+   However, for maximal portability of your document across systems, use
+only the characters 'a'-'z', '0'-'9', and '.'.  Do not use anything but
+simple filenames, since directory separators vary among systems;
+instead, add the necessary directories to the appropriate search path.
+
+* Menu:
+
+* Quotes: \input quoted filename.   \input "some name"
+* Braces: \input braced filename.   \input {some name}
+* Caveats: \input filename caveats. Tokenization, nulls, Kpathsea expansion.
+
+
+File: web2c.info,  Node: \input quoted filename,  Next: \input braced filename,  Up: \input filenames
+
+3.5.4.1 '\input' quoted filename: '\input "some name"'
+......................................................
+
+As of Web2c version 7.5.3 (2004), double-quote characters can be used to
+include spaces or other special characters.  In typical use, the '"'
 characters surround the entire filename:
      \input "filename with spaces"
 
@@ -844,46 +871,69 @@
 can enclose any characters, as in:
      \input filename" "with" "spaces
 
-   One more point.  In LaTeX, the quotes are needed inside the braces,
-thus
+   One more point.  In LaTeX, the quotes are needed inside the braces of
+its '\input' macro, thus:
      \input{a b}    % fails
      \input{"a b"}  % ok
 
-   This quoting mechanism comes into play _after_ TeX has tokenized and
-expanded the input.  So, multiple spaces and tabs may be seen as a
-single space, active characters such as '~' are expanded first, and so
-on.  (See below.)
+   There is no way to quote the quote character.
 
+
+File: web2c.info,  Node: \input braced filename,  Next: \input filename caveats,  Prev: \input quoted filename,  Up: \input filenames
+
+3.5.4.2 '\input' braced filename: '\input{some name}'
+.....................................................
+
+As of Web2c 2020, '\input' filenames in TeX engines (this does not apply
+in Metafont and MetaPost) can also be specified within a TeX group,
+typically curly braces.  For example:
+     \input{filename with spaces}
+
+   As always with TeX, the brace characters are not hardwired; what
+counts is the category code: the first token after the '\input' must be
+of catcode 1 (begin group), and it is matched with the next character of
+catcode 2 (end group).
+
+   Within the group-delimited filename, braces are treated as normal
+characters.
+
+   As with all forms of filenames, following spaces are ignored (after
+the end group), and double quote ('"') characters are ignored within the
+filename.
+
+
+File: web2c.info,  Node: \input filename caveats,  Prev: \input braced filename,  Up: \input filenames
+
+3.5.4.3 '\input' filename caveats
+.................................
+
+The quoting mechanisms just described come into play _after_ TeX has
+tokenized and expanded the input.  So, multiple spaces and tabs will
+generally be seen as a single space, active characters such as '~' are
+expanded first (generally causing an error), and so on.  More examples
+below.
+
    On the other hand, various C library routines and Unix itself use the
 null byte (character code zero, ASCII NUL) to terminate strings.  So
 filenames in Web2c cannot contain nulls, even though TeX itself does not
-treat NUL specially.  In addition, some older Unix variants do not allow
-eight-bit characters (codes 128-255) in filenames.
+treat NUL specially.
 
-   For maximal portability of your document across systems, use only the
-characters 'a'-'z', '0'-'9', and '.', and restrict your filenames to at
-most eight characters (not including the extension), and at most a
-three-character extension.  Do not use anything but simple filenames,
-since directory separators vary among systems; instead, add the
-necessary directories to the appropriate search path.
-
    Finally, the present Web2c implementation does '~' and '$' expansion
-on NAME, unlike Knuth's original implementation and older versions of
-Web2c.  Thus:
+on NAME, unlike Knuth's original implementation.  Thus:
      \input ~jsmith/$foo.bar
    will dereference the environment variable or Kpathsea config file
-value 'foo' and read that file extended with '.bar' in user 'jsmith''s
-home directory.  You can also use braces, as in '${foo}bar', if you want
-to follow the variable name with a letter, numeral, or '_'.
+value 'foo' and read that file, extended with '.bar', in user 'jsmith''s
+home directory.  You can also use braces in the variable expansion, as
+in '${foo}bar', if you want to follow the variable name with a letter,
+numeral, or '_'.
 
    (So another way to get a program to read a filename containing
 whitespace is to define an environment variable and dereference it.)
 
-   In all the common TeX formats (plain TeX, LaTeX, AMSTeX), the
-characters '~' and '$' have special category codes, so to actually use
-these in a document you have to change their catcodes or use '\string'.
-(The result is unportable anyway, see the suggestions above.)  The place
-where they are most likely to be useful is when typing interactively.
+   In all the common TeX formats (plain TeX, LaTeX, ConTeXt, AMSTeX,
+...), the characters '~' and '$' have special category codes, so to
+actually use these in a document you have to change their catcodes or
+use '\string'.
 
 
 File: web2c.info,  Node: TeX,  Next: Metafont,  Prev: Commonalities,  Up: Top
@@ -2323,9 +2373,9 @@
 
 * Menu:
 
-* tangle invocation::           
-* weave invocation::            
-* pooltype invocation::         
+* tangle invocation::
+* weave invocation::
+* pooltype invocation::
 
 
 File: web2c.info,  Node: tangle invocation,  Next: weave invocation,  Up: WEB
@@ -2564,7 +2614,7 @@
 
 * Menu:
 
-* dvitype output example::      
+* dvitype output example::
 
 
 File: web2c.info,  Node: dvitype output example,  Up: dvitype invocation
@@ -3425,9 +3475,11 @@
  [index ]
 * Menu:
 
-* '#define' options:                     Compile-time options.
+* " character, ignored in filenames:     \input filenames.    (line  22)
+* #define options:                       Compile-time options.
                                                               (line   6)
-* $ expansion in filenames:              \input filenames.    (line  47)
+* $ expansion in filenames:              \input filename caveats.
+                                                              (line  17)
 * %& magic number:                       Determining the memory dump to use.
                                                               (line  19)
 * - starting a filename:                 Option conventions.  (line  19)
@@ -3466,7 +3518,7 @@
 * -base=BASE:                            Determining the memory dump to use.
                                                               (line  15)
 * -base=DUMPNAME:                        Common options.      (line  34)
-* -change=CHFILE:                        mft invocation.      (line  62)
+* -change=CHFILE:                        mft invocation.      (line  63)
 * -charcode-format=TYPE:                 tftopl invocation.   (line  27)
 * -charcode-format=TYPE <1>:             vftovp invocation.   (line  30)
 * -D compiler options:                   Compile-time options.
@@ -3527,7 +3579,7 @@
 * -shell-restricted:                     tex invocation.      (line 121)
 * -show-opcodes:                         dvitype invocation.  (line  52)
 * -strict:                               tangle invocation.   (line  46)
-* -style=MFTFILE:                        mft invocation.      (line  66)
+* -style=MFTFILE:                        mft invocation.      (line  67)
 * -T:                                    mpost invocation.    (line 115)
 * -terse:                                bibtex invocation.   (line  28)
 * -tex=TEXPROGRAM:                       mpost invocation.    (line 118)
@@ -3547,7 +3599,7 @@
 * .fmt:                                  Initial TeX.         (line   6)
 * .mf:                                   mf invocation.       (line  24)
 * .mp:                                   mpost invocation.    (line  30)
-* '.mps' files and PDF:                  mpost invocation.    (line  86)
+* .mps files and PDF:                    mpost invocation.    (line  86)
 * .NNN PostScript figures:               mpost invocation.    (line  35)
 * .NNNgf generic fonts:                  mf invocation.       (line  34)
 * .tcx character translation files:      Common options.      (line  98)
@@ -3571,7 +3623,13 @@
 * \font and dynamic generation:          tex invocation.      (line  41)
 * \fontdimen:                            tftopl invocation.   (line  99)
 * \immediate\write18:                    Shell escapes.       (line   6)
+* \input braced (grouped) filename:      \input braced filename.
+                                                              (line   6)
+* \input filename caveats:               \input filename caveats.
+                                                              (line   6)
 * \input filenames:                      \input filenames.    (line   6)
+* \input quoted filename:                \input quoted filename.
+                                                              (line   6)
 * \input, and pipes:                     Shell escapes.       (line  64)
 * \mag:                                  dvicopy invocation.  (line  20)
 * \mag <1>:                              dvitype invocation.  (line  28)
@@ -3578,14 +3636,16 @@
 * \openin, and pipes:                    Shell escapes.       (line  64)
 * \openout and security:                 tex invocation.      (line  48)
 * \openout, and pipes:                   Shell escapes.       (line  64)
-* \output routine, and '\write':         Shell escapes.       (line  28)
+* \output routine, and \write:           Shell escapes.       (line  28)
 * \pdfshellescape:                       Shell escapes.       (line  64)
-* \string:                               \input filenames.    (line  59)
+* \string, and \input filenames:         \input filename caveats.
+                                                              (line  29)
 * \tracingcharsubdef and MLTeX:          \tracingcharsubdef.  (line   6)
 * \tracinglostchars and MLTeX:           \tracingcharsubdef.  (line  11)
 * \write18 shell escape extension:       Shell escapes.       (line   6)
 * ^^ notation, avoiding:                 TCX files.           (line  87)
-* ~ expansion in filenames:              \input filenames.    (line  47)
+* ~ expansion in filenames:              \input filename caveats.
+                                                              (line  17)
 * abbrv.bst:                             Basic BibTeX style files.
                                                               (line  16)
 * accented character:                    TCX files.           (line   6)
@@ -3648,6 +3708,8 @@
 * binaries, linking:                     Common options.      (line  77)
 * blank lines, in TCX files:             TCX files.           (line  66)
 * boxes, memory for:                     Runtime options.     (line  20)
+* braced filename for \input:            \input braced filename.
+                                                              (line   6)
 * breakpoints, memory for:               Runtime options.     (line  20)
 * Breitenlohner, Peter:                  Introduction.        (line   9)
 * BSTINPUTS, search path for bst files:  bibtex invocation.   (line  18)
@@ -3660,7 +3722,9 @@
 * byte swapping:                         Hardware and memory dumps.
                                                               (line  13)
 * c-sources Makefile target:             Additional targets.  (line  12)
-* change files, and MFT:                 mft invocation.      (line  62)
+* caveats for \input filenames:          \input filename caveats.
+                                                              (line   6)
+* change files, and MFT:                 mft invocation.      (line  63)
 * change files, and Tangle:              tangle invocation.   (line  11)
 * change files, and Weave:               weave invocation.    (line  14)
 * changing error messages style:         Common options.      (line  26)
@@ -3680,7 +3744,7 @@
                                                               (line  69)
 * cm.base:                               Initial Metafont.    (line  26)
 * cmbase.mf:                             Initial Metafont.    (line  26)
-* cmbase.mft:                            mft invocation.      (line  72)
+* cmbase.mft:                            mft invocation.      (line  73)
 * cmmf.base not recommended:             Initial Metafont.    (line  26)
 * color, in DVItoMP:                     dvitomp invocation.  (line  15)
 * comments, in TCX files:                TCX files.           (line  70)
@@ -3693,7 +3757,7 @@
                                                               (line   6)
 * Computer Modern fonts, and Troff:      mpost invocation.    (line  65)
 * Computer Modern macros:                Initial Metafont.    (line  26)
-* 'Computer Modern Typefaces', production of: mft invocation. (line  72)
+* Computer Modern Typefaces, production of: mft invocation.   (line  73)
 * configuration:                         Installation.        (line   6)
 * configuration file reading:            Path searching.      (line   6)
 * configuration file values:             Runtime options.     (line   6)
@@ -3737,6 +3801,8 @@
 * DISPLAY:                               Online Metafont graphics.
                                                               (line  76)
 * dot files, written by TeX programs:    tex invocation.      (line  48)
+* double quote character, ignored in filenames: \input filenames.
+                                                              (line  22)
 * downloading of fonts for MetaPost labels: mpost invocation. (line  70)
 * DrawingServant:                        Online Metafont graphics.
                                                               (line  35)
@@ -3758,18 +3824,19 @@
 * dx horizontal escapement <1>:          gftype invocation.   (line 106)
 * dy vertical escapement:                gftype invocation.   (line 106)
 * dynamic array allocation:              Runtime options.     (line  35)
-* dynamic Metafont mode definitions with 'smode': Modes.      (line  28)
+* dynamic Metafont mode definitions with smode: Modes.        (line  28)
 * dynamic packing variable:              pktype invocation.   (line  44)
 * e response at error prompt:            Editor invocation.   (line   6)
 * e-circumflex:                          \charsubdef.         (line  20)
 * e-TeX:                                 TeX extensions.      (line  10)
-* e.mft:                                 mft invocation.      (line  72)
+* e.mft:                                 mft invocation.      (line  73)
 * EC fonts:                              tex invocation.      (line  41)
 * EC fonts <1>:                          mf invocation.       (line  24)
 * editing of bitmap fonts:               Font utilities available elsewhere.
                                                               (line  23)
 * editor invoked at error:               Editor invocation.   (line   6)
-* eight-bit characters in filenames:     \input filenames.    (line  34)
+* eight-bit characters in filenames:     \input filename caveats.
+                                                              (line  12)
 * empty.tcx:                             TCX files.           (line  48)
 * endian dependencies:                   Hardware and memory dumps.
                                                               (line   6)
@@ -3785,6 +3852,8 @@
 * executables, shared initial and virgin: Initial and virgin. (line   6)
 * exit status, of shell escape:          Shell escapes.       (line  34)
 * expanded plain format:                 Formats.             (line  54)
+* expansion, and \input filenames:       \input filename caveats.
+                                                              (line   6)
 * extensions to TeX:                     TeX extensions.      (line   6)
 * extra_mem_bot:                         Runtime options.     (line  19)
 * FACE property:                         tftopl invocation.   (line  95)
@@ -3794,7 +3863,7 @@
 * file formats for fonts:                Font file formats.   (line   6)
 * file recorder:                         Common options.      (line  84)
 * filename conventions, in input files:  \input filenames.    (line   6)
-* filenames starting with '-':           Option conventions.  (line  19)
+* filenames starting with -:             Option conventions.  (line  19)
 * first line of the main input file:     Common options.      (line  98)
 * fixed-point arithmetic:                Compile-time options.
                                                               (line  21)
@@ -3859,6 +3928,8 @@
 * glue, memory for:                      Runtime options.     (line  20)
 * glyph substitutions:                   MLTeX.               (line   6)
 * gray font:                             gftodvi invocation.  (line  29)
+* group-delimited filename for \input:   \input braced filename.
+                                                              (line   6)
 * Gruff, Billy Goat:                     Triptrap.            (line   6)
 * gsftopk:                               Font utilities available elsewhere.
                                                               (line  35)
@@ -3914,7 +3985,7 @@
 * install-formats Make target:           Additional targets.  (line  17)
 * install-mems Make target:              Additional targets.  (line  34)
 * installation:                          Installation.        (line   6)
-* interaction between TCX files and '-8bit'.: TCX files.      (line 104)
+* interaction between TCX files and -8bit.: TCX files.        (line 104)
 * interaction mode:                      Common options.      (line  50)
 * international characters:              TCX files.           (line   6)
 * introduction:                          Introduction.        (line   6)
@@ -3984,7 +4055,8 @@
 * memory dumps, creating:                Creating memory dumps.
                                                               (line   6)
 * mems Make target:                      Additional targets.  (line  34)
-* meta characters in filenames:          \input filenames.    (line  34)
+* meta characters in filenames:          \input filename caveats.
+                                                              (line  12)
 * Metafont:                              Metafont.            (line   6)
 * Metafont geometry:                     Online Metafont graphics.
                                                               (line  69)
@@ -4004,7 +4076,7 @@
                                                               (line  15)
 * MetaPost input files:                  mpost invocation.    (line  30)
 * MetaPost invocation:                   mpost invocation.    (line   6)
-* MetaPost source, prettyprinting:       mft invocation.      (line  78)
+* MetaPost source, prettyprinting:       mft invocation.      (line  79)
 * MetaPost, initial:                     Initial MetaPost.    (line   6)
 * MetaPost, TeX, and Metafont:           Three programs.      (line   6)
 * metatype1:                             Font utilities available elsewhere.
@@ -4044,6 +4116,8 @@
 * mptrap.readme:                         Triptrap.            (line   6)
 * MPX files, converting from DVI files:  dvitomp invocation.  (line   6)
 * Multi-lingual TeX:                     MLTeX.               (line   6)
+* multiple spaces, and \input filenames: \input filename caveats.
+                                                              (line   6)
 * N tilde:                               \charsubdef.         (line  36)
 * new graphics support for Metafont:     Online Metafont graphics.
                                                               (line  79)
@@ -4055,7 +4129,8 @@
                                                               (line  65)
 * NO_X11WIN:                             Online Metafont graphics.
                                                               (line  56)
-* NUL, not allowed in filenames:         \input filenames.    (line  34)
+* NUL, not allowed in filenames:         \input filename caveats.
+                                                              (line  12)
 * octal character codes, in TCX files:   TCX files.           (line  77)
 * offset for overflow labels:            gftodvi invocation.  (line  59)
 * online Metafont graphics:              Online Metafont graphics.
@@ -4081,7 +4156,7 @@
 * path searching:                        Path searching.      (line   6)
 * path searching debugging:              Common options.      (line  59)
 * PDF:                                   TeX extensions.      (line  20)
-* PDF, and '.mps' files:                 mpost invocation.    (line  86)
+* PDF, and .mps files:                   mpost invocation.    (line  86)
 * pdfTeX:                                TeX extensions.      (line  20)
 * permissions, legal:                    Legalisms.           (line   6)
 * PFA and PFB conversion:                Font utilities available elsewhere.
@@ -4114,13 +4189,13 @@
 * plain.bst:                             Basic BibTeX style files.
                                                               (line  11)
 * plain.fmt:                             Initial TeX.         (line  13)
-* plain.mft:                             mft invocation.      (line  66)
+* plain.mft:                             mft invocation.      (line  67)
 * pltotf:                                pltotf invocation.   (line   6)
 * pool file, writing:                    tangle invocation.   (line  16)
 * Poole, Simon:                          Online Metafont graphics.
                                                               (line  50)
 * pooltype:                              pooltype invocation. (line   6)
-* portable filenames:                    \input filenames.    (line  40)
+* portable filenames:                    \input filenames.    (line  25)
 * PostScript fonts, and Troff:           mpost invocation.    (line  65)
 * PostScript meets Metafont:             MetaPost.            (line   6)
 * PostScript output:                     mpost invocation.    (line  35)
@@ -4156,6 +4231,8 @@
 * PXL files, explained:                  Font file formats.   (line  39)
 * pxtoch:                                Font utilities available elsewhere.
                                                               (line  23)
+* quoted filename for \input:            \input quoted filename.
+                                                              (line   6)
 * Raichle, Bernd:                        MLTeX.               (line   6)
 * reading, additional:                   Introduction.        (line  60)
 * readonly directory, running TeX in:    Output file location.
@@ -4187,8 +4264,8 @@
                                                               (line  42)
 * security, and output files:            tex invocation.      (line  48)
 * security, and shell escapes:           Shell escapes.       (line   6)
-* security, and 'write':                 mpost invocation.    (line  92)
-* security, and '\openout':              tex invocation.      (line  48)
+* security, and write:                   mpost invocation.    (line  92)
+* security, and \openout:                tex invocation.      (line  48)
 * shapes:                                Metafont.            (line   6)
 * sharing memory dumps:                  Hardware and memory dumps.
                                                               (line   6)
@@ -4218,7 +4295,7 @@
 * string pool, writing:                  tangle invocation.   (line  16)
 * string representation:                 pooltype invocation. (line  30)
 * style design, for BibTeX:              bibtex invocation.   (line  49)
-* style files:                           mft invocation.      (line  66)
+* style files:                           mft invocation.      (line  67)
 * substitutions of font glyphs:          MLTeX.               (line   6)
 * sun:                                   Online Metafont graphics.
                                                               (line  42)
@@ -4235,6 +4312,8 @@
 * system C library function:             Shell escapes.       (line   6)
 * system command:                        Shell escapes.       (line   6)
 * T1 encoding and ISO input:             TCX files.           (line  48)
+* tabs, and \input filenames:            \input filename caveats.
+                                                              (line   6)
 * Tachikawa, Elizabeth:                  Font file formats.   (line  62)
 * tangle:                                tangle invocation.   (line   6)
 * targets, additional Make:              Additional targets.  (line   6)
@@ -4271,7 +4350,7 @@
                                                               (line  79)
 * TEXMFOUTPUT, used for reading:         Output file location.
                                                               (line  25)
-* TEXMFOUTPUT, used if '.' unwritable:   Output file location.
+* TEXMFOUTPUT, used if . unwritable:     Output file location.
                                                               (line  19)
 * texput:                                tex invocation.      (line  33)
 * TFM files, converting property lists to: pltotf invocation. (line   6)
@@ -4286,6 +4365,8 @@
 * time and date, in memory dumps:        Hardware and memory dumps.
                                                               (line  30)
 * title font:                            gftodvi invocation.  (line  33)
+* tokenization, and \input filenames:    \input filename caveats.
+                                                              (line   6)
 * toolkits, X:                           Online Metafont graphics.
                                                               (line  59)
 * torture tests:                         Triptrap.            (line   6)
@@ -4390,75 +4471,83 @@
 
 
 Tag Table:
-Node: Top2754
-Node: Introduction3751
-Node: Installation6911
-Node: configure options9013
-Node: Compile-time options11035
-Node: Additional targets12137
-Node: Triptrap13414
-Node: Runtime options14941
-Node: Commonalities16699
-Node: Option conventions17300
-Node: Common options18523
-Node: Path searching22903
-Node: Output file location23875
-Node: Three programs25200
-Node: Initial and virgin25954
-Node: Memory dumps26883
-Node: Creating memory dumps27339
-Node: Determining the memory dump to use28550
-Node: Hardware and memory dumps30131
-Node: Editor invocation32581
-Node: \input filenames33448
-Node: TeX36441
-Node: tex invocation37592
-Node: Initial TeX44495
-Node: Formats45859
-Node: Languages and hyphenation48785
-Node: MLTeX49215
-Node: \charsubdef50703
-Node: \tracingcharsubdef53026
-Node: TCX files53601
-Node: patgen invocation59041
-Node: Shell escapes59747
-Node: IPC and TeX63327
-Node: TeX extensions63897
-Node: Metafont65028
-Node: mf invocation66316
-Node: Initial Metafont70153
-Node: Modes71783
-Node: Online Metafont graphics74033
-Node: gftodvi invocation77458
-Node: mft invocation80278
-Node: MetaPost84276
-Node: mpost invocation85038
-Node: Initial MetaPost90214
-Node: dvitomp invocation91136
-Node: BibTeX91801
-Node: bibtex invocation92162
-Node: Basic BibTeX style files94636
-Node: WEB95966
-Node: tangle invocation97207
-Node: weave invocation99330
-Node: pooltype invocation100737
-Node: DVI utilities101867
-Node: dvicopy invocation102799
-Node: dvitype invocation104082
-Node: dvitype output example106417
-Node: Font utilities109468
-Node: Font file formats110648
-Node: gftopk invocation113917
-Node: pktogf invocation115108
-Node: pktype invocation116274
-Node: gftype invocation119097
-Node: tftopl invocation123600
-Node: pltotf invocation128193
-Node: vftovp invocation129244
-Node: vptovf invocation131479
-Node: Font utilities available elsewhere132506
-Node: Legalisms134886
-Node: References137040
-Node: Index141607
+Node: Top2765
+Node: Introduction3760
+Node: Installation6918
+Node: configure options9020
+Node: Compile-time options11042
+Node: Additional targets12144
+Node: Triptrap13421
+Node: Runtime options14948
+Node: Commonalities16706
+Node: Option conventions17307
+Node: Common options18530
+Node: Path searching22910
+Node: Output file location23882
+Node: Three programs25207
+Node: Initial and virgin25973
+Node: Memory dumps26902
+Node: Creating memory dumps27358
+Node: Determining the memory dump to use28569
+Node: Hardware and memory dumps30150
+Node: Editor invocation32600
+Node: \input filenames33467
+Node: \input quoted filename35012
+Node: \input braced filename35793
+Node: \input filename caveats36727
+Node: TeX38245
+Node: tex invocation39396
+Node: Initial TeX46299
+Node: Formats47663
+Node: Languages and hyphenation50589
+Node: MLTeX51019
+Node: \charsubdef52507
+Node: \tracingcharsubdef54830
+Node: TCX files55405
+Node: patgen invocation60845
+Node: Shell escapes61551
+Node: IPC and TeX65131
+Node: TeX extensions65701
+Node: Metafont66832
+Node: mf invocation68120
+Node: Initial Metafont71957
+Node: Modes73587
+Node: Online Metafont graphics75837
+Node: gftodvi invocation79262
+Node: mft invocation82082
+Node: MetaPost86080
+Node: mpost invocation86842
+Node: Initial MetaPost92018
+Node: dvitomp invocation92940
+Node: BibTeX93605
+Node: bibtex invocation93966
+Node: Basic BibTeX style files96440
+Node: WEB97770
+Node: tangle invocation98979
+Node: weave invocation101102
+Node: pooltype invocation102509
+Node: DVI utilities103639
+Node: dvicopy invocation104571
+Node: dvitype invocation105854
+Node: dvitype output example108183
+Node: Font utilities111234
+Node: Font file formats112414
+Node: gftopk invocation115683
+Node: pktogf invocation116874
+Node: pktype invocation118040
+Node: gftype invocation120863
+Node: tftopl invocation125366
+Node: pltotf invocation129959
+Node: vftovp invocation131010
+Node: vptovf invocation133245
+Node: Font utilities available elsewhere134272
+Node: Legalisms136652
+Node: References138806
+Node: Index143373
 
 End Tag Table
+
+
+Local Variables:
+coding: utf-8
+End:

Modified: trunk/Build/source/texk/web2c/doc/web2c.texi
===================================================================
--- trunk/Build/source/texk/web2c/doc/web2c.texi	2020-03-12 17:03:25 UTC (rev 54254)
+++ trunk/Build/source/texk/web2c/doc/web2c.texi	2020-03-12 17:55:08 UTC (rev 54255)
@@ -12,7 +12,7 @@
 @end tex
 
 @set version 2020
- at set month-year January 2020
+ at set month-year March 2020
 
 @c Define new indices for commands in auxiliary files, filenames, and options.
 @defcodeindex cm
@@ -63,7 +63,7 @@
 an implementation of Donald Knuth's TeX system.
 
 Copyright @copyright{} 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-2004, 2005, 2007, 2008, 2009 Karl Berry & Olaf Weber.
+2004, 2005, 2007, 2008, 2009, 2010-2020 Karl Berry & Olaf Weber.
 
 Permission is granted to make and distribute verbatim copies of this
 manual provided the copyright notice and this permission notice are
@@ -88,7 +88,6 @@
 
 
 @titlepage
-
 @title Web2c
 @subtitle for version @value{version}
 @subtitle @value{month-year}
@@ -525,7 +524,7 @@
 * Initial and virgin::          Making memory dumps vs. production runs.
 * Memory dumps::                .fmt/.base files for fast startup.
 * Editor invocation::           The `e' response at errors.
-* \input filenames::            ~ and $ expansion in TeX/MF/MP.
+* \input filenames::            Filename delimiters and Kpathsea expansion.
 @end menu
 
 
@@ -808,9 +807,42 @@
 @code{\input} that allow different notation; here we are concerned only
 with the primitive operation.)  
 
-As of Web2c version 7.5.3, double-quote characters can be used to
-include spaces or other special cases.  In typical use, the @samp{"}
-characters surround the entire filename:
+As (allowed) extensions to standard @TeX{}, Web2c also supports
+specifying the filename in double quotes (@code{"some name"}) and in
+braces (@code{@{"some name"@}}), which is convenient for filenames
+containing spaces or other special characters, as described in the
+sections below.
+
+In all cases, space tokens are ignored after the filename is read.
+
+ at cindex @code{"} character, ignored in filenames
+ at cindex double quote character, ignored in filenames
+Also, double quote (@code{"}) characters are ignored within the
+filename; there is no way to read files whose names contain a @code{"}.
+
+ at cindex portable filenames
+However, for maximal portability of your document across systems, use
+only the characters @samp{a}-- at samp{z}, @samp{0}-- at samp{9}, and
+ at samp{.}.  Do not use anything but simple filenames, since directory
+separators vary among systems; instead, add the necessary directories
+to the appropriate search path.
+
+ at menu
+* Quotes: \input quoted filename.   \input "some name"
+* Braces: \input braced filename.   \input @{some name@}
+* Caveats: \input filename caveats. Tokenization, nulls, Kpathsea expansion.
+ at end menu
+
+
+ at node \input quoted filename
+ at subsubsection @code{\input} quoted filename: @code{\input "some name"}
+
+ at cindex @code{\input} quoted filename
+ at cindex quoted filename for @code{\input}
+
+As of Web2c version 7.5.3 (2004), double-quote characters can be used
+to include spaces or other special characters.  In typical use, the
+ at samp{"} characters surround the entire filename:
 @example
 \input "filename with spaces"
 @end example
@@ -821,17 +853,58 @@
 \input filename" "with" "spaces
 @end example
 
-One more point.  In @LaTeX{}, the quotes are needed inside the braces, thus
+One more point.  In @LaTeX{}, the quotes are needed inside the braces
+of its @code{\input} macro, thus:
 @example
 \input@{a b@}    % fails
 \input@{"a b"@}  % ok
 @end example
 
-This quoting mechanism comes into play @emph{after} @TeX{} has
-tokenized and expanded the input.  So, multiple spaces and tabs may be
-seen as a single space, active characters such as @samp{~} are
-expanded first, and so on.  (See below.)
+There is no way to quote the quote character.
 
+
+ at node \input braced filename
+ at subsubsection @code{\input} braced filename: @code{\input@{some name@}}
+
+ at cindex @code{\input} braced (grouped) filename
+ at cindex braced filename for @code{\input}
+ at cindex group-delimited filename for @code{\input}
+
+As of Web2c 2020, @code{\input} filenames in @TeX{} engines (this does
+not apply in Metafont and MetaPost) can also be specified within a
+ at TeX{} group, typically curly braces. For example:
+ at example
+\input@{filename with spaces@}
+ at end example
+
+As always with @TeX{}, the brace characters are not hardwired; what
+counts is the category code: the first token after the @code{\input}
+must be of catcode at tie{}1 (begin group), and it is matched with the
+next character of catcode at tie{}2 (end group).
+
+Within the group-delimited filename, braces are treated as normal
+characters.
+
+As with all forms of filenames, following spaces are ignored (after
+the end group), and double quote (@code{"}) characters are ignored
+within the filename.
+
+
+ at node \input filename caveats
+ at subsubsection @code{\input} filename caveats
+
+ at cindex @code{\input} filename caveats
+ at cindex caveats for @code{\input} filenames
+ at cindex tokenization, and @code{\input} filenames
+ at cindex expansion, and @code{\input} filenames
+ at cindex multiple spaces, and @code{\input} filenames
+ at cindex tabs, and @code{\input} filenames
+The quoting mechanisms just described come into play @emph{after}
+ at TeX{} has tokenized and expanded the input.  So, multiple spaces and
+tabs will generally be seen as a single space, active characters such
+as @samp{~} are expanded first (generally causing an error), and so
+on.  More examples below.
+
 @cindex NUL, not allowed in filenames
 @cindex eight-bit characters in filenames
 @cindex meta characters in filenames
@@ -839,42 +912,29 @@
 byte (character code zero, ASCII NUL) to terminate strings.  So
 filenames in Web2c cannot contain nulls, even though @TeX{} itself does
 not treat NUL specially.
-In addition, some older Unix variants do not allow eight-bit characters
-(codes 128--255) in filenames.
 
- at cindex portable filenames
-For maximal portability of your document across systems, use only the
-characters @samp{a}-- at samp{z}, @samp{0}-- at samp{9}, and @samp{.}, and
-restrict your filenames to at most eight characters (not including the
-extension), and at most a three-character extension.  Do not use
-anything but simple filenames, since directory separators vary among
-systems; instead, add the necessary directories to the appropriate
-search path.
-
 @kindex ~ @r{expansion in filenames}
 @kindex $ @r{expansion in filenames}
 Finally, the present Web2c implementation does @samp{~} and @samp{$}
-expansion on @var{name}, unlike Knuth's original implementation and
-older versions of Web2c.  Thus:
+expansion on @var{name}, unlike Knuth's original implementation.
+Thus:
 @example
 \input ~jsmith/$foo.bar
 @end example
-will dereference the environment variable or Kpathsea config file value
- at samp{foo} and read that file extended with @samp{.bar} in user
- at samp{jsmith}'s home directory.  You can also use braces, as in
- at samp{$@{foo@}bar}, if you want to follow the variable name with a letter,
-numeral, or @samp{_}.
+will dereference the environment variable or Kpathsea config file
+value @samp{foo} and read that file, extended with @samp{.bar}, in
+user @samp{jsmith}'s home directory.  You can also use braces in the
+variable expansion, as in @samp{$@{foo@}bar}, if you want to follow
+the variable name with a letter, numeral, or @samp{_}.
 
 (So another way to get a program to read a filename containing
 whitespace is to define an environment variable and dereference it.)
 
- at findex \string
-In all the common @TeX{} formats (plain @TeX{}, @LaTeX{}, AMS at TeX{}),
-the characters @samp{~} and @samp{$} have special category codes, so to
-actually use these in a document you have to change their catcodes or
-use @code{\string}.  (The result is unportable anyway, see the
-suggestions above.)  The place where they are most likely to be useful
-is when typing interactively.
+ at findex \string at r{, and @code{\input filenames}}
+In all the common @TeX{} formats (plain @TeX{}, @LaTeX{}, Con at TeX{}t,
+AMS at TeX{}, @dots{}), the characters @samp{~} and @samp{$} have special
+category codes, so to actually use these in a document you have to
+change their catcodes or use @code{\string}.
 
 
 @node TeX



More information about the tex-live-commits mailing list.