summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/mfirstuc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-12-08 22:08:55 +0000
committerKarl Berry <karl@freefriends.org>2015-12-08 22:08:55 +0000
commit32dfcb4c5c886d97931290e76ed02234e8dbe485 (patch)
treee39cb3e2be2aa0f0c70f2a2023f2891f932075fe /Master/texmf-dist/source/latex/mfirstuc
parent5db0950ba6b90723a352862042de9231540decfc (diff)
mfirstuc (8dec15)
git-svn-id: svn://tug.org/texlive/trunk@39055 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/mfirstuc')
-rw-r--r--Master/texmf-dist/source/latex/mfirstuc/mfirstuc.dtx68
-rw-r--r--Master/texmf-dist/source/latex/mfirstuc/mfirstuc.ins2
2 files changed, 57 insertions, 13 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}
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