summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/titlecaps
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-01-30 22:02:57 +0000
committerKarl Berry <karl@freefriends.org>2015-01-30 22:02:57 +0000
commit37a530cfe394c0bfeef73bd34cf86b9c5ecedabb (patch)
tree9041b11a20548dfa9eed5229100a5bee35c30f5c /Master/texmf-dist/tex/latex/titlecaps
parente5e0aeb7fe58d7adb35199774ede1ac6da9ad454 (diff)
titlecaps (30jan15)
git-svn-id: svn://tug.org/texlive/trunk@36170 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/titlecaps')
-rw-r--r--Master/texmf-dist/tex/latex/titlecaps/titlecaps.sty135
1 files changed, 71 insertions, 64 deletions
diff --git a/Master/texmf-dist/tex/latex/titlecaps/titlecaps.sty b/Master/texmf-dist/tex/latex/titlecaps/titlecaps.sty
index 256c2f6e7c2..8b0b6f1c386 100644
--- a/Master/texmf-dist/tex/latex/titlecaps/titlecaps.sty
+++ b/Master/texmf-dist/tex/latex/titlecaps/titlecaps.sty
@@ -1,5 +1,5 @@
\ProvidesPackage{titlecaps}
-[2013/04/11 V1.01
+[2015/01/30 V1.2
Routines for setting rich-text input into Titling Caps]
%% Copyright 2013 Steven B. Segletes
%
@@ -17,6 +17,10 @@
%
% V1.1 -Typographical corrections to docs.
% -Missing % added on line 356
+% V1.2 -Now works with \l and \aa national symbols.
+% -Replaced all occurrences of \roman with \romannumeral\value
+% -Found two lines needing a trailing %
+% -Added a trailing space following invocations of \catcode
%
\usepackage{ifnextok}
\usepackage{ifthen}
@@ -25,7 +29,7 @@
\newcounter{lc@words}
\let\SaveHardspace~
\def\SoftSpace{ }
-\catcode`\^^00=12
+\catcode`\^^00=12 %
\def\cmd@flag{^^00} % FLAGS END-OF-COMMAND; NEXT CHAR CAPPED
\let\sv@textup\textup
@@ -50,33 +54,33 @@
% THESE ARE THE PUNCTUATION MARKS SCREENED OUT FOR
% LOWER CASE WORD SEARCH
\newcommand\kill@punct{%
-\catcode`.=9%
-\catcode`,=9%
-\catcode`:=9%
-\catcode`;=9%
-\catcode`(=9%
-\catcode`)=9%
-\catcode`[=9%
-\catcode`]=9%
-\catcode`?=9%
-\catcode`!=9%
-\catcode``=9%
-\catcode`'=9%
+\catcode`.=9 %
+\catcode`,=9 %
+\catcode`:=9 %
+\catcode`;=9 %
+\catcode`(=9 %
+\catcode`)=9 %
+\catcode`[=9 %
+\catcode`]=9 %
+\catcode`?=9 %
+\catcode`!=9 %
+\catcode``=9 %
+\catcode`'=9 %
}
\newcommand\restore@punct{%
-\catcode`.=12%
-\catcode`,=12%
-\catcode`:=12%
-\catcode`;=12%
-\catcode`(=12%
-\catcode`)=12%
-\catcode`[=12%
-\catcode`]=12%
-\catcode`?=12%
-\catcode`!=12%
-\catcode``=12%
-\catcode`'=12%
+\catcode`.=12 %
+\catcode`,=12 %
+\catcode`:=12 %
+\catcode`;=12 %
+\catcode`(=12 %
+\catcode`)=12 %
+\catcode`[=12 %
+\catcode`]=12 %
+\catcode`?=12 %
+\catcode`!=12 %
+\catcode``=12 %
+\catcode`'=12 %
}
\def\add@space{\protected@edef\@thestring{\@thestring\SoftSpace}}
@@ -189,7 +193,7 @@
% STORE (DON'T EXECUTE) \titlecap COMMAND & ARGUMENT
\newcommand\titlecap@q[2][P]{%
\def\thestring{\titlecap[#1]{#2}}%
-}%
+}
% RESET PREDESIGNATED LOWERCASE WORD LIST
\setcounter{lc@words}{0}
@@ -201,12 +205,13 @@
\setcounter{lcword@index}{0}%
\whiledo{\value{lcword@index} < \narg}{%
\addtocounter{lcword@index}{1}%
- \add@lcword{\csname arg\roman{lcword@index}\endcsname}%
- }
+ \add@lcword{\csname arg\romannumeral\value{lcword@index}\endcsname}%
+ }%
}
+
\newcommand\add@lcword[1]{%
\addtocounter{lc@words}{1}%
- \expandafter\edef\csname lcword\roman{lc@words}\endcsname{#1}
+ \expandafter\edef\csname lcword\romannumeral\value{lc@words}\endcsname{#1}%
}
% SEARCH TERTIUS CONVERTED ARGUMENT FOR LOWERCASE WORDS, SET FLAG
@@ -216,22 +221,23 @@
\setcounter{word@count}{0}%
\whiledo{\value{word@count} < \narg}{%
\addtocounter{word@count}{1}%
-\protected@edef\current@word{\csname arg\roman{word@count}\endcsname}%
+ \protected@edef\current@word{%
+ \csname arg\romannumeral\value{word@count}\endcsname}%
\def\found@word{F}%
\setcounter{lcword@index}{0}%
\expandafter\def\csname%
- found@word\roman{word@count}\endcsname{F}%
+ found@word\romannumeral\value{word@count}\endcsname{F}%
\whiledo{\value{lcword@index} < \value{lc@words}}{%
\addtocounter{lcword@index}{1}%
\protected@edef\current@lcword{%
- \csname lcword\roman{lcword@index}\endcsname}%
+ \csname lcword\romannumeral\value{lcword@index}\endcsname}%
%% THE FOLLOWING THREE LINES ARE FROM DAVID CARLISLE
\protected@edef\tmp{\noexpand\scantokens{\def\noexpand\tmp%
{\noexpand\ifthenelse{\noexpand\equal{\current@word}{\current@lcword}}}}}%
\tmp\ifhmode\unskip\fi\tmp
%%
{\expandafter\def\csname%
- found@word\roman{word@count}\endcsname{T}%
+ found@word\romannumeral\value{word@count}\endcsname{T}%
\setcounter{lcword@index}{\value{lc@words}}}%
{}%
}%
@@ -260,14 +266,14 @@
\if P#1\protected@edef\argi{\primus@argi}\fi%
\whiledo{\value{word@count} < \narg}{%
\addtocounter{word@count}{1}%
- \if F\csname found@word\roman{word@count}\endcsname%
- \title@word{\csname arg\roman{word@count}\endcsname}%
+ \if F\csname found@word\romannumeral\value{word@count}\endcsname%
+ \title@word{\csname arg\romannumeral\value{word@count}\endcsname}%
\expandafter\protected@edef\csname%
- arg\roman{word@count}\endcsname{\@thestring}%
- \else
- \notitle@word{\csname arg\roman{word@count}\endcsname}%
+ arg\romannumeral\value{word@count}\endcsname{\@thestring}%
+ \else%
+ \notitle@word{\csname arg\romannumeral\value{word@count}\endcsname}%
\expandafter\protected@edef\csname%
- arg\roman{word@count}\endcsname{\@thestring}%
+ arg\romannumeral\value{word@count}\endcsname{\@thestring}%
\fi%
}%
\def\@thestring{}%
@@ -277,7 +283,7 @@
\ifthenelse{\value{word@count} = 1}%
{}{\add@space}%
\protected@edef\@thestring{\@thestring%
- \csname arg\roman{word@count}\endcsname}%
+ \csname arg\romannumeral\value{word@count}\endcsname}%
}%
\let~\SaveHardspace%
\@thestring%
@@ -322,36 +328,37 @@
\def\@symbolxii{\noexpand\c}
\def\@symbolxiii{\noexpand\d}
\def\@symbolxiv{\noexpand\b}
-\def\@symbolxv{\oe}
- \def\uc@symbolxv{\OE}
-\def\@symbolxvi{\ae}
- \def\uc@symbolxvi{\AE}
-\def\@symbolxvii{\o}
- \def\uc@symbolxvii{\O}
-%\def\@symbolxviii{\aa}
-% \def\uc@symbolxviii{\AA}
-%\def\@symbolxix{\l}
-% \def\uc@symbolxix{\L}
+\def\@symbolxv{\noexpand\r}
+\def\@symbolxvi{\noexpand\a}
+%
+\def\@symbolxvii{\ae}
+ \def\uc@symbolxvii{\AE}
+\def\@symbolxviii{\o}
+ \def\uc@symbolxviii{\O}
+\def\@symbolxix{\oe}
+ \def\uc@symbolxix{\OE}
+\def\@symbolxx{\l}
+ \def\uc@symbolxx{\L}
\newcounter{dia@count}
\def\title@string#1#2{%
\if T\make@cap%
\setcounter{dia@count}{1}%
\if F\symbol@flag%
- \whiledo{\value{dia@count} < 18}{%
- \ifthenelse{\equal{\csname @symbol\roman{dia@count}\endcsname}%
- {#2}}{%
+ \whiledo{\value{dia@count} < 21}{%
+ \ifthenelse{\equal{%
+ \csname @symbol\romannumeral\value{dia@count}\endcsname}{#2}}{%
%BEGIN IFDIACRIT
- \ifthenelse{\value{dia@count} < 15}{%
-%IF = DIACRIT<15
+ \ifthenelse{\value{dia@count} < 17}{%
+%IF = DIACRIT<17
\protected@edef\di@critic%
- {\csname @symbol\roman{dia@count}\endcsname}%
+ {\csname @symbol\romannumeral\value{dia@count}\endcsname}%
\def\symbol@flag{D}%
\setcounter{dia@count}{99}% INDICATING DICRIT JUST FOUND
}{%
%IF = NATSYM
\protected@edef\di@critic%
- {\csname uc@symbol\roman{dia@count}\endcsname}%
+ {\csname uc@symbol\romannumeral\value{dia@count}\endcsname}%
\setcounter{dia@count}{90}% >19 AND <99 MEANS NON-DIACRIT SYMBOL
\def\symbol@flag{N}%
}%
@@ -409,22 +416,22 @@
\def\the@@@rule{\rule{.8ex}{1.6ex}}%
\def\get@argsC#1{%
- \if T\converttilde\def~{ }\else\catcode`~=12\fi
+ \if T\converttilde\def~{ }\else\catcode`~=12 \fi
\protected@edef\the@@@string{#1}%
\setcounter{arg@@@index}{0}%
\lowercase{\expandafter\parse@@@Block\the@@@string} \string@@@end
\let~\SaveHardspace%
- \catcode`~=13%
+ \catcode`~=13 %
}
\def\parse@@@Block#1 {%
\stepcounter{arg@@@index}%
- \@namedef{arg\roman{arg@@@index}}{#1}%
+ \@namedef{arg\romannumeral\value{arg@@@index}}{#1}%
\ifthenelse{\equal{\argi}{}}{\addtocounter{arg@@@index}{-1}}{}%
\futurelet\tmp\parse@@@Block@@@}
\def\parse@@@Block@@@{%
-\ifx\tmp\string@@@end\edef\narg{\thearg@@@index}\expandafter\@gobble
+\ifx\tmp\string@@@end\edef\narg{\thearg@@@index}\expandafter\@gobble%
\else\expandafter\parse@@@Block\fi}
%%%%%%%%%%%%
@@ -444,8 +451,8 @@
\let\make@othr\makeatother%
\newcommand\noatinsidetc{%
- \def\make@lttr{}
- \def\make@othr{}
+ \def\make@lttr{}%
+ \def\make@othr{}%
}
\def\restore@sizes{%