[latexrefman-commits] r352 - in /trunk: ChangeLog latex2e.texi

jhefferon at domain.hid jhefferon at domain.hid
Thu Jun 4 02:32:31 CEST 2015


Author: jhefferon
Date: Thu Jun  4 02:32:30 2015
New Revision: 352

URL: http://svn.gna.org/viewcvs/latexrefman?rev=352&view=rev
Log:
\value

Modified:
    trunk/ChangeLog
    trunk/latex2e.texi

Modified: trunk/ChangeLog
URL: http://svn.gna.org/viewcvs/latexrefman/trunk/ChangeLog?rev=352&r1=351&r2=352&view=diff
==============================================================================
--- trunk/ChangeLog	(original)
+++ trunk/ChangeLog	Thu Jun  4 02:32:30 2015
@@ -1,3 +1,8 @@
+2015-06-03  Jim Hefferon  <jhefferon at domain.hid>
+
+	* latex2e.texi (\value): Expand description, put in warning about
+	\protect, add examples.
+
 2015-06-02  Jim Hefferon  <jhefferon at domain.hid>
 
 	* latex2e.texi (\protect): Expand description, add examples.

Modified: trunk/latex2e.texi
URL: http://svn.gna.org/viewcvs/latexrefman/trunk/latex2e.texi?rev=352&r1=351&r2=352&view=diff
==============================================================================
--- trunk/latex2e.texi	(original)
+++ trunk/latex2e.texi	Thu Jun  4 02:32:30 2015
@@ -4098,7 +4098,7 @@
 Footnotes, line breaks, any command that has an optional argument, and
 many more, are fragile.  A fragile command can break when it is used in
 the argument to certain commands.  To prevent such commands from
-breaking they must be preceeded by the command @code{\protect}.
+breaking they must be preceded by the command @code{\protect}.
 
 For example, when @LaTeX{} runs the @code{\section at domain.hid
 name}@}} command it writes the @var{section name} text to the
@@ -4114,13 +4114,15 @@
 
 If you get strange errors from commands used in moving arguments, try
 proceding it with @code{\protect}.  Every fragile commands must be
-protected with their own @code{\protect}.  Typically, a @code{\protect}
-command won't hurt, so it is worth a try.
-
- at domain.hid xx True? Length commands are robust and should not be preceded by a \protect command. Nor should a \protect command be used in the argument to \addtocounter or \setcounter command.
+protected with their own @code{\protect}.  
+
+Although usually, a @code{\protect} command doesn't hurt, length
+commands are robust and should not be preceded by a @code{\protect}
+command. Nor can a @code{\protect} command be used in the argument to
+ at code{\addtocounter} or @code{\setcounter} command.
 
 In this example the @code{caption} command gives a mysterious error
-about an extra curly brace.  Fix the problem by preceeding each
+about an extra curly brace.  Fix the problem by preceding each
 @code{\raisebox} command with @code{\protect}.
 
 @example
@@ -4132,8 +4134,8 @@
 
 In the next example the @code{\tableofcontents} command gives an error
 because the @code{\(..\)} in the section title expands to illegal @TeX{}
-in the @file{.toc} file.  Solve this by changing @code{\(..\)} to
- at domain.hid\)}.
+in the @file{.toc} file.  You can solve this by changing @code{\(..\)}
+to @code{\protect\(..\protect\)}.
 
 @example
 \begin at domain.hid@}
@@ -4142,14 +4144,6 @@
 \section at domain.hid \( e=mc^2 \)@}
  ..
 @end example
-
-See also:
-
- at domain.hid
- at domain.hid @url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=protect}
- at domain.hid smallexample
-
-
 
 
 @node Counters
@@ -4279,12 +4273,32 @@
 \value at domain.hid}@}
 @end example
 
-The @code{\value} command produces the value of @var{counter}.  It can
-be used anywhere @LaTeX{} expects a number, for example:
-
- at domain.hid
-\setcounter at domain.hid@}
-\addtocounter at domain.hid@}
+This command produces the value of @var{counter}.  It is often used in
+ at code{\setcounter} or @code{\addtocounter}, however @code{\value} can be
+used anywhere that @LaTeX{} expects a number.  
+
+The @code{\value} command is not used for typesetting the value of the
+counter.  @xref{\alph \Alph \arabic \roman \Roman \fnsymbol} for that.
+
+Note that @code{\value} produces an error when it is preceded by
+ at code{\protect} (@pxref{\protect}).
+
+This example which will print @samp{Test counter is 6. Other counter is
+5.}.
+
+ at example
+\newcounter at domain.hid@} \setcounter at domain.hid@}
+\newcounter at domain.hid@} \setcounter at domain.hid@}@}
+\addtocounter at domain.hid@}
+
+Test counter is \arabic at domain.hid@}.
+Other counter is \arabic at domain.hid@}.
+ at end example
+
+This example this will insert a @code{\hspace at domain.hid@}}.
+
+ at example
+\setcounter at domain.hid@} \addtocounter at domain.hid@}
 \hspace at domain.hid@}
 @end example
 





More information about the latexrefman-commits mailing list