From 32dfcb4c5c886d97931290e76ed02234e8dbe485 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 8 Dec 2015 22:08:55 +0000 Subject: mfirstuc (8dec15) git-svn-id: svn://tug.org/texlive/trunk@39055 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/mfirstuc/mfirstuc.dtx | 68 ++++++++++++++++++---- .../texmf-dist/source/latex/mfirstuc/mfirstuc.ins | 2 +- 2 files changed, 57 insertions(+), 13 deletions(-) (limited to 'Master/texmf-dist/source/latex/mfirstuc') 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 -- cgit v1.2.3