texlive[41766] Master/texmf-dist: mfirstuc (30jul16)

commits+karl at tug.org commits+karl at tug.org
Sun Jul 31 01:07:45 CEST 2016


Revision: 41766
          http://tug.org/svn/texlive?view=revision&revision=41766
Author:   karl
Date:     2016-07-31 01:07:44 +0200 (Sun, 31 Jul 2016)
Log Message:
-----------
mfirstuc (30jul16)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/mfirstuc/CHANGES
    trunk/Master/texmf-dist/doc/latex/mfirstuc/README
    trunk/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-code.pdf
    trunk/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.html
    trunk/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.pdf
    trunk/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.tex
    trunk/Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.pdf
    trunk/Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.tex
    trunk/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.dtx
    trunk/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.ins
    trunk/Master/texmf-dist/tex/latex/mfirstuc/mfirstuc-english.sty
    trunk/Master/texmf-dist/tex/latex/mfirstuc/mfirstuc.sty

Modified: trunk/Master/texmf-dist/doc/latex/mfirstuc/CHANGES
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mfirstuc/CHANGES	2016-07-30 23:07:33 UTC (rev 41765)
+++ trunk/Master/texmf-dist/doc/latex/mfirstuc/CHANGES	2016-07-30 23:07:44 UTC (rev 41766)
@@ -1,5 +1,17 @@
 mfirstuc change log:
 
+v2.03:
+
+  * Fixed test for \protect at the start of \makefirstuc
+
+  * Add new conditional \ifMFUhyphen and new command
+    \MFUcapword
+
+  * New commands \capitalisefmtwords, \xcapitalisefmtwords
+    and \ecapitalisefmtwords (like \capitalisewords etc
+    but allows for text-block formatting commands within
+    the argument).
+
 v2.02:
 
   * Fixed bug in \capitalisewords

Modified: trunk/Master/texmf-dist/doc/latex/mfirstuc/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mfirstuc/README	2016-07-30 23:07:33 UTC (rev 41765)
+++ trunk/Master/texmf-dist/doc/latex/mfirstuc/README	2016-07-30 23:07:44 UTC (rev 41766)
@@ -1,6 +1,6 @@
-LaTeX Package : mfirstuc v2.02
+LaTeX Package : mfirstuc v2.03
 
-Last Modified : 2015-12-17
+Last Modified : 2016-07-29
 
 Author        : Nicola Talbot
 

Modified: trunk/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-code.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.html
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.html	2016-07-30 23:07:33 UTC (rev 41765)
+++ trunk/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.html	2016-07-30 23:07:44 UTC (rev 41766)
@@ -4,13 +4,12 @@
 <!--http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd-->  
 <html xmlns="http://www.w3.org/1999/xhtml"  
 > 
-<head><title>mfirstuc.sty v2.02: uppercasing first letter</title> 
+<head><title></title> 
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
 <meta name="generator" content="TeX4ht (http://www.tug.org/tex4ht/)" /> 
 <meta name="originator" content="TeX4ht (http://www.tug.org/tex4ht/)" /> 
 <!-- xhtml,fn-in,css-in,uni-html4,utf8 --> 
 <meta name="src" content="mfirstuc-manual.tex" /> 
-<meta name="date" content="2015-12-17 12:46:00" /> 
  
 <style type="text/css"> 
 <!--  
@@ -35,6 +34,7 @@
 .cmitt-10{font-family: monospace; font-style: italic;}  
 .cmti-10{ font-style: italic;}  
 .cmbx-10{ font-weight: bold;}  
+.cmbxti-10{ font-weight: bold; font-style: italic;}  
 .cmssi-10{ font-family: sans-serif; font-style: oblique;}  
 .cmssi-10{ font-family: sans-serif; font-style: oblique;}  
 p.noindent { text-indent: 0em }  
@@ -149,6 +149,7 @@
 .alltt { margin-bottom : 1em; margin-top : 1em; }  
 div.important { border : solid red; }  
 div.verbatim { font-family: monospace; white-space: nowrap; text-align:left; clear:both; padding-top: 2ex; padding-bottom: 2ex;}  
+span#textcolor1{color:#FF0000}  
 /* end css.sty */  
  
  
@@ -156,26 +157,44 @@
 </style> 
 </head><body 
 >
-   <div class="maketitle"><a 
+<!--l. 36--><p class="noindent" ><a 
  id="top"></a>
-                                                                    
+</p><!--l. 36--><p class="indent" >
+                                                                         
 
-                                                                    
-                                                                    
+                                                                         
+</p><!--l. 36--><p class="indent" >
+                                                                         
 
-                                                                    
-
-<h2 class="titleHead">mfirstuc.sty v2.02: uppercasing first letter</h2>
-         <div class="author" ><span 
-class="cmr-12">Nicola L.C. Talbot</span>
-<br />          <span 
-class="cmr-12">Dickimaw Books</span>
-<br /><a 
+                                                                         
+</p>
+<div class="center" 
+>
+<!--l. 36--><p class="noindent" >
+</p><!--l. 36--><p class="noindent" ><span 
+class="cmr-17">mfirstuc.sty v2.03: uppercasing first letter</span>
+</p>
+<div class="tabular"> <table id="TBL-1" class="tabular" 
+cellspacing="0" cellpadding="0"  
+><colgroup id="TBL-1-1g"><col 
+id="TBL-1-1" /></colgroup><tr  
+ style="vertical-align:baseline;" id="TBL-1-1-"><td  style="white-space:nowrap; text-align:center;" id="TBL-1-1-1"  
+class="td11">       <span 
+class="cmr-12">Nicola L.C. Talbot           </span></td>
+</tr><tr 
+class="vspace" style="font-size:10.0pt"><td 
+> </td></tr><tr  
+ style="vertical-align:baseline;" id="TBL-1-2-"><td  style="white-space:nowrap; text-align:center;" id="TBL-1-2-1"  
+class="td11">        <span 
+class="cmr-12">Dickimaw Books             </span></td>
+</tr><tr  
+ style="vertical-align:baseline;" id="TBL-1-3-"><td  style="white-space:nowrap; text-align:center;" id="TBL-1-3-1"  
+class="td11"><a 
 href="http://www.dickimaw-books.com/" class="url" ><span 
-class="cmtt-12">http://www.dickimaw-books.com/</span></a></div><br />
-<div class="date" ><span 
-class="cmr-12">2015-12-17</span></div>
-   </div>
+class="cmtt-12">http://www.dickimaw-books.com/</span></a></td></tr></table>
+</div>
+<!--l. 36--><p class="noindent" ><span 
+class="cmr-12">2016-07-29</span></p></div>
    <h3 class="likesectionHead"><a 
  id="x1-1000"></a>Contents</h3>
    <div class="tableofcontents">
@@ -182,46 +201,117 @@
    <span class="sectionToc" >1 <a 
 href="#sec:intro" id="QQ2-1-2">Introduction</a></span>
 <br />   <span class="sectionToc" >2 <a 
-href="#sec:makefirstuc" id="QQ2-1-3">Capitalising a Word</a></span>
+href="#sec:makefirstuc" id="QQ2-1-3">Capitalising the First Letter of a Word</a></span>
 <br />   <span class="sectionToc" >3 <a 
-href="#sec:capitalisewords" id="QQ2-1-4">Capitalise Each Word in a Phrase or Sentence (Title Case)</a></span>
+href="#sec:capitalisewords" id="QQ2-1-4">Capitalise the First Letter of Each Word in a Phrase or Sentence (Title Case)</a></span>
+<br />   &#x00A0;<span class="subsectionToc" >3.1 <a 
+href="#sec:pdfbookmarks" id="QQ2-1-5">PDF Bookmarks</a></span>
+<br />   &#x00A0;<span class="subsectionToc" >3.2 <a 
+href="#sec:nocap" id="QQ2-1-6">Excluding Words From Case-Changing</a></span>
 <br />   <span class="sectionToc" >4 <a 
-href="#sec:utf8" id="QQ2-1-5">UTF-8</a></span>
+href="#sec:utf8" id="QQ2-1-7">UTF-8</a></span>
    </div>
-<!--l. 33--><p class="noindent" >
+<!--l. 39--><p class="noindent" >
 </p>
-<!--l. 33--><p class="noindent" ><a 
+<!--l. 39--><p class="noindent" ><a 
 href="#top">Top</a><h2 class="sectionHead"></p><h3 class="sectionHead"><span class="titlemark">1   </span> <a 
  id="sec:intro"></a>Introduction</h3>
-<!--l. 36--><p class="noindent" >The <span 
+<!--l. 42--><p class="noindent" >The <span 
 class="cmss-10">mfirstuc </span>package was originally part of the <span 
-class="cmss-10">glossaries </span>bundle for use with commands
-like <span 
+class="cmss-10">glossaries </span>bundle for use with commands like
+<span 
 class="cmtt-10">\Gls</span>, but as the commands provided by <span 
 class="cmss-10">mfirstuc </span>may be used without <span 
