diff options
author | Norbert Preining <norbert@preining.info> | 2021-10-16 03:01:43 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-10-16 03:01:43 +0000 |
commit | ed11d82ee5f3bdb266cd37f150c1ca941fc3e67d (patch) | |
tree | a5144e99e7d9543a85a897853c3f30c5f41e091e /macros/latex/contrib/mfirstuc/mfirstuc-manual.tex | |
parent | 3183539b7cf96584b2e0993e49e230bee3755b09 (diff) |
CTAN sync 202110160301
Diffstat (limited to 'macros/latex/contrib/mfirstuc/mfirstuc-manual.tex')
-rw-r--r-- | macros/latex/contrib/mfirstuc/mfirstuc-manual.tex | 69 |
1 files changed, 62 insertions, 7 deletions
diff --git a/macros/latex/contrib/mfirstuc/mfirstuc-manual.tex b/macros/latex/contrib/mfirstuc/mfirstuc-manual.tex index 71430da10a..e741c6d45d 100644 --- a/macros/latex/contrib/mfirstuc/mfirstuc-manual.tex +++ b/macros/latex/contrib/mfirstuc/mfirstuc-manual.tex @@ -26,13 +26,13 @@ \begin{document} \MakeShortVerb{|} - \title{mfirstuc.sty v2.06: + \title{mfirstuc.sty v2.07: uppercasing first letter} \author{Nicola L.C. Talbot\\[10pt] Dickimaw Books\\ \url{http://www.dickimaw-books.com/}} - \date{2017-11-14} + \date{2021-10-15} \maketitle \tableofcontents @@ -120,6 +120,12 @@ sequence followed by a non-empty group, in which case the first object in the group is converted to upper case. \textbf{No expansion is performed on the argument.} +If \meta{stuff} starts with punctuation that should be skipped over, +use: +\begin{definition}[\DescribeMacro\MFUskippunc] +\cs{MFUskippunc}\marg{punctuation} +\end{definition} + \begin{important} If \meta{stuff} starts with a control sequence that takes more than one argument, the case-changing will always be applied to the @@ -157,6 +163,9 @@ therefore first object is |\em| and so is equivalent to \item |\makefirstuc{{ä}bc}| produces \makefirstuc{{ä}bc}. +\item |\makefirstuc{\MFUskippunc{'}tis the season}| produces +\makefirstuc{\MFUskippunc{'}tis the season}. + \end{itemize} Note that non-Latin or accented characters appearing at the @@ -279,12 +288,12 @@ on \meta{text}. See \sectionref{sec:nocap} for excluding words (such as \qt{of}) from the case-changing. The actual capitalisation of each word is done using -(new to version 2.03): -\begin{definition}[\DescribeMacro\MFUcapword] -\cs{MFUcapword}\marg{word} +\begin{definition}[\DescribeMacro\MFUcapwordfirstuc] +\cs{MFUcapwordfirstuc}\marg{word} \end{definition} -This just does \cs{makefirstuc}\marg{word} by default, but -its behaviour is determined by the conditional: +This just does \cs{makefirstuc}\marg{word} by default. +There's a conditional that determines whether or not to consider a +hyphen a word break: \begin{definition}[\DescribeMacro\ifMFUhyphen] \cs{ifMFUhyphen} \end{definition} @@ -316,6 +325,44 @@ which produces: \MFUhyphentrue \capitalisewords{server-side includes} \end{display} +Note that this won't apply exceptions to each part of the hyphenated +word. + +For other punctuation you need to markup the character with: +\begin{definition}[\DescribeMacro\MFUwordbreak] +\cs{MFUwordbreak}\marg{punctuation} +\end{definition} +For example: +\begin{verbatim} +\capitalisewords{a big\MFUwordbreak{/}small idea} +\end{verbatim} +which produces: +\begin{display} +\capitalisewords{a big\MFUwordbreak{/}small idea} +\end{display} +In this case, exceptions are applied. For example, if +\sty{mfirstuc-english} is loaded then: +\begin{verbatim} +\capitalisewords{one and\MFUwordbreak{/}or another} +\end{verbatim} +produces: +\begin{display} +\MFUnocap{and}\MFUnocap{or}% +\capitalisewords{one and\MFUwordbreak{/}or another} +\end{display} +Note that you can't hide \cs{MFUwordbreak} inside a command or group. + +Exceptions aren't applied if \cs{MFUwordbreak} occurs before the +first space. For example: +\begin{verbatim} +\MFUnocap{a}\MFUnocap{the}% +\capitalisewords{a\MFUwordbreak{/}the something} +\end{verbatim} +produces: +\begin{display} +\MFUnocap{a}\MFUnocap{the}% +\capitalisewords{a\MFUwordbreak{/}the something} +\end{display} Formatting for the entire phrase must go outside \cs{capitalisewords} (unlike \cs{makefirstuc}). Compare: @@ -754,6 +801,11 @@ other users find it useful. \chapter{UTF-8} \label{sec:utf8} +(See +\href{https://dickimaw-books.com/blog/binary-files-text-files-and-file-encodings/}{Binary +Files, Text Files and File Encodings} if you are confused about how +file encodings such as UTF-8 relate to text files.) + The \cs{makefirstuc} command works by utilizing the fact that, in most cases, \TeX\ doesn't require a regular argument to be enclosed in braces if it only consists of a single token. (This is why you @@ -846,6 +898,9 @@ must be grouped: \begin{alltt} \cs{MakeUppercase}\{\~a\}bc \end{alltt} +Over recent years the \LaTeX\ kernel has changed to allow the use of +UTF-8 characters within labels but the fundamental problem of each +octet been viewed as a separated token remains. Note that \XeTeX\ (and therefore \XeLaTeX) is a modern implementation of \TeX\ designed to work with Unicode and therefore |