diff options
author | Karl Berry <karl@freefriends.org> | 2015-12-08 22:08:55 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-12-08 22:08:55 +0000 |
commit | 32dfcb4c5c886d97931290e76ed02234e8dbe485 (patch) | |
tree | e39cb3e2be2aa0f0c70f2a2023f2891f932075fe | |
parent | 5db0950ba6b90723a352862042de9231540decfc (diff) |
mfirstuc (8dec15)
git-svn-id: svn://tug.org/texlive/trunk@39055 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/mfirstuc/CHANGES | 8 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/mfirstuc/README | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-code.pdf | bin | 220571 -> 222100 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.html | 173 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.pdf | bin | 223024 -> 224025 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.tex | 24 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.pdf | bin | 25848 -> 52326 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.tex | 15 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/mfirstuc/mfirstuc.dtx | 68 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/mfirstuc/mfirstuc.ins | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mfirstuc/mfirstuc.sty | 12 |
11 files changed, 212 insertions, 94 deletions
diff --git a/Master/texmf-dist/doc/latex/mfirstuc/CHANGES b/Master/texmf-dist/doc/latex/mfirstuc/CHANGES index 277d9033b7d..cc1d366c01a 100644 --- a/Master/texmf-dist/doc/latex/mfirstuc/CHANGES +++ b/Master/texmf-dist/doc/latex/mfirstuc/CHANGES @@ -1,10 +1,14 @@ mfirstuc change log: -v1.11 +v2.01: + + * Added check for initial \protect in \makefirstuc + +v2.0: * Split from glossaries bundle. - * Fixed bug the occurred when the first two tokens of + * Fixed bug that occurred when the first two tokens of \makefirstuc are both control sequences. v1.10: diff --git a/Master/texmf-dist/doc/latex/mfirstuc/README b/Master/texmf-dist/doc/latex/mfirstuc/README index eee6e3d6343..d8fd1365b9a 100644 --- a/Master/texmf-dist/doc/latex/mfirstuc/README +++ b/Master/texmf-dist/doc/latex/mfirstuc/README @@ -1,6 +1,6 @@ -LaTeX Package : mfirstuc v2.0 +LaTeX Package : mfirstuc v2.01 -Last Modified : 2015-09-09 +Last Modified : 2015-12-08 Author : Nicola Talbot diff --git a/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-code.pdf b/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-code.pdf Binary files differindex 3bf567fe659..d05041ea7b2 100644 --- a/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-code.pdf +++ b/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-code.pdf diff --git a/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.html b/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.html index 8d30a8f8844..f6706928f1f 100644 --- a/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.html +++ b/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.html @@ -4,13 +4,13 @@ <!--http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd--> <html xmlns="http://www.w3.org/1999/xhtml" > -<head><title>mfirstuc.sty v2.0: uppercasing first letter</title> +<head><title>mfirstuc.sty v2.01: uppercasing first letter</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-09-09 15:55:00" /> +<meta name="date" content="2015-12-08 14:22:00" /> <style type="text/css"> <!-- @@ -165,7 +165,7 @@ div.verbatim { font-family: monospace; white-space: nowrap; text-align:left; cle -<h2 class="titleHead">mfirstuc.sty v2.0: uppercasing first letter</h2> +<h2 class="titleHead">mfirstuc.sty v2.01: uppercasing first letter</h2> <div class="author" ><span class="cmr-12">Nicola L.C. Talbot</span> <br /> <span @@ -174,7 +174,7 @@ class="cmr-12">Dickimaw Books</span> 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-09-09</span></div> +class="cmr-12">2015-12-08</span></div> </div> <h3 class="likesectionHead"><a id="x1-1000"></a>Contents</h3> @@ -443,7 +443,7 @@ class="cmtt-10">\capitalisewords{</span>⟨<span class="cmitt-10">text</span>⟩<span class="cmtt-10">} </span></div><hr> </p><!--l. 188--><p class="noindent" > -This command apply <span +This command applies <span class="cmtt-10">\makefirstuc</span><a id="dx1-4002"></a> to each word in ⟨<span class="cmti-10">text</span>⟩ where the space character is @@ -453,52 +453,79 @@ class="cmtt-10">~</span></span></span> or <span class="cmtt-10">\space</span>. Note that no expansion is performed on ⟨<span class="cmti-10">text</span>⟩. -</p><!--l. 195--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +</p><!--l. 195--><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"> +\capitalisewords{\textbf{a sample phrase}} +</div> +<!--l. 199--><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"> +\textbf{\capitalisewords{a sample phrase}} +</div> +<!--l. 207--><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 class="cmtt-9">\xcapitalisewords</span><span class="cmtt-9"> </span></span><a id="dx1-4003"></a> <span class="cmtt-10">\xcapitalisewords{</span>⟨<span class="cmitt-10">text</span>⟩<span class="cmtt-10">} </span></div><hr> -</p><!--l. 197--><p class="noindent" > +</p><!--l. 215--><p class="noindent" > This is a short cut for <span class="cmtt-10">\expandafter\capitalisewords\expandafter{</span>⟨<span class="cmti-10">text</span>⟩<span class="cmtt-10">}</span>. -</p><!--l. 201--><p class="indent" > As from version 1.10, there is now a command that fully expands the entire +</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 class="cmtt-10">\capitalisewords</span>: -</p><!--l. 203--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +</p><!--l. 221--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span class="cmtt-9">\ecapitalisewords</span><span class="cmtt-9"> </span></span><a id="dx1-4004"></a> <span class="cmtt-10">\ecapitalisewords{</span>⟨<span class="cmitt-10">text</span>⟩<span class="cmtt-10">} </span></div><hr> -</p><!--l. 205--><p class="noindent" > -</p><!--l. 207--><p class="indent" > Examples: +</p><!--l. 223--><p class="noindent" > +</p><!--l. 225--><p class="indent" > Examples: </p> - <div class="verbatim" id="verbatim-9"> + <div class="verbatim" id="verbatim-11"> \newcommand{\abc}{\xyz\space four five}  <br />\newcommand{\xyz}{one two three}  <br />No expansion: \capitalisewords{\abc}.  <br />First object one-level expansion: \xcapitalisewords{\abc}.  <br />Fully expanded: \ecapitalisewords{\abc}. </div> -<!--l. 214--><p class="nopar" > produces: No expansion: ONE TWO THREE FOUR FIVE. First object one-level +<!--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. 222--><p class="indent" > (Remember that the spaces need to be explicit. In the second case above, using +</p><!--l. 240--><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. 228--><p class="indent" > <div class="important" title="Important Note"> If you are using <span +</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 @@ -511,12 +538,12 @@ like: </p> - <div class="verbatim" id="verbatim-10"> + <div class="verbatim" id="verbatim-12"> Package hyperref Warning: Token not allowed in a PDF string  <br />(PDFDocEncoding):  <br />(hyperref)                removing ‘\capitalisewords’ </div> -<!--l. 237--><p class="nopar" > If you want to provide an alternative for the PDF bookmark, you can use +<!--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 @@ -525,39 +552,39 @@ class="cmtt-10">\texorpdfstring</span><a class="cmss-10">hyperref</span><a id="dx1-4009"></a> manual for further details. </div> -</p><!--l. 241--><p class="noindent" > -</p><!--l. 243--><p class="indent" > Examples: +</p><!--l. 259--><p class="noindent" > +</p><!--l. 261--><p class="indent" > Examples: </p><ol class="enumerate1" > <li class="enumerate" id="x1-4011x1"> - <div class="verbatim" id="verbatim-11"> + <div class="verbatim" id="verbatim-13"> \capitalisewords{a book of rhyme.} </div> - <!--l. 248--><p class="nopar" > produces: A Book Of Rhyme. + <!--l. 266--><p class="nopar" > produces: A Book Of Rhyme. </p></li> <li class="enumerate" id="x1-4013x2"> - <div class="verbatim" id="verbatim-12"> + <div class="verbatim" id="verbatim-14"> \capitalisewords{a book\space of rhyme.} </div> - <!--l. 255--><p class="nopar" > produces: A Book of Rhyme. + <!--l. 273--><p class="nopar" > produces: A Book of Rhyme. </p></li> <li class="enumerate" id="x1-4015x3"> - <div class="verbatim" id="verbatim-13"> + <div class="verbatim" id="verbatim-15"> \newcommand{\mytitle}{a book\space of rhyme.}  <br />\capitalisewords{\mytitle} </div> - <!--l. 263--><p class="nopar" > produces: A BOOK OF RHYME. (No expansion is performed on <span + <!--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: </p></li> @@ -566,65 +593,65 @@ class="cmtt-10">\mytitle</span>.) - <div class="verbatim" id="verbatim-14"> + <div class="verbatim" id="verbatim-16"> \newcommand{\mytitle}{a book\space of rhyme.}  <br />\xcapitalisewords{\mytitle} </div> - <!--l. 273--><p class="nopar" > produces: A Book of Rhyme. - </p><!--l. 277--><p class="noindent" >However + <!--l. 291--><p class="nopar" > produces: A Book of Rhyme. + </p><!--l. 295--><p class="noindent" >However </p> - <div class="verbatim" id="verbatim-15"> + <div class="verbatim" id="verbatim-17"> \ecapitalisewords{\mytitle} </div> - <!--l. 280--><p class="nopar" > produces: A Book Of Rhyme. + <!--l. 298--><p class="nopar" > produces: A Book Of Rhyme. </p> </li></ol> -<!--l. 286--><p class="indent" > As from v1.09, you can specify words which shouldn’t be capitalised unless they +<!--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 ⟨<span class="cmti-10">text</span>⟩ using: -</p><!--l. 288--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +</p><!--l. 306--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span class="cmtt-9">\MFUnocap</span><span class="cmtt-9"> </span></span><a id="dx1-4018"></a> <span class="cmtt-10">\MFUnocap{</span>⟨<span class="cmitt-10">word</span>⟩<span class="cmtt-10">} </span></div><hr> -</p><!--l. 290--><p class="noindent" > +</p><!--l. 308--><p class="noindent" > This only has a local effect. The global version is: -</p><!--l. 292--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +</p><!--l. 310--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span class="cmtt-9">\gMFUnocap</span><span class="cmtt-9"> </span></span><a id="dx1-4019"></a> <span class="cmtt-10">\gMFUnocap{</span>⟨<span class="cmitt-10">word</span>⟩<span class="cmtt-10">} </span></div><hr> -</p><!--l. 294--><p class="noindent" > -</p><!--l. 296--><p class="indent" > For example: +</p><!--l. 312--><p class="noindent" > +</p><!--l. 314--><p class="indent" > For example: </p> - <div class="verbatim" id="verbatim-16"> + <div class="verbatim" id="verbatim-18"> \capitalisewords{the wind in the willows}  <br />\MFUnocap{in}%  <br />\MFUnocap{the}%  <br />\capitalisewords{the wind in the willows} </div> -<!--l. 304--><p class="nopar" > produces: <spacer type=vertical size=10><span class="obeylines-h"> +<!--l. 322--><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. 315--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span +</p><!--l. 333--><p class="indent" > <hr><div title="Definition"><span class="marginpar"><span class="cmtt-9">\MFUclear</span><span class="cmtt-9"> </span></span><a id="dx1-4020"></a> <span class="cmtt-10">\MFUclear </span></div><hr> -</p><!--l. 317--><p class="noindent" > -</p><!--l. 319--><p class="indent" > The package <span +</p><!--l. 335--><p class="noindent" > +</p><!--l. 337--><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 @@ -634,72 +661,72 @@ English articles and conjunctions, such as “a”, “an”, &# add other 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. -</p><!--l. 326--><p class="indent" > If you want to write a similar package for another language, all you need to do is +</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 class="cmtt-10">.sty </span>that starts with </p> - <div class="verbatim" id="verbatim-17"> + <div class="verbatim" id="verbatim-19"> \NeedsTeXFormat{LaTeX2e} </div> -<!--l. 331--><p class="nopar" > The next line should identify the package. For example, if you have called the file +<!--l. 349--><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-18"> + <div class="verbatim" id="verbatim-20"> \ProvidesPackage{mfirstuc-french} </div> -<!--l. 336--><p class="nopar" > It’s a good idea to also add a version in the final optional argument, for example: +<!--l. 354--><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-19"> + <div class="verbatim" id="verbatim-21"> \ProvidesPackage{mfirstuc-french}[2014/07/30 v1.0] </div> -<!--l. 341--><p class="nopar" > Next load <span +<!--l. 359--><p class="nopar" > Next load <span class="cmss-10">mfirstuc</span><a id="dx1-4023"></a>: </p> - <div class="verbatim" id="verbatim-20"> + <div class="verbatim" id="verbatim-22"> \RequirePackage{mfirstuc} </div> -<!--l. 345--><p class="nopar" > Now add all your <span +<!--l. 363--><p class="nopar" > Now add all your <span class="cmtt-10">\MFUnocap </span>commands. For example: </p> - <div class="verbatim" id="verbatim-21"> + <div class="verbatim" id="verbatim-23"> \MFUnocap{de} </div> -<!--l. 349--><p class="nopar" > At the end of the file add: +<!--l. 367--><p class="nopar" > At the end of the file add: </p> - <div class="verbatim" id="verbatim-22"> + <div class="verbatim" id="verbatim-24"> \endinput </div> -<!--l. 353--><p class="nopar" > -</p><!--l. 355--><p class="indent" > Put the file somewhere on <span class="TEX">T<span +<!--l. 371--><p class="nopar" > +</p><!--l. 373--><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 useful. -</p><!--l. 359--><p class="noindent" > +</p><!--l. 377--><p class="noindent" > </p> -<!--l. 359--><p class="noindent" ><a +<!--l. 377--><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. 362--><p class="noindent" >The <span +<!--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> doesn’t require a regular argument to be enclosed in braces if it only consists of a @@ -709,36 +736,36 @@ class="cmtt-10">\frac{1}{2}</span></span></span> or <span class="obeylines-h"><s 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. 369--><p class="indent" > A simplistic version of the <span +</p><!--l. 387--><p class="indent" > A simplistic version of the <span class="cmtt-10">\makefirstuc </span>command is: </p> - <div class="verbatim" id="verbatim-23"> + <div class="verbatim" id="verbatim-25"> \newcommand*{\FirstUC}[1]{\MakeUppercase #1} </div> -<!--l. 372--><p class="nopar" > Here +<!--l. 390--><p class="nopar" > Here </p> - <div class="verbatim" id="verbatim-24"> + <div class="verbatim" id="verbatim-26"> \FirstUC{abc} </div> -<!--l. 376--><p class="nopar" > is equivalent to +<!--l. 394--><p class="nopar" > is equivalent to </p> - <div class="verbatim" id="verbatim-25"> + <div class="verbatim" id="verbatim-27"> \MakeUppercase abc </div> -<!--l. 380--><p class="nopar" > and since <span +<!--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. 385--><p class="indent" > The <span +</p><!--l. 403--><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 @@ -801,7 +828,7 @@ class="cmtt-10">}</span><span class="cmsy-10">}</span> </div> </div> -<!--l. 417--><p class="indent" > Try the following document: </p><div class="alltt"> +<!--l. 435--><p class="indent" > Try the following document: </p><div class="alltt"> <div class="obeylines-v"> <span class="cmtt-10">\documentclass</span><span @@ -839,22 +866,22 @@ class="cmtt-10">document</span><span class="cmsy-10">}</span> </div> </div> -<!--l. 431--><p class="indent" > This will result in the error: +<!--l. 449--><p class="indent" > This will result in the error: </p> - <div class="verbatim" id="verbatim-26"> + <div class="verbatim" id="verbatim-28"> ! Argument of \UTFviii@two@octets has an extra }. </div> -<!--l. 434--><p class="nopar" > This is why <span class="obeylines-h"><span class="verb"><span +<!--l. 452--><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. 439--><p class="indent" > The reason for this error message is due to <span class="TEX">T<span +</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> having been written before Unicode was invented. Although <span class="cmtt-10">ã</span> may look like a single character in your text editor, @@ -882,7 +909,7 @@ class="cmsy-10">}</span><span class="cmtt-10">bc</span> </div> </div> -<!--l. 455--><p class="indent" > Note that XeTeX (and therefore XeLaTeX) is a modern implementation of +<!--l. 473--><p class="indent" > Note that XeTeX (and therefore XeLaTeX) is a modern implementation of <span class="TEX">T<span class="E">E</span>X</span> designed to work with Unicode and therefore doesn’t suffer from this drawback. Now let’s look at the XeLaTeX equivalent of the above example: @@ -922,7 +949,7 @@ class="cmsy-10">}</span> -<!--l. 471--><p class="indent" > This works correctly when compiled with XeLaTeX. This means that +<!--l. 489--><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 diff --git a/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.pdf b/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.pdf Binary files differindex b6413ad4185..08a73b2a068 100644 --- a/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.pdf +++ b/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.pdf diff --git a/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.tex b/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.tex index 60d25f80a0f..fd77deed5e9 100644 --- a/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.tex +++ b/Master/texmf-dist/doc/latex/mfirstuc/mfirstuc-manual.tex @@ -20,13 +20,13 @@ pdfkeywords={LaTeX,package,uppercase}]{hyperref} \begin{document} - \title{mfirstuc.sty v2.0: + \title{mfirstuc.sty v2.01: uppercasing first letter} \author{Nicola L.C. Talbot\\[10pt] Dickimaw Books\\ \url{http://www.dickimaw-books.com/}} - \date{2015-09-09} + \date{2015-12-08} \maketitle \tableofcontents @@ -186,12 +186,30 @@ New to mfirstuc v1.06: \begin{definition}[\DescribeMacro{\capitalisewords}] \cs{capitalisewords}\marg{text} \end{definition} -This command apply \ics{makefirstuc} to each word in \meta{text} +This command applies \ics{makefirstuc} to each word in \meta{text} 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}. +Formatting for the entire phrase must go outside +\cs{capitalisewords} (unlike \cs{makefirstuc}). Compare: +\begin{verbatim} +\capitalisewords{\textbf{a sample phrase}} +\end{verbatim} +which produces: +\begin{display} +\capitalisewords{\textbf{a sample phrase}} +\end{display} +with: +\begin{verbatim} +\textbf{\capitalisewords{a sample phrase}} +\end{verbatim} +which produces: +\begin{display} +\textbf{\capitalisewords{a sample phrase}} +\end{display} + \begin{definition}[\DescribeMacro{\xcapitalisewords}] \cs{xcapitalisewords}\marg{text} \end{definition} diff --git a/Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.pdf b/Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.pdf Binary files differindex cd01cfbecd4..4ceb5e9f93c 100644 --- a/Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.pdf +++ b/Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.pdf diff --git a/Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.tex b/Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.tex index 0cdae525b58..5fe9d92b48c 100644 --- a/Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.tex +++ b/Master/texmf-dist/doc/latex/mfirstuc/sample-mfirstuc.tex @@ -20,6 +20,12 @@ \newcommand{\abc}{abc}% \xmakefirstuc{\abc}. +\newcommand*{\mytext}{\protect\textbf{some text}} +Protected formatting: \xmakefirstuc{\mytext}. + +\renewcommand*{\mytext}{\ae\oe{some text}} +Sequential commands: \xmakefirstuc{\mytext}. + \capitalisewords{the wind in the willows} \capitalisewords{a book of rhyme.} @@ -37,4 +43,13 @@ \xcapitalisewords{\mytitle} +Formatting for the entire phrase must go outside +\verb|\capitalisewords| (unlike \verb|\makefirstuc|). Compare: + +\capitalisewords{\textbf{a book of rhyme.}} + +with: + +\textbf{\capitalisewords{a book of rhyme.}} + \end{document} diff --git a/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.dtx b/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.dtx index 87bcf8aab48..9b96044e2d6 100644 --- a/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.dtx +++ b/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.dtx @@ -1,21 +1,21 @@ %\iffalse % mfirstuc.dtx generated using makedtx version 1.1 (c) Nicola Talbot % Command line args: +% -author "Nicola Talbot" % -comment ".*\.perl" % -comment ".*\.tex" -% -author "Nicola Talbot" +% -codetitle "Main Package Code" +% -macrocode ".*\.perl" +% -macrocode ".*\.tex" +% -setambles ".*\.perl=>\nopreamble\nopostamble" +% -setambles ".*\.tex=>\nopreamble\nopostamble" +% -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" -% -setambles ".*\.perl=>\nopreamble\nopostamble" -% -setambles ".*\.tex=>\nopreamble\nopostamble" -% -doc "mfirstuc-codedoc.tex" -% -macrocode ".*\.perl" -% -macrocode ".*\.tex" -% -codetitle "Main Package Code" % mfirstuc -% Created on 2015/9/9 15:55 +% Created on 2015/12/8 14:22 %\fi %\iffalse %<*package> @@ -63,7 +63,7 @@ mfirstuc.dtx \setcounter{IndexColumns}{2} -\CheckSum{243} +\CheckSum{260} \begin{document} \DocInput{mfirstuc.dtx} @@ -73,12 +73,12 @@ mfirstuc.dtx %\MakeShortVerb{"} %\DeleteShortVerb{\|} % -% \title{Documented Code For mfirstuc v2.0} +% \title{Documented Code For mfirstuc v2.01} % \author{Nicola L.C. Talbot\\[10pt] %Dickimaw Books\\ %\url{http://www.dickimaw-books.com/}} % -% \date{2015-09-09} +% \date{2015-12-08} % \maketitle % %\tableofcontents @@ -110,7 +110,7 @@ mfirstuc.dtx %\changes{2.0}{2015/09/09}{package split from glossaries} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{mfirstuc}[2015/09/09 v2.0 (NLCT)] +\ProvidesPackage{mfirstuc}[2015/12/08 v2.01 (NLCT)] % \end{macrocode} % Requires \sty{etoolbox}:\changes{1.06}{2012/05/21}{now requires % etoolbox} @@ -136,6 +136,33 @@ mfirstuc.dtx \newtoks\@glsmfirst \newtoks\@glsmrest \newrobustcmd*{\makefirstuc}[1]{% +% \end{macrocode} +% Check if argument starts with \cs{protect} which needs to be +% skipped. +%\changes{2.01}{2015-12-08}{added check for \cs{protect}} +% \begin{macrocode} + \@MFU@p@makefirstuc#1\relax\relax\relax\@end@MFU@protected{#1}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@MFU@p@makefirstuc} +% Internal command to do the required action. +% \begin{macrocode} +\def\@MFU@p@makefirstuc#1#2#3\@end@MFU@protected#4{% + \ifx\protect#1\relax + \@makefirstuc{#2#3}% + \else + \@makefirstuc{#4}% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@makefirstuc} +% Internal command to do the required action. +% \begin{macrocode} +\newcommand*{\@makefirstuc}[1]{% \def\gls@argi{#1}% \ifx\gls@argi\@empty % \end{macrocode} @@ -428,6 +455,15 @@ mfirstuc.dtx \newcommand{\abc}{abc}% \xmakefirstuc{\abc}. +% I know \textbf is robust already and doesn't need protecting. +% This is just to test what happens if the argument starts +% with \protect +\newcommand*{\mytext}{\protect\textbf{some text}} +Protected formatting: \xmakefirstuc{\mytext}. + +\renewcommand*{\mytext}{\ae\oe{some text}} +Sequential commands: \xmakefirstuc{\mytext}. + \capitalisewords{the wind in the willows} \capitalisewords{a book of rhyme.} @@ -445,6 +481,14 @@ mfirstuc.dtx \xcapitalisewords{\mytitle} +Formatting for the entire phrase must go outside +\verb|\capitalisewords| (unlike \verb|\makefirstuc|). Compare: + +\capitalisewords{\textbf{a book of rhyme.}} + +with: + +\textbf{\capitalisewords{a book of rhyme.}} \end{document} % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.ins b/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.ins index 6fff3a624cc..5082f4b97ba 100644 --- a/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.ins +++ b/Master/texmf-dist/source/latex/mfirstuc/mfirstuc.ins @@ -1,4 +1,4 @@ -% mfirstuc.ins generated using makedtx version 1.1 2015/9/9 15:55 +% mfirstuc.ins generated using makedtx version 1.1 2015/12/8 14:22 \input docstrip \preamble diff --git a/Master/texmf-dist/tex/latex/mfirstuc/mfirstuc.sty b/Master/texmf-dist/tex/latex/mfirstuc/mfirstuc.sty index ed7992e1d6f..06fae7ea38d 100644 --- a/Master/texmf-dist/tex/latex/mfirstuc/mfirstuc.sty +++ b/Master/texmf-dist/tex/latex/mfirstuc/mfirstuc.sty @@ -39,12 +39,22 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{mfirstuc}[2015/09/09 v2.0 (NLCT)] +\ProvidesPackage{mfirstuc}[2015/12/08 v2.01 (NLCT)] \RequirePackage{etoolbox} \newif\if@glscs \newtoks\@glsmfirst \newtoks\@glsmrest \newrobustcmd*{\makefirstuc}[1]{% + \@MFU@p@makefirstuc#1\relax\relax\relax\@end@MFU@protected{#1}% +} +\def\@MFU@p@makefirstuc#1#2#3\@end@MFU@protected#4{% + \ifx\protect#1\relax + \@makefirstuc{#2#3}% + \else + \@makefirstuc{#4}% + \fi +} +\newcommand*{\@makefirstuc}[1]{% \def\gls@argi{#1}% \ifx\gls@argi\@empty \else |