diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/glossaries/mfirstuc-manual.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/glossaries/mfirstuc-manual.tex | 94 |
1 files changed, 86 insertions, 8 deletions
diff --git a/Master/texmf-dist/doc/latex/glossaries/mfirstuc-manual.tex b/Master/texmf-dist/doc/latex/glossaries/mfirstuc-manual.tex index dabd6b4dd01..7ce8cb0a6c8 100644 --- a/Master/texmf-dist/doc/latex/glossaries/mfirstuc-manual.tex +++ b/Master/texmf-dist/doc/latex/glossaries/mfirstuc-manual.tex @@ -16,15 +16,16 @@ pdfkeywords={LaTeX,package,uppercase}]{hyperref} \begin{document} - \title{mfirstuc.sty v1.08: uppercasing first letter} + \title{mfirstuc.sty v1.09: +uppercasing first letter} \author{Nicola L.C. Talbot\\[10pt] Dickimaw Books\\ \url{http://www.dickimaw-books.com/}} - \date{2013-11-04} + \date{2014-07-30} \maketitle -The \styfmt{glossaries} bundle is supplied with the package +The \styfmt{glossaries} bundle includes the package \sty{mfirstuc} which provides the command: \begin{definition}[\DescribeMacro{\makefirstuc}] \cs{makefirstuc}\marg{stuff} @@ -32,7 +33,10 @@ The \styfmt{glossaries} bundle is supplied with the package This makes the first object of \meta{stuff} uppercase unless \meta{stuff} starts with a control sequence followed by a non-empty group, in which case the first -object in the group is converted to uppercase. Examples: +object in the group is converted to uppercase. +\textbf{No expansion is performed on the argument.} + +Examples: \begin{itemize} \item |\makefirstuc{abc}| produces \makefirstuc{abc}. @@ -48,7 +52,7 @@ equivalent to |\MakeUppercase{\em abc}|), and {\makefirstuc{\em abc}} \end{verbatim} produces {\makefirstuc{\em abc}} (|\em| doesn't have an argument -therefore first object is |\em| so equivalent to +therefore first object is |\em| and so is equivalent to |{\MakeUppercase{\em}abc}|). \item |\makefirstuc{{\'a}bc}| produces \makefirstuc{{\'a}bc}. @@ -98,8 +102,8 @@ produces: \xmakefirstuc{\abc}. \begin{important} -\cs{xmakefirstuc} only performs one level expansion on the first -object in its argument. It does not fully expand the entire +\cs{xmakefirstuc} only performs one level expansion on the +\emph{first} object in its argument. It does not fully expand the entire argument. \end{important} @@ -141,7 +145,8 @@ or \ics{makefirstuc} (or \cs{xcapitalisewords}\slash\cs{xmakefirstuc}) 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): +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 @@ -186,4 +191,77 @@ produces: \end{enumerate} +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] +\cs{MFUnocap}\marg{word} +\end{definition} +This only has a local effect. The global version is: +\begin{definition}[\DescribeMacro] +\cs{gMFUnocap}\marg{word} +\end{definition} + +For example: +\begin{verbatim} +\capitalisewords{the wind in the willows} + +\MFUnocap{in}% +\MFUnocap{the}% + +\capitalisewords{the wind in the willows} +\end{verbatim} +produces: +\begin{display} +\capitalisewords{the wind in the willows} + +\MFUnocap{in}% +\MFUnocap{the}% + +\capitalisewords{the wind in the willows} +\end{display} +The list of words that shouldn't be capitalised can be cleared using +\begin{definition}[\DescribeMacro\MFUclear] +\cs{MFUclear} +\end{definition} + +The package \sty{mfirstuc-english} loads \sty{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 +dispute over whether prepositions should be capitalised, I~don't +intend to add them to this package. + +If you want to write a similar package for another language, all you +need to do is create a file with the extension \texttt{.sty} +that starts with +\begin{verbatim} +\NeedsTeXFormat{LaTeX2e} +\end{verbatim} +The next line should identify the package. For example, if you have +called the file \texttt{mfirstuc-french.sty} then you need: +\begin{verbatim} +\ProvidesPackage{mfirstuc-french} +\end{verbatim} +It's a good idea to also add a version in the final optional +argument, for example: +\begin{verbatim} +\ProvidesPackage{mfirstuc-french}[2014/07/30 v1.0] +\end{verbatim} +Next load \sty{mfirstuc}: +\begin{verbatim} +\RequirePackage{mfirstuc} +\end{verbatim} +Now add all your \cs{MFUnocap} commands. For example: +\begin{verbatim} +\MFUnocap{de} +\end{verbatim} +At the end of the file add: +\begin{verbatim} +\endinput +\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. + \end{document} |