[latexrefman-commits] [SCM] latexrefman updated: r605 - trunk

jimhefferon at gnu.org.ua jimhefferon at gnu.org.ua
Thu Feb 22 20:04:54 CET 2018


Author: jimhefferon
Date: 2018-02-22 21:04:54 +0200 (Thu, 22 Feb 2018)
New Revision: 605

Modified:
   trunk/ChangeLog
   trunk/latex2e.html
   trunk/latex2e.info
   trunk/latex2e.pdf
   trunk/latex2e.texi
Log:
add \ignorespaces and \ignorespacesafterend

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2018-02-19 18:29:38 UTC (rev 604)
+++ trunk/ChangeLog	2018-02-22 19:04:54 UTC (rev 605)
@@ -1,3 +1,7 @@
+2018-02-21  Jim Hefferon  <jhefferon at smcvt.edu>
+
+	* latex2e.texi (\ignorespaces & \ignorespacesafterend): Create.
+
 2018-02-19  Karl Berry  <karl at freefriends.org>
 
 	* latex2e.texi (\list),
@@ -6,6 +10,11 @@
 	(\AtBeginDocument, \AtEndDocument): @subsection commands needed.
 	Various typos etc. throughout.
 
+2018-02-11  Jim Hefferon  <jhefferon at smcvt.edu>
+
+	* latex2e.texi (list environment): Move list parameters to this
+	entry.
+
 2018-01-02  Vincent Belaïche  <vincentb1 at users.sourceforge.net>
 
 	* latex2e-fr.texi (thebibliography, Upper and lower case): Align

Modified: trunk/latex2e.html
===================================================================
--- trunk/latex2e.html	2018-02-19 18:29:38 UTC (rev 604)
+++ trunk/latex2e.html	2018-02-22 19:04:54 UTC (rev 605)
@@ -34,9 +34,8 @@
 
 Permission is granted to copy and distribute translations of this manual
 into another language, under the above conditions for modified versions. -->
-<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
+<!-- Created by GNU Texinfo 6.1, http://www.gnu.org/software/texinfo/ -->
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <title>LaTeX2e unofficial reference manual (February 2018)</title>
 
 <meta name="description" content="LaTeX2e unofficial reference manual (February 2018)">
@@ -44,6 +43,7 @@
 <meta name="resource-type" content="document">
 <meta name="distribution" content="global">
 <meta name="Generator" content="makeinfo">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <link href="#Top" rel="start" title="Top">
 <link href="#Concept-Index" rel="index" title="Concept Index">
 <link href="#SEC_Contents" rel="contents" title="Table of Contents">
@@ -304,6 +304,7 @@
     <li><a name="toc-_005cnewtheorem-1" href="#g_t_005cnewtheorem">12.7 <code>\newtheorem</code></a></li>
     <li><a name="toc-_005cnewfont_003a-Define-a-new-font-_0028obsolete_0029" href="#g_t_005cnewfont">12.8 <code>\newfont</code>: Define a new font (obsolete)</a></li>
     <li><a name="toc-_005cprotect-1" href="#g_t_005cprotect">12.9 <code>\protect</code></a></li>
+    <li><a name="toc-_005cignorespaces-_0026-_005cignorespacesafterend-1" href="#g_t_005cignorespaces-_0026-_005cignorespacesafterend">12.10 <code>\ignorespaces & \ignorespacesafterend</code></a></li>
   </ul></li>
   <li><a name="toc-Counters-1" href="#Counters">13 Counters</a>
   <ul class="no-bullet">
@@ -7910,6 +7911,8 @@
 </td></tr>
 <tr><td align="left" valign="top">• <a href="#g_t_005cprotect" accesskey="9">\protect</a>:</td><td>  </td><td align="left" valign="top">Using tricky commands.
 </td></tr>
