/ [latexrefman] / trunk / latex2e.texi
To checkout: svn checkout http://svn.gnu.org.ua/sources/latexrefman/trunk/latex2e.texi
Puszcza

Diff of /trunk/latex2e.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 760 by karl, Sun Mar 15 22:27:18 2020 UTC revision 777 by vincentb1, Mon Mar 30 10:20:37 2020 UTC
# Line 17914  Line 17914 
17914  @end example  @end example
17915    
17916  This can be useful for putting documentation or comments at the end of a  This can be useful for putting documentation or comments at the end of a
17917  file, or for avoiding junk characters that can be added during mailing.  file, or for avoiding junk characters that can be added if the file is
17918  It is also useful for debugging: one strategy to localize errors is to  transmitted in the body of an email.  It is also useful for debugging:
17919  put @code{\endinput} halfway through the included file and see if the  one strategy to localize errors is to put @code{\endinput} halfway
17920  error disappears.  Now, knowing which half contains the error, moving  through the included file and see if the error disappears.  Now, knowing
17921  @code{\endinput} to halfway through that area further narrows down the  which half contains the error, moving @code{\endinput} to halfway
17922  location. This process rapidly finds the offending line.  through that area further narrows down the location. This process
17923    rapidly finds the offending line.
17924    
17925  After reading @code{\endinput}, @LaTeX{} continues to read to the end of  After reading @code{\endinput}, @LaTeX{} continues to read to the end of
17926  the line, so something can follow this command and be read nonetheless.  the line, so something can follow this command and be read nonetheless.
# Line 18227  Line 18228 
18228  contents commands; for instance, these work with information stored in  contents commands; for instance, these work with information stored in
18229  @file{.lof} and @file{.lot} files.  @file{.lof} and @file{.lot} files.
18230    
 @PkgIndex{babel}  
 @PkgIndex{polyglossia}  
