diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/mfirstuc/mfirstuc.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/mfirstuc/mfirstuc.dtx | 68 |
1 files changed, 56 insertions, 12 deletions
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} |