+<tr><td align="left" valign="top">• <a href="#g_t_005cignorespaces-_0026-_005cignorespacesafterend">\ignorespaces & \ignorespacesafterend</a>:</td><td>  </td><td align="left" valign="top">Discard extra spaces.
+</td></tr>
 </table>
 
 
@@ -8507,7 +8510,7 @@
 <a name="g_t_005cprotect"></a>
 <div class="header">
 <p>
-Previous: <a href="#g_t_005cnewfont" accesskey="p" rel="prev">\newfont</a>, Up: <a href="#Definitions" accesskey="u" rel="up">Definitions</a>   [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
+Next: <a href="#g_t_005cignorespaces-_0026-_005cignorespacesafterend" accesskey="n" rel="next">\ignorespaces & \ignorespacesafterend</a>, Previous: <a href="#g_t_005cnewfont" accesskey="p" rel="prev">\newfont</a>, Up: <a href="#Definitions" accesskey="u" rel="up">Definitions</a>   [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
 </div>
 <a name="g_t_005cprotect-1"></a>
 <h3 class="section">12.9 <code>\protect</code></h3>
@@ -8575,6 +8578,102 @@
 
 
 <hr>
+<a name="g_t_005cignorespaces-_0026-_005cignorespacesafterend"></a>
+<div class="header">
+<p>
+Previous: <a href="#g_t_005cprotect" accesskey="p" rel="prev">\protect</a>, Up: <a href="#Definitions" accesskey="u" rel="up">Definitions</a>   [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="g_t_005cignorespaces-_0026-_005cignorespacesafterend-1"></a>
+<h3 class="section">12.10 <code>\ignorespaces & \ignorespacesafterend</code></h3>
+
+<a name="index-_005cignorespaces"></a>
+<a name="index-_005cignorespacesafterend"></a>
+<a name="index-spaces_002c-ignore-around-commands"></a>
+<a name="index-commands_002c-ignore-spaces"></a>
+
+<p>Synopsis:
+</p>
+<div class="example">
+<pre class="example">\ignorespaces
+</pre></div>
+
+<p>or
+</p>
+<div class="example">
+<pre class="example">\ignorespacesafterend
+</pre></div>
+
+<p>Both commands cause LaTeX to ignore spaces after the end of the
+command up until the first non-space character.  The first is a command
+from Plain TeX, and the second is LaTeX-specific.
+</p>
+<p>The <code>ignorespaces</code> is often used when defining commands via
+<code>\newcommand</code>, or <code>\newenvironment</code>, or <code>\def</code>.  The
+example below illustrates.  It allows a user to show the points values
+for quiz questions in the margin but it is inconvenient because, as
+shown in the <code>enumerate</code> list, users must not put any space between
+the command and the question text.
+</p>
+<div class="example">
+<pre class="example">\newcommand{\points}[1]{\makebox[0pt]{\makebox[10em][l]{#1~pts}}
+\begin{enumerate} 
+  \item\points{10}no extra space output here
+  \item\points{15} extra space output between the number and the word `extra'
+\end{enumerate} 
+</pre></div>
+
+<p>The solution is to change to
+<code>\newcommand{\points}[1]{\makebox[0pt]{\makebox[10em][l]{#1~pts}}\ignorespaces}</code>.
+</p>
+<p>A second example shows spaces being removed from the front of text.  The
+commands below allow a user to uniformily attach a title to names.  But,
+as given, if a title accidentally starts with a space then
+<code>\fullname</code> will reproduce that.
+</p>
+<div class="example">
+<pre class="example">\makeatletter
+\newcommand{\honorific}[1]{\def\@honorific{#1}} % remember title
+\newcommand{\fullname}[1]{\@honorific~#1}       % recall title; put before name
+\makeatother
+\begin{tabular}{|l|}
+\honorific{Mr/Ms}  \fullname{Jones} \\  % no extra space here
+\honorific{ Mr/Ms} \fullname{Jones}     % extra space before title
+\end{tabular}
+</pre></div>
+
+<p>To fix this, change to
+<code>\newcommand{\fullname}[1]{\ignorespaces\@honorific~#1}</code>.
+</p>
+<p>The <code>\ignorespaces</code> is also often used in a <code>\newenvironment</code>
+at the end of the <var>begin</var> clause, that is, as part of the second
+argument, as in <code>\begin{newenvironment}{<var>env
+name</var>}{... \ignorespaces}{...}</code>.
+</p>
+<p>To strip spaces off the end of an environment use
+<code>\ignorespacesafterend</code>.  An example is that this will show a much
+larger vertical space between the first and second environments than
+between the second and third.
+</p>
+<div class="example">
+<pre class="example">\newenvironment{eq}{\begin{equation}}{\end{equation}}
+\begin{eq}
+e=mc^2
+\end{eq}
+\begin{equation}
+F=ma
+\end{equation}
+\begin{equation}
+E=IR
+\end{equation}
+</pre></div>
+
+<p>Putting a comment character <code>%</code> immediately after every
+<code>\end{eq}</code> will make the vertical space disappear, but that is
+inconvenient.  The solution is to change to
+<code>\newenvironment{eq}{\begin{equation}}{\end{equation}\ignorespacesafterend}</code>.
+</p>
+
+<hr>
 <a name="Counters"></a>
 <div class="header">
 <p>
@@ -15105,6 +15204,7 @@
 <tr><td></td><td valign="top"><a href="#index-commands_002c-defining-new-ones">commands, defining new ones</a>:</td><td> </td><td valign="top"><a href="#g_t_005cnewcommand-_0026-_005crenewcommand">\newcommand & \renewcommand</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-commands_002c-defining-new-ones-1">commands, defining new ones</a>:</td><td> </td><td valign="top"><a href="#g_t_005cprovidecommand">\providecommand</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-commands_002c-document-class">commands, document class</a>:</td><td> </td><td valign="top"><a href="#Class-and-package-construction">Class and package construction</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-commands_002c-ignore-spaces">commands, ignore spaces</a>:</td><td> </td><td valign="top"><a href="#g_t_005cignorespaces-_0026-_005cignorespacesafterend">\ignorespaces & \ignorespacesafterend</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-commands_002c-redefining">commands, redefining</a>:</td><td> </td><td valign="top"><a href="#g_t_005cnewcommand-_0026-_005crenewcommand">\newcommand & \renewcommand</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-commands_002c-star_002dvariants">commands, star-variants</a>:</td><td> </td><td valign="top"><a href="#g_t_005c_0040ifstar">\@ifstar</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-composite-word-mark_002c-in-text">composite word mark, in text</a>:</td><td> </td><td valign="top"><a href="#Text-symbols">Text symbols</a></td></tr>
@@ -15582,6 +15682,7 @@
 <tr><td></td><td valign="top"><a href="#index-space_002c-inserting-vertical">space, inserting vertical</a>:</td><td> </td><td valign="top"><a href="#g_t_005caddvspace">\addvspace</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-space_002c-vertical">space, vertical</a>:</td><td> </td><td valign="top"><a href="#g_t_005cvspace">\vspace</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-spaces">spaces</a>:</td><td> </td><td valign="top"><a href="#Spaces">Spaces</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-spaces_002c-ignore-around-commands">spaces, ignore around commands</a>:</td><td> </td><td valign="top"><a href="#g_t_005cignorespaces-_0026-_005cignorespacesafterend">\ignorespaces & \ignorespacesafterend</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-spacing-within-math-mode">spacing within math mode</a>:</td><td> </td><td valign="top"><a href="#Spacing-in-math-mode">Spacing in math mode</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-spacing_002c-inter_002dsentence">spacing, inter-sentence</a>:</td><td> </td><td valign="top"><a href="#g_t_005cfrenchspacing">\frenchspacing</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-Spanish-ordinals_002c-feminine-and-masculine">Spanish ordinals, feminine and masculine</a>:</td><td> </td><td valign="top"><a href="#Text-symbols">Text symbols</a></td></tr>
@@ -16171,6 +16272,8 @@
 <tr><td></td><td valign="top"><a href="#index-_005ci-_0028dotless-i_0029"><code>\i <span class="roman">(dotless i)</span></code></a>:</td><td> </td><td valign="top"><a href="#Accents">Accents</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-_005ciff"><code>\iff</code></a>:</td><td> </td><td valign="top"><a href="#Math-symbols">Math symbols</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-_005cIfFileExists"><code>\IfFileExists</code></a>:</td><td> </td><td valign="top"><a href="#Class-and-package-commands">Class and package commands</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-_005cignorespaces"><code>\ignorespaces</code></a>:</td><td> </td><td valign="top"><a href="#g_t_005cignorespaces-_0026-_005cignorespacesafterend">\ignorespaces & \ignorespacesafterend</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-_005cignorespacesafterend"><code>\ignorespacesafterend</code></a>:</td><td> </td><td valign="top"><a href="#g_t_005cignorespaces-_0026-_005cignorespacesafterend">\ignorespaces & \ignorespacesafterend</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-_005cij-_0028ij_0029"><code>\ij (ij)</code></a>:</td><td> </td><td valign="top"><a href="#Additional-Latin-letters">Additional Latin letters</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-_005cIJ-_0028IJ_0029"><code>\IJ (IJ)</code></a>:</td><td> </td><td valign="top"><a href="#Additional-Latin-letters">Additional Latin letters</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-_005cIm"><code>\Im</code></a>:</td><td> </td><td valign="top"><a href="#Math-symbols">Math symbols</a></td></tr>

Modified: trunk/latex2e.info
===================================================================
--- trunk/latex2e.info	2018-02-19 18:29:38 UTC (rev 604)
+++ trunk/latex2e.info	2018-02-22 19:04:54 UTC (rev 605)
@@ -1,4 +1,4 @@
-This is latex2e.info, produced by makeinfo version 6.5 from
+This is latex2e.info, produced by makeinfo version 6.1 from
 latex2e.texi.
 
 This document is an unofficial reference manual for LaTeX, a document
@@ -5195,6 +5195,7 @@
 * \newtheorem::                           Define a new theorem-like environment.
 * \newfont::                              Define a new font name.
 * \protect::                              Using tricky commands.
+* \ignorespaces & \ignorespacesafterend:: Discard extra spaces.
 
 
 File: latex2e.info,  Node: \newcommand & \renewcommand,  Next: \providecommand,  Up: Definitions
@@ -5635,7 +5636,7 @@
      \testfontscaled abc
 
 
-File: latex2e.info,  Node: \protect,  Prev: \newfont,  Up: Definitions
+File: latex2e.info,  Node: \protect,  Next: \ignorespaces & \ignorespacesafterend,  Prev: \newfont,  Up: Definitions
 
 12.9 '\protect'
 ===============
@@ -5690,6 +5691,82 @@
      ...
 
 
+File: latex2e.info,  Node: \ignorespaces & \ignorespacesafterend,  Prev: \protect,  Up: Definitions
+
+12.10 '\ignorespaces & \ignorespacesafterend'
+=============================================
+
+Synopsis:
+
+     \ignorespaces
+
+   or
+
+     \ignorespacesafterend
+
+   Both commands cause LaTeX to ignore spaces after the end of the
+command up until the first non-space character.  The first is a command
+from Plain TeX, and the second is LaTeX-specific.
+
+   The 'ignorespaces' is often used when defining commands via
+'\newcommand', or '\newenvironment', or '\def'.  The example below
+illustrates.  It allows a user to show the points values for quiz
+questions in the margin but it is inconvenient because, as shown in the
+'enumerate' list, users must not put any space between the command and
+the question text.
+
+     \newcommand{\points}[1]{\makebox[0pt]{\makebox[10em][l]{#1~pts}}
+     \begin{enumerate}
+       \item\points{10}no extra space output here
+       \item\points{15} extra space output between the number and the word `extra'
+     \end{enumerate}
+
+   The solution is to change to
+'\newcommand{\points}[1]{\makebox[0pt]{\makebox[10em][l]{#1~pts}}\ignorespaces}'.
+
+   A second example shows spaces being removed from the front of text.
+The commands below allow a user to uniformily attach a title to names.
+But, as given, if a title accidentally starts with a space then
+'\fullname' will reproduce that.
+
+     \makeatletter
+     \newcommand{\honorific}[1]{\def\@honorific{#1}} % remember title
+     \newcommand{\fullname}[1]{\@honorific~#1}       % recall title; put before name
+     \makeatother
+     \begin{tabular}{|l|}
+     \honorific{Mr/Ms}  \fullname{Jones} \\  % no extra space here
+     \honorific{ Mr/Ms} \fullname{Jones}     % extra space before title
+     \end{tabular}
+
+   To fix this, change to
+'\newcommand{\fullname}[1]{\ignorespaces\@honorific~#1}'.
+
+   The '\ignorespaces' is also often used in a '\newenvironment' at the
+end of the BEGIN clause, that is, as part of the second argument, as in
+'\begin{newenvironment}{ENV NAME}{... \ignorespaces}{...}'.
+
+   To strip spaces off the end of an environment use
+'\ignorespacesafterend'.  An example is that this will show a much
+larger vertical space between the first and second environments than
+between the second and third.
+
+     \newenvironment{eq}{\begin{equation}}{\end{equation}}
+     \begin{eq}
+     e=mc^2
+     \end{eq}
+     \begin{equation}
+     F=ma
+     \end{equation}
+     \begin{equation}
+     E=IR
+     \end{equation}
+
+   Putting a comment character '%' immediately after every '\end{eq}'
+will make the vertical space disappear, but that is inconvenient.  The
+solution is to change to
+'\newenvironment{eq}{\begin{equation}}{\end{equation}\ignorespacesafterend}'.
+
+
 File: latex2e.info,  Node: Counters,  Next: Lengths,  Prev: Definitions,  Up: Top
 
 13 Counters
@@ -8041,7 +8118,7 @@
 Synopsis:
 
      \begin{lrbox}{\CMD}
-       TEXT
+       TEXT 
      \end{lrbox}
 
    This is the environment form of *note '\sbox': \sbox.
@@ -9612,6 +9689,8 @@
 * commands, defining new ones <1>:       \providecommand.     (line   6)
 * commands, document class:              Class and package construction.
                                                               (line   6)
+* commands, ignore spaces:               \ignorespaces & \ignorespacesafterend.
+                                                              (line   6)
 * commands, redefining:                  \newcommand & \renewcommand.
                                                               (line   6)
 * commands, star-variants:               \@ifstar.            (line   6)
@@ -10150,6 +10229,8 @@
 * space, inserting vertical:             \addvspace.          (line   6)
 * space, vertical:                       \vspace.             (line   6)
 * spaces:                                Spaces.              (line   6)
+* spaces, ignore around commands:        \ignorespaces & \ignorespacesafterend.
+                                                              (line   6)
 * spacing within math mode:              Spacing in math mode.
                                                               (line   6)
 * spacing, inter-sentence:               \frenchspacing.      (line   6)
@@ -10673,6 +10754,10 @@
 * \iff:                                  Math symbols.        (line 258)
 * \IfFileExists:                         Class and package commands.
                                                               (line 127)
+* \ignorespaces:                         \ignorespaces & \ignorespacesafterend.
+                                                              (line   6)
+* \ignorespacesafterend:                 \ignorespaces & \ignorespacesafterend.
+                                                              (line   6)
 * \ij (ij):                              Additional Latin letters.
                                                               (line  32)
 * \IJ (IJ):                              Additional Latin letters.
@@ -11613,116 +11698,117 @@
 Node: Multiple reference to footnotes196430
 Node: Footnote parameters197288
 Node: Definitions198038
-Node: \newcommand & \renewcommand198851
-Node: \providecommand202687
-Node: \newcounter203348
-Node: \newlength204319
-Node: \newsavebox204966
-Node: \newenvironment & \renewenvironment205577
-Node: \newtheorem209937
-Node: \newfont213426
-Node: \protect214991
-Node: Counters217331
-Node: \alph \Alph \arabic \roman \Roman \fnsymbol218931
-Node: \usecounter221003
-Node: \value221835
-Node: \setcounter222778
-Node: \addtocounter223264
-Node: \refstepcounter223729
-Node: \stepcounter224387
-Node: \day \month \year224729
-Node: Lengths225274
-Node: Units of length227064
-Node: \setlength228558
-Node: \addtolength228962
-Node: \settodepth229280
-Node: \settoheight229571
-Node: \settowidth229868
-Node: Predefined lengths230176
-Node: Making paragraphs230691
-Node: \indent231263
-Node: \noindent231725
-Node: \parskip232234
-Node: Marginal notes232492
-Node: Math formulas234304
-Node: Subscripts & superscripts236088
-Node: Math symbols237426
-Node: Math functions262756
-Node: Math accents263699
-Node: Spacing in math mode264671
-Node: Math miscellany266138
-Node: Modes268688
-Node: \ensuremath270528
-Node: Page styles271444
-Node: \maketitle271938
-Node: \pagenumbering273008
-Node: \pagestyle273504
-Node: \thispagestyle274645
-Node: Spaces274951
-Node: \hspace275876
-Node: \hfill276831
-Node: \(SPACE) and \@277226
-Ref: \AT277387
-Node: \(SPACE) after control sequence278924
-Node: \frenchspacing279842
-Node: \thinspace280460
-Node: \/280763
-Node: \hrulefill \dotfill281945
-Node: \addvspace282938
-Node: \bigskip \medskip \smallskip283984
-Node: \vfill284878
-Node: \vspace285747
-Node: Boxes286740
-Node: \mbox287465
-Node: \fbox and \framebox287752
-Node: lrbox288555
-Node: \makebox288913
-Node: \parbox289633
-Node: \raisebox291201
-Node: \savebox291798
-Node: \sbox292213
-Node: \usebox292662
-Node: Special insertions292923
-Node: Reserved characters293724
-Node: Upper and lower case294925
-Node: Symbols by font position296840
-Node: Text symbols297460
-Node: Accents300908
-Node: Additional Latin letters303450
-Ref: Non-English characters303621
-Node: \rule304638
-Node: \today305067
-Node: Splitting the input305821
-Node: \include306585
-Node: \includeonly307176
-Node: \input307689
-Node: Front/back matter308184
-Node: Tables of contents308389
-Node: \addcontentsline309450
-Node: \addtocontents310468
-Node: Glossaries311001
-Node: Indexes311520
-Node: Letters313153
-Node: \address316831
-Node: \cc317701
-Node: \closing318119
-Node: \encl318430
-Node: \location318845
-Node: \makelabels319114
-Node: \name320115
-Node: \opening320345
-Node: \ps320685
-Node: \signature320974
-Node: \telephone322066
-Node: Terminal input/output322431
-Node: \typein322696
-Node: \typeout323281
-Node: Command line323904
-Node: Document templates324856
-Node: beamer template325263
-Node: book template325914
-Node: tugboat template326282
-Node: Concept Index328646
-Node: Command Index386049
+Node: \newcommand & \renewcommand198915
+Node: \providecommand202751
+Node: \newcounter203412
+Node: \newlength204383
+Node: \newsavebox205030
+Node: \newenvironment & \renewenvironment205641
+Node: \newtheorem210001
+Node: \newfont213490
+Node: \protect215055
+Node: \ignorespaces & \ignorespacesafterend217441
+Node: Counters220193
+Node: \alph \Alph \arabic \roman \Roman \fnsymbol221793
+Node: \usecounter223865
+Node: \value224697
+Node: \setcounter225640
+Node: \addtocounter226126
+Node: \refstepcounter226591
+Node: \stepcounter227249
+Node: \day \month \year227591
+Node: Lengths228136
+Node: Units of length229926
+Node: \setlength231420
+Node: \addtolength231824
+Node: \settodepth232142
+Node: \settoheight232433
+Node: \settowidth232730
+Node: Predefined lengths233038
+Node: Making paragraphs233553
+Node: \indent234125
+Node: \noindent234587
+Node: \parskip235096
+Node: Marginal notes235354
+Node: Math formulas237166
+Node: Subscripts & superscripts238950
+Node: Math symbols240288
+Node: Math functions265618
+Node: Math accents266561
+Node: Spacing in math mode267533
+Node: Math miscellany269000
+Node: Modes271550
+Node: \ensuremath273390
+Node: Page styles274306
+Node: \maketitle274800
+Node: \pagenumbering275870
+Node: \pagestyle276366
+Node: \thispagestyle277507
+Node: Spaces277813
+Node: \hspace278738
+Node: \hfill279693
+Node: \(SPACE) and \@280088
+Ref: \AT280249
+Node: \(SPACE) after control sequence281786
+Node: \frenchspacing282704
+Node: \thinspace283322
+Node: \/283625
+Node: \hrulefill \dotfill284807
+Node: \addvspace285800
+Node: \bigskip \medskip \smallskip286846
+Node: \vfill287740
+Node: \vspace288609
+Node: Boxes289602
+Node: \mbox290327
+Node: \fbox and \framebox290614
+Node: lrbox291417
+Node: \makebox291776
+Node: \parbox292496
+Node: \raisebox294064
+Node: \savebox294661
+Node: \sbox295076
+Node: \usebox295525
+Node: Special insertions295786
+Node: Reserved characters296587
+Node: Upper and lower case297788
+Node: Symbols by font position299703
+Node: Text symbols300323
+Node: Accents303771
+Node: Additional Latin letters306313
+Ref: Non-English characters306484
+Node: \rule307501
+Node: \today307930
+Node: Splitting the input308684
+Node: \include309448
+Node: \includeonly310039
+Node: \input310552
+Node: Front/back matter311047
+Node: Tables of contents311252
+Node: \addcontentsline312313
+Node: \addtocontents313331
+Node: Glossaries313864
+Node: Indexes314383
+Node: Letters316016
+Node: \address319694
+Node: \cc320564
+Node: \closing320982
+Node: \encl321293
+Node: \location321708
+Node: \makelabels321977
+Node: \name322978
+Node: \opening323208
+Node: \ps323548
+Node: \signature323837
+Node: \telephone324929
+Node: Terminal input/output325294
+Node: \typein325559
+Node: \typeout326144
+Node: Command line326767
+Node: Document templates327719
+Node: beamer template328126
+Node: book template328777
+Node: tugboat template329145
+Node: Concept Index331509
+Node: Command Index389218
 
 End Tag Table

Modified: trunk/latex2e.pdf
===================================================================
(Binary files differ)

Modified: trunk/latex2e.texi
===================================================================
--- trunk/latex2e.texi	2018-02-19 18:29:38 UTC (rev 604)
+++ trunk/latex2e.texi	2018-02-22 19:04:54 UTC (rev 605)
@@ -11,7 +11,7 @@
 @c xx but latex2e stuff is missing.
 @c xx random list of a few of the missing items is at the end of this file
 @c
- at c xx misc commands from clsguide.pdf: \ignorespacesafterend,
+ at c xx misc commands from clsguide.pdf:
 @c   \normalsfcodes
 @c xx color (include info from clsguide.pdf)
 @c xx ending a run with errors
@@ -6428,6 +6428,7 @@
 * \newtheorem::                           Define a new theorem-like environment.
 * \newfont::                              Define a new font name.
 * \protect::                              Using tricky commands.
+* \ignorespaces & \ignorespacesafterend:: Discard extra spaces.
 @end menu
 
 
@@ -7026,6 +7027,96 @@
 @end example
 
 
+ at node \ignorespaces & \ignorespacesafterend
+ at section @code{\ignorespaces & \ignorespacesafterend}
+
+ at findex \ignorespaces
+ at findex \ignorespacesafterend
+ at cindex spaces, ignore around commands
+ at cindex commands, ignore spaces
+
+Synopsis:
+
+ at example
+\ignorespaces
+ at end example
+
+or
+
+ at example
+\ignorespacesafterend
+ at end example
+
+Both commands cause @LaTeX{} to ignore spaces after the end of the
+command up until the first non-space character.  The first is a command
+from Plain @TeX{}, and the second is @LaTeX{}-specific.
+
+The @code{ignorespaces} is often used when defining commands via
+ at code{\newcommand}, or @code{\newenvironment}, or @code{\def}.  The
+example below illustrates.  It allows a user to show the points values
+for quiz questions in the margin but it is inconvenient because, as
+shown in the @code{enumerate} list, users must not put any space between
+the command and the question text.
+
+ at example
+\newcommand@{\points@}[1]@{\makebox[0pt]@{\makebox[10em][l]@{#1~pts@}@}
+\begin@{enumerate@} 
+  \item\points@{10@}no extra space output here
+  \item\points@{15@} extra space output between the number and the word `extra'
+\end@{enumerate@} 
+ at end example
+
+The solution is to change to
+ at code{\newcommand@{\points@}[1]@{\makebox[0pt]@{\makebox[10em][l]@{#1~pts@}@}\ignorespaces@}}.
+
+A second example shows spaces being removed from the front of text.  The
+commands below allow a user to uniformily attach a title to names.  But,
+as given, if a title accidentally starts with a space then
+ at code{\fullname} will reproduce that.
+
+ at example
+\makeatletter
+\newcommand@{\honorific@}[1]@{\def\@@honorific@{#1@}@} % remember title
+\newcommand@{\fullname@}[1]@{\@@honorific~#1@}       % recall title; put before name
+\makeatother
+\begin@{tabular@}@{|l|@}
+\honorific@{Mr/Ms@}  \fullname@{Jones@} \\  % no extra space here
+\honorific@{ Mr/Ms@} \fullname@{Jones@}     % extra space before title
+\end@{tabular@}
+ at end example
+
+To fix this, change to
+ at code{\newcommand@{\fullname@}[1]@{\ignorespaces\@@honorific~#1@}}.
+
+The @code{\ignorespaces} is also often used in a @code{\newenvironment}
+at the end of the @var{begin} clause, that is, as part of the second
+argument, as in @code{\begin@{newenvironment@}@{@var{env
+name}@}@{... \ignorespaces@}@{...@}}.
+
+To strip spaces off the end of an environment use
+ at code{\ignorespacesafterend}.  An example is that this will show a much
+larger vertical space between the first and second environments than
+between the second and third.
+
+ at example
+\newenvironment@{eq@}@{\begin@{equation@}@}@{\end@{equation@}@}
+\begin@{eq@}
+e=mc^2
+\end@{eq@}
+\begin@{equation@}
+F=ma
+\end@{equation@}
+\begin@{equation@}
+E=IR
+\end@{equation@}
+ at end example
+
+Putting a comment character at tie{}@code{%} immediately after the
+ at code{\end@{eq@}} will make the vertical space disappear, but that is
+inconvenient.  The solution is to change to
+ at code{\newenvironment@{eq@}@{\begin@{equation@}@}@{\end@{equation@}\ignorespacesafterend@}}.
+
+
 @node Counters
 @chapter Counters
 



More information about the latexrefman-commits mailing list