| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
%<*internal> |
| 4 |
\begingroup |
| 5 |
\input docstrip.tex |
| 6 |
\preamble |
| 7 |
|
| 8 |
Copyright 2012-2015 Claudio Beccari and Donald Goodman. All rights reserved. |
| 9 |
|
| 10 |
This system is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 |
|
| 14 |
|
| 15 |
IMPORTANT NOTICE: |
| 16 |
|
| 17 |
This file is subject to the LPPL licence, version 1.3 or any subsequent |
| 18 |
version. Copy of the LaTeX Project Public Licence is downloadable from |
| 19 |
any CTAN archive. |
| 20 |
|
| 21 |
It may be distributed and/or modified under the |
| 22 |
conditions of the above mentiond LaTeX Project Public License |
| 23 |
|
| 24 |
This file has the LPPL maintenance status "author-maintained". |
| 25 |
|
| 26 |
\endpreamble |
| 27 |
|
| 28 |
\postamble |
| 29 |
This work consists of this file ecclesiastic.dtx, a README file, |
| 30 |
a manifest.txt file and the derived files ecclesiastic.sty and |
| 31 |
ecclesiastic.pdf. |
| 32 |
|
| 33 |
\endpostamble |
| 34 |
|
| 35 |
\keepsilent |
| 36 |
|
| 37 |
\askforoverwritefalse |
| 38 |
|
| 39 |
|
| 40 |
\generate{\file{ecclesiastic.sty}{\from{ecclesiastic.dtx}{package}}} |
| 41 |
|
| 42 |
\def\tmpa{plain} |
| 43 |
\ifx\tmpa\fmtname\endgroup\expandafter\bye\fi |
| 44 |
\endgroup |
| 45 |
%</internal> |
| 46 |
%<*driver> |
| 47 |
\ProvidesFile{ecclesiastic.dtx}% |
| 48 |
%</driver> |
| 49 |
%<package>\NeedsTeXFormat{LaTeX2e}[1996/12/01]% |
| 50 |
%<package>\ProvidesPackage{ecclesiastic}% |
| 51 |
%<*package> |
| 52 |
[2015/08/20 v.0.3 Ecclesiastic composition of Latin] |
| 53 |
%</package> |
| 54 |
%<*driver> |
| 55 |
\documentclass{ltxdoc} |
| 56 |
\usepackage[T1]{fontenc} |
| 57 |
\usepackage[latin.ecclesiastic,english]{babel} |
| 58 |
\usepackage[latin1]{inputenc} |
| 59 |
\usepackage{xspace} |
| 60 |
\newcommand*\pack[1]{\textsf{#1}} |
| 61 |
\newcommand\babel{\pack{babel}\xspace} |
| 62 |
\begin{document} |
| 63 |
\DocInput{ecclesiastic.dtx} |
| 64 |
\end{document} |
| 65 |
%</driver> |
| 66 |
% \fi |
| 67 |
% |
| 68 |
% |
| 69 |
% \GetFileInfo{ecclesiastic.sty} |
| 70 |
% |
| 71 |
% |
| 72 |
% \title{Package \texttt{ecclesiastic.sty}\thanks{This document corresponds |
| 73 |
% to \pack{ecclesiastic.sty}~\fileversion, dated~\filedate.\newline |
| 74 |
% Claudio Beccari (\texttt{claudio dot beccari at gmail dot com}) did the |
| 75 |
% programming. |
| 76 |
% Donald Goodman (\texttt{dgoodmaniii at gmail dot com}) asked for this |
| 77 |
% extension, produced the requirements, and |
| 78 |
% tested the results.}} |
| 79 |
% %\date{\fileversion\space\filedate} |
| 80 |
% \author{Claudio Beccari \and Donald Goodman} |
| 81 |
% \maketitle |
| 82 |
% |
| 83 |
% \begin{abstract} |
| 84 |
% This package extends the typesetting facilities of the \textsl{latin} option |
| 85 |
% to the \pack{babel} package for typesetting Latin according to the |
| 86 |
% tradition of ecclesiastic documents; these documents are mainly the |
| 87 |
% devotional books used by the Roman Catholic clergy, but not limited to them, |
| 88 |
% that are being published not only by the Vatican Typography, but also by many |
| 89 |
% Printing Companies around the world. This package works only with pdf\/\LaTeX; |
| 90 |
% if an attempt is made to use it while typesetting with Xe\string|Lua\,\LaTeX, its |
| 91 |
% input is aborted and nothing is done. Most additions and modifications that |
| 92 |
% can be achieved with this package under pdf\/\LaTeX\ typesetting, are obtained |
| 93 |
% thanks to clever use of the OpenType fonts when using Xe\string|Lua \,\LaTeX. |
| 94 |
% |
| 95 |
% \end{abstract} |
| 96 |
% |
| 97 |
% \section{Introduction} |
| 98 |
% This small extension package extends the features of \texttt{latin.ldf} |
| 99 |
% by adding a certain level of "frenchization" to the way of typesetting |
| 100 |
% Ecclesiastical Latin; in particular all punctuation marks, except comma |
| 101 |
% and full stop are preceded by a small space. The guillemots are also |
| 102 |
% accompanied by small spaces to the right of the opening marks and to the |
| 103 |
% left of the closing ones, with the provision of removing spurious previous |
| 104 |
% spaces. Footnotes are not indented and their reference number is not an |
| 105 |
% exponent, although footnote marks in the text keep being exponents. |
| 106 |
% |
| 107 |
% The acute accent (actually the apostrophe sign) is made active |
| 108 |
% so as to set an acute accent over the following vowel (notice that in Latin |
| 109 |
% there is no elision, so there cannot be any conflict between the acute accent |
| 110 |
% and the elision apostrophe). Ecclesiastical Latin uses the |
| 111 |
% \ae\ and \oe\ ligatures. Goodman asked to declare `a' and `o' as active |
| 112 |
% characters so that the spelling |ae| and |oe| would automatically produce the |
| 113 |
% equivalent of |\ae| and |\oe| respectively. |
| 114 |
% |
| 115 |
% In practice Beccari found serious programming problems with this solution and |
| 116 |
% adopted an alternative one; specifically the adopted solution was to type in |
| 117 |
% |"ae| and |"oe| respectively, and \ae\ and \oe\ would be inserted in the |
| 118 |
% source text without the need of leaving blanks after the control sequences or |
| 119 |
% the need of inserting extra braces; therefore one types in |c"aelum| and this |
| 120 |
% is equivalent to \verb*|c\ae lum| or |c{\ae}lum| or |c\ae{}lum|; the saving in |
| 121 |
% the% input stream is evident and typos are likely less frequent. |
| 122 |
% |
| 123 |
% The active apostrophe for the acute accent behaves properly also with y |
| 124 |
% and |'ae| and |'oe| produce the accented diphthongs. |
| 125 |
% |
| 126 |
% Of course, when using the OT1 encoding all accents interfere with |
| 127 |
% hyphenation and kerning. When using the T1 encoding this interference |
| 128 |
% takes place only with the accented diphthongs \ae\ and \oe; no visible |
| 129 |
% problems for the lack of kerning, but no hyphenation takes place after |
| 130 |
% the accented diphthongs until the end of the word, even if the grammar |
| 131 |
% allowed it; you can correct by hand this behavior if you add an \textsc{ascii} |
| 132 |
% straight double quote \emph{after} the accented diphthong: $(a)$ if |
| 133 |
% the grammar allows a line break at that point, and $(b)$ if justification |
| 134 |
% of the right margin requires it. |
| 135 |
% |
| 136 |
%\section{Usage} |
| 137 |
% Previous versions of this package were loaded after package \babel with |
| 138 |
% the |latin| language option; you can still do this way because for backwards |
| 139 |
% compatibility this procedure is maintained, but we discourage it for the |
| 140 |
% reasons that are explained hereafter. |
| 141 |
|
| 142 |
% With this new version the preferred procedure is to specify the |
| 143 |
% |ecclesiastic| modifier to the |latin| language option. This very file |
| 144 |
% contains le line: |
| 145 |
%\begin{verbatim} |
| 146 |
%\usepackage[latin.ecclesiastic,english]{babel} |
| 147 |
%\end{verbatim} |
| 148 |
% Of course this new way of loading the package assures it to be loaded |
| 149 |
% at the proper moment, but it requires a \babel of at least version 3.9k; |
| 150 |
% the old procedure is still usable with previous versions of the \babel |
| 151 |
% package. |
| 152 |
% |
| 153 |
% \textbf{Important notice}: This package works only while using the |pdfLaTeX| |
| 154 |
% typesetting program and \babel; if you try to use it with |XeLaTeX| or |
| 155 |
% |LuaLaTeX| its loading procedure issues an error message and the it aborts. |
| 156 |
% if for any reason you have to use |XeLaTeX| or |LuaLaTeX| you can safely |
| 157 |
% run them without loading thins package, but simply specifying the |
| 158 |
% ``key=value'' option |variant=ecclesiastic| in a similar way as you specify |
| 159 |
% the |ecclesiastic| modifier when using \babel. With |XeLaTeX| you have |
| 160 |
% the full functionality of the ecclesiastic Latin variant, while, at the |
| 161 |
% moment, with |LuaLaTeX| the functionality misses the particular spacing |
| 162 |
% around some punctuation marks and around guillemots. This functionality |
| 163 |
% is under study, but it is hopefully available with the next package version. |
| 164 |
% |
| 165 |
% After in one way or another you have assured the presence of the special macros that implement the ecclesiastic Latin style, |
| 166 |
% all you have to do (with \babel) is to input your source code the usual way, |
| 167 |
% except that for guillemots and accents you are supposed to use the |"| and |
| 168 |
% the |'| active characters. The input code |
| 169 |
%\begin{verbatim} |
| 170 |
%Ita enim fit, ut regn'are is "< in m'entibus h'ominum "> dic'atur non |
| 171 |
%tam ob mentis 'aciem scienti'aeque su"ae amplit'udinem, quam quod ipse est |
| 172 |
%V'eritas, et verit'atem ab eo mort'ales haur'ire atque obedi'enter acc'ipere |
| 173 |
%nec'esse est; "< in volunt'atibus "> item "< h'ominum ">, quia \dots |
| 174 |
%\end{verbatim} |
| 175 |
% will produce the following text: |
| 176 |
%\begin{quote}\otherlanguage{latin} |
| 177 |
%Ita enim fit, ut regn'are is "< in m'entibus h'ominum "> dic'atur non |
| 178 |
%tam ob mentis 'aciem scienti'aeque su"ae amplit'udinem, quam quod ipse est |
| 179 |
%V'eritas, et verit'atem ab eo mort'ales haur'ire atque obedi'enter acc'ipere |
| 180 |
%nec'esse est; "< in volunt'atibus "> item "< h'ominum ">, quia \dots |
| 181 |
%\end{quote} |
| 182 |
% Notice that the source text has spaces around the guillemots, but the |
| 183 |
% typeset code has the right small and constant space, irrespective of |
| 184 |
% justification. Notice the use of the `acute' accent (actually the |
| 185 |
% apostrophe) for accented vowels and diphthongs. Notice the space in the |
| 186 |
% typeset text before the semicolon; this space is gobbled and substituted |
| 187 |
% with the proper space. |
| 188 |
% |
| 189 |
% \section{Documented code} |
| 190 |
% Some checks in order to use this package together with the one it |
| 191 |
% should extend. Firse we load the |iftex| package in order to have the right switch to test if we are typesetting with the |pdftex| engine; inf not, an error message is issued and loading aborted. |
| 192 |
% \iffalse |
| 193 |
%<*package> |
| 194 |
% \fi |
| 195 |
% \begin{macrocode} |
| 196 |
\RequirePackage{iftex} |
| 197 |
\unless\ifPDFTeX |
| 198 |
\PackageError{ecclesiastic}{\MessageBreak |
| 199 |
***********************************************\MessageBreak |
| 200 |
* This package works only with pdfLaTeX \MessageBreak |
| 201 |
* Please do not load it when typesetting with \MessageBreak |
| 202 |
* XeLaTeX or LuaLaTeX. \MessageBreak |
| 203 |
***********************************************\MessageBreak |
| 204 |
}{% |
| 205 |
**********************************************************\MessageBreak |
| 206 |
* Carefully read the documentation of package \MessageBreak |
| 207 |
* ecclesiastic, and understand why most functionalities \MessageBreak |
| 208 |
* of this package are obtained with completely different \MessageBreak |
| 209 |
* means, thanks the use of OpenType fonts. \MessageBreak |
| 210 |
* \MessageBreak |
| 211 |
* Input of this package is aborted. \MessageBreak |
| 212 |
**********************************************************\MessageBreak |
| 213 |
} |
| 214 |
\expandafter\endinput |
| 215 |
\fi |
| 216 |
% \end{macrocode} |
| 217 |
% |
| 218 |
% Then we test if \babel has already been loaded; if not an error message |
| 219 |
% is issued and loading aborted. Loading is aborted also if babel has been |
| 220 |
% loaded but the |latin| option has not been specified. |
| 221 |
% Notice that with version 3.5 of the Latin description file, it is recommended |
| 222 |
% to use the |ecclesiastic| modifier to the |latin| option; or it is possible |
| 223 |
% to specify the |ecclesiastic| attribute after loading \babel with the |
| 224 |
% |latin| option, or even after specifying this language option to the |
| 225 |
% |\documentclass| statement, where the modifiers can't be used. |
| 226 |
% By so doing you are sure that the next tests will never produce unexpected |
| 227 |
% results. Nevertheless we recommend to use the first method, that is to |
| 228 |
% specify the |ecclesiastic| modifier to the |latin| option. |
| 229 |
% \begin{macrocode} |
| 230 |
\def\CheckLatin{\unless\ifcsname captionslatin\endcsname |
| 231 |
\PackageWarning{ecclesiastic}{\MessageBreak |
| 232 |
latin must be specified as a global option\MessageBreak |
| 233 |
or it must be passed as an option to babel\MessageBreak |
| 234 |
\MessageBreak |
| 235 |
Nothing done}\expandafter\endinput\fi} |
| 236 |
|
| 237 |
\@ifpackageloaded{babel}{\CheckLatin}{% |
| 238 |
\PackageError{ecclesiastic}{\MessageBreak |
| 239 |
************************************************\MessageBreak |
| 240 |
Package babel must be loaded before this package\MessageBreak |
| 241 |
************************************************% |
| 242 |
}{Package loading is aborted}\endinput} |
| 243 |
% \end{macrocode} |
| 244 |
% In practice you can chose among one of these methods to use this package. |
| 245 |
%\begin{enumerate} |
| 246 |
%\item First and recommended choice: |
| 247 |
%\begin{verbatim} |
| 248 |
%\documentclass[...]{...} |
| 249 |
%... |
| 250 |
%\usepackage[...,latin.ecclesiastic,...]{babel} |
| 251 |
%\end{verbatim} |
| 252 |
%\item~Second choice: |
| 253 |
%\begin{verbatim} |
| 254 |
%\documentclass[...]{...} |
| 255 |
%... |
| 256 |
%\usepackage[...,latin,...]{babel} |
| 257 |
%... |
| 258 |
%\usepackage{ecclesiastic} |
| 259 |
%\end{verbatim} |
| 260 |
%\item Third choice: |
| 261 |
%\begin{verbatim} |
| 262 |
%\documentclass[...,latin,...]{...] |
| 263 |
%... |
| 264 |
%\usepackage[...]{babel} |
| 265 |
%\languageattribute{latin}{ecclesiastic} |
| 266 |
%\end{verbatim} |
| 267 |
%\item Fourth choice: |
| 268 |
%\begin{verbatim} |
| 269 |
%\documentclass[...]{...} |
| 270 |
%... |
| 271 |
%\usepackage[...,latin,...]{babe} |
| 272 |
%\languageattribute{latin}{ecclesiastic} |
| 273 |
%\end{verbatim} |
| 274 |
%\end{enumerate} |
| 275 |
% |
| 276 |
% The following code was borrowed from \pack{frenchle.sty} by Bernard Gaule, |
| 277 |
% but there are several modifications; in particular we avoid the horrible |
| 278 |
% patch made up with the shorter and wider script size math signs. |
| 279 |
% The Latin Modern fonts are preferred if they are available. When the T1 |
| 280 |
% encoding is in force the guillemots are taken from the current font; if |
| 281 |
% you want to typeset ecclesiastic Latin, you'd better use the T1 font |
| 282 |
% encoding; if you don't, you may get proper accented glyphs, but no hyphenation |
| 283 |
% after any accented glyph until the end of the word. No attempt is made to |
| 284 |
% create fake guillemots or to pick them from fonts that do not match the |
| 285 |
% current text font. In any case we provide the command |\FrenchGuillemetsFrom| |
| 286 |
% ( and its alias |\FrenchGuillemotsFrom|) that allows the user to chose what |
| 287 |
% font s/he likes best. |
| 288 |
% |
| 289 |
% The first macro specifies a common interface for choosing where to get |
| 290 |
% guillemots from. |
| 291 |
% \begin{macrocode} |
| 292 |
\let\og\empty\let\fg\empty% |
| 293 |
|
| 294 |
\def\FrenchGuillemetsFrom#1#2#3#4{% |
| 295 |
\DeclareFontEncoding{#1}{}{}% |
| 296 |
\DeclareFontSubstitution{#1}{#2}{m}{n}% |
| 297 |
\DeclareTextCommand{\guillemotleft}{T1}{% |
| 298 |
{\fontencoding{#1}\fontfamily{#2}\selectfont\char#3}}% |
| 299 |
\DeclareTextCommand{\guillemotright}{T1}{% |
| 300 |
{\fontencoding{#1}\fontfamily{#2}\selectfont\char#4}}} |
| 301 |
|
| 302 |
\let\FrenchGuillemotsFrom\FrenchGuillemetsFrom |
| 303 |
|
| 304 |
% \end{macrocode} |
| 305 |
% Then come the macros for selecting various type of guillemots: the |
| 306 |
%|\ToneGuillemets| macro selects them from the T1 encoded fonts; |
| 307 |
% according to the user input encoding, in particular the |utf8| one, when |
| 308 |
% this package is loaded the macros |\guillemotleft| and |\guillemotright| |
| 309 |
% should be defined; if either one is not, then the default guillemots are |
| 310 |
% taken from the T1 encoded Latin Modern fonts: |
| 311 |
% \begin{macrocode} |
| 312 |
\AtBeginDocument{% |
| 313 |
\unless\ifcsname guillemotleft\endcsname |
| 314 |
\def\ToneGuillemets{\FrenchGuillemetsFrom{T1}{lmr}{19}{20}}\fi} |
| 315 |
% \end{macrocode} |
| 316 |
% Having defined the symbols, we now provide to the spacing; we chose a smaller |
| 317 |
% space than in French typography, but, essentially this glue is without |
| 318 |
% stretch and shrink components, so that this space remains constant and |
| 319 |
% does not stretch or shrink for helping in line justification. |
| 320 |
% \begin{macrocode} |
| 321 |
\def\guill@spacing{\penalty\@M\hskip.3\fontdimen2\font |
| 322 |
\@plus\z@\@minus\z@} |
| 323 |
% \end{macrocode} |
| 324 |
% Notice that |\fontdimen2\font| gets the normal inter word space of the |
| 325 |
% current font; therefore the defined spacing of the guillemots is about |
| 326 |
% 1\,pt, with a 10\,pt sized font. |
| 327 |
% |
| 328 |
% Now we are in the position to define the opening and the closing |
| 329 |
% guillemot commands. |
| 330 |
% |
| 331 |
% The spacings on the interior of the guillemots and the spacings before the |
| 332 |
% ``high'' punctuation marks are smaller than with the \texttt{frenchle.sty} |
| 333 |
% settings for the French typography. This has been made according to Robert |
| 334 |
% Bringhurst's recommendation to maintain tight spacing, in particular before |
| 335 |
% the punctuation marks and within the French quotes. |
| 336 |
% |
| 337 |
% Since Beccari is not used to such spacings, forbidden in Italian typography, |
| 338 |
% he finds the traditional French spacings very large, too large for his taste. |
| 339 |
% Bringhurst recommendations come in very handy to justify the chosen spacings. |
| 340 |
% May be who is used to wider spacings finds them too tight. We think we found |
| 341 |
% a compromise. |
| 342 |
% \begin{macrocode} |
| 343 |
\DeclareRobustCommand*{\begin@guill}{\leavevmode |
| 344 |
\guillemotleft\penalty\@M\guill@spacing |
| 345 |
\ignorespaces} |
| 346 |
\DeclareRobustCommand*{\end@guill}{\ifdim\lastskip>\z@\unskip\fi |
| 347 |
\penalty\@M\guill@spacing\guillemotright{}} |
| 348 |
% \end{macrocode} |
| 349 |
% |
| 350 |
% We add the definition of |\og| (\emph{ouvrir guillemets}) and |\fg| |
| 351 |
% (\emph{fermer guillemets}) to the |\extraslatin| list, as well as we |
| 352 |
% add their `emptiness' to the |\noextraslatin| one. |
| 353 |
% \begin{macrocode} |
| 354 |
\addto\extraslatin{% |
| 355 |
\renewcommand{\og}{\begin@guill}\renewcommand{\fg}{\end@guill}% |
| 356 |
} |
| 357 |
\addto\noextraslatin{\let\og\empty\let\fg\empty} |
| 358 |
% \end{macrocode} |
| 359 |
% |
| 360 |
% Therefore open guillemots may be input with the |\og| macro and the |
| 361 |
% closed ones with the |\fg| macro. This might be inconvenient, so that |
| 362 |
% the |"<| and |">| shortcuts should be preferred; these shortcuts assure |
| 363 |
% that the spaces after these shortcuts are really spaces and are not |
| 364 |
% used to terminate the macro name. B.~Gaulle uses the |\xspace| macro from |
| 365 |
% the xspace package, but if this package is not loaded or is not available, the |
| 366 |
% |\xspace| macro behaves as |\relax| and does not produce what is intended to |
| 367 |
% do. See below the extended definition of the |"| shortcut active character. |
| 368 |
% |
| 369 |
% Here we make the apostrophe an active char and define the shortcuts for |
| 370 |
% Latin that introduce the acute accent over the specified vowels, lower |
| 371 |
% and upper case. Probably upper case is useless, but it does not harm. |
| 372 |
% \begin{macrocode} |
| 373 |
\initiate@active@char{'}% |
| 374 |
\addto\extraslatin{\bbl@activate{'}}% |
| 375 |
\addto\noextraslatin{\bbl@deactivate{'}}% |
| 376 |
|
| 377 |
\declare@shorthand{latin}{'a}{\@ifnextchar e{\'\ae\@gobble}{\'a}} |
| 378 |
\declare@shorthand{latin}{'e}{\'e} |
| 379 |
\declare@shorthand{latin}{'i}{\'i} |
| 380 |
\declare@shorthand{latin}{'o}{\@ifnextchar e{\'\oe\@gobble}{\'o}} |
| 381 |
\declare@shorthand{latin}{'u}{\'u} |
| 382 |
\declare@shorthand{latin}{'y}{\'y} |
| 383 |
\declare@shorthand{latin}{'A}{\@ifnextchar E{\'\AE\@gobble}{\'A}} |
| 384 |
\declare@shorthand{latin}{'E}{\'E} |
| 385 |
\declare@shorthand{latin}{'I}{\'I} |
| 386 |
\declare@shorthand{latin}{'O}{\@ifnextchar E{\'\OE\@gobble}{\'O}} |
| 387 |
\declare@shorthand{latin}{'U}{\'U} |
| 388 |
\declare@shorthand{latin}{'Y}{\'Y} |
| 389 |
% \end{macrocode} |
| 390 |
% |
| 391 |
% Here we redefine the |"| shortcut active character; |
| 392 |
% it is borrowed from \pack{italian.ldf}, but a new |\LT@cwm| macro is |
| 393 |
% added to the existing |\lt@@cwm| one so as to cope also with |"ae| and |"oe|, |
| 394 |
% besides the guillemot commands. |
| 395 |
% |
| 396 |
% The following declaration is probably a repetition of what is already in |
| 397 |
% \pack{latin.ldf} |
| 398 |
% \begin{macrocode} |
| 399 |
\declare@shorthand{latin}{"}{% |
| 400 |
\textormath{\def\lt@next{\futurelet\lt@temp\lt@cwm}}% |
| 401 |
{\def\lt@next{''}}\lt@next |
| 402 |
}% |
| 403 |
% \end{macrocode} |
| 404 |
% |
| 405 |
% This also should already be in \pack{latin.ldf}; it is the command that |
| 406 |
% inserts a discretionary break, but does not inhibit hyphenation in the |
| 407 |
% rest of the word. |
| 408 |
% \begin{macrocode} |
| 409 |
\def\lt@@cwm{\nobreak\discretionary{-}{}{}\nobreak\hskip\z@skip}% |
| 410 |
% \end{macrocode} |
| 411 |
% |
| 412 |
% This, for what concerns Latin, is new as an interface with the definitions |
| 413 |
% of the guillemots |
| 414 |
% \begin{macrocode} |
| 415 |
\def\lt@@ocap#1{\begin@guill}\def\lt@@ccap#1{\end@guill}% |
| 416 |
% \end{macrocode} |
| 417 |
% |
| 418 |
% This is completely new; it deals with |\ae| and |\oe|; since |\ae| is much |
| 419 |
% more frequent than |\oe|, we start with testing for an `a' followed by |
| 420 |
% an `e', otherwise we test about the presence of an `o': |
| 421 |
% \begin{macrocode} |
| 422 |
\DeclareRobustCommand\LT@cwm[2]{% |
| 423 |
\ifx#1a\bbl@afterelse |
| 424 |
\maybeae#1#2% |
| 425 |
\else\bbl@afterfi |
| 426 |
\testoe#1#2% |
| 427 |
\fi} |
| 428 |
% \end{macrocode} |
| 429 |
% |
| 430 |
% If a sequence |ae| was detected, then |\ae| is inserted in the input stream |
| 431 |
% in place of that sequence, otherwise the two tokens are inserted in the input |
| 432 |
% stream preceded by the discretionary break implied by the presence of the |
| 433 |
% |"| sign that triggered the whole process. |
| 434 |
% |
| 435 |
% \begin{macrocode} |
| 436 |
\def\maybeae#1#2{% |
| 437 |
\ifx#2e\bbl@afterelse |
| 438 |
\ae% |
| 439 |
\else\bbl@afterfi |
| 440 |
\lt@@cwm#1#2% |
| 441 |
\fi |
| 442 |
} |
| 443 |
% \end{macrocode} |
| 444 |
% |
| 445 |
% The same procedure is valid for the sequence |oe| |
| 446 |
% \begin{macrocode} |
| 447 |
\def\maybeoe#1#2{% |
| 448 |
\ifx#2e\bbl@afterelse |
| 449 |
\oe% |
| 450 |
\else\bbl@afterfi |
| 451 |
\lt@@cwm#1#2% |
| 452 |
\fi |
| 453 |
} |
| 454 |
% \end{macrocode} |
| 455 |
% |
| 456 |
% But the presence of an `o' must be checked before activating the previous |
| 457 |
% macro: |
| 458 |
% \begin{macrocode} |
| 459 |
\def\testoe#1#2{% |
| 460 |
\ifx#1o\bbl@afterelse |
| 461 |
\maybeoe#1#2% |
| 462 |
\else\bbl@afterfi |
| 463 |
\lt@@cwm#1#2% |
| 464 |
\fi} |
| 465 |
% \end{macrocode} |
| 466 |
% |
| 467 |
% This is the real execution of the |"| shortcut; remember that |\lt@cwm| |
| 468 |
% is activated by |\lt@next|, the action associated with |"| when outside |
| 469 |
% the math mode; furthermore |\lt@temp| contains the token following |
| 470 |
% the |"| sign. Notice that the category code of the |\lt@temp| is compared |
| 471 |
% to that of a generic letter; the choice of `e' is absolutely irrelevant, |
| 472 |
% because it is a generic letter; any other letter would do the same. |
| 473 |
% So, first the temporary token category code is compared to that of a letter; |
| 474 |
% if it's a letter then |
| 475 |
% |\LT@cwm| is executed; the latter on turn looks for an `a' or an `o' and |
| 476 |
% possibly inserts a diphthong or a discretionary break; otherwise the |
| 477 |
% temporary token is compared to \verb+|+, so that the shortcut \verb+"|+ |
| 478 |
% is possibly executed by inserting a discretionary break and by gobbling |
| 479 |
% the bar; otherwise it checks for a `less than' sign and |
| 480 |
% possibly inserts double open guillemots; otherwise it checks for a |
| 481 |
% `greater than' sign and possibly inserts double closed guillemots; |
| 482 |
% otherwise it checks for the slash and possibly it inserts a breakable |
| 483 |
% slash |\slash|; otherwise it checks for another double straight quote |
| 484 |
% sign and possibly it inserts double open high quotes (this is useful |
| 485 |
% for those keyboards that do not have the `back tick' sign |`|). |
| 486 |
% \begin{macrocode} |
| 487 |
\DeclareRobustCommand*{\lt@cwm}{\let\lt@@next\relax |
| 488 |
\ifcat\noexpand\lt@temp e% |
| 489 |
\def\lt@@next{\LT@cwm}% |
| 490 |
\else |
| 491 |
\if\noexpand\lt@temp \string|% |
| 492 |
\def\lt@@next{\lt@@cwm\@gobble}% |
| 493 |
\else |
| 494 |
\if\noexpand\lt@temp \string<% |
| 495 |
\def\lt@@next{\lt@@ocap}% |
| 496 |
\else |
| 497 |
\if\noexpand\lt@temp \string>% |
| 498 |
\def\lt@@next{\lt@@ccap}% |
| 499 |
\else |
| 500 |
\if\noexpand\lt@temp\string/% |
| 501 |
\def\lt@@next{\slash\@gobble}% |
| 502 |
\else |
| 503 |
\ifx\lt@temp"% |
| 504 |
\def\lt@@next{``\@gobble}% |
| 505 |
\fi |
| 506 |
\fi |
| 507 |
\fi |
| 508 |
\fi |
| 509 |
\fi |
| 510 |
\fi |
| 511 |
\lt@@next}% |
| 512 |
% \end{macrocode} |
| 513 |
% |
| 514 |
% This done let's take care of the punctuation. First we create the aliases |
| 515 |
% of the punctuation marks with their original category codes |
| 516 |
% \begin{macrocode} |
| 517 |
\edef\puntoevirgola{\string;}\edef\cc@pv{\the\catcode`;}% |
| 518 |
\edef\duepunti{\string:}\edef\cc@dp{\the\catcode`:}% |
| 519 |
\edef\puntoesclamativo{\string!}\edef\cc@pe{\the\catcode`!}% |
| 520 |
\edef\puntointerrogativo{\string?}\edef\cc@pi{\the\catcode`?}% |
| 521 |
% \end{macrocode} |
| 522 |
% |
| 523 |
% Then we make those punctuation marks active and add their activeness to |
| 524 |
% |\extraslatin|, and also their ``deactiveness'' to the |\noextraslatin| list. |
| 525 |
% In this way we are sure that there is no interference with other languages. |
| 526 |
% \begin{macrocode} |
| 527 |
\initiate@active@char{;} |
| 528 |
\initiate@active@char{:} |
| 529 |
\initiate@active@char{!} |
| 530 |
\initiate@active@char{?} |
| 531 |
\addto\extraslatin{\bbl@activate{;}} |
| 532 |
\addto\extraslatin{\bbl@activate{:}} |
| 533 |
\addto\extraslatin{\bbl@activate{!}} |
| 534 |
\addto\extraslatin{\bbl@activate{?}} |
| 535 |
\addto\noextraslatin{\bbl@deactivate{;}} |
| 536 |
\addto\noextraslatin{\bbl@deactivate{:}} |
| 537 |
\addto\noextraslatin{\bbl@deactivate{!}} |
| 538 |
\addto\noextraslatin{\bbl@deactivate{?}} |
| 539 |
% \end{macrocode} |
| 540 |
% |
| 541 |
% Here we define the space before punctuation; again the glue that is inserted |
| 542 |
% in the French typography is too large according to our taste; the glue we |
| 543 |
% want to put in front of the high punctuation marks should be smaller |
| 544 |
% and we chose a smaller compromise value, but again we fix the stretch |
| 545 |
% and shrink components to zero. |
| 546 |
% \begin{macrocode} |
| 547 |
\def\punct@spacing{\penalty\@M\hskip.3\fontdimen2\font |
| 548 |
\@plus\z@\@minus\z@} |
| 549 |
% \end{macrocode} |
| 550 |
% |
| 551 |
% Then we give a definition to these active characters; in each definition |
| 552 |
% we start by eliminating any previous spacing inserted by the typist, then |
| 553 |
% we insert our space and finally the punctuation mark. |
| 554 |
% \begin{macrocode} |
| 555 |
\declare@shorthand{latin}{;}{\ifdim\lastskip>\z@\unskip\fi |
| 556 |
\punct@spacing\puntoevirgola} |
| 557 |
\declare@shorthand{latin}{:}{\ifdim\lastskip>\z@\unskip\fi |
| 558 |
\punct@spacing\duepunti} |
| 559 |
\declare@shorthand{latin}{!}{\ifdim\lastskip>\z@\unskip\fi |
| 560 |
\punct@spacing\puntoesclamativo} |
| 561 |
\declare@shorthand{latin}{?}{\ifdim\lastskip>\z@\unskip\fi |
| 562 |
\punct@spacing\puntointerrogativo} |
| 563 |
% \end{macrocode} |
| 564 |
% |
| 565 |
% For footnotes we require that the footnote mark be typed flush to the |
| 566 |
% left margin and that it is typed in normal size; this requires the |
| 567 |
% redefinition of the |\@makefntext| macro that must call a different |
| 568 |
% version of |\@makefnmark|. |
| 569 |
% \begin{macrocode} |
| 570 |
% |
| 571 |
\let\lt@ori@makefntext\@makefntext |
| 572 |
\newcommand\lt@makefntext[1]{% |
| 573 |
\parindent 1em% |
| 574 |
\noindent |
| 575 |
\lt@Makefnmark\enspace #1} |
| 576 |
\newcommand\lt@Makefnmark{\hbox{\normalfont\@thefnmark.}} |
| 577 |
% \end{macrocode} |
| 578 |
% We add these commands to the |\extraslatin| and |\noextraslatin| lists. |
| 579 |
% \begin{macrocode} |
| 580 |
\addto\extraslatin{\let\@makefntext\lt@makefntext} |
| 581 |
\addto\noextraslatin{\let\@makefntext\lt@ori@makefntext} |
| 582 |
% \end{macrocode} |
| 583 |
% |
| 584 |
% Is this correct? May be not! In a mixed language text footnotes get labelled |
| 585 |
% in a different way depending on which language was in force when the |
| 586 |
% |\footnote| command was issued. Any solution? |
| 587 |
% |
| 588 |
% In order to leave the category codes clean we re-establish the default codes |
| 589 |
% reassigning the active cars their initial meaning; we do this by executing |
| 590 |
% |\noextraslatin|. If Latin is the default language, or when Latin is |
| 591 |
% selected, the |\extraslatin| macro is automatically executed and the original |
| 592 |
% category codes reassigned to the active characters. |
| 593 |
% |
| 594 |
% \begin{macrocode} |
| 595 |
\noextraslatin |
| 596 |
% \end{macrocode} |
| 597 |
% \iffalse |
| 598 |
%</package> |
| 599 |
% \fi |
| 600 |
% |
| 601 |
% \Finale |
| 602 |
\endinput |