18231  To change the header for the table of contents page do something like  To change the header for the table of contents page do something like
18232  the first line here.  the first line here.
18233    
# Line 18239  Line 18238 
18238  @end example  @end example
18239    
18240  @noindent  @noindent
18241    @PkgIndex{babel}
18242    @PkgIndex{polyglossia}
18243  Similarly, the other two lines will do the other two.  Similarly, the other two lines will do the other two.
18244  Internationalization packages such as @file{babel} or @file{polyglossia}  Internationalization packages such as @file{babel} or @file{polyglossia}
18245  will change the headers depending on the chosen base language.  will change the headers depending on the chosen base language.
# Line 19560  Line 19561 
19561  the ten digits, along with underscore and dash, and in particular with  the ten digits, along with underscore and dash, and in particular with
19562  no dot or space.  no dot or space.
19563    
19564  For @code{openin}, if @TeX{} cannot find the file then it does not give  For @code{\openin}, if @TeX{} cannot find the file then it does not give
19565  an error.  It just considers that the stream is not open (test for this  an error.  It just considers that the stream is not open (test for this
19566  with @code{\ifeof}; one recourse is the command  with @code{\ifeof}; one recourse is the command
19567  @code{\InputIfFileExists}, @pxref{Class and package commands}).  If you  @code{\InputIfFileExists}, @pxref{Class and package commands}).  If you
# Line 19591  Line 19592 
19592  @example  @example
19593  \newread\recipientfile  \newread\recipientfile
19594  \openin\recipientfile=email  \openin\recipientfile=email
19595  \read\file to\email  \read\recipientfile to\email
19596  \typeout@{Email address: \email@}  \typeout@{Email address: \email@}
19597  \closein\recipientfile  \closein\recipientfile
19598  @end example  @end example
# Line 19730  Line 19731 
19731  \write@var{number}@{@var{string}@}  \write@var{number}@{@var{string}@}
19732  @end example  @end example
19733    
19734  Write @code{string} to the log file, to the terminal, or to a file  Write @var{string} to the log file, to the terminal, or to a file
19735  opened by @code{\openout}.  For instance, @code{\write6} writes to text  opened by @code{\openout}.  For instance, @code{\write6} writes to text
19736  stream number@tie{}6.  stream number@tie{}6.
19737    
# Line 19750  Line 19751 
19751    
19752  @noindent  @noindent
19753  The @code{\newwrite} allocates a stream number, giving it a symbolic  The @code{\newwrite} allocates a stream number, giving it a symbolic
19754  names to make life easier, so that @code{test  name to make life easier, so that @code{test
19755  \newwrite\myfile\the\myfile} produces something like @samp{test 3}.  \newwrite\myfile\the\myfile} produces something like @samp{test 3}.
19756  Then @code{\openout} associates the stream number with the given file  Then @code{\openout} associates the stream number with the given file
19757  name.  With that, @code{\write3} puts the string in the file.  name.  With that, @code{\write3} puts the string in the file.
# Line 19770  Line 19771 
19771  In Lua@TeX{}, instead of 16 output streams there are 256  In Lua@TeX{}, instead of 16 output streams there are 256
19772  (@pxref{@TeX{} engines}).  (@pxref{@TeX{} engines}).
19773    
19774  Write to the current @file{.aux} file, which is associated with the main  Write to the current @file{.aux} file, which is associated with the root
19775  file or with the current include file, using  file or with the current include file, using
19776  @code{\write\@@auxout@{@var{string}@}}.  Write to the main @file{.aux}  @code{\write\@@auxout@{@var{string}@}}.  Write to the main @file{.aux}
19777  file using @code{\write\@@mainaux@{@var{string}@}}.  file using @code{\write\@@mainaux@{@var{string}@}}.
# Line 19788  Line 19789 
19789  \protected@@write\@@auxout@{@}@{@var{string}@}  \protected@@write\@@auxout@{@}@{@var{string}@}
19790  @end example  @end example
19791    
19792  With the first, @LaTeX{} writes @var{string} to the file.  Any commands  With the first, @LaTeX{} writes @var{string} to the file.  Any macros in
19793  in @var{string} will be expanded (just as in @code{\edef} so that to  @var{string} will be expanded (just as in @code{\edef} so that to
19794  prevent expansion you should use @code{\noexpand} or a @code{toks},  prevent expansion you should use @code{\noexpand} or a @code{toks},
19795  except that you should use @code{#} instead of @code{##}).  With the  except that you should use @code{#} instead of @code{##}).  With the
19796  second, @var{string} is stored on the current list of things (as a  second, @var{string} is stored on the current list of things (as a
19797  @TeX{} ``whatsit'') and kept until the page is shipped out and likewise  @TeX{} ``whatsit'') and kept until the page is shipped out and likewise
19798  the commands are unexpanded until shipout.  The third,  the macros are unexpanded until shipout.  The third,
19799  @code{\protected@@write}, is like the second except that you can use  @code{\protected@@write}, is like the second except that you can use
19800  @code{\protect} on fragile commands. The extra first argument allows you  @code{\protect} on fragile macros. The extra first argument allows you
19801  to locally insert extra definitions to make more commands be safe or  to locally insert extra definitions to make more macros be safe or
19802  have special definition during the write.  have special definition during the write.
19803    
19804  Here @var{string} contains a control sequence.  Here @var{string} contains a control sequence.
# Line 19847  Line 19848 
19848  error when trying to use commands such as @code{\include@{../filename@}}  error when trying to use commands such as @code{\include@{../filename@}}
19849  because @LaTeX{} will try to open @file{../filename.aux}.  The simplest  because @LaTeX{} will try to open @file{../filename.aux}.  The simplest
19850  solution is to put the included files in the same directory as the  solution is to put the included files in the same directory as the
19851  master file, or in subdirectories.  root file, or in subdirectories.
19852    
19853  @PkgIndex{answers}  @PkgIndex{answers}
19854  A common case where authors want to write a file not already provided by  A common case where authors want to write a file not already provided by
19855  @LaTeX{} is for answers to exercises, or some other situation where you  @LaTeX{} is for answers to exercises, or some other situation where you
19856  want to write out verbatim, without expanding the commands.  CTAN has a  want to write out verbatim, without expanding the macros.  CTAN has a
19857  number of packages for this; one is @file{answers}.  number of packages for this; one is @file{answers}.
19858    
19859  @menu  @menu
# Line 19873  Line 19874 
19874  \message@{@var{string}@}  \message@{@var{string}@}
19875  @end example  @end example
19876    
19877  Write @code{string} to the log file and the terminal.  Write @var{string} to the log file and the terminal.
19878    
19879  Typically, @LaTeX{} authors use @code{\typeout} (@pxref{\typeout}). It  Typically, @LaTeX{} authors use @code{\typeout} (@pxref{\typeout}). It
19880  allows you to use @code{\protect} on any fragile commands in  allows you to use @code{\protect} on any fragile commands in

Legend:
Removed from v.760  
changed lines
  Added in v.777

Send suggestions and bug reports to Sergey Poznyakoff
ViewVC Help
Powered by ViewVC 1.1.20