-class="cmss-10">glossaries</span>,
-the two have been split into separately maintained packages.
-</p><!--l. 42--><p class="noindent" >
+class="cmss-10">glossaries</span>, the two have
+been split into separately maintained packages.
+</p><!--l. 48--><p class="indent" >   <div class="important" title="Important Note"> The commands described here all have limitations. To minimise problems, use text-block
+style semantic commands with one argument (the text that requires case-changing), and avoid
+scoped declarations. </div>
+</p><!--l. 53--><p class="noindent" >
+</p><!--l. 55--><p class="indent" >   Here are some examples of semantic commands:
+     </p><ol  class="enumerate1" >
+     <li 
+  class="enumerate" id="x1-2002x1">Quoted material:
+                                                                         
+
+                                                                         
+     <div class="verbatim" id="verbatim-1">
+     \newcommand{\qt}[1]{‘‘#1’’}
+</div>
+     <!--l. 60--><p class="nopar" > (or use the <span 
+class="cmss-10">csquotes </span>package). With this, the following works:
+                                                                         
+
+                                                                         
 </p>
-<!--l. 42--><p class="noindent" ><a 
+     <div class="verbatim" id="verbatim-2">
+     \makefirstuc{\qt{word}}
+</div>
+     <!--l. 65--><p class="nopar" > This produces: <spacer type=vertical size=10><span class="obeylines-h">
+     <br />“Word”
+     <br /><spacer type=vertical size=10></span>
+     Whereas
+                                                                         
+
+                                                                         
+</p>
+     <div class="verbatim" id="verbatim-3">
+     \makefirstuc{‘‘word’’}
+</div>
+     <!--l. 73--><p class="nopar" > fails (no case-change and double open quote becomes two single open quotes):
+     <spacer type=vertical size=10><span class="obeylines-h">
+     <br />‘‘word”
+     <br /><spacer type=vertical size=10></span>
+     </p></li>
+     <li 
+  class="enumerate" id="x1-2004x2">Font styles or colours:
+                                                                         
+
+                                                                         
+     <div class="verbatim" id="verbatim-4">
+     \newcommand*{\alert}[1]{\textcolor{red}{#1}}
+</div>
+     <!--l. 83--><p class="nopar" > Now the following is possible:
+                                                                         
+
+                                                                         
+</p>
+     <div class="verbatim" id="verbatim-5">
+     \makefirstuc{\alert{word}}
+</div>
+     <!--l. 87--><p class="nopar" > This produces <spacer type=vertical size=10><span class="obeylines-h">
+     <br /><span id="textcolor1">Word</span>
+     <br /><spacer type=vertical size=10></span>
+     Note that <span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\makefirstuc{\textcolor{red}{word}}</span></span></span> fails (with an error) because the
+     case-changing interferes with the label.</p></li></ol>
+<!--l. 97--><p class="indent" >   Define these semantic commands robustly if you intend using any of the commands
+that fully expand their argument (<span 
+class="cmtt-10">\emakefirstuc</span>, <span 
+class="cmtt-10">\ecapitalisewords </span>and
+<span 
+class="cmtt-10">\ecapitalisefmtwords</span>).
+</p><!--l. 102--><p class="noindent" >
+</p>
+<!--l. 102--><p class="noindent" ><a 
 href="#top">Top</a><h2 class="sectionHead"></p><h3 class="sectionHead"><span class="titlemark">2   </span> <a 
- id="sec:makefirstuc"></a>Capitalising a Word</h3>
-<!--l. 45--><p class="noindent" >A simple word can be capitalised just using the standard <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span 
-class="E">E</span>X</span></span>&#x00A0;upper casing
-command. For example,
-                                                                    
+ id="sec:makefirstuc"></a>Capitalising the First Letter of a Word</h3>
+<!--l. 105--><p class="noindent" >A simple word can be capitalised just using the standard <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span 
+class="E">E</span>X</span></span>&#x00A0;upper casing command. For
+example,
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-1">
+   <div class="verbatim" id="verbatim-6">
 \MakeUppercase&#x00A0;word
 </div>
-<!--l. 49--><p class="nopar" > but for commands like <span 
-class="cmtt-10">\Gls </span>the word may be embedded within the argument of
-another command, such as a&#x00A0;font changing command. This makes things more
-complicated for a&#x00A0;general purpose solution, so the <span 
+<!--l. 109--><p class="nopar" > but for commands like <span 
+class="cmtt-10">\Gls </span>the word may be embedded within the argument of another
+command, such as a&#x00A0;font changing command. This makes things more complicated for
+a&#x00A0;general purpose solution, so the <span 
 class="cmss-10">mfirstuc </span>package provides:
-</p><!--l. 54--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+</p><!--l. 114--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
 class="cmtt-9">\makefirstuc</span><span 
 class="cmtt-9">&#x00A0;</span></span><a 
  id="dx1-3001"></a> <span 
@@ -228,28 +318,26 @@
 class="cmtt-10">\makefirstuc{</span>&#x27E8;<span 
 class="cmitt-10">stuff</span>&#x27E9;<span 
 class="cmtt-10">} </span></div><hr>
-</p><!--l. 56--><p class="noindent" >
+</p><!--l. 116--><p class="noindent" >
 This makes the first object of &#x27E8;<span 
 class="cmti-10">stuff </span>&#x27E9; upper case unless &#x27E8;<span 
-class="cmti-10">stuff </span>&#x27E9; starts with a control
-sequence followed by a non-empty group, in which case the first object in
-the group is converted to upper case. <span 
-class="cmbx-10">No expansion is performed on the</span>
-<span 
-class="cmbx-10">argument.</span>
-</p><!--l. 63--><p class="indent" >   <div class="important" title="Important Note"> If &#x27E8;<span 
+class="cmti-10">stuff </span>&#x27E9; starts with a control sequence
+followed by a non-empty group, in which case the first object in the group is converted to
+upper case. <span 
+class="cmbx-10">No expansion is performed on the argument.</span>
+</p><!--l. 123--><p class="indent" >   <div class="important" title="Important Note"> If &#x27E8;<span 
 class="cmti-10">stuff </span>&#x27E9; starts with a control sequence that takes more than one argument, the
 case-changing will always be applied to the <span 
-class="cmti-10">first </span>argument. If the text that requires the
-case change is in one of the other arguments, you must hide the earlier arguments in a
-wrapper command. For example, instead of <span class="obeylines-h"><span class="verb"><span 
-class="cmtt-10">\color{red}{text}</span></span></span> you need to define,
-say, <span class="obeylines-h"><span class="verb"><span 
-class="cmtt-10">\red</span></span></span> as <span class="obeylines-h"><span class="verb"><span 
+class="cmti-10">first </span>argument. If the text that requires the case
+change is in one of the other arguments, you must hide the earlier arguments in a wrapper
+command. For example, instead of <span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\textcolor{red}{text}</span></span></span> you need to define, say, <span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\red</span></span></span> as
+<span class="obeylines-h"><span class="verb"><span 
 class="cmtt-10">\color{red}</span></span></span> and use <span class="obeylines-h"><span class="verb"><span 
 class="cmtt-10">\red{text}</span></span></span>. </div>
-</p><!--l. 71--><p class="noindent" >
-</p><!--l. 73--><p class="indent" >   Examples: </p>
+</p><!--l. 131--><p class="noindent" >
+</p><!--l. 133--><p class="indent" >   Examples: </p>
      <ul class="itemize1">
      <li class="itemize"><span class="obeylines-h"><span class="verb"><span 
 class="cmtt-10">\makefirstuc{abc}</span></span></span> produces Abc.
@@ -258,33 +346,33 @@
 class="cmtt-10">\makefirstuc{\emph{abc}}</span></span></span> produces <span 
 class="cmti-10">Abc </span>(<span 
 class="cmtt-10">\MakeUppercase</span><a 
- id="dx1-3002"></a> has been applied to
-     the letter “a” rather than <span 
+ id="dx1-3002"></a> has been applied to the
+     letter “a” rather than <span 
 class="cmtt-10">\emph</span>). Note however that
-                                                                    
+                                                                         
 
-                                                                    
-     <div class="verbatim" id="verbatim-2">
+                                                                         
+     <div class="verbatim" id="verbatim-7">
      \makefirstuc{{\em&#x00A0;abc}}
 </div>
-     <!--l. 82--><p class="nopar" > produces <span 
+     <!--l. 142--><p class="nopar" > produces <span 
 class="cmti-10">ABC </span>(first object is <span class="obeylines-h"><span class="verb"><span 
 class="cmtt-10">{\em</span><span 
-class="cmtt-10">&#x00A0;abc}</span></span></span> so this is equivalent to
-     <span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">&#x00A0;abc}</span></span></span> so this is equivalent to <span class="obeylines-h"><span class="verb"><span 
 class="cmtt-10">\MakeUppercase{\em</span><span 
-class="cmtt-10">&#x00A0;abc}</span></span></span>), and
-                                                                    
+class="cmtt-10">&#x00A0;abc}</span></span></span>),
+     and
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-     <div class="verbatim" id="verbatim-3">
+     <div class="verbatim" id="verbatim-8">
      {\makefirstuc{\em&#x00A0;abc}}
 </div>
-     <!--l. 87--><p class="nopar" > produces abc (<span class="obeylines-h"><span class="verb"><span 
+     <!--l. 147--><p class="nopar" > produces abc (<span class="obeylines-h"><span class="verb"><span 
 class="cmtt-10">\em</span></span></span> doesn’t have an argument therefore first object is <span class="obeylines-h"><span class="verb"><span 
-class="cmtt-10">\em</span></span></span> and so
-     is equivalent to <span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\em</span></span></span> and so is
+     equivalent to <span class="obeylines-h"><span class="verb"><span 
 class="cmtt-10">{\MakeUppercase{\em}abc}</span></span></span>).
      </p></li>
      <li class="itemize"><span class="obeylines-h"><span class="verb"><span 
@@ -302,45 +390,44 @@
 class="cmtt-10">ä</span><span 
 class="cmtt-10">}bc}</span></span></span> produces Äbc.
      </li></ul>
-<!--l. 101--><p class="noindent" >Note that non-Latin or accented characters appearing at the start of the text must be
-placed in a group (even if you are using the <span 
+<!--l. 161--><p class="noindent" >Note that non-Latin or accented characters appearing at the start of the text must be placed in a
+group (even if you are using the <span 
 class="cmss-10">inputenc</span><a 
- id="dx1-3003"></a> package). The reason for this
-restriction is detailed in <a 
+ id="dx1-3003"></a> package). The reason for this restriction is detailed in
+<a 
 href="#sec:utf8"><span 
 class="cmsy-10">§</span>4 </a><a 
 href="#sec:utf8">UTF-8<!--tex4ht:ref: sec:utf8 --></a>.
-</p><!--l. 106--><p class="indent" >   <div class="important" title="Important Note"> In version 1.02 of <span 
-class="cmss-10">mfirstuc</span>, a bug fix resulted in a change in output if the first
-object is a control sequence followed by an empty group. Prior to version 1.02,
-<span class="obeylines-h"><span class="verb"><span 
-class="cmtt-10">\makefirstuc{\ae{}bc}</span></span></span> produced æBc. However as from version 1.02, it now produces
-Æbc. </div>
-</p><!--l. 112--><p class="noindent" >
-</p><!--l. 114--><p class="indent" >   Note also that
-                                                                    
+</p><!--l. 166--><p class="indent" >   <div class="important" title="Important Note"> In version 1.02 of <span 
+class="cmss-10">mfirstuc</span>, a bug fix resulted in a change in output if the first object is a
+control sequence followed by an empty group. Prior to version 1.02, <span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\makefirstuc{\ae{}bc}</span></span></span>
+produced æBc. However as from version 1.02, it now produces Æbc. </div>
+</p><!--l. 172--><p class="noindent" >
+</p><!--l. 174--><p class="indent" >   Note also that
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-4">
+   <div class="verbatim" id="verbatim-9">
 \newcommand{\abc}{abc}
 &#x00A0;<br />\makefirstuc{\abc}
 </div>
-<!--l. 118--><p class="nopar" > produces: ABC. This is because the first object in the argument of <span 
-class="cmtt-10">\makefirstuc </span>is
-<span 
-class="cmtt-10">\abc</span>, so it does <span class="obeylines-h"><span class="verb"><span 
+<!--l. 178--><p class="nopar" > produces: ABC. This is because the first object in the argument of <span 
+class="cmtt-10">\makefirstuc </span>is <span 
+class="cmtt-10">\abc</span>, so
+it does <span class="obeylines-h"><span class="verb"><span 
 class="cmtt-10">\MakeUppercase{\abc}</span></span></span>. Whereas:
-                                                                    
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-5">
+   <div class="verbatim" id="verbatim-10">
 \newcommand{\abc}{abc}
 &#x00A0;<br />\expandafter\makefirstuc\expandafter{\abc}
 </div>
-<!--l. 125--><p class="nopar" > produces: Abc. There is a short cut command which will do this:
-</p><!--l. 127--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+<!--l. 185--><p class="nopar" > produces: Abc. There is a short cut command which will do this:
+</p><!--l. 187--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
 class="cmtt-9">\xmakefirstuc</span><span 
 class="cmtt-9">&#x00A0;</span></span><a 
  id="dx1-3004"></a> <span 
@@ -347,29 +434,29 @@
 class="cmtt-10">\xmakefirstuc{</span>&#x27E8;<span 
 class="cmitt-10">stuff</span>&#x27E9;<span 
 class="cmtt-10">} </span></div><hr>
-</p><!--l. 129--><p class="noindent" >
+</p><!--l. 189--><p class="noindent" >
 This is equivalent to <span 
 class="cmtt-10">\expandafter\makefirstuc\expandafter{</span>&#x27E8;<span 
 class="cmti-10">stuff </span>&#x27E9;<span 
 class="cmtt-10">}</span>. So
-                                                                    
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-6">
+   <div class="verbatim" id="verbatim-11">
 \newcommand{\abc}{abc}
 &#x00A0;<br />\xmakefirstuc{\abc}
 </div>
-<!--l. 134--><p class="nopar" > produces: Abc.
-</p><!--l. 139--><p class="indent" >   <div class="important" title="Important Note"> <span 
+<!--l. 194--><p class="nopar" > produces: Abc.
+</p><!--l. 199--><p class="indent" >   <div class="important" title="Important Note"> <span 
 class="cmtt-10">\xmakefirstuc </span>only performs one level expansion on the <span 
-class="cmti-10">first </span>object in its
-argument. It does not fully expand the entire argument. </div>
-</p><!--l. 143--><p class="noindent" >
-</p><!--l. 145--><p class="indent" >   As from version 1.10, there is now a command that fully expands the entire
-argument before applying <span 
+class="cmti-10">first </span>object in its argument. It
+does not fully expand the entire argument. </div>
+</p><!--l. 203--><p class="noindent" >
+</p><!--l. 205--><p class="indent" >   As from version 1.10, there is now a command that fully expands the entire argument
+before applying <span 
 class="cmtt-10">\makefirstuc</span>:
-</p><!--l. 147--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+</p><!--l. 207--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
 class="cmtt-9">\emakefirstuc</span><span 
 class="cmtt-9">&#x00A0;</span></span><a 
  id="dx1-3005"></a> <span 
@@ -376,13 +463,13 @@
 class="cmtt-10">\emakefirstuc{</span>&#x27E8;<span 
 class="cmitt-10">text</span>&#x27E9;<span 
 class="cmtt-10">} </span></div><hr>
-</p><!--l. 149--><p class="noindent" >
-</p><!--l. 151--><p class="indent" >   Examples:
-                                                                    
+</p><!--l. 209--><p class="noindent" >
+</p><!--l. 211--><p class="indent" >   Examples:
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-7">
+   <div class="verbatim" id="verbatim-12">
 \newcommand{\abc}{\xyz&#x00A0;a}
 &#x00A0;<br />\newcommand{\xyz}{xyz}
 &#x00A0;<br />No&#x00A0;expansion:&#x00A0;\makefirstuc{\abc}.
@@ -389,27 +476,27 @@
 &#x00A0;<br />First&#x00A0;object&#x00A0;one-level&#x00A0;expansion:&#x00A0;\xmakefirstuc{\abc}.
 &#x00A0;<br />Fully&#x00A0;expanded:&#x00A0;\emakefirstuc{\abc}.
 </div>
-<!--l. 158--><p class="nopar" > produces:  No expansion: XYZA. First object one-level expansion: XYZa. Fully
-expanded: Xyza.
-</p><!--l. 166--><p class="indent" >   If you use <span 
+<!--l. 218--><p class="nopar" > produces:  No expansion: XYZA. First object one-level expansion: XYZa. Fully expanded:
+Xyza.
+</p><!--l. 226--><p class="indent" >   If you use <span 
 class="cmss-10">mfirstuc </span>without the <span 
 class="cmss-10">glossaries</span><a 
  id="dx1-3006"></a> package, the standard <span 
-class="cmtt-10">\MakeUppercase</span>
-command is used. If used with <span 
+class="cmtt-10">\MakeUppercase </span>command
+is used. If used with <span 
 class="cmss-10">glossaries</span><a 
  id="dx1-3007"></a>, <span 
 class="cmtt-10">\MakeTextUppercase</span><a 
  id="dx1-3008"></a> (defined by the <span 
 class="cmss-10">textcase</span><a 
- id="dx1-3009"></a>
-package) is used instead. If you are using <span 
+ id="dx1-3009"></a> package) is used
+instead. If you are using <span 
 class="cmss-10">mfirstuc </span>without the <span 
-class="cmss-10">glossaries </span>package and
-want to use <span 
+class="cmss-10">glossaries </span>package and want to use
+<span 
 class="cmtt-10">\MakeTextUppercase</span><a 
  id="dx1-3010"></a> instead, you can redefine
-</p><!--l. 172--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+</p><!--l. 232--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
 class="cmtt-9">\glsmakefirstuc</span><span 
 class="cmtt-9">&#x00A0;</span></span><a 
  id="dx1-3011"></a> <span 
@@ -416,26 +503,27 @@
 class="cmtt-10">\glsmakefirstuc{</span>&#x27E8;<span 
 class="cmitt-10">text</span>&#x27E9;<span 
 class="cmtt-10">} </span></div><hr>
-</p><!--l. 174--><p class="noindent" >
+</p><!--l. 234--><p class="noindent" >
 For example:
-                                                                    
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-8">
+   <div class="verbatim" id="verbatim-13">
 \renewcommand{\glsmakefirstuc}[1]{\MakeTextUppercase&#x00A0;#1}
 </div>
-<!--l. 178--><p class="nopar" > Remember to also load <span 
+<!--l. 238--><p class="nopar" > Remember to also load <span 
 class="cmss-10">textcase</span><a 
  id="dx1-3012"></a> (<span 
 class="cmss-10">glossaries </span>loads this automatically).
-</p><!--l. 182--><p class="noindent" >
+</p><!--l. 242--><p class="noindent" >
 </p>
-<!--l. 182--><p class="noindent" ><a 
+<!--l. 242--><p class="noindent" ><a 
 href="#top">Top</a><h2 class="sectionHead"></p><h3 class="sectionHead"><span class="titlemark">3   </span> <a 
- id="sec:capitalisewords"></a>Capitalise Each Word in a Phrase or Sentence (Title Case)</h3>
-<!--l. 185--><p class="noindent" >New to mfirstuc v1.06:
-</p><!--l. 186--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+ id="sec:capitalisewords"></a>Capitalise the First Letter of Each Word in a Phrase or Sentence (Title
+Case)</h3>
+<!--l. 245--><p class="noindent" >New to mfirstuc v1.06:
+</p><!--l. 246--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
 class="cmtt-9">\capitalisewords</span><span 
 class="cmtt-9">&#x00A0;</span></span><a 
  id="dx1-4001"></a> <span 
@@ -442,73 +530,285 @@
 class="cmtt-10">\capitalisewords{</span>&#x27E8;<span 
 class="cmitt-10">text</span>&#x27E9;<span 
 class="cmtt-10">} </span></div><hr>
-</p><!--l. 188--><p class="noindent" >
+</p><!--l. 248--><p class="noindent" >
 This command applies <span 
 class="cmtt-10">\makefirstuc</span><a 
  id="dx1-4002"></a> to each word in &#x27E8;<span 
-class="cmti-10">text</span>&#x27E9; where the space character is
-used as the word separator. Note that it has to be a plain space character, not another
-form of space, such as <span class="obeylines-h"><span class="verb"><span 
+class="cmti-10">text</span>&#x27E9; where the space character is used
+as the word separator. Note that it has to be a plain space character, not another form of
+space, such as <span class="obeylines-h"><span class="verb"><span 
 class="cmtt-10">~</span></span></span> or <span 
-class="cmtt-10">\space</span>. Note that no expansion is performed on
-&#x27E8;<span 
-class="cmti-10">text</span>&#x27E9;.
-</p><!--l. 195--><p class="indent" >   Formatting for the entire phrase must go outside <span 
+class="cmtt-10">\space</span>. Note that no expansion is performed on &#x27E8;<span 
+class="cmti-10">text</span>&#x27E9;. See <a 
+href="#sec:nocap"><span 
+class="cmsy-10">§</span>3.2
+</a><a 
+href="#sec:nocap">Excluding Words From Case-Changing<!--tex4ht:ref: sec:nocap --></a> for excluding words (such as “of”) from the
+case-changing.
+</p><!--l. 256--><p class="indent" >   The actual capitalisation of each word is done using (new to version 2.03):
+</p><!--l. 258--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+class="cmtt-9">\MFUcapword</span><span 
+class="cmtt-9">&#x00A0;</span></span><a 
+ id="dx1-4003"></a> <span 
+class="cmtt-10">\MFUcapword{</span>&#x27E8;<span 
+class="cmitt-10">word</span>&#x27E9;<span 
+class="cmtt-10">} </span></div><hr>
+</p><!--l. 260--><p class="noindent" >
+This just does <span 
+class="cmtt-10">\makefirstuc{</span>&#x27E8;<span 
+class="cmti-10">word</span>&#x27E9;<span 
+class="cmtt-10">} </span>by default, but its behaviour is determined by the
+conditional:
+</p><!--l. 263--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+class="cmtt-9">\ifMFUhyphen</span><span 
+class="cmtt-9">&#x00A0;</span></span><a 
+ id="dx1-4004"></a> <span 
+class="cmtt-10">\ifMFUhyphen </span></div><hr>
+</p><!--l. 265--><p class="noindent" >
+</p><!--l. 267--><p class="indent" >   If you want to title case each part of a compound word containing hyphens, you can enable
+this using
+</p><!--l. 269--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+class="cmtt-9">\MFUhyphentrue</span><span 
+class="cmtt-9">&#x00A0;</span></span><a 
+ id="dx1-4005"></a> <span 
+class="cmtt-10">\MFUhyphentrue </span></div><hr>
+</p><!--l. 271--><p class="noindent" >
+or switch it back off again using:
+</p><!--l. 273--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+class="cmtt-9">\MFUhyphenfalse</span><span 
+class="cmtt-9">&#x00A0;</span></span><a 
+ id="dx1-4006"></a> <span 
+class="cmtt-10">\MFUhyphenfalse </span></div><hr>
+</p><!--l. 275--><p class="noindent" >
+Compare
+                                                                         
+
+                                                                         
+</p>
+   <div class="verbatim" id="verbatim-14">
+\capitalisewords{server-side&#x00A0;includes}
+</div>
+<!--l. 279--><p class="nopar" > which produces: <spacer type=vertical size=10><span class="obeylines-h">
+   <br />Server-side Includes
+   <br /><spacer type=vertical size=10></span>
+with
+                                                                         
+
+                                                                         
+</p>
+   <div class="verbatim" id="verbatim-15">
+\MFUhyphentrue
+&#x00A0;<br />\capitalisewords{server-side&#x00A0;includes}
+</div>
+<!--l. 288--><p class="nopar" > which produces: <spacer type=vertical size=10><span class="obeylines-h">
+   <br />Server-Side Includes
+   <br /><spacer type=vertical size=10></span>
+</p><!--l. 295--><p class="indent" >   Formatting for the entire phrase must go outside <span 
 class="cmtt-10">\capitalisewords </span>(unlike
 <span 
 class="cmtt-10">\makefirstuc</span>). Compare:
-                                                                    
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-9">
+   <div class="verbatim" id="verbatim-16">
 \capitalisewords{\textbf{a&#x00A0;sample&#x00A0;phrase}}
 </div>
-<!--l. 199--><p class="nopar" > which produces: <spacer type=vertical size=10><span class="obeylines-h">
+<!--l. 299--><p class="nopar" > which produces: <spacer type=vertical size=10><span class="obeylines-h">
    <br /><span 
 class="cmbx-10">A sample phrase</span>
    <br /><spacer type=vertical size=10></span>
 with:
-                                                                    
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-10">
+   <div class="verbatim" id="verbatim-17">
 \textbf{\capitalisewords{a&#x00A0;sample&#x00A0;phrase}}
 </div>
-<!--l. 207--><p class="nopar" > which produces: <spacer type=vertical size=10><span class="obeylines-h">
+<!--l. 307--><p class="nopar" > which produces: <spacer type=vertical size=10><span class="obeylines-h">
    <br /><span 
 class="cmbx-10">A Sample Phrase</span>
    <br /><spacer type=vertical size=10></span>
-</p><!--l. 213--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+</p><!--l. 313--><p class="indent" >   As from version 2.03, there is now a command for phrases that may include a formatting
+command:
+</p><!--l. 316--><p class="indent" >   <hr><div title="Definition"><span 
+class="cmtt-10">\capitalisefmtwords{</span>&#x27E8;<span 
+class="cmitt-10">phrase</span>&#x27E9;<span 
+class="cmtt-10">} </span></div><hr>
+</p><!--l. 317--><p class="noindent" >
+where &#x27E8;<span 
+class="cmti-10">phrase</span>&#x27E9; may be just words (as with <span 
+class="cmtt-10">\capitalisewords</span>) or may be entirely enclosed in a
+formatting command in the form </p><div class="alltt">
+<div class="obeylines-v">
+<span 
+class="cmtt-10">\capitalisefmtwords</span><span 
+class="cmsy-10">{</span>&#x27E8;<span 
+class="cmitt-10">cs</span>&#x27E9;<span 
+class="cmtt-10">{</span>&#x27E8;<span 
+class="cmitt-10">phrase</span>&#x27E9;<span 
+class="cmtt-10">}</span><span 
+class="cmsy-10">}</span>
+</div>
+</div> or contain formatted sub-phrases <div class="alltt">
+<div class="obeylines-v">
+<span 
+class="cmtt-10">\capitalisefmtwords</span><span 
+class="cmsy-10">{</span>&#x27E8;<span 
+class="cmitt-10">words</span>&#x27E9;<span 
+class="cmtt-10">&#x00A0;</span>&#x27E8;<span 
+class="cmitt-10">cs</span>&#x27E9;<span 
+class="cmtt-10">{</span>&#x27E8;<span 
+class="cmitt-10">sub-phrase</span>&#x27E9;<span 
+class="cmtt-10">}</span><span 
+class="cmtt-10">&#x00A0;</span>&#x27E8;<span 
+class="cmitt-10">words</span>&#x27E9;<span 
+class="cmsy-10">}</span>
+</div>
+</div> Avoid scoped declarations.
+<!--l. 329--><p class="indent" >   Examples:
+     </p><ol  class="enumerate1" >
+     <li 
+  class="enumerate" id="x1-4008x1">Phrase entirely enclosed in a formatting command:
+                                                                         
+
+                                                                         
+     <div class="verbatim" id="verbatim-18">
+     \capitalisefmtwords{\textbf{a&#x00A0;small&#x00A0;book&#x00A0;of&#x00A0;rhyme}}
+</div>
+     <!--l. 334--><p class="nopar" > produces: <spacer type=vertical size=10><span class="obeylines-h">
+     <br /><span 
+class="cmbx-10">A Small Book Of Rhyme</span>
+     <br /><spacer type=vertical size=10></span>
+     </p></li>
+     <li 
+  class="enumerate" id="x1-4010x2">Sub-phrase enclosed in a formatting command:
+                                                                         
+
+                                                                         
+     <div class="verbatim" id="verbatim-19">
+     \capitalisefmtwords{a&#x00A0;\textbf{small&#x00A0;book}&#x00A0;of&#x00A0;rhyme}
+</div>
+     <!--l. 343--><p class="nopar" > produces: <spacer type=vertical size=10><span class="obeylines-h">
+     <br />A <span 
+class="cmbx-10">Small Book </span>Of Rhyme
+     <br /><spacer type=vertical size=10></span>
+     </p></li>
+     <li 
+  class="enumerate" id="x1-4012x3">Nested text-block commands:
+                                                                         
+
+                                                                         
+     <div class="verbatim" id="verbatim-20">
+     \capitalisefmtwords{\textbf{a&#x00A0;\emph{small&#x00A0;book}}&#x00A0;of&#x00A0;rhyme}
+</div>
+     <!--l. 352--><p class="nopar" > produces: <spacer type=vertical size=10><span class="obeylines-h">
+     <br /><span 
+class="cmbx-10">A </span><span 
+class="cmbxti-10">Small Book </span>Of Rhyme
+     <br /><spacer type=vertical size=10></span>
+     </p></li>
+     <li 
+  class="enumerate" id="x1-4014x4">Indicating words that shouldn’t have the case changed (see <a 
+href="#sec:nocap"><span 
+class="cmsy-10">§</span>3.2 </a><a 
+href="#sec:nocap">Excluding Words From
+     Case-Changing<!--tex4ht:ref: sec:nocap --></a>):
+                                                                         
+
+                                                                         
+     <div class="verbatim" id="verbatim-21">
+     \MFUnocap{of}
+     &#x00A0;<br />\capitalisefmtwords{\textbf{a&#x00A0;\emph{small&#x00A0;book}}&#x00A0;of&#x00A0;rhyme}
+</div>
+     <!--l. 363--><p class="nopar" > produces: <spacer type=vertical size=10><span class="obeylines-h">
+     <br /><span 
+class="cmbx-10">A </span><span 
+class="cmbxti-10">Small Book </span>of Rhyme
+     <br /><spacer type=vertical size=10></span>
+     </p></li></ol>
+<!--l. 371--><p class="indent" >   Grouping causes interference:
+                                                                         
+
+                                                                         
+</p>
+   <div class="verbatim" id="verbatim-22">
+\capitalisefmtwords{{a&#x00A0;\emph{small&#x00A0;book}}&#x00A0;of&#x00A0;rhyme}
+</div>
+<!--l. 374--><p class="nopar" > produces: <spacer type=vertical size=10><span class="obeylines-h">
+   <br />A <span 
+class="cmti-10">Small book </span>Of Rhyme
+   <br /><spacer type=vertical size=10></span>
+As with all the commands described here, avoid declarations. For example, the following
+fails:
+                                                                         
+
+                                                                         
+</p>
+   <div class="verbatim" id="verbatim-23">
+\capitalisefmtwords{{\bfseries&#x00A0;a&#x00A0;\emph{small&#x00A0;book}}&#x00A0;of&#x00A0;rhyme}
+</div>
+<!--l. 383--><p class="nopar" > produces: <spacer type=vertical size=10><span class="obeylines-h">
+   <br />a <span 
+class="cmti-10">Small book </span>Of Rhyme
+   <br /><spacer type=vertical size=10></span>
+</p><!--l. 389--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
 class="cmtt-9">\xcapitalisewords</span><span 
 class="cmtt-9">&#x00A0;</span></span><a 
- id="dx1-4003"></a> <span 
+ id="dx1-4015"></a> <span 
 class="cmtt-10">\xcapitalisewords{</span>&#x27E8;<span 
 class="cmitt-10">text</span>&#x27E9;<span 
 class="cmtt-10">} </span></div><hr>
-</p><!--l. 215--><p class="noindent" >
+</p><!--l. 391--><p class="noindent" >
 This is a short cut for <span 
 class="cmtt-10">\expandafter\capitalisewords\expandafter{</span>&#x27E8;<span 
 class="cmti-10">text</span>&#x27E9;<span 
 class="cmtt-10">}</span>.
-</p><!--l. 219--><p class="indent" >   As from version 1.10, there is now a command that fully expands the entire
-argument before applying <span 
+</p><!--l. 395--><p class="indent" >   As from version 1.10, there is now a command that fully expands the entire argument
+before applying <span 
 class="cmtt-10">\capitalisewords</span>:
-</p><!--l. 221--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+</p><!--l. 397--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
 class="cmtt-9">\ecapitalisewords</span><span 
 class="cmtt-9">&#x00A0;</span></span><a 
- id="dx1-4004"></a> <span 
+ id="dx1-4016"></a> <span 
 class="cmtt-10">\ecapitalisewords{</span>&#x27E8;<span 
 class="cmitt-10">text</span>&#x27E9;<span 
 class="cmtt-10">} </span></div><hr>
-</p><!--l. 223--><p class="noindent" >
-</p><!--l. 225--><p class="indent" >   Examples:
-                                                                    
+</p><!--l. 399--><p class="noindent" >
+</p><!--l. 401--><p class="indent" >   There are also similar shortcut commands for the version that allows formatting
+commands:
+</p><!--l. 403--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+class="cmtt-9">\xcapitalisefmtwords</span><span 
+class="cmtt-9">&#x00A0;</span></span><a 
+ id="dx1-4017"></a> <span 
+class="cmtt-10">\xcapitalisefmtwords{</span>&#x27E8;<span 
+class="cmitt-10">text</span>&#x27E9;<span 
+class="cmtt-10">} </span></div><hr>
+</p><!--l. 405--><p class="noindent" >
+This is a short cut for <span 
+class="cmtt-10">\expandafter\capitalisefmtwords\expandafter{</span>&#x27E8;<span 
+class="cmti-10">text</span>&#x27E9;<span 
+class="cmtt-10">}</span>.
+</p><!--l. 409--><p class="indent" >   For full expansion:
+</p><!--l. 410--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+class="cmtt-9">\ecapitalisefmtwords</span><span 
+class="cmtt-9">&#x00A0;</span></span><a 
+ id="dx1-4018"></a> <span 
+class="cmtt-10">\ecapitalisefmtwords{</span>&#x27E8;<span 
+class="cmitt-10">text</span>&#x27E9;<span 
+class="cmtt-10">} </span></div><hr>
+</p><!--l. 412--><p class="noindent" >
+Take care with this as it may expand non-robust semantic commands to replacement text that
+breaks the functioning of <span 
+class="cmtt-10">\capitalisefmtwords</span>. Use robust semantic commands where
+possible.
+</p><!--l. 418--><p class="indent" >   Examples:
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-11">
+   <div class="verbatim" id="verbatim-24">
 \newcommand{\abc}{\xyz\space&#x00A0;four&#x00A0;five}
 &#x00A0;<br />\newcommand{\xyz}{one&#x00A0;two&#x00A0;three}
 &#x00A0;<br />No&#x00A0;expansion:&#x00A0;\capitalisewords{\abc}.
@@ -515,268 +815,331 @@
 &#x00A0;<br />First&#x00A0;object&#x00A0;one-level&#x00A0;expansion:&#x00A0;\xcapitalisewords{\abc}.
 &#x00A0;<br />Fully&#x00A0;expanded:&#x00A0;\ecapitalisewords{\abc}.
 </div>
-<!--l. 232--><p class="nopar" > produces:  No expansion: ONE TWO THREE FOUR FIVE. First object one-level
-expansion: ONE TWO THREE four Five. Fully expanded: One Two Three Four
-Five.
-</p><!--l. 240--><p class="indent" >   (Remember that the spaces need to be explicit. In the second case above, using
+<!--l. 425--><p class="nopar" > produces: <spacer type=vertical size=10><span class="obeylines-h">
+   <br />No expansion: ONE TWO THREE FOUR FIVE.
+   <br />First object one-level expansion: ONE TWO THREE four Five.
+   <br />Fully expanded: One Two Three Four Five.
+   <br /><spacer type=vertical size=10></span>
+</p><!--l. 435--><p class="indent" >   (Remember that the spaces need to be explicit. In the second case above, using
 <span 
 class="cmtt-10">\xcapitalisewords</span>, the space before “four” has been hidden within <span 
 class="cmtt-10">\space </span>so it’s not
 recognised as a word boundary, but in the third case, <span 
-class="cmtt-10">\space </span>has been expanded to an
-actual space character.)
-</p><!--l. 246--><p class="indent" >   <div class="important" title="Important Note"> If you are using <span 
-class="cmss-10">hyperref</span><a 
- id="dx1-4005"></a> and want to use <span 
-class="cmtt-10">\capitalisewords </span>or <span 
-class="cmtt-10">\makefirstuc</span><a 
- id="dx1-4006"></a> (or
-the expanded variants) in a section heading, the PDF bookmarks won’t be able to use
-the command as it’s not expandable, so you will get a warning that looks
-like:
-                                                                    
-
-                                                                    
-</p>
-   <div class="verbatim" id="verbatim-12">
-Package&#x00A0;hyperref&#x00A0;Warning:&#x00A0;Token&#x00A0;not&#x00A0;allowed&#x00A0;in&#x00A0;a&#x00A0;PDF&#x00A0;string
-&#x00A0;<br />(PDFDocEncoding):
-&#x00A0;<br />(hyperref)&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;removing&#x00A0;‘\capitalisewords’
-</div>
-<!--l. 255--><p class="nopar" > If you want to provide an alternative for the PDF bookmark, you can use
-<span 
-class="cmss-10">hyperref</span><a 
- id="dx1-4007"></a>’s <span 
-class="cmtt-10">\texorpdfstring</span><a 
- id="dx1-4008"></a> command. See the <span 
-class="cmss-10">hyperref</span><a 
- id="dx1-4009"></a> manual for further details.
-</div>
-</p><!--l. 259--><p class="noindent" >
-</p><!--l. 261--><p class="indent" >   Examples:
+class="cmtt-10">\space </span>has been expanded to an actual
+space character.)
+</p><!--l. 441--><p class="indent" >   Examples:
      </p><ol  class="enumerate1" >
      <li 
-  class="enumerate" id="x1-4011x1">
-                                                                    
+  class="enumerate" id="x1-4020x1">
+                                                                         
 
-                                                                    
-     <div class="verbatim" id="verbatim-13">
+                                                                         
+     <div class="verbatim" id="verbatim-25">
      \capitalisewords{a&#x00A0;book&#x00A0;of&#x00A0;rhyme.}
 </div>
-     <!--l. 266--><p class="nopar" > produces: A Book Of Rhyme.
+     <!--l. 446--><p class="nopar" > produces: A Book Of Rhyme.
      </p></li>
      <li 
-  class="enumerate" id="x1-4013x2">
-                                                                    
+  class="enumerate" id="x1-4022x2">
+                                                                         
 
-                                                                    
-     <div class="verbatim" id="verbatim-14">
+                                                                         
+     <div class="verbatim" id="verbatim-26">
      \capitalisewords{a&#x00A0;book\space&#x00A0;of&#x00A0;rhyme.}
 </div>
-     <!--l. 273--><p class="nopar" > produces: A Book of Rhyme.
+     <!--l. 453--><p class="nopar" > produces: A Book of Rhyme.
      </p></li>
      <li 
-  class="enumerate" id="x1-4015x3">
-                                                                    
+  class="enumerate" id="x1-4024x3">
+                                                                         
 
-                                                                    
-     <div class="verbatim" id="verbatim-15">
+                                                                         
+     <div class="verbatim" id="verbatim-27">
      \newcommand{\mytitle}{a&#x00A0;book\space&#x00A0;of&#x00A0;rhyme.}
      &#x00A0;<br />\capitalisewords{\mytitle}
 </div>
-     <!--l. 281--><p class="nopar" > produces:  A BOOK OF RHYME. (No expansion is performed on <span 
-class="cmtt-10">\mytitle</span>.)
-     Compare with next example:
+     <!--l. 461--><p class="nopar" > produces:  A BOOK OF RHYME. (No expansion is performed on <span 
+class="cmtt-10">\mytitle</span>.) Compare
+     with next example:
      </p></li>
      <li 
-  class="enumerate" id="x1-4017x4">
-                                                                    
+  class="enumerate" id="x1-4026x4">
+                                                                         
 
-                                                                    
-     <div class="verbatim" id="verbatim-16">
+                                                                         
+     <div class="verbatim" id="verbatim-28">
      \newcommand{\mytitle}{a&#x00A0;book\space&#x00A0;of&#x00A0;rhyme.}
      &#x00A0;<br />\xcapitalisewords{\mytitle}
 </div>
-     <!--l. 291--><p class="nopar" > produces: A Book of Rhyme.
-     </p><!--l. 295--><p class="noindent" >However
-                                                                    
+     <!--l. 471--><p class="nopar" > produces: A Book of Rhyme.
+     </p><!--l. 475--><p class="noindent" >However
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-     <div class="verbatim" id="verbatim-17">
+     <div class="verbatim" id="verbatim-29">
      \ecapitalisewords{\mytitle}
 </div>
-     <!--l. 298--><p class="nopar" > produces: A Book Of Rhyme.
+     <!--l. 478--><p class="nopar" > produces: A Book Of Rhyme.
 </p>
      </li></ol>
-<!--l. 304--><p class="indent" >   As from v1.09, you can specify words which shouldn’t be capitalised unless they
-occur at the start of &#x27E8;<span 
+<!--l. 484--><p class="noindent" >
+</p>
+<!--l. 484--><p class="noindent" ><a 
+href="#top">Top</a><h3 class="subsectionHead"></p><h4 class="subsectionHead"><span class="titlemark">3.1   </span> <a 
+ id="sec:pdfbookmarks"></a>PDF Bookmarks</h4>
+<!--l. 487--><p class="noindent" ><div class="important" title="Important Note"> If you are using <span 
+class="cmss-10">hyperref</span><a 
+ id="dx1-5001"></a> and want to use <span 
+class="cmtt-10">\capitalisewords</span>, <span 
+class="cmtt-10">\capitalisefmtwords </span>or
+<span 
+class="cmtt-10">\makefirstuc</span><a 
+ id="dx1-5002"></a> (or the expanded variants) in a section heading, the PDF bookmarks won’t be
+able to use the command as it’s not expandable, so you will get a warning that looks
+like:
+                                                                         
+
+                                                                         
+</p>
+   <div class="verbatim" id="verbatim-30">
+Package&#x00A0;hyperref&#x00A0;Warning:&#x00A0;Token&#x00A0;not&#x00A0;allowed&#x00A0;in&#x00A0;a&#x00A0;PDF&#x00A0;string
+&#x00A0;<br />(PDFDocEncoding):
+&#x00A0;<br />(hyperref)&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;removing&#x00A0;‘\capitalisewords’
+</div>
+<!--l. 497--><p class="nopar" > </div>
+</p><!--l. 498--><p class="noindent" >
+</p><!--l. 500--><p class="noindent" >If you want to provide an alternative for the PDF bookmark, you can use <span 
+class="cmss-10">hyperref</span><a 
+ id="dx1-5003"></a>’s
+<span 
+class="cmtt-10">\texorpdfstring</span><a 
+ id="dx1-5004"></a> command. For example:
+                                                                         
+
+                                                                         
+</p>
+   <div class="verbatim" id="verbatim-31">
+\chapter{\texorpdfstring
+&#x00A0;<br />&#x00A0;&#x00A0;{\capitalisewords{a&#x00A0;book&#x00A0;of&#x00A0;rhyme}}%&#x00A0;TeX
+&#x00A0;<br />&#x00A0;&#x00A0;{A&#x00A0;Book&#x00A0;of&#x00A0;Rhyme}%&#x00A0;PDF
+&#x00A0;<br />}
+</div>
+<!--l. 507--><p class="nopar" > Alternatively, you can use <span 
+class="cmss-10">hyperref</span><a 
+ id="dx1-5005"></a>’s mechanism for disabling commands within the
+bookmarks. For example:
+                                                                         
+
+                                                                         
+</p>
+   <div class="verbatim" id="verbatim-32">
+\pdfstringdefDisableCommands{%
+&#x00A0;<br />&#x00A0;\let\capitalisewords\@firstofone
+&#x00A0;<br />}
+</div>
+<!--l. 514--><p class="nopar" >
+</p><!--l. 516--><p class="indent" >   See the <span 
+class="cmss-10">hyperref</span><a 
+ id="dx1-5006"></a> manual for further details.
+</p><!--l. 518--><p class="noindent" >
+</p>
+<!--l. 518--><p class="noindent" ><a 
+href="#top">Top</a><h3 class="subsectionHead"></p><h4 class="subsectionHead"><span class="titlemark">3.2   </span> <a 
+ id="sec:nocap"></a>Excluding Words From Case-Changing</h4>
+<!--l. 521--><p class="noindent" >As from v1.09, you can specify words which shouldn’t be capitalised unless they occur at the
+start of &#x27E8;<span 
 class="cmti-10">text</span>&#x27E9; using:
-</p><!--l. 306--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+</p><!--l. 523--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
 class="cmtt-9">\MFUnocap</span><span 
 class="cmtt-9">&#x00A0;</span></span><a 
- id="dx1-4018"></a> <span 
+ id="dx1-6001"></a> <span 
 class="cmtt-10">\MFUnocap{</span>&#x27E8;<span 
 class="cmitt-10">word</span>&#x27E9;<span 
 class="cmtt-10">} </span></div><hr>
-</p><!--l. 308--><p class="noindent" >
+</p><!--l. 525--><p class="noindent" >
 This only has a local effect. The global version is:
-</p><!--l. 310--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+</p><!--l. 527--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
 class="cmtt-9">\gMFUnocap</span><span 
 class="cmtt-9">&#x00A0;</span></span><a 
- id="dx1-4019"></a> <span 
+ id="dx1-6002"></a> <span 
 class="cmtt-10">\gMFUnocap{</span>&#x27E8;<span 
 class="cmitt-10">word</span>&#x27E9;<span 
 class="cmtt-10">} </span></div><hr>
-</p><!--l. 312--><p class="noindent" >
-</p><!--l. 314--><p class="indent" >   For example:
-                                                                    
+</p><!--l. 529--><p class="noindent" >
+</p><!--l. 531--><p class="indent" >   For example:
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-18">
+   <div class="verbatim" id="verbatim-33">
 \capitalisewords{the&#x00A0;wind&#x00A0;in&#x00A0;the&#x00A0;willows}
 &#x00A0;<br />\MFUnocap{in}%
 &#x00A0;<br />\MFUnocap{the}%
 &#x00A0;<br />\capitalisewords{the&#x00A0;wind&#x00A0;in&#x00A0;the&#x00A0;willows}
 </div>
-<!--l. 322--><p class="nopar" > produces: <spacer type=vertical size=10><span class="obeylines-h">
+<!--l. 539--><p class="nopar" > produces: <spacer type=vertical size=10><span class="obeylines-h">
    <br />The Wind In The Willows
    <br />The Wind in the Willows
    <br /><spacer type=vertical size=10></span>
 The list of words that shouldn’t be capitalised can be cleared using
-</p><!--l. 333--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
+</p><!--l. 550--><p class="indent" >   <hr><div title="Definition"><span class="marginpar"><span 
 class="cmtt-9">\MFUclear</span><span 
 class="cmtt-9">&#x00A0;</span></span><a 
- id="dx1-4020"></a> <span 
+ id="dx1-6003"></a> <span 
 class="cmtt-10">\MFUclear </span></div><hr>
-</p><!--l. 335--><p class="noindent" >
-</p><!--l. 337--><p class="indent" >   The package <span 
+</p><!--l. 552--><p class="noindent" >
+</p><!--l. 554--><p class="indent" >   You can also simply place an empty group in front of a word if you don’t want that specific
+instance to be capitalised. For example:
+                                                                         
+
+                                                                         
+</p>
+   <div class="verbatim" id="verbatim-34">
+\MFUclear
+&#x00A0;<br />\capitalisewords{the&#x00A0;{}wind&#x00A0;in&#x00A0;the&#x00A0;willows}
+</div>
+<!--l. 560--><p class="nopar" > produces: <spacer type=vertical size=10><span class="obeylines-h">
+   <br />The wind In The Willows
+   <br /><spacer type=vertical size=10></span>
+This is also a useful way of protecting commands that shouldn’t be parsed. For
+example:
+                                                                         
+
+                                                                         
+</p>
+   <div class="verbatim" id="verbatim-35">
+\capitalisewords{this&#x00A0;is&#x00A0;section&#x00A0;{}\nameref{sec:nocap}.}
+</div>
+<!--l. 570--><p class="nopar" > produces <spacer type=vertical size=10><span class="obeylines-h">
+   <br />This Is Section <a 
+href="#sec:nocap">Excluding Words From Case-Changing<!--tex4ht:ref: sec:nocap --></a>.
+   <br /><spacer type=vertical size=10></span>
+(No case-changing is applied to <span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\nameref{sec:nocap}</span></span></span>.)
+</p><!--l. 577--><p class="indent" >   The package <span 
 class="cmss-10">mfirstuc-english</span><a 
- id="dx1-4021"></a> loads <span 
-class="cmss-10">mfirstuc</span><a 
- id="dx1-4022"></a> and uses <span 
+ id="dx1-6004"></a> loads <span 
+class="cmss-10">mfirstuc </span>and uses <span 
 class="cmtt-10">\MFUnocap </span>to add common
-English articles and conjunctions, such as “a”, “an”, “and”, “but”. You may want to
-add other words to this list, such as prepositions, but as there’s some dispute over
-whether prepositions should be capitalised, I&#x00A0;don’t intend to add them to this
+English articles and conjunctions, such as “a”, “an”, “and”, “but”. You may want
+to add other words to this list, such as prepositions but, as there’s some dispute
+over whether prepositions should be capitalised, I&#x00A0;don’t intend to add them to this
 package.
-</p><!--l. 344--><p class="indent" >   If you want to write a similar package for another language, all you need to do is
-create a file with the extension <span 
+</p><!--l. 584--><p class="indent" >   If you want to write a similar package for another language, all you need to do is create a
+file with the extension <span 
 class="cmtt-10">.sty </span>that starts with
-                                                                    
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-19">
+   <div class="verbatim" id="verbatim-36">
 \NeedsTeXFormat{LaTeX2e}
 </div>
-<!--l. 349--><p class="nopar" > The next line should identify the package. For example, if you have called the file
+<!--l. 589--><p class="nopar" > The next line should identify the package. For example, if you have called the file
 <span 
 class="cmtt-10">mfirstuc-french.sty </span>then you need:
-                                                                    
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-20">
+   <div class="verbatim" id="verbatim-37">
 \ProvidesPackage{mfirstuc-french}
 </div>
-<!--l. 354--><p class="nopar" > It’s a good idea to also add a version in the final optional argument, for example:
-                                                                    
+<!--l. 594--><p class="nopar" > It’s a good idea to also add a version in the final optional argument, for example:
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-21">
+   <div class="verbatim" id="verbatim-38">
 \ProvidesPackage{mfirstuc-french}[2014/07/30&#x00A0;v1.0]
 </div>
-<!--l. 359--><p class="nopar" > Next load <span 
-class="cmss-10">mfirstuc</span><a 
- id="dx1-4023"></a>:
-                                                                    
+<!--l. 599--><p class="nopar" > Next load <span 
+class="cmss-10">mfirstuc</span>:
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-22">
+   <div class="verbatim" id="verbatim-39">
 \RequirePackage{mfirstuc}
 </div>
-<!--l. 363--><p class="nopar" > Now add all your <span 
+<!--l. 603--><p class="nopar" > Now add all your <span 
 class="cmtt-10">\MFUnocap </span>commands. For example:
-                                                                    
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-23">
+   <div class="verbatim" id="verbatim-40">
 \MFUnocap{de}
 </div>
-<!--l. 367--><p class="nopar" > At the end of the file add:
-                                                                    
+<!--l. 607--><p class="nopar" > At the end of the file add:
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-24">
+   <div class="verbatim" id="verbatim-41">
 \endinput
 </div>
-<!--l. 371--><p class="nopar" >
-</p><!--l. 373--><p class="indent" >   Put the file somewhere on <span class="TEX">T<span 
+<!--l. 611--><p class="nopar" >
+</p><!--l. 613--><p class="indent" >   Put the file somewhere on <span class="TEX">T<span 
 class="E">E</span>X</span>’s path, and now you can use this package in your
-document. You might also consider uploading it to CTAN in case other users find it
+document. You might also consider <a 
+href="http://ctan.org/upload" >uploading it to CTAN</a> in case other users find it
 useful.
-</p><!--l. 377--><p class="noindent" >
+</p><!--l. 618--><p class="noindent" >
 </p>
-<!--l. 377--><p class="noindent" ><a 
+<!--l. 618--><p class="noindent" ><a 
 href="#top">Top</a><h2 class="sectionHead"></p><h3 class="sectionHead"><span class="titlemark">4   </span> <a 
  id="sec:utf8"></a>UTF-8</h3>
-<!--l. 380--><p class="noindent" >The <span 
-class="cmtt-10">\makefirstuc </span>command works by utilizing the fact that, in most cases,
-<span class="TEX">T<span 
-class="E">E</span>X</span>&#x00A0;doesn’t require a regular argument to be enclosed in braces if it only consists of a
-single token. (This is why you can do, say, <span class="obeylines-h"><span class="verb"><span 
+<!--l. 621--><p class="noindent" >The <span 
+class="cmtt-10">\makefirstuc </span>command works by utilizing the fact that, in most cases, <span class="TEX">T<span 
+class="E">E</span>X</span>&#x00A0;doesn’t
+require a regular argument to be enclosed in braces if it only consists of a single token. (This is
+why you can do, say, <span class="obeylines-h"><span class="verb"><span 
 class="cmtt-10">\frac12</span></span></span> instead of <span class="obeylines-h"><span class="verb"><span 
 class="cmtt-10">\frac{1}{2}</span></span></span> or <span class="obeylines-h"><span class="verb"><span 
-class="cmtt-10">x^2</span></span></span>
-instead of <span class="obeylines-h"><span class="verb"><span 
-class="cmtt-10">x^{2}</span></span></span>, although some users frown on this practice.)
-</p><!--l. 387--><p class="indent" >   A&#x00A0;simplistic version of the <span 
+class="cmtt-10">x^2</span></span></span> instead of <span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">x^{2}</span></span></span>, although some
+users frown on this practice.)
+</p><!--l. 628--><p class="indent" >   A&#x00A0;simplistic version of the <span 
 class="cmtt-10">\makefirstuc </span>command is:
-                                                                    
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-25">
+   <div class="verbatim" id="verbatim-42">
 \newcommand*{\FirstUC}[1]{\MakeUppercase&#x00A0;#1}
 </div>
-<!--l. 390--><p class="nopar" > Here
-                                                                    
+<!--l. 631--><p class="nopar" > Here
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-26">
+   <div class="verbatim" id="verbatim-43">
 \FirstUC{abc}
 </div>
-<!--l. 394--><p class="nopar" > is equivalent to
-                                                                    
+<!--l. 635--><p class="nopar" > is equivalent to
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-27">
+   <div class="verbatim" id="verbatim-44">
 \MakeUppercase&#x00A0;abc
 </div>
-<!--l. 398--><p class="nopar" > and since <span 
-class="cmtt-10">\MakeUppercase </span>requires an argument, it grabs the first token (the
-character “a” in this case) and uses that as the argument so that the result is:
-Abc.
-</p><!--l. 403--><p class="indent" >   The <span 
+<!--l. 639--><p class="nopar" > and since <span 
+class="cmtt-10">\MakeUppercase </span>requires an argument, it grabs the first token (the character “a” in
+this case) and uses that as the argument so that the result is: Abc.
+</p><!--l. 644--><p class="indent" >   The <span 
 class="cmss-10">glossaries</span><a 
- id="dx1-5001"></a> package needs to take into account the fact that the text may be
-contained in the argument of a formatting command, such as <span 
-class="cmtt-10">\acronymfont</span>, so
-<span 
-class="cmtt-10">\makefirstuc </span>has to be more complicated than the trivial <span 
-class="cmtt-10">\FirstUC </span>shown above, but
-at its basic level, <span 
-class="cmtt-10">\makefirstuc </span>uses this same method and is the reason why,
-in most cases, you don’t need to enclose the first character in braces. So if
-</p><div class="alltt">
+ id="dx1-7001"></a> package needs to take into account the fact that the text may be contained
+in the argument of a formatting command, such as <span 
+class="cmtt-10">\acronymfont</span>, so <span 
+class="cmtt-10">\makefirstuc </span>has to be
+more complicated than the trivial <span 
+class="cmtt-10">\FirstUC </span>shown above, but at its basic level, <span 
+class="cmtt-10">\makefirstuc</span>
+uses this same method and is the reason why, in most cases, you don’t need to enclose the first
+character in braces. So if </p><div class="alltt">
 <div class="obeylines-v">
 <span 
 class="cmtt-10">\MakeUppercase</span><span 
@@ -813,9 +1176,6 @@
 class="cmtt-10">\makefirstuc{</span>&#x27E8;<span 
 class="cmitt-10">stuff</span>&#x27E9;<span 
 class="cmtt-10">}</span>
-                                                                    
-
-                                                                    
 </div>
 </div> nor <div class="alltt">
 <div class="obeylines-v">
@@ -826,9 +1186,12 @@
 class="cmitt-10">stuff</span>&#x27E9;<span 
 class="cmtt-10">}</span><span 
 class="cmsy-10">}</span>
+                                                                         
+
+                                                                         
 </div>
 </div>
-<!--l. 435--><p class="indent" >   Try the following document: </p><div class="alltt">
+<!--l. 676--><p class="indent" >   Try the following document: </p><div class="alltt">
 <div class="obeylines-v">
 <span 
 class="cmtt-10">\documentclass</span><span 
@@ -866,27 +1229,27 @@
 class="cmsy-10">}</span>
 </div>
 </div>
-<!--l. 449--><p class="indent" >   This will result in the error:
-                                                                    
+<!--l. 690--><p class="indent" >   This will result in the error:
+                                                                         
 
-                                                                    
+                                                                         
 </p>
-   <div class="verbatim" id="verbatim-28">
+   <div class="verbatim" id="verbatim-45">
 !&#x00A0;Argument&#x00A0;of&#x00A0;\UTFviii at two@octets&#x00A0;has&#x00A0;an&#x00A0;extra&#x00A0;}.
 </div>
-<!--l. 452--><p class="nopar" > This is why <span class="obeylines-h"><span class="verb"><span 
+<!--l. 693--><p class="nopar" > This is why <span class="obeylines-h"><span class="verb"><span 
 class="cmtt-10">\makefirstuc{</span></span></span><span 
 class="cmtt-10">ã</span><span 
 class="cmtt-10">bc</span><span class="obeylines-h"><span class="verb"><span 
 class="cmtt-10">}</span></span></span> won’t work. It will only work if the character <span 
-class="cmtt-10">ã</span> is
-placed inside a group.
-</p><!--l. 457--><p class="indent" >   The reason for this error message is due to <span class="TEX">T<span 
-class="E">E</span>X</span>&#x00A0;having been written before
-Unicode was invented. Although <span 
-class="cmtt-10">ã</span> may look like a single character in your text editor,
-from <span class="TEX">T<span 
-class="E">E</span>X</span>’s point of view it’s <span 
+class="cmtt-10">ã</span> is placed
+inside a group.
+</p><!--l. 698--><p class="indent" >   The reason for this error message is due to <span class="TEX">T<span 
+class="E">E</span>X</span>&#x00A0;having been written before Unicode was
+invented. Although <span 
+class="cmtt-10">ã</span> may look like a single character in your text editor, from <span class="TEX">T<span 
+class="E">E</span>X</span>’s point
+of view it’s <span 
 class="cmti-10">two </span>tokens. So </p><div class="alltt">
 <div class="obeylines-v">
 <span 
@@ -896,10 +1259,10 @@
 class="cmtt-10">bc</span>
 </div>
 </div> tries to apply <span 
-class="cmtt-10">\MakeUppercase </span>to just the first octet of ã. This means that the second
-octet has been separated from the first octet, which is the cause of the error. In this
-case the argument isn’t a single token, so the two tokens (the first and second octet of
-ã) must be grouped: <div class="alltt">
+class="cmtt-10">\MakeUppercase </span>to just the first octet of ã. This means that the second octet
+has been separated from the first octet, which is the cause of the error. In this case the
+argument isn’t a single token, so the two tokens (the first and second octet of ã) must be
+grouped: <div class="alltt">
 <div class="obeylines-v">
 <span 
 class="cmtt-10">\MakeUppercase</span><span 
@@ -909,11 +1272,10 @@
 class="cmtt-10">bc</span>
 </div>
 </div>
-<!--l. 473--><p class="indent" >   Note that XeTeX&#x00A0;(and therefore XeLaTeX) is a modern implementation of
-<span class="TEX">T<span 
-class="E">E</span>X</span>&#x00A0;designed to work with Unicode and therefore doesn’t suffer from this
-drawback. Now let’s look at the XeLaTeX&#x00A0;equivalent of the above example:
-</p><div class="alltt">
+<!--l. 714--><p class="indent" >   Note that XeTeX&#x00A0;(and therefore XeLaTeX) is a modern implementation of <span class="TEX">T<span 
+class="E">E</span>X</span>&#x00A0;designed
+to work with Unicode and therefore doesn’t suffer from this drawback. Now let’s look at the
+XeLaTeX&#x00A0;equivalent of the above example: </p><div class="alltt">
 <div class="obeylines-v">
 <span 
 class="cmtt-10">\documentclass</span><span 
@@ -946,26 +1308,111 @@
 class="cmsy-10">}</span>
 </div>
 </div>
-                                                                    
-
-                                                                    
-<!--l. 489--><p class="indent" >   This works correctly when compiled with XeLaTeX. This means that
-<span 
+<!--l. 730--><p class="indent" >   This works correctly when compiled with XeLaTeX. This means that <span 
 class="cmtt-10">\makefirstuc</span><span class="obeylines-h"><span class="verb"><span 
 class="cmtt-10">{</span></span></span><span 
 class="cmtt-10">ã</span><span 
 class="cmtt-10">bc</span><span class="obeylines-h"><span class="verb"><span 
-class="cmtt-10">}</span></span></span> will work <span 
+class="cmtt-10">}</span></span></span>
+will work <span 
 class="cmti-10">provided you use XeLaTeX</span><span 
 class="cmti-10">&#x00A0;and the </span><span 
 class="cmssi-10">fontspec</span><a 
- id="dx1-5002"></a>
-<span 
+ id="dx1-7002"></a> <span 
 class="cmti-10">package</span>.
+                                                                         
+
+                                                                         
+</p><!--l. 2--><p class="noindent" >
 </p>
-    
+   <h3 class="likesectionHead"><a 
+ id="x1-80004"></a>Index</h3>
+<!--l. 4--><p class="noindent" >                                                                       <span 
+class="cmbx-10">C</span>
+</p>
+   <div class="theindex"><span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\capitalisewords</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">5 </span><br /></span>
+<p class="theindex">                                                                       <span 
+class="cmbx-10">E</span>
+<span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\ecapitalisefmtwords</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">8 </span><br /></span>
+<span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\ecapitalisewords</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">8 </span><br /></span>
+<span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\emakefirstuc</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">4 </span><br /></span>
+</p><p class="theindex">                                                                       <span 
+class="cmbx-10">F</span>
+<span class="index-item"><span 
+class="cmss-10">fontspec </span>package&#x00A0;&#x00A0;13 <br /></span>
+</p><p class="theindex">                                                                       <span 
+class="cmbx-10">G</span>
+<span class="index-item"><span 
+class="cmss-10">glossaries </span>package&#x00A0;&#x00A0;4, 12 <br /></span>
+<span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\glsmakefirstuc</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">4 </span><br /></span>
+<span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\gMFUnocap</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">10 </span><br /></span>
+</p><p class="theindex">                                                                       <span 
+class="cmbx-10">H</span>
+<span class="index-item"><span 
+class="cmss-10">hyperref </span>package&#x00A0;&#x00A0;9 <br /></span>
+</p><p class="theindex">                                                                        <span 
+class="cmbx-10">I</span>
+<span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\ifMFUhyphen</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">5 </span><br /></span>
+<span class="index-item"><span 
+class="cmss-10">inputenc </span>package&#x00A0;&#x00A0;3 <br /></span>
+</p><p class="theindex">                                                                       <span 
+class="cmbx-10">M</span>
+<span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\makefirstuc</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">2 </span><br /></span>
+<span class="index-item"><span 
+class="cmss-10">mfirstuc-english </span>package&#x00A0;&#x00A0;10 <br /></span>
+<span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\MFUcapword</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">5 </span><br /></span>
+<span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\MFUclear</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">10 </span><br /></span>
+<span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\MFUhyphenfalse</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">5 </span><br /></span>
+<span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\MFUhyphentrue</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">5 </span><br /></span>
+<span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\MFUnocap</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">9 </span><br /></span>
+</p><p class="theindex">                                                                       <span 
+class="cmbx-10">T</span>
+<span class="index-item"><span 
+class="cmss-10">textcase </span>package&#x00A0;&#x00A0;4 <br /></span>
+</p><p class="theindex">                                                                       <span 
+class="cmbx-10">X</span>
+<span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\xcapitalisefmtwords</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">8 </span><br /></span>
+                                                                         
+
+                                                                         
+<span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\xcapitalisewords</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">7 </span><br /></span>
+<span class="index-item"><span class="obeylines-h"><span class="verb"><span 
+class="cmtt-10">\xmakefirstuc</span></span></span>&#x00A0;&#x00A0;<span 
+class="cmti-10">4 </span><br /></span>
+</p></div>
+ 
 </body></html> 
 
-                                                                    
+                                                                         
 
 

Modified: trunk/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.tex	2016-07-30 23:07:33 UTC (rev 41765)
+++ trunk/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.tex	2016-07-30 23:07:44 UTC (rev 41766)
@@ -1,5 +1,6 @@
 \documentclass{nlctdoc}
 
+\usepackage[a4paper,left=1.75in]{geometry}
 \usepackage{alltt}
 \usepackage{mfirstuc}
 \usepackage{pifont}
@@ -19,14 +20,19 @@
             pdftitle={mfirstuc.sty: uppercasing first letter},
             pdfkeywords={LaTeX,package,uppercase}]{hyperref}
 
+\IndexPrologue{%
+\section*{\indexname}\markright{\indexname}
+\addcontentsline{toc}{section}{\indexname}}
+
 \begin{document}
- \title{mfirstuc.sty v2.02: 
+\MakeShortVerb{|}
+ \title{mfirstuc.sty v2.03: 
 uppercasing first letter}
  \author{Nicola L.C. Talbot\\[10pt]
 Dickimaw Books\\
 \url{http://www.dickimaw-books.com/}}
 
- \date{2015-12-17}
+ \date{2016-07-29}
  \maketitle
  \tableofcontents
 
@@ -39,7 +45,61 @@
 \styfmt{glossaries}, the two have been split into separately
 maintained packages.
 
-\section{Capitalising a Word}
+\begin{important}
+The commands described here all have limitations. To minimise
+problems, use text-block style semantic commands with one argument
+(the text that requires case-changing), and avoid scoped 
+declarations.
+\end{important}
+
+Here are some examples of semantic commands:
+\begin{enumerate}
+\item Quoted material:
+\begin{verbatim}
+\newcommand{\qt}[1]{``#1''}
+\end{verbatim}
+(or use the \styfmt{csquotes} package). With this, the following
+works:
+\begin{verbatim}
+\makefirstuc{\qt{word}}
+\end{verbatim}
+This produces:
+\begin{display}
+\makefirstuc{\qt{word}}
+\end{display}
+Whereas 
+\begin{verbatim}
+\makefirstuc{``word''}
+\end{verbatim}
+fails (no case-change and double open quote becomes two single open
+quotes):
+\begin{display}
+\makefirstuc{``word''}
+\end{display}
+
+\item Font styles or colours:
+\begin{verbatim}
+\newcommand*{\alert}[1]{\textcolor{red}{#1}}
+\end{verbatim}
+Now the following is possible:
+\begin{verbatim}
+\makefirstuc{\alert{word}}
+\end{verbatim}
+This produces
+\begin{display}
+\newcommand*{\alert}[1]{\textcolor{red}{#1}}%
+\makefirstuc{\alert{word}}
+\end{display}
+Note that \verb|\makefirstuc{\textcolor{red}{word}}| fails
+(with an error) because the case-changing interferes with the label.
+\end{enumerate}
+
+Define these semantic commands robustly if you intend using
+any of the commands that fully expand their argument
+(\cs{emakefirstuc}, \cs{ecapitalisewords} and
+\cs{ecapitalisefmtwords}).
+
+\section{Capitalising the First Letter of a Word}
 \label{sec:makefirstuc}
 
 A simple word can be capitalised just using the standard \LaTeX\
@@ -65,7 +125,7 @@
 one argument, the case-changing will always be applied to the
 \emph{first} argument. If the text that requires the case change is
 in one of the other arguments, you must hide the earlier arguments
-in a wrapper command. For example, instead of \verb|\color{red}{text}|
+in a wrapper command. For example, instead of \verb|\textcolor{red}{text}|
 you need to define, say, \verb|\red| as \verb|\color{red}| and use
 \verb|\red{text}|.
 \end{important}
@@ -179,7 +239,7 @@
 Remember to also load \sty{textcase} (\styfmt{glossaries} loads this
 automatically).
 
-\section{Capitalise Each Word in a Phrase or Sentence (Title Case)}
+\section{Capitalise the First Letter of Each Word in a Phrase or Sentence (Title Case)}
 \label{sec:capitalisewords}
 
 New to mfirstuc v1.06:
@@ -190,8 +250,48 @@
 where the space character is used as the word separator. Note that
 it has to be a plain space character, not another form of space,
 such as \verb|~| or \cs{space}. Note that no expansion is performed
-on \meta{text}.
+on \meta{text}. See \sectionref{sec:nocap} for excluding
+words (such as \qt{of}) from the case-changing.
 
+The actual capitalisation of each word is done using
+(new to version 2.03): 
+\begin{definition}[\DescribeMacro\MFUcapword]
+\cs{MFUcapword}\marg{word}
+\end{definition}
+This just does \cs{makefirstuc}\marg{word} by default, but
+its behaviour is determined by the conditional:
+\begin{definition}[\DescribeMacro\ifMFUhyphen]
+\cs{ifMFUhyphen}
+\end{definition}
+
+If you want to title case each part of
+a compound word containing hyphens, you can enable this using
+\begin{definition}[\DescribeMacro\MFUhyphentrue]
+\cs{MFUhyphentrue}
+\end{definition}
+or switch it back off again using:
+\begin{definition}[\DescribeMacro\MFUhyphenfalse]
+\cs{MFUhyphenfalse}
+\end{definition}
+Compare
+\begin{verbatim}
+\capitalisewords{server-side includes}
+\end{verbatim}
+which produces: 
+\begin{display}
+\capitalisewords{server-side includes}
+\end{display}
+with
+\begin{verbatim}
+\MFUhyphentrue
+\capitalisewords{server-side includes}
+\end{verbatim}
+which produces: 
+\begin{display}
+\MFUhyphentrue
+\capitalisewords{server-side includes}
+\end{display}
+
 Formatting for the entire phrase must go outside
 \cs{capitalisewords} (unlike \cs{makefirstuc}). Compare:
 \begin{verbatim}
@@ -210,6 +310,82 @@
 \textbf{\capitalisewords{a sample phrase}}
 \end{display}
 
+As from version 2.03, there is now a command for phrases that may
+include a formatting command:
+\begin{definition}
+\cs{capitalisefmtwords}\marg{phrase}
+\end{definition}
+where \meta{phrase} may be just words (as with \cs{capitalisewords})
+or may be entirely enclosed in a formatting command in the form
+\begin{alltt}
+\cs{capitalisefmtwords}\{\meta{cs}\marg{phrase}\}
+\end{alltt}
+or contain formatted sub-phrases 
+\begin{alltt}
+\cs{capitalisefmtwords}\{\meta{words} \meta{cs}\marg{sub-phrase} \meta{words}\}
+\end{alltt}
+Avoid scoped declarations.
+
+Examples:
+\begin{enumerate}
+\item Phrase entirely enclosed in a formatting command:
+\begin{verbatim}
+\capitalisefmtwords{\textbf{a small book of rhyme}}
+\end{verbatim}
+produces:
+\begin{display}
+\capitalisefmtwords{\textbf{a small book of rhyme}}
+\end{display}
+
+\item Sub-phrase enclosed in a formatting command:
+\begin{verbatim}
+\capitalisefmtwords{a \textbf{small book} of rhyme}
+\end{verbatim}
+produces:
+\begin{display}
+\capitalisefmtwords{a \textbf{small book} of rhyme}
+\end{display}
+
+\item Nested text-block commands:
+\begin{verbatim}
+\capitalisefmtwords{\textbf{a \emph{small book}} of rhyme}
+\end{verbatim}
+produces:
+\begin{display}
+\capitalisefmtwords{\textbf{a \emph{small book}} of rhyme}
+\end{display}
+
+\item Indicating words that shouldn't have the case changed
+(see \sectionref{sec:nocap}):
+\begin{verbatim}
+\MFUnocap{of}
+\capitalisefmtwords{\textbf{a \emph{small book}} of rhyme}
+\end{verbatim}
+produces:
+\begin{display}
+\MFUnocap{of}
+\capitalisefmtwords{\textbf{a \emph{small book}} of rhyme}
+\end{display}
+\end{enumerate}
+
+Grouping causes interference:
+\begin{verbatim}
+\capitalisefmtwords{{a \emph{small book}} of rhyme}
+\end{verbatim}
+produces:
+\begin{display}
+\capitalisefmtwords{{a \emph{small book}} of rhyme}
+\end{display}
+As with all the commands described here, avoid declarations.
+For example, the following fails:
+\begin{verbatim}
+\capitalisefmtwords{{\bfseries a \emph{small book}} of rhyme}
+\end{verbatim}
+produces:
+\begin{display}
+\capitalisefmtwords{{\bfseries a \emph{small book}} of rhyme}
+\end{display}
+
 \begin{definition}[\DescribeMacro{\xcapitalisewords}]
 \cs{xcapitalisewords}\marg{text}
 \end{definition}
@@ -222,6 +398,23 @@
 \cs{ecapitalisewords}\marg{text}
 \end{definition}
 
+There are also similar shortcut commands for the version that allows
+formatting commands:
+\begin{definition}[\DescribeMacro{\xcapitalisefmtwords}]
+\cs{xcapitalisefmtwords}\marg{text}
+\end{definition}
+This is a short cut for
+\cs{expandafter}\cs{capitalisefmtwords}\cs{expandafter}\marg{text}.
+
+For full expansion:
+\begin{definition}[\DescribeMacro\ecapitalisefmtwords]
+\cs{ecapitalisefmtwords}\marg{text}
+\end{definition}
+Take care with this as it may expand non-robust semantic commands
+to replacement text that breaks the functioning of
+\cs{capitalisefmtwords}. Use robust semantic commands
+where possible.
+
 Examples:
 \begin{verbatim}
 \newcommand{\abc}{\xyz\space four five}
@@ -231,11 +424,13 @@
 Fully expanded: \ecapitalisewords{\abc}.
 \end{verbatim}
 produces: 
+\begin{display}
 \renewcommand{\abc}{\xyz\space four five}%
 \renewcommand{\xyz}{one two three}
 No expansion: \capitalisewords{\abc}.
 First object one-level expansion: \xcapitalisewords{\abc}.
 Fully expanded: \ecapitalisewords{\abc}.
+\end{display}
 
 (Remember that the spaces need to be explicit. In the second case
 above, using \cs{xcapitalisewords}, the space before \qt{four} has
@@ -243,21 +438,6 @@
 boundary, but in the third case, \cs{space} has been expanded to an
 actual space character.)
 
-\begin{important}
-If you are using \sty{hyperref} and want to use \cs{capitalisewords}
-or \ics{makefirstuc} (or the expanded variants) 
-in a section heading, the PDF bookmarks won't be able to use the command 
-as it's not expandable, so you will get a warning that looks like:
-\begin{verbatim}
-Package hyperref Warning: Token not allowed in a PDF string 
-(PDFDocEncoding):
-(hyperref)                removing `\capitalisewords'
-\end{verbatim}
-If you want to provide an alternative for the PDF bookmark, you can
-use \sty{hyperref}'s \ics{texorpdfstring} command. See the
-\sty{hyperref} manual for further details.
-\end{important}
-
 Examples:
 \begin{enumerate}
 \item 
@@ -301,6 +481,43 @@
 
 \end{enumerate}
 
+\subsection{PDF Bookmarks}
+\label{sec:pdfbookmarks}
+
+\begin{important}
+If you are using \sty{hyperref} and want to use
+\cs{capitalisewords}, \cs{capitalisefmtwords}
+or \ics{makefirstuc} (or the expanded variants) 
+in a section heading, the PDF bookmarks won't be able to use the command 
+as it's not expandable, so you will get a warning that looks like:
+\begin{verbatim}
+Package hyperref Warning: Token not allowed in a PDF string 
+(PDFDocEncoding):
+(hyperref)                removing `\capitalisewords'
+\end{verbatim}
+\end{important}
+
+If you want to provide an alternative for the PDF bookmark, you can
+use \sty{hyperref}'s \ics{texorpdfstring} command. For example:
+\begin{verbatim}
+\chapter{\texorpdfstring
+  {\capitalisewords{a book of rhyme}}% TeX
+  {A Book of Rhyme}% PDF
+}
+\end{verbatim}
+Alternatively, you can use \sty{hyperref}'s mechanism for
+disabling commands within the bookmarks. For example:
+\begin{verbatim}
+\pdfstringdefDisableCommands{%
+ \let\capitalisewords\@firstofone
+}
+\end{verbatim}
+
+See the \sty{hyperref} manual for further details.
+
+\subsection{Excluding Words From Case-Changing}
+\label{sec:nocap}
+
 As from v1.09, you can specify words which shouldn't be capitalised unless they
 occur at the start of \meta{text} using:
 \begin{definition}[\DescribeMacro\MFUnocap]
@@ -334,10 +551,33 @@
 \cs{MFUclear}
 \end{definition}
 
-The package \sty{mfirstuc-english} loads \sty{mfirstuc} and uses
+You can also simply place an empty group in front of a word
+if you don't want that specific instance to be capitalised.
+For example:
+\begin{verbatim}
+\MFUclear
+\capitalisewords{the {}wind in the willows}
+\end{verbatim}
+produces:
+\begin{display}
+\MFUclear
+\capitalisewords{the {}wind in the willows}
+\end{display}
+This is also a useful way of protecting commands that
+shouldn't be parsed. For example:
+\begin{verbatim}
+\capitalisewords{this is section {}\nameref{sec:nocap}.}
+\end{verbatim}
+produces
+\begin{display}
+\capitalisewords{this is section {}\nameref{sec:nocap}.}
+\end{display}
+(No case-changing is applied to \verb|\nameref{sec:nocap}|.)
+
+The package \sty{mfirstuc-english} loads \styfmt{mfirstuc} and uses
 \cs{MFUnocap} to add common English articles and conjunctions, such
 as ``a'', ``an'', ``and'', ``but''. You may want to add other
-words to this list, such as prepositions, but as there's some
+words to this list, such as prepositions but, as there's some
 dispute over whether prepositions should be capitalised, I~don't
 intend to add them to this package.
 
@@ -357,7 +597,7 @@
 \begin{verbatim}
 \ProvidesPackage{mfirstuc-french}[2014/07/30 v1.0]
 \end{verbatim}
-Next load \sty{mfirstuc}:
+Next load \styfmt{mfirstuc}:
 \begin{verbatim}
 \RequirePackage{mfirstuc}
 \end{verbatim}
@@ -371,8 +611,9 @@
 \end{verbatim}
 
 Put the file somewhere on \TeX's path, and now you can use this
-package in your document. You might also consider uploading it
-to CTAN in case other users find it useful.
+package in your document. You might also consider 
+\href{http://ctan.org/upload}{uploading it to CTAN} in case 
+other users find it useful.
 
 \section{UTF-8}
 \label{sec:utf8}
@@ -490,4 +731,5 @@
 that \cs{makefirstuc}\verb|{|\texttt{\~abc}\verb|}| will work
 \emph{provided you use \XeLaTeX\ and the \sty{fontspec} package}.
 
+\PrintIndex
 \end{document}

Modified: trunk/Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.tex	2016-07-30 23:07:33 UTC (rev 41765)
+++ trunk/Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.tex	2016-07-30 23:07:44 UTC (rev 41766)
@@ -3,20 +3,31 @@
  % arara: pdflatex: { synctex: on }
 \documentclass{article}
 
-\usepackage{mfirstuc-english}
+\usepackage[a4paper]{geometry}
+\usepackage{color}
+\usepackage{mfirstuc-english}% also loads mfirstuc.sty
 
 \begin{document}
+This is a sample document illustrating the mfirstuc package.
 
+\section{First Letter Upper Case}
+
+\verb|\makefirstuc{abc}.|
 \makefirstuc{abc}.
 
+\verb|\makefirstuc{{\em abc}}.|
 \makefirstuc{{\em abc}}.
 
+\verb|\makefirstuc{\emph{abc}}.|
 \makefirstuc{\emph{abc}}.
 
+\verb|\makefirstuc{\ae bc}.|
 \makefirstuc{\ae bc}.
 
+\verb|\makefirstuc{{\ae}bc}.|
 \makefirstuc{{\ae}bc}.
 
+\verb|\newcommand{\abc}{abc}\xmakefirstuc{\abc}.|
 \newcommand{\abc}{abc}%
 \xmakefirstuc{\abc}.
 
@@ -26,30 +37,169 @@
 \renewcommand*{\mytext}{\ae\oe{some text}}
 Sequential commands: \xmakefirstuc{\mytext}.
 
-\capitalisewords{the wind in the willows}
+\section{Title Case (Formatting)}
 
-\capitalisewords{a book of rhyme.}
+Formatting for the entire phrase must go outside
+\verb|\capitalisewords| (unlike \verb|\makefirstuc|). Compare:
 
-\MFUclear
+\verb|\capitalisewords{\textbf{a small book of rhyme.}}|
+\capitalisewords{\textbf{a small book of rhyme.}}
 
+with:
+
+\verb|\textbf{\capitalisewords{a small book of rhyme.}}|
+\textbf{\capitalisewords{a small book of rhyme.}}
+
+\medskip
+
+Use \verb|\capitalisefmtwords| instead (full stop outside
+argument to check for spurious spaces):
+
+\verb|\capitalisefmtwords{\textbf{a small book of rhyme}}.|
+\capitalisefmtwords{\textbf{a small book of rhyme}}.
+
+\verb|\capitalisefmtwords{\textbf{a small book} of rhyme}.|
+\capitalisefmtwords{\textbf{a small book} of rhyme}.
+
+\verb|\capitalisefmtwords{a \textbf{small book} of rhyme}.|
+\capitalisefmtwords{a \textbf{small book} of rhyme}.
+
+\verb|\capitalisefmtwords{\textbf{a} book of rhyme}.|
+\capitalisefmtwords{\textbf{a} small book of rhyme}.
+
+\verb|\capitalisefmtwords{\textbf{a book }of rhyme}.|
+\capitalisefmtwords{\textbf{a small book }of rhyme}.
+
+\verb|\capitalisefmtwords{a small book \textbf{of rhyme}}.|
+\capitalisefmtwords{a small book \textbf{of rhyme}}.
+
+\medskip
+
+Use semantic commands for things like quotations:
+
+\begin{verbatim}
+\newcommand*{\qt}[1]{``#1''}
+\capitalisefmtwords{\qt{a small book of rhyme.}}
+\end{verbatim}
+\newcommand*{\qt}[1]{``#1''}
+\capitalisefmtwords{\qt{a small book of rhyme.}}
+
+\smallskip
+
+(But make them robust if you intend using commands like
+\verb|\ecapitalisefmtwords|.)
+
+\medskip
+
+Nested text-block commands:
+
+\begin{verbatim}
+\capitalisefmtwords{\textbf{a \emph{small book} of} rhyme}.
+\end{verbatim}
+\capitalisefmtwords{\textbf{a \emph{small book} of} rhyme}.
+
+\begin{verbatim}
+\capitalisefmtwords{\textbf{a \emph{small book}} of rhyme}.
+\end{verbatim}
+\capitalisefmtwords{\textbf{a \emph{small book}} of rhyme}.
+
+\begin{verbatim}
+\capitalisefmtwords{\textbf{\emph{a small} book of} rhyme}.
+\end{verbatim}
+\capitalisefmtwords{\textbf{\emph{a small} book of} rhyme}.
+
+\medskip
+
+An empty brace at the start of a word will suppress the
+case-changing.
+
+\begin{verbatim}
+\capitalisefmtwords{\textbf{a small {}book of} rhyme}.
+\end{verbatim}
+\capitalisefmtwords{\textbf{a small {}book of} rhyme}.
+
+\medskip
+
+Suppress case-changing for problematic commands by inserting
+an empty group in front:
+
+\begin{verbatim}
+\capitalisefmtwords{{}\textcolor{red}{a} small book of
+{}\textcolor{red}{rhyme}}.
+\end{verbatim}
+\capitalisefmtwords{{}\textcolor{red}{a} small book of
+{}\textcolor{red}{rhyme}}.
+
+\medskip
+
+If possible provide semantic command instead.
+
+\begin{verbatim}
+\newcommand*{\alert}[1]{\textcolor{red}{#1}}
+\capitalisefmtwords{\alert{a} small book of \alert{rhyme}}.
+\end{verbatim}
+\newcommand*{\alert}[1]{\textcolor{red}{#1}}
+\capitalisefmtwords{\alert{a} small book of \alert{rhyme}}.
+
+\medskip
+
+No formatting commands in the following example:
+
+\verb|\capitalisefmtwords{a small book of rhyme}.|
+\capitalisefmtwords{a small book of rhyme}.
+
+\medskip
+
+Avoid scoped declarations. The next example doesn't work.
+
+\begin{verbatim}
+\capitalisefmtwords{{\bfseries a \emph{small book} of} rhyme.}
+\end{verbatim}
+\capitalisefmtwords{{\bfseries a \emph{small book} of} rhyme.}
+
+\medskip
+
+If a command isn't followed by a grouped argument, the
+case-change is applied to the command (on the assumption
+that it's a character command, such as \verb|\ae|). This can
+have an odd effect if case-changing has no meaning for that command.
+As illustrated next:
+
+\verb|\capitalisefmtwords{\relax a book of rhyme.}|
+\capitalisefmtwords{\relax a book of rhyme.}
+
+\section{Title Case (No Formatting)}
+
+\bgroup
+
+\verb|\capitalisewords{the wind in the willows}|
 \capitalisewords{the wind in the willows}
 
-\capitalisewords{a book of rhyme.}
+\verb|\capitalisewords{a small book of rhyme.}|
+\capitalisewords{a small book of rhyme.}
 
-\capitalisewords{a book\space of rhyme.}
+\medskip
 
-\newcommand{\mytitle}{a book\space of rhyme.}
-\capitalisewords{\mytitle}
+\verb|\space| isn't considered a word boundary for
+\verb|\capitalisewords| as shown below:
 
-\xcapitalisewords{\mytitle}
+\begin{verbatim}
+\capitalisewords{a small\space book of rhyme.}
+\end{verbatim}
+\capitalisewords{a small\space book of rhyme.}
 
-Formatting for the entire phrase must go outside
-\verb|\capitalisewords| (unlike \verb|\makefirstuc|). Compare:
+\medskip
+No expansion is performed on the argument of
+\verb|\capitalisewords|:
 
-\capitalisewords{\textbf{a book of rhyme.}}
+\verb|\newcommand{\mytitle}{a small\space book of rhyme.}|
+\newcommand{\mytitle}{a small\space book of rhyme.}
 
-with:
+\verb|\capitalisewords{\mytitle}|
+\capitalisewords{\mytitle}
 
-\textbf{\capitalisewords{a book of rhyme.}}
+\verb|\xcapitalisewords{\mytitle}|
+\xcapitalisewords{\mytitle}
 
+\egroup
 \end{document}

Modified: trunk/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.dtx	2016-07-30 23:07:33 UTC (rev 41765)
+++ trunk/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.dtx	2016-07-30 23:07:44 UTC (rev 41766)
@@ -1,21 +1,21 @@
 %\iffalse
 % mfirstuc.dtx generated using makedtx version 1.1 (c) Nicola Talbot
 % Command line args:
+%   -codetitle "Main Package Code"
+%   -author "Nicola Talbot"
+%   -doc "mfirstuc-codedoc.tex"
 %   -src "mfirstuc.sty\Z=>mfirstuc.sty"
 %   -src "mfirstuc-english.sty\Z=>mfirstuc-english.sty"
 %   -src "(sample.*\.tex)\Z=>\1"
 %   -src "(.*\.perl)\Z=>\1"
-%   -doc "mfirstuc-codedoc.tex"
 %   -comment ".*\.perl"
 %   -comment ".*\.tex"
-%   -author "Nicola Talbot"
+%   -macrocode ".*\.perl"
+%   -macrocode ".*\.tex"
 %   -setambles ".*\.perl=>\nopreamble\nopostamble"
 %   -setambles ".*\.tex=>\nopreamble\nopostamble"
-%   -codetitle "Main Package Code"
-%   -macrocode ".*\.perl"
-%   -macrocode ".*\.tex"
 %   mfirstuc
-% Created on 2015/12/17 12:46
+% Created on 2016/7/29 22:54
 %\fi
 %\iffalse
 %<*package>
@@ -38,7 +38,7 @@
 %\fi
 % \iffalse
 % Doc-Source file to use with LaTeX2e
-% Copyright (C) 2015 Nicola Talbot, all rights reserved.
+% Copyright (C) 2016 Nicola Talbot, all rights reserved.
 % \fi
 % \iffalse
 %<*driver>
@@ -62,8 +62,9 @@
 \renewcommand*{\main}[1]{\hyperpage{#1}}
 
 \setcounter{IndexColumns}{2}
+\setlength\IndexMin{100pt}
 
-\CheckSum{268}
+\CheckSum{519}
 
 \begin{document}
 \DocInput{mfirstuc.dtx}
@@ -73,12 +74,12 @@
 %\MakeShortVerb{"}
 %\DeleteShortVerb{\|}
 %
-% \title{Documented Code For mfirstuc v2.02}
+% \title{Documented Code For mfirstuc v2.03}
 % \author{Nicola L.C. Talbot\\[10pt]
 %Dickimaw Books\\
 %\url{http://www.dickimaw-books.com/}}
 %
-% \date{2015-12-17}
+% \date{2016-07-29}
 % \maketitle
 %
 %\tableofcontents
@@ -110,7 +111,7 @@
 %\changes{2.0}{2015/09/09}{package split from glossaries}
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{mfirstuc}[2015/12/17 v2.02 (NLCT)]
+\ProvidesPackage{mfirstuc}[2016/07/29 v2.03 (NLCT)]
 %    \end{macrocode}
 % Requires \sty{etoolbox}:\changes{1.06}{2012/05/21}{now requires
 % etoolbox}
@@ -146,11 +147,23 @@
 %    \end{macrocode}
 %\end{macro}
 %
+%\begin{macro}{\@MFU at protect}
+%\changes{2.03}{2016-07-29}{new}
+%    \begin{macrocode}
+\newcommand*{\@MFU at protect}{\protect}
+%    \end{macrocode}
+%\end{macro}
+%
 %\begin{macro}{\@MFU at p@makefirstuc}
 % Internal command to do the required action.
 %    \begin{macrocode}
 \def\@MFU at p@makefirstuc#1#2#3\@end at MFU@protected#4{%
-  \ifx\protect#1\relax
+%    \end{macrocode}
+%\changes{2.03}{2016-07-29}{changed test}
+%Test if the first argument is \cs{protect}.
+%    \begin{macrocode}
+  \def\gls at argi{#1}%
+  \ifx\gls at argi\@MFU at protect
    \@makefirstuc{#2#3}%
   \else
    \@makefirstuc{#4}%
@@ -210,13 +223,35 @@
 }
 %    \end{macrocode}
 %\end{macro}
+%\begin{macro}{\@gls at split}
 % Put first argument in \cs{@gls at first} and second argument in
 % \cs{@gls at rest}:
+%\changes{??}{??}{added check for datatool-base UTF-8 support}
 %    \begin{macrocode}
-\def\@gls at split#1#2\@nil{%
-  \def\@gls at first{#1}\def\@gls at rest{#2}%
+\ifdef\dtl at getfirst@UTFviii
+{%
+  \def\@gls at split#1#2\@nil{%
+   \ifbool{@dtl at utf8}
+    {%
+      \expandafter\dtl at if@two at octets#1#2\relax\dtl at end@if at two@octets
+      {%
+        \dtl at getfirst@UTFviii#1#2\@nil\end at dtl@getfirst at UTFviii
+        \let\@gls at first\dtl at first
+        \let\@gls at rest\dtl at rest
+      }%
+      {%
+        \def\@gls at first{#1}\def\@gls at rest{#2}%
+      }%
+    }%
+  }
+}%
+{%
+  \def\@gls at split#1#2\@nil{%
+    \def\@gls at first{#1}\def\@gls at rest{#2}%
+  }
 }
 %    \end{macrocode}
+%\end{macro}
 %    \begin{macrocode}
 \def\@gls at checkcs#1 #2#3\relax{%
   \def\@gls at argi{#1}\def\@gls at argii{#2}%
@@ -227,10 +262,69 @@
   \fi
 }
 %    \end{macrocode}
+% Has \sty{datatool-base} v2.24 (or above) been loaded? If so and we
+% have UTF-8 enabled, we can grab the first octet.
+%\begin{macro}{\@mfu at applytofirst}
+%\changes{??}{??}{new}
+%    \begin{macrocode}
+\ifdef\dtl at getfirst@UTFviii
+{%
+  \def\@mfu at applytofirst#1#2\@mfu at end@applytofirst#3{%
+    \expandafter\dtl at if@two at octets#1#2\relax\dtl at end@if at two@octets
+    {%
+       \dtl at getfirst@UTFviii#1#2\@nil\end at dtl@getfirst at UTFviii
+       \expandafter#3\expandafter{\dtl at first}\dtl at rest
+    }%
+    {%
+      #3#1#2%
+    }%
+  }%
+}%
+{%
+  \def\@mfu at applytofirst#1#2\@mfu at end@applytofirst#3{#3#1#2}
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\MFUapplytofirst}
+%\changes{??}{??}{new}
+%\begin{definition}
+%\cs{MFUapplytofirst}\marg{cs}\marg{text}
+%\end{definition}
+% Apply \meta{cs} to first token of text, or first UTF-8 character
+% if \sty{datatool-base} v2.24 above has been loaded with the utf8
+% support enabled.
+%    \begin{macrocode}
+\ifdef\dtl at getfirst@UTFviii
+{%
+  \newcommand*{\MFUapplytofirst}[2]{%
+    \ifbool{@dtl at utf8}
+    {%
+       \ifblank{#2}%
+       {#1{#2}}%
+       {%
+         \ifblank{#1}%
+         {#1#2}%
+         {%
+           \@mfu at applytofirst#2\@mfu at end@applytofirst#1\relax
+         }%
+       }%
+    }%
+    {%
+      #1#2%
+    }%
+  }
+}%
+{%
+  \newcommand*{\MFUapplytofirst}[2]{#1#2}
+}
+%    \end{macrocode}
+%\end{macro}
+%
 %\begin{macro}{\@gls at makefirstuc}
 % Make first thing upper case:
 %    \begin{macrocode}
-\def\@gls at makefirstuc#1{\mfirstucMakeUppercase #1}
+\def\@gls at makefirstuc#1{\MFUapplytofirst\mfirstucMakeUppercase{#1}}
 %    \end{macrocode}
 %\end{macro}
 %
@@ -263,7 +357,8 @@
 % (added v1.01).
 %    \begin{macrocode}
 \newcommand*{\xmakefirstuc}[1]{%
-\expandafter\makefirstuc\expandafter{#1}}
+  \expandafter\makefirstuc\expandafter{#1}%
+}
 %    \end{macrocode}
 %\end{macro}
 %
@@ -271,7 +366,7 @@
 %\changes{1.10}{2015/05/03}{new}
 % Fully expand argument before applying \cs{makefirstuc}
 %    \begin{macrocode}
-\DeclareRobustCommand*{\emakefirstuc}[1]{%
+\newrobustcmd*{\emakefirstuc}[1]{%
   \protected at edef\@MFU at caparg{#1}%
   \expandafter\makefirstuc\expandafter{\@MFU at caparg}%
 }
@@ -288,15 +383,27 @@
 %capitalised}
 %    \begin{macrocode}
 \newrobustcmd*{\capitalisewords}[1]{%
+  \let\@mfu at checkword\@gobble
   \def\gls at add@space{}%
-  \let\@mfu at domakefirstuc\makefirstuc
-  \let\@mfu at checkword\@gobble
+  \let\@mfu at domakefirstuc\MFUcapword
   \mfu at capitalisewords#1 \@nil\mfu at endcap
 }
 %    \end{macrocode}
 %\end{macro}
 %
+%\begin{macro}{\@mfu at mid@capitalisewords}
+%\changes{2.03}{2016-07-29}{new}
+%\cs{@mfu at checkword} needs to be set before use.
 %    \begin{macrocode}
+\newcommand*{\@mfu at mid@capitalisewords}[1]{%
+  \def\gls at add@space{}%
+  \let\@mfu at domakefirstuc\MFUcapword
+  \mfu at capitalisewords#1 \@nil\mfu at endcap
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%    \begin{macrocode}
 \def\mfu at capitalisewords#1 #2\mfu at endcap{%
   \def\mfu at cap@first{#1}%
   \def\mfu at cap@second{#2}%
@@ -315,6 +422,42 @@
 \def\mfu at noop#1\mfu at endcap{}
 %    \end{macrocode}
 %
+%\begin{macro}{\ifMFUhyphen}
+%\changes{2.03}{2016-07-29}{new}
+%Split on hyphens.
+%    \begin{macrocode}
+\newif\ifMFUhyphen
+\MFUhyphenfalse
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\MFUcapword}
+%\changes{2.03}{2016-07-29}{new}
+%    \begin{macrocode}
+\newcommand*{\MFUcapword}[1]{%
+  \ifMFUhyphen
+   \@MFUcapword#1-\@nil\@endMFUcapword
+  \else
+    \makefirstuc{#1}%
+  \fi
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@MFUcapword}
+%\changes{2.03}{2016-07-29}{new}
+%    \begin{macrocode}
+\def\@MFUcapword#1-#2\@endMFUcapword{%
+  \makefirstuc{#1}%
+  \def\@mfu at argii{#2}%
+  \ifx\@mfu at argii\@nnil
+  \else
+    -\@MFUcapword#2\@endMFUcapword
+  \fi
+}
+%    \end{macrocode}
+%\end{macro}
+%
 %\begin{macro}{\mfu at checkword}
 % Check if word should be capitalised.
 % This originally used \sty{etoolbox}'s \ics{ifinlist} command
@@ -324,7 +467,7 @@
 %    \begin{macrocode}
 \newcommand*\mfu at checkword[1]{%
   \def\mfu at checkword@arg{#1}%
-  \let\@mfu at domakefirstuc\makefirstuc
+  \let\@mfu at domakefirstuc\MFUcapword
   \forlistloop\mfu at checkword@do\@mfu at nocaplist
 }
 %    \end{macrocode}
@@ -389,12 +532,165 @@
 %\changes{1.10}{2015/05/03}{new}
 % Fully expand argument before applying \cs{capitalisewords}
 %    \begin{macrocode}
-\DeclareRobustCommand*{\ecapitalisewords}[1]{%
+\newrobustcmd*{\ecapitalisewords}[1]{%
   \protected at edef\@MFU at caparg{#1}%
   \expandafter\capitalisewords\expandafter{\@MFU at caparg}%
 }
 %    \end{macrocode}
 %\end{macro}
+%
+%\begin{macro}{\capitalisefmtwords}
+%\changes{2.03}{2016-07-29}{new}
+%Like \cs{capitalisewords} but assumes that the phrase contains
+%formatting text-block commands.
+%    \begin{macrocode}
+\newcommand*{\capitalisefmtwords}[1]{%
+  \let\@mfu at checkword\@gobble
+  \def\gls at add@space{}%
+  \@capitalisefmtwords#1 \@nil\relax
+}
+%    \end{macrocode}
+%\end{macro}
+%\begin{macro}{\@capitalisefmtwords}
+%\changes{2.03}{2016-07-29}{new}
+%    \begin{macrocode}
+\def\@capitalisefmtwords#1 #2{%
+  \def\gls at argi{#2}%
+  \ifx\gls at argi\@nnil
+   \def\@mfu at capfmtwordsnext{\@capitalise at fmtwords#1\@nil}%
+  \else
+   \def\@mfu at capfmtwordsnext{\@capitalise at fmtwords#1\@nil
+     \def\gls at add@space{ }%
+     \let\@mfu at checkword\mfu at checkword
+     \@@cap at nofmtphrase#2}%
+  \fi
+  \@mfu at capfmtwordsnext
+}%
+%    \end{macrocode}
+%\end{macro}
+%\begin{macro}{\@capitalise at fmtwords}
+%\changes{2.03}{2016-07-29}{new}
+%    \begin{macrocode}
+\def\@capitalise at fmtwords#1{%
+  \def\gls at argi{#1}%
+  \ifx\gls at argi\@nnil
+%    \end{macrocode}
+%Do nothing.
+%    \begin{macrocode}
+    \let\@mfu at capfmtwordsnext\relax
+  \else
+    \ifx\gls at argi\@MFU at protect
+%    \end{macrocode}
+%Skip \cs{protect}
+%    \begin{macrocode}
+      \def\@mfu at capfmtwordsnext{\@capitalise at fmtwords}%
+    \else
+      \def\@gls at tmp{\ #1}%
+      \@onelevel at sanitize\@gls at tmp
+      \expandafter\@gls at checkcs\@gls at tmp\relax\relax
+      \if at glscs
+       \def\@mfu at capfmtwordsnext{\@@capitalisefmtwords#1}%
+      \else
+       \ifx\gls at argi\@empty
+         \def\@mfu at capfmtwordsnext{\@@capnofmtphrase{}}%
+       \else
+         \def\@mfu at capfmtwordsnext{\@@capnofmtphrase#1}%
+       \fi
+      \fi
+    \fi
+  \fi
+  \@mfu at capfmtwordsnext
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@capitalisefmtwords}
+%\changes{2.03}{2016-07-29}{new}
+%Check for a group following argument.
+%    \begin{macrocode}
+\def\@@capitalisefmtwords#1{%
+  \@ifnextchar\bgroup{\@@capfmtphrase#1}{\@@capnofmtphrase#1}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@@capfmtphrase}
+%\changes{2.03}{2016-07-29}{new}
+%    \begin{macrocode}
+\def\@@capfmtphrase#1#2#3{%
+  \def\@gls at tmp{#3}%
+  \ifx\@gls at tmp\@nnil
+    \def\@mfu at capfmtwordsnext{#1{\@capitalisefmtwords#2 \@nil}}%
+  \else
+    \def\@mfu at capfmtwordsnext{\@@capfmtsubphrase#1{#2}#3}%
+  \fi
+  \@mfu at capfmtwordsnext
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@@capnofmtphrase}
+%\changes{2.03}{2016-07-29}{new}
+%    \begin{macrocode}
+\def\@@capnofmtphrase#1\@nil{%
+  \gls at add@space
+  \@mfu at mid@capitalisewords{#1}%
+  \def\gls at add@space{ }%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@@capfmtsubphrase}
+%\changes{2.03}{2016-07-29}{new}
+%    \begin{macrocode}
+\def\@@capfmtsubphrase#1#2#3\@nil{%
+  \gls at add@space
+  #1{\@mfu at mid@capitalisewords{#2}}%
+  \def\gls at add@space{ }%
+  \let\@mfu at checkword\mfu at checkword
+  #3%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%
+%\begin{macro}{\@@cap at nofmtphrase}
+%\changes{2.03}{2016-07-29}{new}
+%    \begin{macrocode}
+\def\@@cap at nofmtphrase#1 #2\@nil{%
+  \def\gls at arg{#2}%
+  \ifx\gls at arg\@empty
+    \@capitalisefmtwords#1 \@nil
+  \else
+    \@capitalisefmtwords#1 \@nil
+    \def\gls at add@space{ }%
+    \let\@mfu at checkword\mfu at checkword
+    \@capitalisefmtwords#2 \@nil
+  \fi
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\xcapitalisefmtwords}
+%\changes{2.03}{2016-07-29}{new}
+% Short-cut command:
+%    \begin{macrocode}
+\newcommand*{\xcapitalisefmtwords}[1]{%
+  \expandafter\capitalisefmtwords\expandafter{#1}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\ecapitalisefmtwords}
+%\changes{2.03}{2016-07-29}{new}
+%    \begin{macrocode}
+\newrobustcmd*{\ecapitalisefmtwords}[1]{%
+  \protected at edef\@MFU at caparg{#1}%
+  \expandafter\capitalisefmtwords\expandafter{\@MFU at caparg}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
 %\iffalse
 %    \begin{macrocode}
 %</mfirstuc.sty>
@@ -409,7 +705,7 @@
 %\label{sec:code:mfirstuc-english}
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{mfirstuc-english}[2015/09/09 v2.0 (NLCT)]
+\ProvidesPackage{mfirstuc-english}[2016/07/29 v2.03 (NLCT)]
 %    \end{macrocode}
 % Load \sty{mfirstuc} if not already loaded:
 %    \begin{macrocode}
@@ -452,20 +748,31 @@
  % arara: pdflatex: { synctex: on }
 \documentclass{article}
 
-\usepackage{mfirstuc-english}
+\usepackage[a4paper]{geometry}
+\usepackage{color}
+\usepackage{mfirstuc-english}% also loads mfirstuc.sty
 
 \begin{document}
+This is a sample document illustrating the mfirstuc package.
 
+\section{First Letter Upper Case}
+
+\verb|\makefirstuc{abc}.|
 \makefirstuc{abc}.
 
+\verb|\makefirstuc{{\em abc}}.|
 \makefirstuc{{\em abc}}.
 
+\verb|\makefirstuc{\emph{abc}}.|
 \makefirstuc{\emph{abc}}.
 
+\verb|\makefirstuc{\ae bc}.|
 \makefirstuc{\ae bc}.
 
+\verb|\makefirstuc{{\ae}bc}.|
 \makefirstuc{{\ae}bc}.
 
+\verb|\newcommand{\abc}{abc}\xmakefirstuc{\abc}.|
 \newcommand{\abc}{abc}%
 \xmakefirstuc{\abc}.
 
@@ -478,32 +785,174 @@
 \renewcommand*{\mytext}{\ae\oe{some text}}
 Sequential commands: \xmakefirstuc{\mytext}.
 
-\capitalisewords{the wind in the willows}
+\section{Title Case (Formatting)}
 
-\capitalisewords{a book of rhyme.}
+Formatting for the entire phrase must go outside
+\verb|\capitalisewords| (unlike \verb|\makefirstuc|). Compare:
 
-\MFUclear
+\verb|\capitalisewords{\textbf{a small book of rhyme.}}|
+\capitalisewords{\textbf{a small book of rhyme.}}
 
+with:
+
+\verb|\textbf{\capitalisewords{a small book of rhyme.}}|
+\textbf{\capitalisewords{a small book of rhyme.}}
+
+\medskip
+
+Use \verb|\capitalisefmtwords| instead (full stop outside
+argument to check for spurious spaces):
+
+\verb|\capitalisefmtwords{\textbf{a small book of rhyme}}.|
+\capitalisefmtwords{\textbf{a small book of rhyme}}.
+
+\verb|\capitalisefmtwords{\textbf{a small book} of rhyme}.|
+\capitalisefmtwords{\textbf{a small book} of rhyme}.
+
+\verb|\capitalisefmtwords{a \textbf{small book} of rhyme}.|
+\capitalisefmtwords{a \textbf{small book} of rhyme}.
+
+\verb|\capitalisefmtwords{\textbf{a} book of rhyme}.|
+\capitalisefmtwords{\textbf{a} small book of rhyme}.
+
+\verb|\capitalisefmtwords{\textbf{a book }of rhyme}.|
+\capitalisefmtwords{\textbf{a small book }of rhyme}.
+
+\verb|\capitalisefmtwords{a small book \textbf{of rhyme}}.|
+\capitalisefmtwords{a small book \textbf{of rhyme}}.
+
+\medskip
+
+Use semantic commands for things like quotations:
+
+\begin{verbatim}
+\newcommand*{\qt}[1]{``#1''}
+\capitalisefmtwords{\qt{a small book of rhyme.}}
+\end{verbatim}
+\newcommand*{\qt}[1]{``#1''}
+\capitalisefmtwords{\qt{a small book of rhyme.}}
+
+\smallskip
+
+(But make them robust if you intend using commands like
+\verb|\ecapitalisefmtwords|.)
+
+\medskip
+
+Nested text-block commands:
+
+\begin{verbatim}
+\capitalisefmtwords{\textbf{a \emph{small book} of} rhyme}.
+\end{verbatim}
+\capitalisefmtwords{\textbf{a \emph{small book} of} rhyme}.
+
+\begin{verbatim}
+\capitalisefmtwords{\textbf{a \emph{small book}} of rhyme}.
+\end{verbatim}
+\capitalisefmtwords{\textbf{a \emph{small book}} of rhyme}.
+
+\begin{verbatim}
+\capitalisefmtwords{\textbf{\emph{a small} book of} rhyme}.
+\end{verbatim}
+\capitalisefmtwords{\textbf{\emph{a small} book of} rhyme}.
+
+\medskip
+
+An empty brace at the start of a word will suppress the
+case-changing.
+
+\begin{verbatim}
+\capitalisefmtwords{\textbf{a small {}book of} rhyme}.
+\end{verbatim}
+\capitalisefmtwords{\textbf{a small {}book of} rhyme}.
+
+\medskip
+
+Suppress case-changing for problematic commands by inserting
+an empty group in front:
+
+\begin{verbatim}
+\capitalisefmtwords{{}\textcolor{red}{a} small book of 
+{}\textcolor{red}{rhyme}}.
+\end{verbatim}
+\capitalisefmtwords{{}\textcolor{red}{a} small book of 
+{}\textcolor{red}{rhyme}}.
+
+\medskip
+
+If possible provide semantic command instead.
+
+\begin{verbatim}
+\newcommand*{\alert}[1]{\textcolor{red}{#1}}
+\capitalisefmtwords{\alert{a} small book of \alert{rhyme}}.
+\end{verbatim}
+\newcommand*{\alert}[1]{\textcolor{red}{#1}}
+\capitalisefmtwords{\alert{a} small book of \alert{rhyme}}.
+
+\medskip
+
+No formatting commands in the following example:
+
+\verb|\capitalisefmtwords{a small book of rhyme}.|
+\capitalisefmtwords{a small book of rhyme}.
+
+\medskip
+
+Avoid scoped declarations. The next example doesn't work.
+
+\begin{verbatim}
+\capitalisefmtwords{{\bfseries a \emph{small book} of} rhyme.}
+\end{verbatim}
+\capitalisefmtwords{{\bfseries a \emph{small book} of} rhyme.}
+
+\medskip
+
+If a command isn't followed by a grouped argument, the
+case-change is applied to the command (on the assumption
+that it's a character command, such as \verb|\ae|). This can
+have an odd effect if case-changing has no meaning for that command.
+As illustrated next:
+
+\verb|\capitalisefmtwords{\relax a book of rhyme.}|
+\capitalisefmtwords{\relax a book of rhyme.}
+
+\section{Title Case (No Formatting)}
+
+\bgroup
+%Clearing ``nocap'' words.
+%\verb|\MFUclear|
+%\MFUclear
+
+\verb|\capitalisewords{the wind in the willows}|
 \capitalisewords{the wind in the willows}
 
-\capitalisewords{a book of rhyme.}
+\verb|\capitalisewords{a small book of rhyme.}|
+\capitalisewords{a small book of rhyme.}
 
-\capitalisewords{a book\space of rhyme.}
+\medskip
 
-\newcommand{\mytitle}{a book\space of rhyme.}
-\capitalisewords{\mytitle}
+\verb|\space| isn't considered a word boundary for
+\verb|\capitalisewords| as shown below:
 
-\xcapitalisewords{\mytitle}
+\begin{verbatim}
+\capitalisewords{a small\space book of rhyme.}
+\end{verbatim}
+\capitalisewords{a small\space book of rhyme.}
 
-Formatting for the entire phrase must go outside
-\verb|\capitalisewords| (unlike \verb|\makefirstuc|). Compare:
+\medskip
+No expansion is performed on the argument of
+\verb|\capitalisewords|:
 
-\capitalisewords{\textbf{a book of rhyme.}}
+\verb|\newcommand{\mytitle}{a small\space book of rhyme.}|
+\newcommand{\mytitle}{a small\space book of rhyme.}
 
-with:
+\verb|\capitalisewords{\mytitle}|
+\capitalisewords{\mytitle}
 
-\textbf{\capitalisewords{a book of rhyme.}}
+\verb|\xcapitalisewords{\mytitle}|
+\xcapitalisewords{\mytitle}
 
+\egroup
 \end{document}
 %    \end{macrocode}
 %\fi

Modified: trunk/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.ins	2016-07-30 23:07:33 UTC (rev 41765)
+++ trunk/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.ins	2016-07-30 23:07:44 UTC (rev 41766)
@@ -1,10 +1,10 @@
-% mfirstuc.ins generated using makedtx version 1.1 2015/12/17 12:46
+% mfirstuc.ins generated using makedtx version 1.1 2016/7/29 22:54
 \input docstrip
 
 \preamble
 
  mfirstuc.dtx
- Copyright 2015 Nicola Talbot
+ Copyright 2016 Nicola Talbot
 
  This work may be distributed and/or modified under the
  conditions of the LaTeX Project Public License, either version 1.3

Modified: trunk/Master/texmf-dist/tex/latex/mfirstuc/mfirstuc-english.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/mfirstuc/mfirstuc-english.sty	2016-07-30 23:07:33 UTC (rev 41765)
+++ trunk/Master/texmf-dist/tex/latex/mfirstuc/mfirstuc-english.sty	2016-07-30 23:07:44 UTC (rev 41766)
@@ -7,7 +7,7 @@
 %% mfirstuc.dtx  (with options: `mfirstuc-english.sty,package')
 %% 
 %%  mfirstuc.dtx
-%%  Copyright 2015 Nicola Talbot
+%%  Copyright 2016 Nicola Talbot
 %% 
 %%  This work may be distributed and/or modified under the
 %%  conditions of the LaTeX Project Public License, either version 1.3
@@ -39,7 +39,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{mfirstuc-english}[2015/09/09 v2.0 (NLCT)]
+\ProvidesPackage{mfirstuc-english}[2016/07/29 v2.03 (NLCT)]
 \RequirePackage{mfirstuc}
 \MFUnocap{a}
 \MFUnocap{an}

Modified: trunk/Master/texmf-dist/tex/latex/mfirstuc/mfirstuc.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/mfirstuc/mfirstuc.sty	2016-07-30 23:07:33 UTC (rev 41765)
+++ trunk/Master/texmf-dist/tex/latex/mfirstuc/mfirstuc.sty	2016-07-30 23:07:44 UTC (rev 41766)
@@ -7,7 +7,7 @@
 %% mfirstuc.dtx  (with options: `mfirstuc.sty,package')
 %% 
 %%  mfirstuc.dtx
-%%  Copyright 2015 Nicola Talbot
+%%  Copyright 2016 Nicola Talbot
 %% 
 %%  This work may be distributed and/or modified under the
 %%  conditions of the LaTeX Project Public License, either version 1.3
@@ -39,7 +39,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{mfirstuc}[2015/12/17 v2.02 (NLCT)]
+\ProvidesPackage{mfirstuc}[2016/07/29 v2.03 (NLCT)]
 \RequirePackage{etoolbox}
 \newif\if at glscs
 \newtoks\@glsmfirst
@@ -47,8 +47,10 @@
 \newrobustcmd*{\makefirstuc}[1]{%
   \@MFU at p@makefirstuc#1\relax\relax\relax\@end at MFU@protected{#1}%
 }
+\newcommand*{\@MFU at protect}{\protect}
 \def\@MFU at p@makefirstuc#1#2#3\@end at MFU@protected#4{%
-  \ifx\protect#1\relax
+  \def\gls at argi{#1}%
+  \ifx\gls at argi\@MFU at protect
    \@makefirstuc{#2#3}%
   \else
    \@makefirstuc{#4}%
@@ -90,8 +92,27 @@
     \fi
   \fi
 }
-\def\@gls at split#1#2\@nil{%
-  \def\@gls at first{#1}\def\@gls at rest{#2}%
+\ifdef\dtl at getfirst@UTFviii
+{%
+  \def\@gls at split#1#2\@nil{%
+   \ifbool{@dtl at utf8}
+    {%
+      \expandafter\dtl at if@two at octets#1#2\relax\dtl at end@if at two@octets
+      {%
+        \dtl at getfirst@UTFviii#1#2\@nil\end at dtl@getfirst at UTFviii
+        \let\@gls at first\dtl at first
+        \let\@gls at rest\dtl at rest
+      }%
+      {%
+        \def\@gls at first{#1}\def\@gls at rest{#2}%
+      }%
+    }%
+  }
+}%
+{%
+  \def\@gls at split#1#2\@nil{%
+    \def\@gls at first{#1}\def\@gls at rest{#2}%
+  }
 }
 \def\@gls at checkcs#1 #2#3\relax{%
   \def\@gls at argi{#1}\def\@gls at argii{#2}%
@@ -101,23 +122,68 @@
     \@glscsfalse
   \fi
 }
-\def\@gls at makefirstuc#1{\mfirstucMakeUppercase #1}
+\ifdef\dtl at getfirst@UTFviii
+{%
+  \def\@mfu at applytofirst#1#2\@mfu at end@applytofirst#3{%
+    \expandafter\dtl at if@two at octets#1#2\relax\dtl at end@if at two@octets
+    {%
+       \dtl at getfirst@UTFviii#1#2\@nil\end at dtl@getfirst at UTFviii
+       \expandafter#3\expandafter{\dtl at first}\dtl at rest
+    }%
+    {%
+      #3#1#2%
+    }%
+  }%
+}%
+{%
+  \def\@mfu at applytofirst#1#2\@mfu at end@applytofirst#3{#3#1#2}
+}
+\ifdef\dtl at getfirst@UTFviii
+{%
+  \newcommand*{\MFUapplytofirst}[2]{%
+    \ifbool{@dtl at utf8}
+    {%
+       \ifblank{#2}%
+       {#1{#2}}%
+       {%
+         \ifblank{#1}%
+         {#1#2}%
+         {%
+           \@mfu at applytofirst#2\@mfu at end@applytofirst#1\relax
+         }%
+       }%
+    }%
+    {%
+      #1#2%
+    }%
+  }
+}%
+{%
+  \newcommand*{\MFUapplytofirst}[2]{#1#2}
+}
+\def\@gls at makefirstuc#1{\MFUapplytofirst\mfirstucMakeUppercase{#1}}
 \newcommand*{\mfirstucMakeUppercase}{\MakeUppercase}
 \newcommand*{\glsmakefirstuc}[1]{\@gls at makefirstuc{#1}}
 \def\@gls at getbody#1#{\def\@gls at body{#1}\@gls at gobbletonil}
 \def\@gls at gobbletonil#1\@nil{\def\@gls at rest{#1}}
 \newcommand*{\xmakefirstuc}[1]{%
-\expandafter\makefirstuc\expandafter{#1}}
-\DeclareRobustCommand*{\emakefirstuc}[1]{%
+  \expandafter\makefirstuc\expandafter{#1}%
+}
+\newrobustcmd*{\emakefirstuc}[1]{%
   \protected at edef\@MFU at caparg{#1}%
   \expandafter\makefirstuc\expandafter{\@MFU at caparg}%
 }
 \newrobustcmd*{\capitalisewords}[1]{%
+  \let\@mfu at checkword\@gobble
   \def\gls at add@space{}%
-  \let\@mfu at domakefirstuc\makefirstuc
-  \let\@mfu at checkword\@gobble
+  \let\@mfu at domakefirstuc\MFUcapword
   \mfu at capitalisewords#1 \@nil\mfu at endcap
 }
+\newcommand*{\@mfu at mid@capitalisewords}[1]{%
+  \def\gls at add@space{}%
+  \let\@mfu at domakefirstuc\MFUcapword
+  \mfu at capitalisewords#1 \@nil\mfu at endcap
+}
 \def\mfu at capitalisewords#1 #2\mfu at endcap{%
   \def\mfu at cap@first{#1}%
   \def\mfu at cap@second{#2}%
@@ -134,9 +200,26 @@
   \next at mfu@cap#2\mfu at endcap
 }
 \def\mfu at noop#1\mfu at endcap{}
+\newif\ifMFUhyphen
+\MFUhyphenfalse
+\newcommand*{\MFUcapword}[1]{%
+  \ifMFUhyphen
+   \@MFUcapword#1-\@nil\@endMFUcapword
+  \else
+    \makefirstuc{#1}%
+  \fi
+}
+\def\@MFUcapword#1-#2\@endMFUcapword{%
+  \makefirstuc{#1}%
+  \def\@mfu at argii{#2}%
+  \ifx\@mfu at argii\@nnil
+  \else
+    -\@MFUcapword#2\@endMFUcapword
+  \fi
+}
 \newcommand*\mfu at checkword[1]{%
   \def\mfu at checkword@arg{#1}%
-  \let\@mfu at domakefirstuc\makefirstuc
+  \let\@mfu at domakefirstuc\MFUcapword
   \forlistloop\mfu at checkword@do\@mfu at nocaplist
 }
 \newcommand*{\mfu at checkword@do}[1]{%
@@ -154,10 +237,93 @@
 \newcommand*{\xcapitalisewords}[1]{%
   \expandafter\capitalisewords\expandafter{#1}%
 }
-\DeclareRobustCommand*{\ecapitalisewords}[1]{%
+\newrobustcmd*{\ecapitalisewords}[1]{%
   \protected at edef\@MFU at caparg{#1}%
   \expandafter\capitalisewords\expandafter{\@MFU at caparg}%
 }
+\newcommand*{\capitalisefmtwords}[1]{%
+  \let\@mfu at checkword\@gobble
+  \def\gls at add@space{}%
+  \@capitalisefmtwords#1 \@nil\relax
+}
+\def\@capitalisefmtwords#1 #2{%
+  \def\gls at argi{#2}%
+  \ifx\gls at argi\@nnil
+   \def\@mfu at capfmtwordsnext{\@capitalise at fmtwords#1\@nil}%
+  \else
+   \def\@mfu at capfmtwordsnext{\@capitalise at fmtwords#1\@nil
+     \def\gls at add@space{ }%
+     \let\@mfu at checkword\mfu at checkword
+     \@@cap at nofmtphrase#2}%
+  \fi
+  \@mfu at capfmtwordsnext
+}%
+\def\@capitalise at fmtwords#1{%
+  \def\gls at argi{#1}%
+  \ifx\gls at argi\@nnil
+    \let\@mfu at capfmtwordsnext\relax
+  \else
+    \ifx\gls at argi\@MFU at protect
+      \def\@mfu at capfmtwordsnext{\@capitalise at fmtwords}%
+    \else
+      \def\@gls at tmp{\ #1}%
+      \@onelevel at sanitize\@gls at tmp
+      \expandafter\@gls at checkcs\@gls at tmp\relax\relax
+      \if at glscs
+       \def\@mfu at capfmtwordsnext{\@@capitalisefmtwords#1}%
+      \else
+       \ifx\gls at argi\@empty
+         \def\@mfu at capfmtwordsnext{\@@capnofmtphrase{}}%
+       \else
+         \def\@mfu at capfmtwordsnext{\@@capnofmtphrase#1}%
+       \fi
+      \fi
+    \fi
+  \fi
+  \@mfu at capfmtwordsnext
+}
+\def\@@capitalisefmtwords#1{%
+  \@ifnextchar\bgroup{\@@capfmtphrase#1}{\@@capnofmtphrase#1}%
+}
+\def\@@capfmtphrase#1#2#3{%
+  \def\@gls at tmp{#3}%
+  \ifx\@gls at tmp\@nnil
+    \def\@mfu at capfmtwordsnext{#1{\@capitalisefmtwords#2 \@nil}}%
+  \else
+    \def\@mfu at capfmtwordsnext{\@@capfmtsubphrase#1{#2}#3}%
+  \fi
+  \@mfu at capfmtwordsnext
+}
+\def\@@capnofmtphrase#1\@nil{%
+  \gls at add@space
+  \@mfu at mid@capitalisewords{#1}%
+  \def\gls at add@space{ }%
+}
+\def\@@capfmtsubphrase#1#2#3\@nil{%
+  \gls at add@space
+  #1{\@mfu at mid@capitalisewords{#2}}%
+  \def\gls at add@space{ }%
+  \let\@mfu at checkword\mfu at checkword
+  #3%
+}
+\def\@@cap at nofmtphrase#1 #2\@nil{%
+  \def\gls at arg{#2}%
+  \ifx\gls at arg\@empty
+    \@capitalisefmtwords#1 \@nil
+  \else
+    \@capitalisefmtwords#1 \@nil
+    \def\gls at add@space{ }%
+    \let\@mfu at checkword\mfu at checkword
+    \@capitalisefmtwords#2 \@nil
+  \fi
+}
+\newcommand*{\xcapitalisefmtwords}[1]{%
+  \expandafter\capitalisefmtwords\expandafter{#1}%
+}
+\newrobustcmd*{\ecapitalisefmtwords}[1]{%
+  \protected at edef\@MFU at caparg{#1}%
+  \expandafter\capitalisefmtwords\expandafter{\@MFU at caparg}%
+}
 \endinput
 %%
 %% End of file `mfirstuc.sty'.



More information about the tex-live-commits mailing list