diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-11 23:57:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-11 23:57:05 +0000 |
commit | c6d956281e73a7a254056af7d560a824a6d8713a (patch) | |
tree | 32d2bdcb2ced6ea2d2ca31fdf75412e4a308244c /Master/texmf-dist/source/latex/relenc | |
parent | 193a5c2af815c60702429d7c60af89878d984c6d (diff) |
trunk/Master/texmf-dist/source/latex/relenc
git-svn-id: svn://tug.org/texlive/trunk@489 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/relenc')
-rw-r--r-- | Master/texmf-dist/source/latex/relenc/README | 136 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/relenc/relenc.dtx | 1549 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/relenc/relenc.ins | 15 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/relenc/t1renc.dtx | 998 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/relenc/t1rzcm.fdd | 273 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/relenc/zcmr8d.vf2 | bin | 0 -> 3132 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/relenc/zcmr8d.vf3 | bin | 0 -> 3128 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/relenc/zcmra.vf2 | bin | 0 -> 3196 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/relenc/zcmra.vf3 | bin | 0 -> 3192 bytes |
9 files changed, 2971 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/relenc/README b/Master/texmf-dist/source/latex/relenc/README new file mode 100644 index 00000000000..06e99d5e807 --- /dev/null +++ b/Master/texmf-dist/source/latex/relenc/README @@ -0,0 +1,136 @@ +ABSTRACT: +What in my opinion is one of the most irritating limitations with the +standard encodings used with LaTeX today is that they either have very +few slots available for ligatures or offer no way in which LaTeX can make +use all those accented character glyphs that fonts usually come equipped +with. The relenc package makes it possible to get around this by +introducing the concept of a relaxed encoding. Unlike normal encodings, +relaxed encodings give the font designer (or whoever is setting up the +font for use with LaTeX) a saying on what the author commands setting text +from the fonts should really do to get their work done. This can be used +to make more slots available for ligatures without more than marginally +changing the visible result of any command. + +One such relaxed encoding is included with the relenc package: the T1R +encoding. It behaves like T1 to the author, but allows the font designer to +include some 60 ligatures in the font (T1 only allows seven). Note however +that it is up to the font designer to decide how those 60 slots should be +used, so any subset of them can just as well be used for accented letters. + +The package also comes with a font family called zcm, which exists only to +provide an example of what can be done with the relenc package. This +example can be viewed if you typeset the file reldemo.tex, but before you +do that you need to have docstrip generate some other files. That will be +done automatically if you run LaTeX on relenc.ins. + + +The distribution of the package roughly consists of four logical parts: +The first part is the package itself and its documentation, the second is +the T1R encoding, the third is the zcm font family, and the fourth consists +of files related to the distribution in general. The files in all four +parts are listed and described below. All these files should be present in +the distribution. If you recieve only some of these files from someone, +then complain. + +The files in the fourth part are: + +README This file +relenc.ins The docstrip installation script for the package and + accompanying files. This script extracts files for parts + one, two, and three from their respective documented source + files. + +The files in the first part are: + +relenc.dtx The documented source file for the relenc package. +relenc.tex The complete documentation. The appendices of this document + even contain the documentation for the T1R encoding and zcm + font family, but that text is located in the files + t1renc.dtx and t1rzcm.fdd. +2sidedoc.sty A LaTeX2e package used when typesetting relenc.tex and + relenc.dtx. See [1] below. + + +The file in the second part is: + +t1renc.dtx The specification of the T1R encoding and the documented + source for its encoding definition file. + +The files in the third part are: + +t1rzcm.fdd A short description of the zcm font family and the + documented source for its font definition file. +reldemo.tex A file that generates an example of what can be done with + the relenc package. +zcmr8d.tfm \ The actual font files for the zcm font family. +zcmr8d.vf | PLEASE NOTE: These files are binary files and must be +zcmr8d.vf2 | transferred as such. If TeX, while typesetting +zcmr8d.vf3 \ reldemo.tex, stops and complains about "Bad metric (TFM) +zcmra.tfm / file" then these files have most likely been damaged in +zcmra.vf | some way. This sort of thing is usually caused by the +zcmra.vf2 | files being FTPed as text files instead of binary +zcmra.vf3 / files. ALSO NOTE: You only need four of these for any + given TeX installation, but different installations need + different subsets of them. See the documentation (typeset + relenc.tex or t1rzcm.fdd) for more information. + +The files docstrip generate from the documented source files above are: + +relenc.sty This is the relenc package itself. +t1renc.def This is the encoding definition file for the T1R encoding. +t1rzcm.fd This is the font definition file for the zcm font family + under the T1R encoding. +ecsubzcm.sty This is a helper package, that may be useful for those who + uses the T1R encoding but prefer not to have the zcm font + family around. + +A simple installation: + + Files to put in some TeX inputs directory: + relenc.sty + t1renc.def + t1rzcm.fd + + Files to put in some directory where TeX and DVI drivers looks for + TeX font metric (TFM) files: + zcmr8d.tfm + zcmra.tfm + + Files to put in some directory where DVI drivers looks for virtual font + (VF) files: + zcmr8d.vf + zcmra.vf + + + +[1] The usage of the 2sidedoc package here is merely to split some of my + overlong macro names on more than one line, but I originally wrote it + to get a better layout on files documented with the doc package when + printing them in twoside mode. 2sidedoc sees to that the macro and + environment names printed in the margin by the commands in doc always + end up in the outer margin (instead of the left margin as with the + naked doc package) when the class operates in twoside mode. + + One funny thing about the package is that it writes information in the + aux file to help it figure out (for each piece of marginal material) + which margin is the outer. Due to this you may have to typeset a + document more than one time before the placing gets correct + everywhere, but that is the same kind of problem you'll be used to + get with incorrect page references, so we all know we can live with it. + + I intend to make a proper release of the 2sidedoc package sometime, + but first I will have to do something about the placement of codeline + numbers as well. As it turns out, the codeline numbers will assume the + role of an optical axis on the page; marking the boundary between the + body text and marginal material parts of the paper. This means that + these codeline numbers will have to change side depending on whether + the page is odd or even as well, just like the marginal material, and + I haven't gotten round to implementing a mechanism for this yet. + + Still, there is no harm in using the package as it is. If you put its + \usepackage somewhere after that of doc, then it will modify the doc + macros that needs to be modified. You don't notice much of it however, + unless you are typesetting with twosided printing active. + + +Lars Hellström diff --git a/Master/texmf-dist/source/latex/relenc/relenc.dtx b/Master/texmf-dist/source/latex/relenc/relenc.dtx new file mode 100644 index 00000000000..28700b68fb7 --- /dev/null +++ b/Master/texmf-dist/source/latex/relenc/relenc.dtx @@ -0,0 +1,1549 @@ +%% \CheckSum{724} +% \iffalse (Comment) +% This is the code for the relenc package, with doc style comments. +% \fi +% +% \iffalse (Driver code) +% (The driver is enclosed in a macrocode environment, even though the +% iffalse will make \TeX\ skip past it, just in case.) +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} +\usepackage{2sidedoc} +\newcommand\B{\penalty300\relax} +\newcommand\package[1]{\textsf{#1}} +\title{\texttt{relenc.dtx}} +\author{Lars Hellstr\"om% + \thanks{E-mail: \texttt{Lars.Hellstrom@math.umu.se}}% +} +\date{1999/01/23} +\begin{document} +\maketitle +\DocInput{relenc.dtx} +\begin{thebibliography}{99} +% +\bibitem{ltoutenc} + Johannes Braams, David Carlisle, Alan Jeffrey, Frank Mittelbach, + Chris Rowley, Rainer Sch\"opf: \texttt{ltoutenc.dtx} (part of the + \LaTeXe\ base distribution). +% +\bibitem{fontinst} + Alan Jeffrey, Rowland McDonnell (manual), Sebastian Rahtz, + Ulrik Vieth: \emph{The fontinst utility} (v\,1.8), + \texttt{fontinst.dtx}, in CTAN at \texttt{ftp:/\slash + ftp.tex.ac.uk\slash tex-archive\slash fonts\slash utilities\slash + fontinst\slash}\textellipsis +% +\bibitem{fntguide} + \LaTeX3 Project Team: \emph{\LaTeXe\ font selection}, + \texttt{fntguide.tex} (part of the \LaTeXe\ base distribution). +% +\bibitem{encguide} + Frank Mittelbach [et al. ?]: \texttt{encguide.tex}. To appear as + part of the \LaTeXe\ base distribution. Sometime. Or at least, that + is the intention. +% +\end{thebibliography} +\end{document} +%</driver> +% \end{macrocode} +% \fi +% +% \StopEventually{} +% +% \section{Implementation} +% \label{Implementation} +% +% \iffalse (Comment) +% The following code really belong in the preamble, but since there +% are two documents which contain the text in this file, I prefer to +% put the code in one place instead. +% \fi +% \makeatletter +% \def\gobble@zeroX#10X{} +% \newcommand\St@rtShowGeneric[1]{^^A +% \begin{list}{}{^^A +% \@beginparpenalty=\predisplaypenalty +% \@endparpenalty=\postdisplaypenalty +% \@itempenalty=100\relax +% \setlength\leftmargin\z@ +% \setlength\rightmargin\z@ +% \setlength\listparindent\z@ +% \setlength\parsep\z@skip +% \setlength\itemsep\z@skip +% \MacroFont +% \frenchspacing +% }^^A +% \ifnum#1<\@ne\else +% \item[]\leavevmode +% \rlap{ +% \count@=\z@ +% \loop +% \ \advance\count@\@ne +% \if \expandafter\gobble@zeroX \the\count@ X0XXX^^A +% ^^A \the\count@ does not end with 0. +% \else +% \hb@xt@\z@{{\hss\normalfont\tiny\the\count@\hss}}^^A +% \fi +% \ifnum\count@<#1\relax\repeat +% \llap{\strut\vrule}^^A +% }^^A +% \fi +% \def\mynewline{\unskip\hfil\penalty-\@M\vadjust{}} +% \set@display@protect +% } +% \newcommand\ShowGenericError[5][0]{^^A +% \St@rtShowGeneric{#1}^^A +% \item[]^^A +% \def\MessageBreak{\mynewline#2}^^A +% ! #3.\mynewline\mynewline +% #4\mynewline +% Type H <return> for immediate help\mynewline +% \ ...\mynewline\mynewline +% I.100\mynewline\mynewline +% \item[]^^A +% \def\MessageBreak{\mynewline}^^A +% ? h\mynewline +% #5\mynewline +% \end{list}^^A +% } +% \newcommand{\ShowGenericWarningOrInfo}[3][0]{^^A +% \St@rtShowGeneric{#1}^^A +% \item[]^^A +% \def\MessageBreak{\mynewline#2}^^A +% #3.\par +% \end{list} +% } +% \newcommand{\ShowPackageError}[4][0]{^^A +% \ShowGenericError[#1]{^^A +% (#2)\@spaces\@spaces\@spaces\@spaces +% }{^^A +% Package #2 Error: #3^^A +% }{^^A +% See the #2 package documentation for explanation.^^A +% }{#4}^^A +% } +% \newcommand\ShowPackageWarning[3][0]{^^A +% \ShowGenericWarningOrInfo[#1]{^^A +% (#2)\@spaces\@spaces\@spaces\@spaces +% }{^^A +% Package #2 Warning: #3^^A +% }^^A +% } +% \newcommand\ShowPackageInfo[3][0]{^^A +% \ShowGenericWarningOrInfo[#1]{^^A +% (#2) \@spaces\@spaces\@spaces +% }{^^A +% Package #2 Info: #3^^A +% }^^A +% } +% \makeatother +% +% +% \subsection{Initial stuff} +% The obligatory header code for a \LaTeXe\ package. +% \begin{macrocode} +%<*package> +\NeedsTeXFormat{LaTeX2e}[1994/06/01] +\ProvidesPackage{relenc}[1999/01/23] +% \end{macrocode} +% \bigskip +% +% At the moment, there are no options for the \package{relenc} package. +% +% +% \subsection{Variables and similar things} +% +% \begin{macro}{\RE@temptoks} +% |\RE@temptoks| is used by the basic search mechaism to store +% the part of the search path that has not yet been used. +% \begin{macrocode} +\newtoks\RE@temptoks +% \end{macrocode} +% \end{macro} +% \begin{macro}{\RE@garbage} +% The |\RE@garbage| macro is used as a target for some assignments that +% really shouldn't be made, but where a mechanism for detecting this +% would not be worth the cost. It is also used as a temporary storage +% by some definition commands. +% \end{macro} +% \begin{macro}{\RE@first@search@item} +% During a search, the |\RE@first@search@item| macro will expand the +% first item in the search path. This is needed for the define first +% mechanism to work. +% \end{macro} +% \begin{macro}{\RE@define@first} +% The |\RE@define@first| macro works like a switch. If it is +% |\RE@active@define|\B|@first| then the define first mechanism is +% active: If the search does not find anything on the first try but +% finds something later then the first command in the search path gets +% |\let| to whatever the search finds. If |\RE@define@first| is +% |\@gobbletwo| then the define first mechanism is inactive and nothing +% happens. This construction allows for other possibilities as well. +% +% The initial setting is |\@gobbletwo|, i.e., off. +% \begin{macrocode} +\let\RE@define@first\@gobbletwo +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Search mechanisms for variable commands} +% +% Variable commands are intended to be used as definitions of +% encoding-specific commands or compositions of such. Thus variable +% commands are actually instances of some user level command, which is +% not the same \TeX\ control sequence as the variable command itself. +% +% A variable command is defined to be a parameterless macro whose +% expansion consists of two tokens. The first is |\RE@text@variable| if +% the command is not a composition and it is |\RE@text@comp@variable| if +% the command is a composition. The second token is the user level +% command itself; this command will not be expanded, its name is merely +% used as a word-stem from which names of possible variants are formed. +% Thus if the definition of the user level command |\foo| in the +% \texttt{T1R} encoding (which would be stored in the control sequence +% |\T1R\foo|) would be a variable command, that definition would be +% \begin{quote} +% |\RE@text@variable|\,|\foo| +% \end{quote} +% +% +% \subsubsection{Identifying the search path and initiating the search} +% \begin{macro}{\RE@text@variable} +% \begin{macro}{\RE@text@comp@variable} +% \begin{macro}{\RE@spath@unavailable} +% \begin{macro}{\RE@spath@available} +% The first thing |\RE@text@variable| must do is to find the +% search path to use. It might be either a family-specific search +% path, in which case it is stored in the macro +% |\|\meta{encoding}|/|\meta{family}\texttt{-path}, +% or the general search path for the entire encoding, in which case +% it is stored in the macro |\|\meta{encoding}\texttt{-path}. +% If the family-specific search path exists, it is chosen. If neither +% exists, this is an error which is reported. +% +% The second thing |\RE@text@variable| does is setting up the +% search along the search path. This is by expanding to +% \begin{quote} +% |\RE@first@read@spath|\,\meta{search path}\,^^A +% |\RE@read@spath| +% \end{quote} +% which starts the next phase of the search. +% +% \begin{macrocode} +\def\RE@text@variable{% + \expandafter\ifx \csname\cf@encoding/\f@family-path\endcsname \relax + \expandafter\ifx \csname\cf@encoding-path\endcsname \relax + \RE@spath@unavailable + \else + \RE@spath@available\RE@first@read@spath\RE@read@spath + \fi + \else + \expandafter\expandafter \expandafter\RE@first@read@spath + \csname\cf@encoding/\f@family-path\expandafter\endcsname + \expandafter\RE@read@spath + \fi +} +% \end{macrocode} +% Hackers may find a few things in the definition a little strange. +% To begin with, I use |\cf@encoding|\label{Why cf@encoding} +% for the name of the current +% encoding, although \cite{fntguide} says that |\f@encoding| +% is defined as precisely that. I too find this a little odd, but the +% corresponding routines in the \LaTeXe\ kernel use |\cf@encoding| +% (see~\cite{ltoutenc}) so I suppose that is safer, for some +% reason. I believe the only time at which |\cf@encoding| and +% |\f@encoding| are different is during a font change, but I might +% be mistaken about that. +% +% The usage of |\RE@spath@unavailable| and |\RE@spath@available| +% might also be confusing, but the alternative to this is heavily +% nested |\expandafter| sequences, and those things are not easy to +% read. Besides, |\RE@spath@unavailable| must do something with the +% initial command token anyway, because |\RE@text|\B|@variable| does +% not move it. +% +% |\RE@spath@available| have two real arguments: The initial search +% command header (which can be |\RE@first@read@spath| or +% |\RE@first@comp@read|\B|@spath|) and the initial search command tail +% (which can be |\RE@read@spath| or |\RE@comp@read@spath|). The other +% arguments are ``dummys'' used to remove unvanted tokens. +% +% All arguments of |\RE@spath@unavailable| are such dummys. +% +% \begin{macrocode} +\def\RE@spath@available#1#2#3\fi#4\fi{\fi\fi + \expandafter\expandafter \expandafter#1% + \csname\cf@encoding-path\endcsname#2% +} +% \end{macrocode} +% \begin{macrocode} +\def\RE@spath@unavailable#1\fi#2\fi#3{% + \fi\fi + \PackageError{relenc}{% + There is no search path for relaxed encoding \cf@encoding% + }\@eha +} +% \end{macrocode} +% +% Example error message: +% \ShowPackageError{relenc}{There is no search path for relaxed +% encoding XX}{\csname @eha\endcsname} +% +% The reason that |\RE@text@comp@variable| and |\RE@text@variable| +% exist as separate macros is that there are separate commands +% |\RE@first@comp|\B|@read|\B|@spath| and |\RE@first@read@spath| at +% the next stage of the search process. +% +% \begin{macrocode} +\def\RE@text@comp@variable{% + \expandafter\ifx \csname\cf@encoding/\f@family-path\endcsname \relax + \expandafter\ifx \csname\cf@encoding-path\endcsname \relax + \RE@spath@unavailable + \else + \RE@spath@available\RE@first@comp@read@spath\RE@comp@read@spath + \fi + \else + \expandafter\expandafter \expandafter\RE@first@comp@read@spath + \csname\cf@encoding/\f@family-path\expandafter\endcsname + \expandafter\RE@comp@read@spath + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% \subsubsection{Performing the search} +% +% Between the steps of the second stage of the search, the initial +% font-dependent command (|\foo| say) will have expanded to +% \begin{quote} +% \meta{search header}\,\meta{remaining search path}\,^^A +% \meta{search tail}\,|\foo| +% \end{quote} +% The \meta{search header} can be one of |\RE@read@spath|, +% |\RE@first@read@spath|, |\RE@comp@read@spath|, and +% |\RE@first@comp@read@spath|. The \meta{search tail} can be either +% |\RE@read@spath| or |\RE@comp@read@spath|. +% +% The \meta{search path} consists mainly of a sequence of blocks that +% looks as follows +% \begin{quote} +% |{| \meta{character tokens, macros} |}| +% \end{quote} +% The macros should also expand to character tokens. At each step, the +% first of these blocks is extracted as the |#1| argument of the search +% header. The remaining blocks are put in the |#2| argument and if no +% definition is found then these will be the \meta{remaining search path} +% to use when setting up for the next step. For the moment, it is put +% away in the token list register |\RE@temptoks|. +% +% Argument |#1| is first checked for whether the +% control sequence formed by expanding +% \begin{quote} +% |\csname|\,|#1|\,|\string|\,|#3|\,|\endcsname| +% \end{quote} +% (|#3| is the control sequence named |\foo| above) exists. If it does, +% it is assumed to be the definition of |\foo| for the current font, +% otherwise everything is set up for the next step using the +% \meta{remaining search path} as search path. +% +% There is no check to see if |#2| is empty, so if the entire search path +% consisted of blocks like the one above, using a font-dependent command +% for which no definition has been given would cause an infinite loop. +% There is however a hack which prevents this: When a search path is set +% using the proper command, the control sequence |\RE@var@not@found| is +% appended to the search path. Primarily, this macro is a hack that +% prevents the search loop from going haywire, but it also has the +% advantage of stopping the expansion of the search header from stripping +% off the braces around the last group prematurely (when +% \begin{quote} +% |\RE@read@spath|\,|{a}|\,|{b}|\,|{cd}|\,|\RE@read@spath|\,|\foo| +% \end{quote} +% is expanded |#1| will be |a| and |#2| will be |{b}|\,|{cd}|, but when +% \begin{quote} +% |\RE@read@spath|\,|{b}|\,|{cd}|\,|\RE@read@spath|\,|\foo| +% \end{quote} +% is expanded |#1| will be |b| and |#2| will be |cd|, so the next time +% round, |#1| will be |c| and |#2| will be |d|---the last group has been +% split---but if the last item in the search path is not a group, but a +% single token, there is no group to split). +% +% \begin{macro}{\RE@read@spath} +% \begin{macro}{\RE@first@read@spath} +% \begin{macro}{\RE@comp@read@spath} +% \begin{macro}{\RE@first@comp@read@spath} +% Considering their usage only, the difference between |\RE@read@spath| +% and |\RE@comp|\B|@read|\B|@spath| is that |\RE@read@spath| is used +% for actual font-dependent commands while |\RE@comp@read@spath| is +% used for compositions of a font-dependent command and its argument. +% In that case, the third argument will not be |\foo| but rather +% something like |\\foo-a| (a single control sequence, the first +% backslash is the escape character and the second is part of the +% actual name); this particular case occurs when the user has written +% |\foo|\,|{a}|). +% +% If, on the other hand, their definitions are looked at, the +% difference is that while |\RE@read@spath| checks if the expansion of +% \begin{quote} +% |\csname|\,|#1|\,|\string|\,|#3|\,|\endcsname| +% \end{quote} +% is defined, |\RE@comp@read@spath| checks if the expansion of +% \begin{quote} +% |\csname|\,|#1|\,|\@empty\|\,|string|\,|#3|\,|\endcsname| +% \end{quote} +% is defined. In most cases, these expand to the same thing (since +% |\@empty| is a parameterless macro which expands to nothing), but +% sometimes one needs to write a |#1| which gives somewhat different +% results depending on whether |#3| is a command or a composition. +% These blocks in the search path can now simply test whether the token +% after the parameter is |\@empty| or |\string|. The two macros that +% currently do this are |\RE@var@not@found| and |\RE@convert@nfss|. +% +% The difference between |\RE@read@spath| and |\RE@first@read@spath| +% is that the latter is used in the first step, while the former is +% used in all the other steps. This difference exists because of the +% define first mechanism: If |\RE@first|\B|@read|\B|@spath| finds a +% definition in the first step, there is no need to call the mechanism +% no matter what the value of |\RE@define@first| is, but if +% |\RE@first@read@spath| does not find a definition then it must store +% the first block of the search path for a possible future use by +% |\RE@active@define@first|. |\RE@read@spath|, on the other hand, +% should never store a search path block, but if it finds a +% definition then it should call |\RE@define@first| since the define +% first mechanism might be active. +% +% Quite naturally, |\RE@comp@read@spath| relates to +% |\RE@first@comp@read@spath| as |\RE@read@spath| to +% |\RE@first@read@spath| and |\RE@first@comp@read@spath| relates to +% |\RE@first@read@spath| as |\RE@comp@read@spath| to |\RE@read@spath| +% [phew!]. +% +% \begin{macrocode} +\def\RE@read@spath#1#2\RE@read@spath#3{% + \RE@temptoks={#2}% + \expandafter\ifx \csname#1\string#3\endcsname \relax + \expandafter\RE@read@spath \the\expandafter\RE@temptoks + \expandafter\RE@read@spath \expandafter#3% + \else + \RE@define@first{#1}{#3}% + \csname#1\string#3\expandafter\endcsname + \fi +} +% \end{macrocode} +% \begin{macrocode} +\def\RE@first@read@spath#1#2\RE@read@spath#3{% + \RE@temptoks={#2}% + \expandafter\ifx \csname#1\string#3\endcsname \relax + \def\RE@first@search@item{#1}% + \expandafter\RE@read@spath \the\expandafter\RE@temptoks + \expandafter\RE@read@spath \expandafter#3% + \else + \csname#1\string#3\expandafter\endcsname + \fi +} +% \end{macrocode} +% \begin{macrocode} +\def\RE@comp@read@spath#1#2\RE@comp@read@spath#3{% + \RE@temptoks={#2}% + \expandafter\ifx \csname#1\@empty\string#3\endcsname \relax + \expandafter\RE@comp@read@spath \the\expandafter\RE@temptoks + \expandafter\RE@comp@read@spath \expandafter#3% + \else + \RE@define@first{#1\@empty}{#3}% + \csname#1\@empty\string#3\expandafter\endcsname + \fi +} +% \end{macrocode} +% \begin{macrocode} +\def\RE@first@comp@read@spath#1#2\RE@comp@read@spath#3{% + \RE@temptoks={#2}% + \expandafter\ifx \csname#1\@empty\string#3\endcsname \relax + \def\RE@first@search@item{#1\@empty}% + \expandafter\RE@comp@read@spath \the\expandafter\RE@temptoks + \expandafter\RE@comp@read@spath \expandafter#3% + \else + \csname#1\@empty\string#3\expandafter\endcsname + \fi +} +% \end{macrocode} +% +% The definition of |\RE@read@spath| is not quite trivial. It must +% not leave any |\fi| up ahead, since everything should eventually +% expand to the actual definition of the searched-for command, and +% this is very likely to have parameters. There must be no surplus +% tokens between this command and its arguments; this is why +%\begin{verbatim} +% \def\RE@read@spath#1#2\RE@read@spath#3{% +% \RE@temptoks={#2}% +% \expandafter\ifx \csname#1\string#3\endcsname \relax +% \expandafter\RE@read@spath\the\RE@temptoks\RE@read@spath#3% +% \else +% \RE@define@first{#1}{#3}% +% \csname#1\string#3\endcsname +% \fi +% } +%\end{verbatim} +% would not do as a definition of |\RE@read@spath|. +% +% A definition that would work is +%\begin{verbatim} +% \def\RE@read@spath#1#2\RE@read@spath#3{% +% \expandafter\ifx \csname#1\string#3\endcsname \relax +% \expandafter\@firstoftwo +% \else +% \expandafter\@secondoftwo +% \fi{% +% \RE@read@spath#2\RE@read@spath#3% +% }{% +% \RE@define@first{#1}{#3}% +% \csname#1\string#3\endcsname +% }% +% } +%\end{verbatim} +% but I prefer the ``save away'' definition since it makes a few +% additional features possible; the most important perhaps being that +% it gives a chance to peek in afterwards and see where the search +% ended (using |\ShowVariantSearchResult|). +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% \subsubsection{Miscellaneous search-related macros} +% +% \begin{macro}{\RE@active@define@first} +% \begin{macro}{\RE@again@read@spath} +% |\RE@active@define@first| is the macro which performs the actual +% assignments done by the define first mechanism, if it is active. +% The macro simply expands to the suitable global assignment; |#1| is +% the block from the search path that found a definition (with +% |\@empty| added if the search was for a composition) and |#2| is the +% command or composition whose definition was searched. +% +% \begin{macrocode} +\def\RE@active@define@first#1#2{% + \global\expandafter\let + \csname\RE@first@search@item\string#2\expandafter\endcsname + \csname#1\string#2\endcsname +} +% \end{macrocode} +% In some cases, the scan of the search path is resumed after a +% variant has been found. This is made possible by the fact that the +% remaining serach path is stored in |\RE@temptoks|, but the define +% first mechanism adds a complication. It cannot be allowed to copy a +% variant other than the first in the search path as that could +% actually change the effect of a command. +% +% The typical case here (the only one possible to define using user +% level commands of \package{relenc}) is that a command has two +% variants, one of which is composed and one which is not. The +% composed occurs before the noncomposed and the default definition of +% the composed is to resume the scan of the search path. If the +% command is executed for an argument for which there is no +% composition, an active define first mechanism will hide all +% composite definitions! +% +% Thus the define first mechanism must be temporarily disabled. +% One way to do this is to put a dummy value in +% |\RE@first@search@item|, and this solution is implemented in +% |\RE@again@read@spath|.\label{RE@again@read@spath} +% \begin{macrocode} +\def\RE@again@read@spath{% + \def\RE@first@search@item##1\expandafter\endcsname{% + RE@garbage\expandafter\endcsname + }% + \expandafter\RE@read@spath \the\RE@temptoks \RE@read@spath +} +% \end{macrocode} +% \end{macro}\end{macro} +% +% +% \begin{macro}{\RE@var@not@found} +% \begin{macro}{\RE@gobble@readspath} +% \begin{macro}{\RE@text@comp@unavail} +% These macros put a graceful end to a search that has found +% nothing. When |\RE@var@not@found|, which should be the very last token +% in every search path (it is automatically added by +% |\SetEncodingSearchPath| and |\SetFamilySearchPath|), is expanded +% it should appear in the following context +% \begin{quote} +% |\expandafter|\,|\ifx|\,|\csname|\,|\RE@var@not@found|\,^^A +% \meta{optional \cs{@empty}}\\ +% |\string|\,\meta{command or composition}\,|\endcsname| +% \end{quote} +% As |\RE@var@not@found| inserts an additional |\endcsname| and |\fi| +% when expanded by the |\csname|, the entire |\ifx| is finished +% before \TeX{} gets to |\RE@gobble|\B|@readspath|. There are however +% a lot of mismatched tokens left over by |\RE@var@not@found|, some of +% which will be used in composing the error message. +% +% \begin{macrocode} +\def\RE@var@not@found{relax\endcsname\relax\fi + \RE@gobble@readspath +} +% \end{macrocode} +% +% When |\RE@gobble@readspath| is expanded, it is in the context +% \begin{quote} +% |\RE@gobble@readspath|\,\meta{optional \cs{@empty}}\,^^A +% |\string|\\ \meta{command or composition}\,^^A +% |\endcsname|\,\meta{some text}\,|\fi| +% \end{quote} +% The |\fi| is the |\fi| that originally matched the |\ifx| mensioned +% above. +% +% The |\@empty| is there iff \meta{command or composition} is a +% composition. If it is, this composition is |\string|ed and the +% first backslash is thrown away. Then the remaining `other' tokens +% are given to |\RE@text@comp@unavail| which will figure out what is +% the original command and what is its argument. If it is not a +% composition, the command is given to |\TextSymbolUnavailable|. In +% any case, everything up to and including the |\fi| disappears. +% +% \begin{macrocode} +\def\RE@gobble@readspath#1\string#2\endcsname#3\fi{% + \ifx\@empty#1% +% \end{macrocode} +% If |#2| is a composition then +% \begin{macrocode} + \expandafter\expandafter \expandafter\RE@text@comp@unavail + \expandafter\@gobble \string#2\RE@text@comp@unavail + \else + \TextSymbolUnavailable{#2}% + \fi +} +% \end{macrocode} +% +% As there is a hyphen between the original command and its argument, +% |\RE@text@comp@unavail| splits the name of the composition at the +% first hyphen. This is the right thing to do as long as |-| is not +% used as part of the name of the original command (unlikely, as +% \LaTeX\ does not define |\-| as an encoding-specific command). +% +% \begin{macrocode} +\def\RE@text@comp@unavail#1-#2\RE@text@comp@unavail{% + \PackageError{relenc}{% + The composition of command #1 with #2\MessageBreak is declared % + in encoding \cf@encoding,\MessageBreak but no definition could % + be found% + }\@eha +} +% \end{macrocode} +% +% Example error text: +% \iffalse Some editing is necessary to compensate for the \catcode +% differences.\fi +% +% \ShowPackageError{relenc}{The composition of command +% \protect\foo\space with A\MessageBreak is declared in encoding +% XXX,\MessageBreak but no definition could be found} +% {\csname@eha\endcsname} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% \subsection{Making variable text commands} +% +% \subsubsection{Miscellaneous support macros} +% +% \begin{macro}{\RE@empty@is@qmark} +% Expands to its argument if that is nonempty, otherwise it expands +% to |?|. This macro is primarily meant to be used inside a |\csname| +% \textellipsis\ |\endcsname| block. As always, an ingenious fool might +% break it, but a category 3 |^^M| is extremely unlikely (and hard to +% type), so it should work for any reasonable argument. +% \begin{macrocode} +\begingroup + \lccode`\$=13\relax + \lowercase{% + \gdef\RE@empty@is@qmark#1{\ifx$#1$?\else#1\fi}% + } +\endgroup +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\RE@font@spec} +% This macro concatenates the four parameters \meta{encoding}, +% \meta{family}, \meta{series}, and \meta{shape} into +% \package{relenc}'s name for this font, i.e., puts slashes between +% the arguments and replaces every empty argument with a question mark. +% \begin{macrocode} +\def\RE@font@spec#1#2#3#4{% + \RE@empty@is@qmark{#1}/\RE@empty@is@qmark{#2}/% + \RE@empty@is@qmark{#3}/\RE@empty@is@qmark{#4}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\RE@bsl@string} +% One thing which complicates the definition of the definition commands +% (which must work even if they appear in a font definition file) is +% that \LaTeX\ has the naughty habit of changing the \TeX\ parameter +% |\escapechar| when it is defing a new font (loading the +% corresponding font definition file). The |\escapechar| parameter +% decides which character, if any, should be put in front of a control +% sequence name which is |\string|ed or written to the log file as +% part of some |\tracing|\textellipsis\ operation. (To see this effect +% yourself, set |\tracingmacros| positive just before a font change +% that loads a new font definition file (better reset it to zero +% after the font change though) and have a look at the log +% file---throughout a large chunk of logged macro expansions there +% are no backslashes on the command names!) The reason I don't +% like this is that (i) it doesn't achieve anything that couldn't just +% as well be achieved by a combination of |\expandafter| and gobbling +% of unwanted tokens and (ii) some font definition files are read by +% \LaTeX\ having |\escapechar| set to its normal value, so you can't +% trust it either way! +% +% Still, that is how \LaTeX\ does it and this must somehow be coped +% with. The |\RE@bsl@string| macro acts like |\string| but inserts a +% backslash in front of control sequence names even when |\string| +% wouldn't insert anything there. It is used instead of |\string| in +% all defining commands. +% +% \begin{macrocode} +\def\RE@bsl@string{% + \ifnum \escapechar<\z@ \@backslashchar \fi + \string +} +% \end{macrocode} +% \end{macro} +% +% +% +% \subsubsection{Declaration commands} +% +% \begin{macro}{\DeclareTextVariableCommand} +% \begin{macro}{\DeclareTextVariableCommandNoDefault} +% \begin{macro}{\DeclareTextVariableSymbol} +% Two of these are the obvious counterparts of |\DeclareTextCommand| +% and |\Declare|\B|TextSymbol|. The parameters are the same, and the +% actual declaring (from the \LaTeXe\ kernel's point of view) is done +% by |\DeclareTextCommand|. +% +% |\DeclareTextVariableCommandNoDefault| is a new possibility that +% exists since a relaxed encoding definition file need not actually +% specify the definition of any font-dependent command. It can, for +% example, specify that ``Unless otherwise stated, use the definition +% from encoding \textellipsis{} ''. +% +% As the ordinary counterparts of these commands are preamble +% commands, I have made these preamble commands as well. +% \begin{macrocode} +\newcommand\DeclareTextVariableCommand{\RE@dec@text@varcmd\newcommand} +\@onlypreamble\DeclareTextVariableCommand +% \end{macrocode} +% \begin{macrocode} +\newcommand\DeclareTextVariableCommandNoDefault{% + \RE@dec@text@varcmd\@gobble +} +\@onlypreamble\DeclareTextVariableCommandNoDefault +% \end{macrocode} +% \begin{macrocode} +\newcommand\DeclareTextVariableSymbol[3]{% + \RE@dec@text@varcmd\chardef#1{#2}#3\relax +} +\@onlypreamble\DeclareTextVariableSymbol +% \end{macrocode} +% \begin{macrocode} +\def\RE@dec@text@varcmd#1#2#3{% + \DeclareTextCommand{#2}{#3}{\RE@text@variable#2}% + \expandafter#1\csname#3/?/?/?\string#2\endcsname +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ProvideTextVariableCommand} +% This is the variable counterpart of |\ProvideTextCommand|, and it +% has the same set of parameters. Its definition is a bit more +% complicated than that of the earlier commands for declaring variable +% font-dependent commands, partly because |\ProvideTextCommand| does +% not tell whether the definition it provided was used, but also +% becuase this command need not be meaningless even if the +% font-dependent command it should declare already was declared. +% +% If the font-dependent command is not declared (the +% |\|\meta{encoding}|\|\meta{command} control sequence is |\relax|), +% |\ProvideTextCommand| is used to declare it and |\providecommand| +% is used to give an encoding level definition. If the font-dependent +% command was declared and variable, then |\providecommand| is still +% called, to give an encoding-level definition of the command in +% case there wasn't already one. Otherwise +% it must have been declared as a non-variable font-dependent command +% and the following info message is given: +% \ShowPackageInfo{relenc}{You have provided a declaration of +% \protect\foo\space in\MessageBreak encoding T1R as a +% variable command, but it was\MessageBreak already declared +% as a non-variable command.\MessageBreak Your declaration +% has been ignored} +% In this case, the slight problem of the left-over definition +% remains. This is taken care of by giving it to |\providecommand| as +% a definition of |\RE@garbage| (which was introduced for this kind +% of tasks). +% +% |\ProvideTextCommand| is not a preamble-only command, so I have +% left |\ProvideTextVariableCommand| free to use anywhere too, although +% I cannot see why it should be needed after |\begin|\,|{document}|. +% \begin{macrocode} +\newcommand\ProvideTextVariableCommand[2]{% + \expandafter\ifx \csname#2\string#1\endcsname \relax + \ProvideTextCommand#1#2{\RE@text@variable#1}% + \expandafter\providecommand + \csname#2/?/?/?\string#1\expandafter\endcsname + \else + \long\def\RE@garbage{\RE@text@variable#1}% + \expandafter\ifx \csname#2\string#1\endcsname \RE@garbage + \expandafter\providecommand + \csname#2/?/?/?\string#1\expandafter\expandafter + \expandafter\endcsname + \else + \PackageInfo{relenc}{You have provided a declaration of + \protect#1 in\MessageBreak encoding #2 as a variable + command, but it was\MessageBreak already declared as a + non-variable command.\MessageBreak Your declaration has + been ignored}% + \expandafter\providecommand + \csname RE@garbage\expandafter\expandafter + \expandafter\endcsname + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% +% \iffalse +% A command that was later scrapped, as it turned out it wasn't needed: +% % \newcommand{\DeclareTextComposableVariable}[3]{% +% % \DeclareTextCommand{#1}{#2}[1]{\RE@text@variable#1{##1}}% +% % \expandafter\newcommand \csname#2/?/?/?\string#1\endcsname [1]{#3}% +% % } +% % \@onlypreamble\DeclareTextComposableVariable +% \fi +% +% \begin{macro}{\DeclareTextVariableAccent} +% This is the variable counterpart of |\DeclareTextAccent|, and again +% this counterpart has the same parameters as its non-variable model. +% Also, it is a preamble-only command, just as its model. +% \begin{macrocode} +\newcommand{\DeclareTextVariableAccent}[3]{% + \DeclareTextCommand{#1}{#2}{\RE@text@variable#1}% + \expandafter\newcommand \csname#2/?/?/?\string#1\endcsname + {\add@accent{#3}}% +} +\@onlypreamble\DeclareTextVariableAccent +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Definition commands} +% +% There is an important difference between the declaration commands and +% the definition commands, and this has to do with when they are +% executed. A definition command usually appears in a \texttt{.fd} +% file, which is read in inside a group (usually several, but that is +% irrelevant), but the definitions it makes should be in force after the +% group has ended. Therefore the definitions must be global, but the +% |\newcommand| family of \LaTeX\ definition commands only make local +% definitions. Because of this, I have chosen to primarily use the +% \TeX\ primitive |\gdef| and its relatives in the definition commands, +% although in several cases \LaTeX-style alternatives are available as +% well. +% +% \begin{macro}{\DefineTextCommandVariant} +% The basic defintion command, |\gdef| style. As simple as it can +% be, but note that the \meta{parameter text} does not become one of +% the arguments of the macro. This has some consequences for when +% spaces are ignored. +% \begin{macrocode} +\newcommand{\DefineTextCommandVariant}[5]{% + \expandafter\gdef + \csname\RE@font@spec{#2}{#3}{#4}{#5}\RE@bsl@string#1\endcsname +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DefineTextSymbolVariant} +% The basic command for defining a text symbol command. +% \begin{macrocode} +\newcommand{\DefineTextSymbolVariant}[6]{% + \global\expandafter\chardef + \csname\RE@font@spec{#2}{#3}{#4}{#5}\RE@bsl@string#1\endcsname + =#6\relax +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DefineTextAccentVariant} +% The basic command for defining an accent command. Very much a +% special case of |\DefineTextCommandVariant|. +% \begin{macrocode} +\newcommand{\DefineTextAccentVariant}[6]{% + \expandafter\gdef + \csname\RE@font@spec{#2}{#3}{#4}{#5}\RE@bsl@string#1\endcsname + {\add@accent{#6}}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NewTextCommandVariant} +% \begin{macro}{\RenewTextCommandVariant} +% \begin{macro}{\ProvideTextCommandVariant} +% \begin{macro}{\RE@make@text@cmd@variant} +% \begin{macro}{\RE@make@text@cmd@var@x} +% These commands are the \LaTeX-style commands to define variable +% font-dependent commands. As the \LaTeX\ commands they are built on is +% not really meant to be used for global definitions, this involves +% some hacking (using the \LaTeX\ core's private control sequences to +% do things they are not meant to do, for example). Everything would +% have been much simpler if the autoload format hook |\aut@global| had +% been available in all \LaTeX\ formats, but it is not. The purpose of +% |\RE@make@text@cmd@variant| is to save some |\csname| \ldots\ +% |\endcsname| pairs, the real defining is done by +% |\RE@make@text@cmd@var@x|. +% \begin{macrocode} +\CheckCommand*{\newcommand}{\@star@or@long\new@command} +\newcommand{\NewTextCommandVariant} + {\RE@make@text@cmd@variant\new@command} +% \end{macrocode} +% \begin{macrocode} +\CheckCommand*{\renewcommand}{\@star@or@long\renew@command} +\newcommand{\RenewTextCommandVariant} + {\RE@make@text@cmd@variant\renew@command} +% \end{macrocode} +% \begin{macrocode} +\CheckCommand*{\providecommand}{\@star@or@long\provide@command} +\newcommand{\ProvideTextCommandVariant} + {\RE@make@text@cmd@variant\provide@command} +% \end{macrocode} +% \begin{macrocode} +\def\RE@make@text@cmd@variant#1#2#3#4#5#6{% + \expandafter\RE@make@text@cmd@var@x + \csname\RE@font@spec{#3}{#4}{#5}{#6}\RE@bsl@string#2\endcsname + {#1}% +} +% \end{macrocode} +% Instead of |\aut@global|, |\l@ngrel@x| is used as a hook. |\l@ngrel@x| +% is defined to be a macro whose last action is to execute |\global|. As +% |\l@ngrel@x| appears just before the central |\def|, this makes that +% definition global in exactly those cases where the definition is made. +% This requires that the topmost layer of |\newcommand| (and its cousins), +% the one in which the |*|-processing takes place, is stepped over. +% Otherwise the definition of |\l@ngrel@x| would be reset. +% +% If the command has an optional argument, however, a simple +%\begin{verbatim} +% \def\l@ngrel@x{\global} +%\end{verbatim} +% is not sufficient. In that case the command the user issues is only a +% preparation that inserts the default optional argument if none is +% present and issues the real command (the name of the real command is +% the name of the user command with an extra backslash prepended to it). +% +% The real command will be globally defined, thanks to the |\global| +% at the end of |\l@ngrel@x|, but the preparation command is at the time +% of |\l@ngrel@x| only locally defined. This is why |\l@ngrel@x| |\let|s +% the preparation command to itself globally, this preserves the +% definition but makes it global. If the command does not have an optional +% argument, this does no harm as the incorrect definition is overwritten +% with the correct just after |\l@ngrel@x|. +% +% Finally, |\l@ngrel@x| resets itself to |\relax|, in case something +% expects it to be |\long| or |\relax|. As |\l@ngrel@x| is not reset +% if no command definition takes place, there is a slight chance of +% error in that case, but at least all \LaTeX\ core user commands reset +% it before using so the hack should not have any side-effects. +% \begin{macrocode} +\def\RE@make@text@cmd@var@x#1#2{% + \def\l@ngrel@x{% + \global\let#1#1% + \let\l@ngrel@x\relax + \global + }% + #2#1% +} +% \end{macrocode} +% To examine sometime: Can |\globaldefs=1| be used instead here? As +% that makes all assignments global, there is a definite chance it +% might break something else. +% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} +% +% \iffalse +% An auxillary command that has been scrapped. +% % \begin{macro}{\RE@globalize@if@defined} +% % This command globally |\let|s its argument to itself, if it is +% % defined. This makes the definition of the argument global, +% % regardless of whether the definition was local or global earlier. +% % \begin{macrocode} +% \def\RE@globalize@if@defined#1{% +% \ifx#1\relax\else +% \global\let#1#1% +% \fi +% } +% % \end{macrocode} +% % \end{macro} +% \fi +% +% +% \subsection{Making compositions of font-dependent commands} + +% \begin{macro}{\RE@if@composed} +% This is a general test to see if a macro is a command that is set +% up for having compositions, i.e., if the expansion of the macro +% begins with |\@text@composite|. This is the same test as is used in +% |\DeclareTextCompositeCommand|. +% +% The syntax is as follows: +% \begin{quote} +% |\RE@if@composed|\,\meta{command}\,\marg{then-text}\,^^A +% \marg{else-text} +% \end{quote} +% expands to \meta{then-text} if \meta{command} can have +% compositions and to \meta{else-text} otherwise. +% \begin{macrocode} +\def\RE@if@composed#1{% + \expandafter\expandafter \expandafter\ifx + \expandafter\@car #1\relax\relax\@nil \@text@composite +% \end{macrocode} +% If it is composite then \textellipsis +% \begin{macrocode} + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Commands for compositions that are variable} +% +% The \LaTeXe\ kernel's method of forming the names of compositions is +% to |\string| the name of the base command and append |-|\meta{argument} +% to that, all of which is then |\csname|d. This generates names like +% \begin{quote} +% |\\T1\foo-a| +% \end{quote} +% for the command |\foo|'s composition with the argument |a| in the |T1| +% encoding. As the \LaTeXe\ kernel's mechanism for checking for +% compositions is used for compositions that have variable definitions +% as well, the names of these commands are formed using the same +% procedure. +% +% Should then the names of the variants of the composition be generated +% from names as the above, then these names would be things like +% \begin{quote} +% |\T1R/zcm/m/n\\T1R\foo-a| +% \end{quote} +% which is a bit longish, even for my taste. Therefore the names of the +% variants are formed from a base consisting only of the name of the +% font-dependent command and its argument, which is |\\foo-a| in the above +% example. This reduces the above to +% \begin{quote} +% |\T1R/zcm/m/n\\foo-a| +% \end{quote} +% saving two to four characters. This difference in naming does however +% have some consequences for the usage of definitions from a non-relaxed +% encoding. +% +% +% If, for example, |{T1}| is included in the current search path and a +% definition of the composition |\foo|\,|{a}| is looked for, a possible +% definition of this in the |T1| encoding will not be found! This is +% because the name tried is |\T1\\foo-a|, but the command is called +% |\\T1\foo-a|. This is the reason for the macro |\RE@convert@nfss|, +% which looks ahead to see if a composition or a plain command is +% currently looked for. Had instead |{\RE@convert@nfss|\,|{T1}}| been +% included, |\T1\\foo-a| would have been changed to |\\T1\foo-a|. +% +% \begin{macro}{\DeclareVariableTextComposition} +% \begin{macro}{\RE@dec@var@text@comp} +% This is the variable analog of \LaTeX's |\DeclareTextCompositeCommand|, +% although it is somewhat less as it does not make a default +% definition for the composition. Thus it is also an analog of +% |\DeclareTextVariableCommandNoDefault| for compositions. +% \begin{macrocode} +\newcommand{\DeclareVariableTextComposition}[3]{% + \expandafter\RE@dec@var@text@comp + \csname\string#1-#3\expandafter\endcsname + \csname\@backslashchar#2\string#1-#3\endcsname + {#1}{#2}{#3}% +} +% \end{macrocode} +% As |\DeclareVariableTextComposition| merely make a few combinations of +% its arguments and then call |\RE@dec@var@text@comp|, the arguments of +% the latter are worth an explanation. Continuing the above example of +% |\foo|\,|{a}| in the |T1R| encoding, the arguments will be +% \begin{quote} +% \begin{tabular}{r@{ is }l r@{ is }l r@{ is }l} +% |#1|&|\\foo-a|& |#2|&|\\T1R\foo-a| &\omit\span\omit\\ +% |#3|&|\foo|& |#4|&|T1R|& |#5|&|a| +% \end{tabular} +% \end{quote} +% +% Should the composition already have been declared, but the +% definition is not variable, that definition is made the encoding +% level definition and the composition is made variable. If the +% definition is variable, an info message is given and the +% definition is not changed. +% \begin{macrocode} +\def\RE@dec@var@text@comp#1#2#3#4#5{% + \ifx#2\relax +% \end{macrocode} +% If this composition has not been declared then \textellipsis +% \begin{macrocode} + \DeclareTextCompositeCommand{#3}{#4}{#5}% + {\RE@text@comp@variable#1}% + \else + \expandafter\expandafter \expandafter\ifx + \expandafter\@car#2\@nil + \RE@text@variable +% \end{macrocode} +% If this composition is variable then \textellipsis +% \begin{macrocode} + \PackageInfo{relenc}{Redundant \protect + \DeclareVariableTextComposition.\MessageBreak + The composition of \protect#3 with #5 is\MessageBreak + already declared as a variable command\MessageBreak + in encoding #4% + }% + \else + \expandafter\let \csname#4/?/?/?\string#1\endcsname #2 + \def#2{\RE@text@comp@variable#1}% + \fi + \fi +} +% \end{macrocode} +% Example message: +% \ShowPackageInfo{relenc}{Redundant \protect +% \DeclareVariableTextComposition.\MessageBreak +% The composition of \protect\foo\space with a is\MessageBreak +% already declared as a variable command\MessageBreak +% in encoding T1R} +% \end{macro}\end{macro} +% +% +% \begin{macro}{\DefineTextCompositionVariant} +% \begin{macro}{\DefineTextCompositionVariantCommand} +% \begin{macro}{\RE@def@text@comp@var} +% These are the commands that actually define variants of compositions. +% The first makes the variant a chardef token, the second +% makes it a parameterless macro. +% +% The arguments for |\RE@def@text@comp@var| should be the following +% things: The command that does the defining (|\chardef| or |\gdef|), +% the base user command, the relevant encoding, family, series, and +% shape, and finally the argument for the composition. Note that the +% actual definition (slot number or replacement text, respectively) +% is not among the arguments of |\RE@def@text@comp@var|. +% \begin{macrocode} +\newcommand\DefineTextCompositionVariant[7]{% + \global \RE@def@text@comp@var\chardef{#1}{#2}{#3}{#4}{#5}{#6}% + #7\relax +} +% \end{macrocode} +% \begin{macrocode} +\newcommand\DefineTextCompositionVariantCommand{% + \RE@def@text@comp@var\gdef +} +% \end{macrocode} +% \begin{macrocode} +\def\RE@def@text@comp@var#1#2#3#4#5#6#7{% + \expandafter#1% + \csname + \RE@font@spec{#3}{#4}{#5}{#6}\@backslashchar + \RE@bsl@string#1-#6% + \endcsname +} +% \end{macrocode} +% \end{macro}\end{macro}\end{macro} +% +% \begin{macro}{\DefineTextUncomposedVariant} +% \begin{macro}{\RE@def@text@uncmp} +% \begin{macro}{\RE@def@text@uncmp@x} +% |\DefineTextUncomposedVariant| extracts the definition used for +% arguments that does not have definitions, inserts the given +% argument, and makes the resulting token sequence the definition of +% the variant at hand. Doing this requires that the definition of +% the command that the \LaTeXe\ kernel sees is taken apart, so it +% might be worth describing how it is contructed. +% +% If |\foo| is composite in the |T1| encoding, |\T1\foo| is a macro +% which expands to +% \begin{quote} +% |\@text@composite|\,|\T1\foo|\,|#1|\,|\@empty|\,^^A +% |\@text@composite|\\ +% |{|\,\meta{noncomposite definition}\,|}| +% \end{quote} +% where \meta{noncomposite definition} is what is needed here. The +% stuff before checks if the composition is defined, but in this case +% things are best if that part is never expanded further that this. +% +% The actual ``work'' is done by |\RE@def@text@uncmp@x|, as this macro +% contains the |\gdef| which is the only command in this that \TeX's +% stomach sees; everything else just expands in one way or another +% (unless the warning is issued, that of course contains some stomach +% stuff too). |\DefineTextUncomposedVariant| makes two |\csname|s: The +% name of the macro from which the definition is to be extracted and +% the name of the macro to define. +% +% |\RE@def@text@uncmp| checks if the macro to extract from really is +% composed, and if it is then it expands it \emph{one level}, feeding +% it the \meta{argument} as argument. Then |\RE@def@text@uncmp@x| is +% given this one level expansion, and the |\@text@composite|s and +% everything between them is thrown away. The +% \meta{noncomposite definition} is made the replacement text of a +% |\gdef| defining the macro to be defined. If the macro to extract a +% definition from is not composed however, a warning is given. +% +% As this command refers to a specific encoding's definition of a +% command, the \meta{encoding} argument mustn't be empty. +% \begin{macrocode} +\newcommand\DefineTextUncomposedVariant[6]{% + \expandafter\RE@def@text@uncmp + \csname#2\RE@bsl@string#1\expandafter\endcsname + \csname#2/\RE@empty@is@qmark{#3}/\RE@empty@is@qmark{#4}/% + \RE@empty@is@qmark{#5}\@backslashchar\RE@bsl@string#1-#6% + \endcsname + {#6}{#1}{#2}% +} +% \end{macrocode} +% \begin{macrocode} +\def\RE@def@text@uncmp#1#2#3#4#5{% + \RE@if@composed#1{% + \expandafter\RE@def@text@uncmp@x #1{#3}{#2}% + }{% + \PackageWarning{relenc}{There are no compositions for % + \protect#4 in\MessageBreak the #5 encoding. % + \protect\DefineTextUncomposedVariant\MessageBreak + makes no sense here% + }% + }% +} +% \end{macrocode} +% \begin{macrocode} +\def\RE@def@text@uncmp@x\@text@composite#1\@text@composite#2#3{% + \gdef#3{#2}% +} +% \end{macrocode} +% Example warning: +% \ShowPackageWarning{relenc}{There are no compositions for ^^A +% \string\foo\space in\MessageBreak the T1 encoding. ^^A +% \string\DefineTextUncomposedVariant\MessageBreak +% makes no sense here} +% \end{macro}\end{macro}\end{macro} +% +% +% \subsubsection{Commands for variants with compositions} +% +% The \package{relenc} package offers another way in which a command can +% be defined relative to both argument and font, and that is to allow +% variants of font-dependent commands to have compositions. It is pretty +% similar to the usual making of composite commands in \LaTeX. +% +% \begin{macro}{\DefineTextVariantComposition} +% \begin{macro}{\DefineTextVariantCompositionCommand} +% These commands define the composition and make the variant a +% command with compositions, if it is not already. The mechanism used +% for compositions uses |\@text@composite|, exactly like the +% compositions made by commands in the \LaTeXe\ kernel. +% +% |\DefineTextVariantComposition| makes the final definition a +% chardef token. |\DefineTextVariantCompositionCommand| makes the +% final definition a macro without parameters. +% +% An interesting point about these commands is that a variant need not +% be defined before a composition of it is made! If this happens then +% of course technicaly the variant gets defined, but its definition +% for the case when that composition is not found is simply to set things +% up for a continued scan of the search path. What makes this possible +% is that the remaining search path is stored in |\RE@temptoks|. +% +% \begin{macrocode} +\newcommand\DefineTextVariantComposition[7]{% + \RE@def@text@var@comp\chardef{#1}{#2}{#3}{#4}{#5}{#6}#7\relax +} +% \end{macrocode} +% \begin{macrocode} +\newcommand\DefineTextVariantCompositionCommand{% + \RE@def@text@var@comp\gdef +} +% \end{macrocode} +% +% \begin{macro}{\RE@def@text@var@comp} +% \begin{macro}{\RE@make@text@comp} +% These are the macros that do the actual work. The parameters of +% |\RE@def@text|\B|@var@comp| are the user level command, the +% encoding, family, series, and shape in question, the argument for +% the composition, the assignment command +% that should define the composition, and finally +% the text that should be put after the control sequnce of the +% composition to complete the assignment. When the assignment command +% is |\chardef|, as is the case when |\DefineTextVariantComposition| +% makes the call, this is simply a \meta{number}---the slot. The extra +% |\relax| is to stop \TeX\ from reading ahead too +% far when looking for the end of the \meta{number}. +% +% The first thing |\RE@def@text@var@comp| does is to check if the +% variant the user wants do define a composition of is defined. +% \begin{macrocode} +\def\RE@def@text@var@comp#1#2#3#4#5#6#7{% + \expandafter\let \expandafter\RE@garbage + \csname\RE@font@spec{#3}{#4}{#5}{#6}\RE@bsl@string#2\endcsname + \ifx \RE@garbage\relax +% \end{macrocode} +% This means the variant has not been defined. The default definition +% given sets up a continued scan along the search path. The key macro +% here is |\RE@again@read@spath| (the definition of which is found on +% page \pageref{RE@again@read@spath}). It temporarily disables the +% define first mechanism and then it expands to +% \begin{quote} +% |\expandafter|\,|\RE@read@spath|\,|\the|\,|\RE@temptoks|\,^^A +% |\RE@read@spath| +% \end{quote} +% As the |##1| below has become |#1| when |\RE@make@text@comp| is +% expanded, this will act as a normal |#1| in the definition +% |\RE@make@text@comp| expands to. +% \begin{macrocode} + \expandafter\RE@make@text@comp\csname + \RE@font@spec{#3}{#4}{#5}{#6}\RE@bsl@string#2% + \endcsname {\RE@again@read@spath#2{##1}}% +% \end{macrocode} +% Otherwise it must be checked if the variant is composed. If it is, +% then everything is fine, if it isn't, then the current definition +% is made the default definition. +% \begin{macrocode} + \else + \RE@if@composed\RE@garbage{}{% + \expandafter\RE@make@text@comp + \csname + \RE@font@spec{#3}{#4}{#5}{#6}\RE@bsl@string#2% + \expandafter\endcsname + \expandafter{\RE@garbage{##1}}% + }% + \fi +% \end{macrocode} +% Then it is finally time to define the composition. This is pretty +% straight off. +% \begin{macrocode} + \global\expandafter#1\csname + \@backslashchar\RE@font@spec{#3}{#4}{#5}{#6}\RE@bsl@string#2-#7% + \endcsname +} +% \end{macrocode} +% |\RE@make@text@comp| makes |#1| a composed command, with |#2| as +% the default definition. This is exactly what the corresponding +% command in standard \LaTeX\ does, but for some reason \LaTeX\ ^^A +% defines this command of the fly each time it is needed. +% \begin{macrocode} +\def\RE@make@text@comp#1#2{% + \gdef#1##1{\@text@composite#1##1\@empty\@text@composite{#2}}% +} +% \end{macrocode} +% \end{macro}\end{macro}\end{macro}\end{macro} +% +% +% \subsection{Miscellanenous commands} +% +% \subsubsection{Search paths} +% +% A very important thing about search paths is that they are +% responsible for ending a search that has found nothing, as the macros +% which actually perform the search contain no mechanism for this. The +% easiest way to ensure this is to append the token |\RE@var@not@found| +% to every search path set, and this is exactly what the standard +% commands for setting search paths do. Anyone who does not use these +% commands for setting a search path must be aware that if a search +% path does not contain any block that ends the search then some tiny errors +% are likely to start infinite loops. +% +% \begin{macro}{\SetEncodingSearchPath} +% \begin{macro}{\SetFamilySearchPath} +% \begin{macro}{\RE@set@spath} +% \begin{macro}{\RE@spath@catcodes} +% These are all fairly standard. |\RE@set@spath| does the actual +% setting of a search path while |\SetEncodingSearchPath| and +% |\SetFamilySearchPath| merely form the name of the macro that will +% store the search path and temporarily change some |\catcode|s to make +% typing the search path somewhat easier. The |\catcode|s are changed +% by |\RE@spath@catcodes|. +% +% \begin{macrocode} +\newcommand{\SetEncodingSearchPath}[1]{% + \begingroup + \RE@spath@catcodes + \expandafter\RE@set@spath \csname#1-path\endcsname +} +% \end{macrocode} +% \begin{macrocode} +\newcommand{\SetFamilySearchPath}[2]{% + \begingroup + \RE@spath@catcodes + \expandafter\RE@set@spath \csname#1/#2-path\endcsname +} +% \end{macrocode} +% \begin{macrocode} +\def\RE@set@spath#1#2{% + \gdef#1{#2\RE@var@not@found}% + \endgroup +} +% \end{macrocode} +% \begin{macrocode} +\def\RE@spath@catcodes{% + \catcode`\ =9\relax + \catcode`\^^I=9\relax + \catcode`\^^M=9\relax + \catcode`\@=11\relax + \catcode`\/=12\relax + \catcode`\?=12\relax +} +% \end{macrocode} +% \end{macro}\end{macro}\end{macro}\end{macro} +% +% \begin{macro}{\RE@convert@nfss} +% For some relaxed encodings, one wants the definition of a +% font-dependent command to be identical to the definition of the command +% in a non-relaxed encoding (this is the case with \texttt{T1R}, which +% is designed to be a relaxed version of \texttt{T1}). As there are +% slight differences in how the names of compositions are generated +% between the \LaTeXe\ kernel and \package{relenc}, it would not be +% sufficient to simply include |{T1}| in the search path of the +% \texttt{T1R} encoding to make it use \texttt{T1}'s definitions of +% compositions as variants of that composition. The purpose of +% |\RE@convert@nfss| is to overcome this by changing the names of the +% variants of compositions where required. Including +% |\RE@convert@nfss|\,|{T1}| in the search path of \texttt{T1R} gives +% the intended effect. +% \begin{macrocode} +\def\RE@convert@nfss#1#2{% + \ifx\@empty#2% + \@backslashchar#1\expandafter\expandafter \expandafter\@gobble + \else + #1\expandafter#2% + \fi +} +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{The define first mechanism} +% +% \begin{macro}{\ActivateDefineFirst} +% \begin{macro}{\DeactivateDefineFirst} +% These commands can be used to turn the define first mechanism on and +% off. I am not sure at the moment whether implementing it was a good +% idea, but as it exists it might as well stay so it can be evaluated. +% +% It could be worth pointing out that these commands act locally. The +% define first mechanism, on the other hand, acts globally. +% \begin{macrocode} +\newcommand\ActivateDefineFirst{% + \let\RE@define@first\RE@active@define@first +} +\newcommand\DeactivateDefineFirst{% + \let\RE@define@first\@gobbletwo +} +% \end{macrocode} +% \end{macro}\end{macro} +% +% \subsection{Debugging} +% +% \begin{macro}{\ShowVariantSearchResult} +% This command offers a way to peek into the search mechanism, and in +% particular to see where it stopped. This command has a potential to +% come in real handy, but note that it is the \emph{remaining search +% path} that is shown. You do not see the block that was actually +% used, you see all blocks that come after it. +% \begin{macrocode} +\newcommand{\ShowVariantSearchResult}{% + \immediate\write\sixt@@n{Encoding: \cf@encoding}% + \immediate\write\sixt@@n{Family: \f@family}% + \immediate\write\sixt@@n{Series: \f@series}% + \immediate\write\sixt@@n{Shape: \f@shape}% + \immediate\write\sixt@@n + {Remaining search path:\MessageBreak\the\RE@temptoks}% + \show\RE@first@search@item +} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Fix for a bug in \LaTeX} +% +% The definition of the control sequence |\@text@composite@x| in +% \LaTeX{}es released 1998 and earlier has a bug (number 2930 in the +% \LaTeX\ bugs database). The definition in question is +%\begin{verbatim} +% \def\@text@composite@x#1#2{% +% \ifx#1\relax +% \expandafter#2% +% \else +% #1% +% \fi} +%\end{verbatim} +% The problem with this definition is the |\expandafter|. According to +% \cite{ltoutenc}, it was ``added so that less chaos ensues from the +% misuse of this code with commands that take several arguments'', but +% unfortunately, it was placed in a position where it can do no good. +% |#2| is in all reasonable cases a sequence of more than one token, +% hence the |\expandafter| will not expand the following |\else|, but +% some token in |#2| instead! I suspect that the |\expandafter| was +% really meant to be placed in front of the |#1|, which actually is just +% a single token. +% +% As it happens, the above bug can cause some serious problems when the +% non-composite definition of a composite command happens to be +% variable, since the above |\expandafter| will then expand a control +% sequence which should \emph{not} be expanded. +% +% \begin{macro}{\@text@composite@x} +% The following code fixes the above bug if the \LaTeX\ used is +% one with that bug. This is done as a curtesy to all those \LaTeX\ +% users which (like myself) are not always updating \LaTeX\ as soon +% as a new release appears. The definition of |\@text@composite@x| is +% checked and, if it matches the above, replaced with the fixed +% definition. +% \begin{macrocode} +\def\RE@garbage#1#2{% + \ifx#1\relax + \expandafter#2% + \else + #1% + \fi} +\ifx \@text@composite@x\RE@garbage + \def\@text@composite@x#1{% + \ifx #1\relax + \expandafter\@secondoftwo + \else + \expandafter\@firstoftwo + \fi + #1% + } +\fi +\let\RE@garbage\relax +%</package> +% \end{macrocode} +% \end{macro} +% +\endinput + + + + + + + + + + diff --git a/Master/texmf-dist/source/latex/relenc/relenc.ins b/Master/texmf-dist/source/latex/relenc/relenc.ins new file mode 100644 index 00000000000..5f1678d2e3e --- /dev/null +++ b/Master/texmf-dist/source/latex/relenc/relenc.ins @@ -0,0 +1,15 @@ +% Installation script for the relenc package and related files. +\input docstrip + +% \postamble +% ^^J\endinput +% \endpostamble + +\generate{ + \file{relenc.sty}{\from{relenc.dtx}{package}} + \file{t1renc.def}{\from{t1renc.dtx}{encoding}} + \file{t1rzcm.fd}{\from{t1rzcm.fdd}{fd}} + \file{ecsubzcm.sty}{\from{t1rzcm.fdd}{package}} +} + +\endbatchfile
\ No newline at end of file diff --git a/Master/texmf-dist/source/latex/relenc/t1renc.dtx b/Master/texmf-dist/source/latex/relenc/t1renc.dtx new file mode 100644 index 00000000000..2e4f293d8d8 --- /dev/null +++ b/Master/texmf-dist/source/latex/relenc/t1renc.dtx @@ -0,0 +1,998 @@ +%% \CheckSum{474} +% \iffalse (Comment) +% This file contains the specification of the T1R encoding, as well +% as the actual code for its encoding definition file. +% \fi +% \iffalse (Driver code) +%<*driver> +\documentclass{ltxdoc} +\DeclareTextFontCommand{\textcmtt}{\usefont{OT1}{cmtt}{m}{n}} +\newcommand\package[1]{\textsf{#1}} +\title{The \texttt{T1R} encoding} +\author{Lars Hellstr\"om% + \thanks{E-mail: \texttt{Lars.Hellstrom@math.umu.se}}% +} +\begin{document} +\maketitle +\DocInput{t1renc.dtx}\Finale +\begin{thebibliography}{99} +% +\bibitem{fontinst} + Alan Jeffrey, Rowland McDonnell (manual), Sebastian Rahtz, + Ulrik Vieth: \emph{The fontinst utility} (v\,1.8), + \texttt{fontinst.dtx}, in CTAN at \texttt{ftp:/\slash + ftp.tex.ac.uk\slash tex-archive\slash fonts\slash utilities\slash + fontinst\slash}\textellipsis +% +\end{thebibliography} +\end{document} +%</driver> +% \fi +% +% \iffalse (Comment) +% Definitions needed for the documentation of the encoding. I know +% they really belong in the preamble, but I prefer having them in one +% place (this text is used in two different documents, with different +% preambles). +% \fi +% \makeatletter +% \begingroup +% \lccode`\$=13\relax +% \lowercase{^^A +% \gdef\ifempty#1{\ifx$#1$^^A +% \expandafter\@firstoftwo +% \else +% \expandafter\@secondoftwo +% \fi +% } +% } +% \endgroup +% \makeatother +% +% \newcommand\glyph[2]{^^A +% \ifempty{#1}{^^A +% \textit{#2}^^A +% }{^^A +% `\textcmtt{#1}' \ifempty{#2}{}{(\textit{#2})}^^A +% }^^A +% } +% \newcommand\LIG[6]{\glyph{#1}{#2} $+$ \glyph{#3}{#4} $\mapsto$ +% \glyph{#5}{#6}} +% \newcommand\tLIG[6]{\glyph{#1}{#2}&$+$&\glyph{#3}{#4}&$\mapsto$&% +% \glyph{#5}{#6}} +% +% \makeatletter +% \newcount\count@q +% \newcommand\octbase[1]{^^A +% \count@=#1\relax +% \count@q=\count@ +% \divide \count@q 64\relax +% \ifnum 0<\count@q +% \the\count@q +% \multiply \count@q 64^^A +% \advance \count@ -\count@q +% \fi +% \count@q=\count@ +% \divide \count@q 8\relax +% \ifnum 0<\count@q +% \the\count@q +% \multiply \count@q 8^^A +% \advance \count@ -\count@q +% \fi +% \the\count@ +% } +% \newcommand\hexbase[1]{^^A +% \count@=#1\relax +% \count@q=\count@ +% \divide \count@q 16\relax +% \hexnumber@\count@q +% \multiply \count@q 16^^A +% \advance \count@ -\count@q +% \hexnumber@\count@ +% } +% \newcommand\spreadfourthrow[1]{^^A +% \count@=#1\relax +% \count@q=\count@ +% \divide \count@q 4^^A +% \multiply \count@q 4^^A +% \advance \count@ -\count@q +% \ifnum 3=\count@ +% \vrule width\z@ depth1.4\dp\strutbox \relax +% \fi +% } +% \makeatother +% \newcommand\inbases[1]{^^A +% {\small\octbase{#1}}&^^A +% #1\spreadfourthrow{#1}&^^A +% \texttt{\small\hexbase{#1}^^A +% }% +% } +% +% +% \section{Specification} +% +% The \texttt{T1R} encoding is meant to be (almost) equivalent to the +% \texttt{T1} encoding from the author's point of view but offer +% larger flexibility to font designers than the \texttt{T1} encoding +% does---especially the flexibility to include additional ligatures. It +% is thus what I call a \emph{relaxed} version of the \texttt{T1} +% encoding, which is also the reason for its name. +% +% Its basic derivation from \texttt{T1} can be easily described: Slots +% 0--63, 64--127, and 192--255 have exactly the same contents as in the +% \texttt{T1} encoding, whilst slots 128--191 can be used in any way +% the font designer wants; the set of commands, syntactic ligatures, +% and directly usable characters is exactly the same as in the +% \texttt{T1} encoding. The result of my intention to give a formal +% description of the encoding might of course be that this description +% deviates slightly from the above, but it lines out the basic ideas. +% +% The reasons for choosing this basis are pretty arbitrary, especially +% in terms of the assignment of slots. To begin with it gives a simple +% rule (the 256 slots in the font are divided into four continuous blocks +% of 64 slots each) and secondly almost all glyphs in slot ranges 0--63, +% 64--127, and 192--255 can be found in many popular fonts, but most of +% the glyphs in the slot range 128--191 are hard to find. Hence these +% glyphs will very frequently have to be made somehow anyway, the question +% is only at what time this will happen: At the time \TeX\ is running, or +% afterwards, when a virtual font is interpreted? The character usually +% looks the same. +% +% That is not the same thing as saying that it does not matter which, +% because it may well do. \TeX\ will not automatically hyphenate words +% containing letters that are not a single character in the font, so some +% care is necessary. It is however the case that documents that both use and +% require hyphenation of all the accented characters that appear in +% slots 128--191 are extremely few (or do no exist at all---yet), so +% there are usually plenty of slots available for the font designer to +% put, for example, additional ligatures in. It might however well be that +% two different implementations of the same font (presumably made on +% different locations) have kept different sets of characters, due to +% the fact that the two implementors speak different languages and hence +% need hyphentation of different sets of accented letters. This causes no +% problems (unless the implementors are exchanging \texttt{dvi} files), as +% the code in the font definition files would mirror this difference and +% set up the variable commands correctly anyhow, so that exchanging +% \texttt{.tex} manuscripts does not cause problems. +% +% Now for the more formal description, with reservation for that (i) I +% might have missed some point about the \texttt{T1} encoding, lacking a +% formal definition of that and (ii) the current version of the +% \texttt{T1R} encoding is only a beta, so some details may well change +% in the future. In particular, the decisions about whether a +% composition should be a composition of a variant or a composition of +% the main variable command were usually pretty randomly made, so if +% someone should present me with a good reason why it should not be as +% it currently is, then there is a good chance I would change +% it\footnote{Unless too many people's code have already come to depend +% on it. But in that case, there is always the possibility to make new +% encoding that differs from \texttt{T1R} only in a few such points and +% recommend people to use that instead.}. +% +% +% \subsection{The coding scheme} +% +% \begin{table} +% \DeleteShortVerb{\|} +% \begin{center} +% \begin{tabular}{|rrrl|rrrl|} +% \hline +% \multicolumn{3}{|c}{Slot}& \multicolumn{1}{c}{Glyph}& +% \multicolumn{3}{|c}{Slot}& \multicolumn{1}{c|}{Glyph}% +% \\[-0.9\ht\strutbox] +% \multicolumn{3}{|c}{\hrulefill}&\hrulefill& +% \multicolumn{3}{|c}{\hrulefill}&\hrulefill\\ +% \underline{Oct.}& \underline{Dec.}& \underline{Hex.}&& +% \underline{Oct.}& \underline{Dec.}& \underline{Hex.}&\\ +% \inbases{0}&\glyph{\`{}}{grave accent}& +% \inbases{32}&\glyph{\textvisiblespace}{visible space}\\ +% \inbases{1}&\glyph{\'{}}{acute accent}& +% \inbases{33}&\glyph{!}{}\\ +% \inbases{2}&\glyph{\^{}}{circumflex accent}& +% \inbases{34}&\glyph{"}{quotedbl}\\ +% \inbases{3}&\glyph{\~{}}{tilde accent}& +% \inbases{35}&\glyph{\#}{}\\ +% \inbases{4}&\glyph{\"{}}{dieresis}& +% \inbases{36}&\glyph{\$}{}\\ +% \inbases{5}&\glyph{}{Hungarian umlaut}& +% \inbases{37}&\glyph{\%}{}\\ +% \inbases{6}&\glyph{\r{}}{ring accent}& +% \inbases{38}&\glyph{\&}{}\\ +% \inbases{7}&\glyph{\v{}}{caron accent}& +% \inbases{39}&\glyph{'}{quoteright}\\ +% \inbases{8}&\glyph{\u{}}{breve accent}& +% \inbases{40}&\glyph{(}{}\\ +% \inbases{9}&\glyph{\={}}{macron accent}& +% \inbases{41}&\glyph{)}{}\\ +% \inbases{10}&\glyph{}{dot accent}& +% \inbases{42}&\glyph{*}{asterisk}\\ +% \inbases{11}&\glyph{\char24}{cedilla accent}& +% \inbases{43}&\glyph{+}{}\\ +% \inbases{12}&\glyph{}{ogonek accent}& +% \inbases{44}&\glyph{,}{comma}\\ +% \inbases{13}&\glyph{}{quotesinglbase}& +% \inbases{45}&\glyph{-}{hyphen}\\ +% \inbases{14}&\glyph{}{guilsinglleft}& +% \inbases{46}&\glyph{.}{}\\ +% \inbases{15}&\glyph{}{guilsinglright}& +% \inbases{47}&\glyph{/}{slash}\\ +% \inbases{16}&\glyph{}{quotedblleft}& +% \inbases{48}&\glyph{0}{zero}\\ +% \inbases{17}&\glyph{}{quotedblright}& +% \inbases{49}&\glyph{1}{}\\ +% \inbases{18}&\glyph{}{quotedblbase}& +% \inbases{50}&\glyph{2}{}\\ +% \inbases{19}&\glyph{}{guillemotleft}& +% \inbases{51}&\glyph{3}{}\\ +% \inbases{20}&\glyph{}{guillemotright}& +% \inbases{52}&\glyph{4}{}\\ +% \inbases{21}&\glyph{}{endash}& +% \inbases{53}&\glyph{5}{}\\ +% \inbases{22}&\glyph{}{emdash}& +% \inbases{54}&\glyph{6}{}\\ +% \inbases{23}&\glyph{}{compwordmark}& +% \inbases{55}&\glyph{7}{}\\ +% \inbases{24}&\glyph{}{perthousandzero}& +% \inbases{56}&\glyph{8}{}\\ +% \inbases{25}&\glyph{\i}{dotlessi}& +% \inbases{57}&\glyph{9}{}\\ +% \inbases{26}&\glyph{\j}{dotlessj}& +% \inbases{58}&\glyph{:}{}\\ +% \inbases{27}¬ specified& +% \inbases{59}&\glyph{;}{}\\ +% \inbases{28}¬ specified& +% \inbases{60}&\glyph{<}{}\\ +% \inbases{29}¬ specified& +% \inbases{61}&\glyph{=}{}\\ +% \inbases{30}¬ specified& +% \inbases{62}&\glyph{>}{}\\ +% \inbases{31}¬ specified& +% \inbases{63}&\glyph{?}{}\\ +% \hline +% \end{tabular} +% \end{center} +% \caption{The coding scheme for the \texttt{T1R} encoding, +% slots 0--63} +% \label{Block0} +% \MakeShortVerb{\|} +% \end{table} +% \begin{table} +% \DeleteShortVerb{\|} +% \begin{center} +% \begin{tabular}{|rrrl|rrrl|} +% \hline +% \multicolumn{3}{|c}{Slot}& \multicolumn{1}{c}{Glyph}& +% \multicolumn{3}{|c}{Slot}& \multicolumn{1}{c|}{Glyph}% +% \\[-0.9\ht\strutbox] +% \multicolumn{3}{|c}{\hrulefill}&\hrulefill& +% \multicolumn{3}{|c}{\hrulefill}&\hrulefill\\ +% \underline{Oct.}& \underline{Dec.}& \underline{Hex.}&& +% \underline{Oct.}& \underline{Dec.}& \underline{Hex.}&\\ +% \inbases{64}&\glyph{@}{}& \inbases{96}&\glyph{`}{quoteleft}\\ +% \inbases{65}&\glyph{A}{}& \inbases{97}&\glyph{a}{}\\ +% \inbases{66}&\glyph{B}{}& \inbases{98}&\glyph{b}{}\\ +% \inbases{67}&\glyph{C}{}& \inbases{99}&\glyph{c}{}\\ +% \inbases{68}&\glyph{D}{}& \inbases{100}&\glyph{d}{}\\ +% \inbases{69}&\glyph{E}{}& \inbases{101}&\glyph{e}{}\\ +% \inbases{70}&\glyph{F}{}& \inbases{102}&\glyph{f}{}\\ +% \inbases{71}&\glyph{G}{}& \inbases{103}&\glyph{g}{}\\ +% \inbases{72}&\glyph{H}{}& \inbases{104}&\glyph{h}{}\\ +% \inbases{73}&\glyph{I}{}& \inbases{105}&\glyph{i}{}\\ +% \inbases{74}&\glyph{J}{}& \inbases{106}&\glyph{j}{}\\ +% \inbases{75}&\glyph{K}{}& \inbases{107}&\glyph{k}{}\\ +% \inbases{76}&\glyph{L}{}& \inbases{108}&\glyph{l}{}\\ +% \inbases{77}&\glyph{M}{}& \inbases{109}&\glyph{m}{}\\ +% \inbases{78}&\glyph{N}{}& \inbases{110}&\glyph{n}{}\\ +% \inbases{79}&\glyph{O}{}& \inbases{111}&\glyph{o}{}\\ +% \inbases{80}&\glyph{P}{}& \inbases{112}&\glyph{p}{}\\ +% \inbases{81}&\glyph{Q}{}& \inbases{113}&\glyph{q}{}\\ +% \inbases{82}&\glyph{R}{}& \inbases{114}&\glyph{r}{}\\ +% \inbases{83}&\glyph{S}{}& \inbases{115}&\glyph{s}{}\\ +% \inbases{84}&\glyph{T}{}& \inbases{116}&\glyph{t}{}\\ +% \inbases{85}&\glyph{U}{}& \inbases{117}&\glyph{u}{}\\ +% \inbases{86}&\glyph{V}{}& \inbases{118}&\glyph{v}{}\\ +% \inbases{87}&\glyph{W}{}& \inbases{119}&\glyph{w}{}\\ +% \inbases{88}&\glyph{X}{}& \inbases{120}&\glyph{x}{}\\ +% \inbases{89}&\glyph{Y}{}& \inbases{121}&\glyph{y}{}\\ +% \inbases{90}&\glyph{Z}{}& \inbases{122}&\glyph{z}{}\\ +% \inbases{91}&\glyph{[}{}& \inbases{123}&\glyph{\char`\{}{}\\ +% \inbases{92}&\glyph{\char`\\}{}& +% \inbases{124}&\glyph{|}{}\\ +% \inbases{93}&\glyph{]}{}& \inbases{125}&\glyph{\char`\}}{}\\ +% \inbases{94}&\glyph{\char`\^}{circumflex character}& +% \inbases{126}&\glyph{\char`\~}{tilde character}\\ +% \inbases{95}&\glyph{\_}{}& \inbases{127}&\glyph{}{hyphenchar}\\ +% \hline +% \end{tabular} +% \end{center} +% \caption{The coding scheme for the \texttt{T1R} encoding, +% slots 64--127} +% \label{Block1} +% \MakeShortVerb{\|} +% \end{table} +% \begin{table} +% \DeleteShortVerb{\|} +% \begin{center} +% \begin{tabular}{|rrrl|rrrl|} +% \hline +% \multicolumn{3}{|c}{Slot}& \multicolumn{1}{c}{Glyph}& +% \multicolumn{3}{|c}{Slot}& \multicolumn{1}{c|}{Glyph}% +% \\[-0.9\ht\strutbox] +% \multicolumn{3}{|c}{\hrulefill}&\hrulefill& +% \multicolumn{3}{|c}{\hrulefill}&\hrulefill\\ +% \underline{Oct.}& \underline{Dec.}& \underline{Hex.}&& +% \underline{Oct.}& \underline{Dec.}& \underline{Hex.}&\\ +% \inbases{192}&\glyph{\`A}{}& \inbases{224}&\glyph{\`a}{}\\ +% \inbases{193}&\glyph{\'A}{}& \inbases{225}&\glyph{\'a}{}\\ +% \inbases{194}&\glyph{\^A}{}& \inbases{226}&\glyph{\^a}{}\\ +% \inbases{195}&\glyph{\~A}{}& \inbases{227}&\glyph{\~a}{}\\ +% \inbases{196}&\glyph{\"A}{}& \inbases{228}&\glyph{\"a}{}\\ +% \inbases{197}&\glyph{\r{A}}{}& \inbases{229}&\glyph{\r{a}}{}\\ +% \inbases{198}&\glyph{\AE}{}& \inbases{230}&\glyph{\ae}{}\\ +% \inbases{199}&\glyph{\c{C}}{}& \inbases{231}&\glyph{\c{c}}{}\\ +% \inbases{200}&\glyph{\`E}{}& \inbases{232}&\glyph{\`e}{}\\ +% \inbases{201}&\glyph{\'E}{}& \inbases{233}&\glyph{\'e}{}\\ +% \inbases{202}&\glyph{\^E}{}& \inbases{234}&\glyph{\^e}{}\\ +% \inbases{203}&\glyph{\"E}{}& \inbases{235}&\glyph{\"e}{}\\ +% \inbases{204}&\glyph{\`I}{}& \inbases{236}&\glyph{\`\i}{}\\ +% \inbases{205}&\glyph{\'I}{}& \inbases{237}&\glyph{\'\i}{}\\ +% \inbases{206}&\glyph{\^I}{}& \inbases{238}&\glyph{\^\i}{}\\ +% \inbases{207}&\glyph{\"I}{}& \inbases{239}&\glyph{\"\i}{}\\ +% \inbases{208}&\glyph{}{Eth}& \inbases{240}&\glyph{}{eth}\\ +% \inbases{209}&\glyph{\~N}{}& \inbases{241}&\glyph{\~n}{}\\ +% \inbases{210}&\glyph{\`O}{}& \inbases{242}&\glyph{\`o}{}\\ +% \inbases{211}&\glyph{\'O}{}& \inbases{243}&\glyph{\'o}{}\\ +% \inbases{212}&\glyph{\^O}{}& \inbases{244}&\glyph{\^o}{}\\ +% \inbases{213}&\glyph{\~O}{}& \inbases{245}&\glyph{\~o}{}\\ +% \inbases{214}&\glyph{\"O}{}& \inbases{246}&\glyph{\"o}{}\\ +% \inbases{215}&\glyph{\OE}{OE}& \inbases{247}&\glyph{\oe}{}\\ +% \inbases{216}&\glyph{\O}{}& \inbases{248}&\glyph{\o}{}\\ +% \inbases{217}&\glyph{\`U}{}& \inbases{249}&\glyph{\`u}{}\\ +% \inbases{218}&\glyph{\'U}{}& \inbases{250}&\glyph{\'u}{}\\ +% \inbases{219}&\glyph{\^U}{}& \inbases{251}&\glyph{\^u}{}\\ +% \inbases{220}&\glyph{\"U}{}& \inbases{252}&\glyph{\"u}{}\\ +% \inbases{221}&\glyph{\'Y}{}& \inbases{253}&\glyph{\'y}{}\\ +% \inbases{222}&\glyph{}{Thorn}& \inbases{254}&\glyph{}{thorn}\\ +% \inbases{223}&\glyph{}{SS}& +% \inbases{255}&\glyph{\ss}{germandbls}\\ +% \hline +% \end{tabular} +% \end{center} +% \caption{The coding scheme for the \texttt{T1R} encoding, +% slots 192--255} +% \label{Block3} +% \MakeShortVerb{\|} +% \end{table} +% +% Every coding scheme for a \texttt{T1R} encoded font should comply to what +% is specified in Tables \ref{Block0}, \ref{Block1}, and \ref{Block3}. +% The corresponding table for slots 128--191 would read ``not specified'' +% in every entry in the glyph columns, so it has been omitted. `not +% specified' means that the contents of that slot is not specified, so it +% is completely up to the font designer to decide, although there is always +% a default glyph even for the unassigned slots (viz.\ the same glyph as +% in the \texttt{T1} encoding). In most cases, there must be some +% font-dependent command variant definitions in the font definition file for +% each slot that deviates from the default. +% +% The author is guaranteed to be able to access the characters in slots +% 32--126 simply through character tokens. +% +% +% \subsection{The syntactic ligatures} +% % +% \begin{table} +% \begin{center} +% \DeleteShortVerb{\|} +% \begin{tabular}{|lclcl|} +% \hline +% \tLIG{-}{hyphen}{-}{hyphen}{}{endash}\\ +% \tLIG{}{endash}{-}{hyphen}{}{emdash}\\ +% \tLIG{!}{}{`}{}{!`}{}\\ +% \tLIG{'}{}{'}{}{}{quotedblright}\\ +% \tLIG{,}{}{,}{}{}{quotedblbase}\\ +% \tLIG{-}{hyphen}{}{hyphenchar}{}{hyphenchar}\\ +% \tLIG{<}{}{<}{}{}{guillemotleft}\\ +% \tLIG{>}{}{>}{}{}{guillemotright}\\ +% \tLIG{?}{}{`}{}{?`}{}\\ +% \tLIG{`}{}{`}{}{}{quotedblleft}\\ +% \hline +% \end{tabular} +% \MakeShortVerb{\|} +% \end{center} +% \caption{The required syntactic ligatures in the \texttt{T1R} +% encoding} +% \label{Ligatures} +% \end{table} +% The required syntactic ligatures in the \texttt{T1R} encoding are +% listed in Table \ref{Ligatures}. Actually, the +% \LIG{-}{hyphen}{}{hyphenchar}{}{hyphenchar} ligature is a kind of +% ``semi-aestetic'' ligature, as it might have an aestetic function as +% well as a syntactic. When \TeX\ hyphenates a word, a +% \glyph{}{hyphenchar} is automatically inserted at the hyphenation point, +% but when the hyphenation point falls immediately after an explicit +% hyphen, this would result in two hyphens in the printed output, if it +% was not for this ligature. If you know what you do, you may change or +% even leave this ligature out, but be prepared that such an action must +% be attuned to, amongst other things, the hyphenation patterns and the +% current value of the \TeX\ font parameter |\hyphenchar|. +% +% +% \subsection{The font dimensions} +% % +% \begin{table} +% \begin{center} +% \DeleteShortVerb{\|} +% \begin{tabular}{|rl|rl|} +% \hline +% No.& Meaning& No.& Meaning\\[-0.9\ht\strutbox] +% \hrulefill&\hrulefill&\hrulefill&\hrulefill\\ +% 1& Slant per pt& 5& x-height (size of 1\thinspace ex)\\ +% 2& Interword space& 6& Quad width (size of 1\thinspace em)\\ +% 3& Interword stretch& 7& Extra space\\ +% 4& Interword shrink&&\\ +% \hline +% \end{tabular} +% \MakeShortVerb{\|} +% \end{center} +% \caption{Required \cs{fontdimen}s in an \texttt{T1R} encoded font} +% \label{fontdimens} +% \end{table} +% % +% As for the required font dimensions, I have chosen to only require +% the seven font dimensions that all \TeX\ fonts have in common. These +% are listed in Table \ref{fontdimens}. As both the \texttt{ec} family +% of fonts and the \texttt{T1} encoded fonts made by \textit{fontinst} +% (as of v\,1.8, see~\cite{fontinst}) have seven more however, it seems +% like that set of fourteen font dimensions should be considered the +% current \texttt{T1} standard. I will probably have added the other seven +% by the time I get to the first non-beta release, but I have refrained +% from including them in this release since I do not feel sure enough +% about what they are to write a formal specification for them. It should +% be noted, though, that the specification only lists a minimal set of +% font dimensions---therefore including the other seven in a font is most +% likely only good. +% +% +% \subsection{The font-dependent commands} +% % +% The font-dependent commands of the \texttt{T1R} encoding fall into two +% categories: symbol commands and accenting commands. The symbol +% commands simply typeset one symbol. The accenting commands take one +% argument and typesets the result of accenting the material that the +% argument would typeset. +% +% \begin{table} +% \vspace*{0pt minus 1.5cm} +% \begin{center} +% \small +% \DeleteShortVerb{\|} +% \begin{tabular}{|l l l|} +% \hline \MakeShortVerb{\|}^^A +% Command& Action& Remark\\[-0.9\ht\strutbox] +% \hrulefill&\hrulefill&\hrulefill\\ +% |\AE|& Typeset \glyph{\AE}{}&\\ +% |\ae|& Typeset \glyph{\ae}{}&\\ +% |\DH|& Typeset \glyph{}{Eth}&\\ +% |\dh|& Typeset \glyph{}{eth}&\\ +% |\DJ|& Typeset \glyph{}{Eth}&\\ +% |\dj|& Typeset \glyph{}{dbar}& Variable\\ +% |\guillemotleft|& Typeset \glyph{}{guillemotleft}&\\ +% |\guillemotright|& Typeset \glyph{}{guillemotright}&\\ +% |\guilsinglleft|& Typeset \glyph{}{guilsinglleft}&\\ +% |\guilsinglright|& Typeset \glyph{}{guilsinglright}&\\ +% |\i|& Typeset \glyph{\i}{dotlessi}&\\ +% |\j|& Typeset \glyph{\j}{dotlessj}&\\ +% |\L|& Typeset \glyph{}{Lslash}& Variable\\ +% |\l|& Typeset \glyph{}{lslash}& Variable\\ +% |\NG|& Typeset \glyph{}{Eng}& Variable\\ +% |\ng|& Typeset \glyph{}{eng}& Variable\\ +% |\OE|& Typeset \glyph{\OE}{OE}&\\ +% |\oe|& Typeset \glyph{\oe}{}&\\ +% |\O|& Typeset \glyph{\O}{}&\\ +% |\o|& Typeset \glyph{\o}{}&\\ +% |\quotedblbase|& Typeset \glyph{}{quotedblbase}&\\ +% |\quotesinglbase|& Typeset \glyph{}{quotesinglbase}&\\ +% |\SS|& Typeset \glyph{}{SS}& Variable\\ +% |\ss|& Typeset \glyph{\ss}{}&\\ +% |\textasciicircum|& Typeset \glyph{\char`\^}{circumflex character}&\\ +% |\textasciitilde|& Typeset \glyph{\char`\~}{tilde character}&\\ +% |\textbackslash|& Typeset \glyph{\char`\\}{}&\\ +% |\textbar|& Typeset \glyph{\char`\|}{}&\\ +% |\textbraceleft|& Typeset \glyph{\char`\{}{}&\\ +% |\textbraceright|& Typeset \glyph{\char`\}}{}&\\ +% |\textcompwordmark|& Typeset \glyph{}{compwordmark}&\\ +% |\textdollar|& Typeset \glyph{\$}{}&\\ +% |\textemdash|& Typeset \glyph{}{emdash}&\\ +% |\textendash|& Typeset \glyph{}{endash}&\\ +% |\textexclamdown|& Typeset \glyph{!`}{}& Variable\\ +% |\textgreater|& Typeset \glyph{>}{}&\\ +% |\textless|& Typeset \glyph{<}{}&\\ +% |\textperthousand|& Typeset \glyph{\%}{} followed by +% one \glyph{}{perthousandzero}&\\ +% |\textpertenthousand|& Typeset \glyph{\%}{} followed by +% two \glyph{}{perthousandzero}&\\ +% |\textquestiondown|& Typeset \glyph{?`}{}& Variable\\ +% |\textquotedblleft|& Typeset \glyph{}{quotedblleft}&\\ +% |\textquotedblright|& Typeset \glyph{}{quotedblright}&\\ +% |\textquotedbl|& Typeset \glyph{"}{quotedbl}&\\ +% |\textquoteleft|& Typeset \glyph{`}{}&\\ +% |\textquoteright|& Typeset \glyph{'}{}&\\ +% |\textsection|& Typeset \glyph{}{section}& Variable\\ +% |\textsterling|& Typeset \glyph{}{sterling}& Variable\\ +% |\textunderscore|& Typeset \glyph{\_}{}&\\ +% |\textvisiblespace|& Typeset \glyph{\char`\ }{}&\\ +% |\TH|& Typeset \glyph{}{Thorn}&\\ +% |\th|& Typeset \glyph{}{thorn}&\\ +% \hline +% \end{tabular} +% \end{center} +% \caption{The symbol commands of the \texttt{T1R} encoding} +% \label{SymbolCommands} +% \end{table} +% \begin{table} +% \begin{center} +% \DeleteShortVerb{\|} +% \begin{tabular}{|c p{0.35\linewidth} p{0.4\linewidth}|} +% \hline \MakeShortVerb{\|}^^A +% Command& Action& Remark\\[-0.9\ht\strutbox] +% \hrulefill&\hrulefill&\hrulefill\\ +% |\`|& Typeset the argument with a grave accent above it& +% Compositions for |A|, |a|, |E|, |e|, |I|, |i|, |\i|, |O|, |o|, +% |U|, and |u|\\ +% |\'|& Typeset the argument with an acute accent above it& +% Compositions for |A|, |a|, |C| (var.), |c| (var.), |E|, |e|, |I|, +% |i|, |\i|, |L| (var.), |l| (var.), |N| (var.), |n| (var.), |O|, +% |o|, |R| (var.), |r| (var.), |S| (var.), |s| (var.), |U|, |u|, +% |Y|, |y|, |Z| (var.), and |z| (var.)\\ +% |\^|& Typeset the argument with a circumflex accent above it& +% Compositions for |A|, |a|, |E|, |e|, |I|, |i|, |\i|, |O|, |o|, +% |U|, and |u|\\ +% |\~|& Typeset the argument with a tilde accent above it& +% Compositions for |A|, |a|, |N|, |n|, |O|, and |o|\\ +% |\"|& Typeset the argument with a dieresis accent above it& +% Compositions for |A|, |a|, |E|, |e|, |I|, |i|, |\i|, |O|, |o|, +% |U|, |u|, |Y| (var.), and |y| (var.)\\ +% |\H|& Typeset the argument with a Hungarian umlaut above it& +% Variable; compositions of the encoding level variant for |O|, +% |o|, |U|, and |u|\\ +% |\r|& Typeset the argument with a ring accent above it& +% Compositions for |A|, |a|, |U| (var.), and |u| (var.)\\ +% |\v|& Typeset the argument with a caron accent above it& +% Variable; compositions of the encoding level variant for |C|, +% |c|, |D|, |d|, |E|, |e|, |L|, |l|, |N|, |n|, |R|, |r|, |S|, |s|, +% |T|, |t|, |Z|, and |z|\\ +% |\u|& Typeset the argument with a breve accent above it& +% Variable; compositions of the encoding level variant for |A|, +% |a|, |G|, and |g|\\ +% |\=|& Typeset the argument with a macron accent above it&\\ +% |\.|& Typeset the argument with a dot accent above it& +% Variable; compositions of the encoding level variant for |I|, +% |i|, |Z|, and |z|\\ +% |\b|& Typeset the argument with a macron accent under it&\\ +% |\c|& Typeset the argument with a cedilla accent under it& +% Variable; compositions for |C|, |c|, |S| (var.), |s| (var.), +% |T| (var.), and |t| (var.)\\ +% |\d|& Typeset the argument with a dot accent under it&\\ +% |\k|& Typeset the argument with an ogonek accent under it& +% Variable; compositions of the encoding level variant for |A|, +% |a|, |E|, and |e|\\ +% \hline +% \end{tabular} +% \end{center} +% \caption{The accenting commands of the \texttt{T1R} encoding} +% \label{AccentCommands} +% \end{table} +% +% A list of the symbol commands of the \texttt{T1R} encoding can be found +% in Table~\ref{SymbolCommands}. One thing worth noticing about this table +% is that it lists some glyphs, for example \glyph{}{sterling}, that are +% not listed in the required coding scheme, yet the font designer is required +% to provide the author with these. Normally this would be done by simply +% including the glyph in the font in the same slot as in the \texttt{T1} +% encoding, but if a large number of slots must be used for other +% glyphs, such as ligatures, then this may not be possible. In such +% cases the symbol command could instead typeset a symbol in +% \emph{another} font. This could be done with a definition such as +% \begin{list}{\labelitemi\MacroFont +% \csname @beginparpenalty\endcsname=\predisplaypenalty +% \csname @endparpenalty\endcsname=\postdisplaypenalty +% }{} +% \item[] +% |\DefineTextCommandVariant|\,|{\textsterling}|\,|{T1R}|\,|{zcm}|\,^^A +% |{}|\,|{}|\,|%|\\ +% | {|\,|\UseTextSymbol|\,|{T1}|\,|{\textsterling}|\,|}| +% \clubpenalty=10000 +% \end{list} +% In order to make this particular piece of code work, the font designer +% would of course need to set up an entire family of \texttt{T1}-encoded +% fonts in parallell with the main \texttt{T1R}-encoded font family. +% Alternatively, one could instead collect all these miscellaneous +% glyphs from an entire family in one font (that would probably become +% \texttt{U}-encoded), but then one needs to define a lot more variants. +% In any case, this trick of implementing a command as using a glyph in +% another font cannot be used for \glyph{!`}{} and \glyph{?`}{}, as these +% need to be accessible through syntactic ligatures as well. What's +% more, font designers to be should be aware that one cannot have kerns +% between two glyphs in different fonts. +% +% A list of the accenting commands of the \texttt{T1R} encoding can be +% found in Table~\ref{AccentCommands}. It is hardly exciting, but the +% font designer should find the information in the `Remark' column +% interesting; it lists all the compositions of the accenting commands +% and whether they are implemented as compositions of the main command +% or compositions of some variant. +% +% +% \subsection{On hyphenation patterns for the \texttt{T1R} encoding} +% \label{Hyph} +% % +% \TeX\ is constructed so that the hyphenation patterns must match the +% coding scheme of the font used for the text that is to be hyphenated. +% It is therefore possible that hyphenation patterns made for use with +% the \texttt{T1} encoding does not always work with the \texttt{T1R} +% encoding. They will work, however, with a font whose coding scheme +% deviates from that of the \texttt{T1} encoding only in that some +% ligatures (or possibly some symbols that never occur as part of a +% word) has replaced some letters. This is because when \TeX\ hyphenates +% a word, it treats a ligature as the sequence of letters it is composed +% from and not as the single character it may be in the font. It does +% not matter whether there is a hyphenation pattern mensioning character +% $n$ or not when character $n$ occurs in the output only as a ligature +% of other characters. +% +% Even in other cases, there is a good chance that hyphenation +% patterns made for use with the \texttt{T1} encoding will work without +% modification for a font with the \texttt{T1R} encoding. The main +% reason for this is that one usually does not have hyphenation patterns +% involving letters of which one does not intend to form automatically +% hyphenatable words active. If one wants hyphenation of words containing +% a certain character, one also wants it to have a slot of its own in the +% coding scheme of the font. In most cases, this means that the character +% is in the same slot as in the \texttt{T1} encoding. +% +% +% +% \section{Implementation} +% \StopEventually{} +% First the file announces itself. +% +% \begin{macrocode} +%<*encoding> +\ProvidesFile{t1renc.def} + [1998/12/17 Relaxed TeX latin text encoding, version 1.00 (beta)] +% \end{macrocode} +% +% Then there is a check for if the \package{relenc} package has been read. +% If it hasn't, there is no point in contiuing. +% \begin{macrocode} +\@ifundefined{RE@text@variable}{% + \PackageError{T1R encoding}{% + The definition of the T1R encoding requires that\MessageBreak + the `relenc' package is loaded first}% + {The T1R encoding cannot be defined.\MessageBreak + If you continue, you will most likely face further errors.% + \MessageBreak The best option is to type `x' and fix your + manuscript.}% + \endinput +}{} +% \end{macrocode} +% +% The encoding declares itself and its font substitution. +% \begin{macrocode} +\DeclareFontEncoding{T1R}{}{} +\DeclareFontSubstitution{T1R}{zcm}{m}{n} +% \end{macrocode} +% +% The search path is set; this is something only relaxed encodings do. +% The most noteworthy point about this search path is that it includes +% searching for definitions from the \texttt{T1} encoding. Thanks to +% this, the \texttt{T1R} encoding can do without definitions of its own +% for many variable commands (saving some memory), so the lines defining +% these have been commented out below. +% \begin{macrocode} +\SetEncodingSearchPath{T1R}{ + {\cf@encoding/\f@family/\f@series/\f@shape} + {\cf@encoding/\f@family/?/\f@shape} + {\cf@encoding/\f@family/?/?} + {\cf@encoding/?/?/?} + {\RE@convert@nfss{T1}} + {\RE@convert@nfss{?}} +} +% \end{macrocode} +% +% The accenting commands are declared. I have choosen to use the same +% default definitions as in the \texttt{T1} encoding, despite the fact +% that the definitions used for |\c| and |\k| do not always do what +% they should (accents are positioned in curious places). These commands +% are declared to be variable though, so a font designer can override +% them with ones that are better suited for the font family in question. +% \begin{macrocode} +\DeclareTextAccent{\`}{T1R}{0} +\DeclareTextAccent{\'}{T1R}{1} +\DeclareTextAccent{\^}{T1R}{2} +\DeclareTextAccent{\~}{T1R}{3} +\DeclareTextAccent{\"}{T1R}{4} +\DeclareTextVariableAccent{\H}{T1R}{5} +\DeclareTextAccent{\r}{T1R}{6} +\DeclareTextVariableAccent{\v}{T1R}{7} +\DeclareTextVariableAccent{\u}{T1R}{8} +\DeclareTextAccent{\=}{T1R}{9} +\DeclareTextVariableAccent{\.}{T1R}{10} +\DeclareTextCommand{\b}{T1R}[1] + {{\o@lign{\relax#1\crcr\hidewidth\sh@ft{29}% + \vbox to.2ex{\hbox{\char9}\vss}\hidewidth}}} +\DeclareTextVariableCommand{\c}{T1R}[1] + {\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent11 #1% + \else{\ooalign{\hidewidth\char11\hidewidth + \crcr\unhbox\z@}}\fi} +\DeclareTextCommand{\d}{T1R}[1] + {{\o@lign{\relax#1\crcr\hidewidth\sh@ft{10}.\hidewidth}}} +\DeclareTextVariableCommand{\k}{T1R}[1] + {\oalign{\null#1\crcr\hidewidth\char12}} +% \end{macrocode} +% +% The symbol commands are declared. These are pretty straightforward, +% but \glyph{}{SS} is a bit of a special case. The command |\SS| must +% exist as the upper case equivalent of |\ss|, but is there any case +% where the \glyph{}{SS} glyph is different from two S's?\footnote{I am +% currently thinking about removing the \glyph{}{SS} glyph from the +% required coding scheme, so if anyone has any opinions on this +% particular matter, please share them with me.} +% \begin{macrocode} +\DeclareTextSymbol{\AE}{T1R}{198} +\DeclareTextSymbol{\DH}{T1R}{208} +\DeclareTextSymbol{\DJ}{T1R}{208} +\DeclareTextVariableSymbol{\L}{T1R}{138} +\DeclareTextVariableSymbol{\NG}{T1R}{141} +\DeclareTextSymbol{\OE}{T1R}{215} +\DeclareTextSymbol{\O}{T1R}{216} +\DeclareTextVariableSymbol{\SS}{T1R}{223} +\DeclareTextSymbol{\TH}{T1R}{222} +\DeclareTextSymbol{\ae}{T1R}{230} +\DeclareTextSymbol{\dh}{T1R}{240} +\DeclareTextVariableSymbol{\dj}{T1R}{158} +\DeclareTextSymbol{\guillemotleft}{T1R}{19} +\DeclareTextSymbol{\guillemotright}{T1R}{20} +\DeclareTextSymbol{\guilsinglleft}{T1R}{14} +\DeclareTextSymbol{\guilsinglright}{T1R}{15} +\DeclareTextSymbol{\i}{T1R}{25} +\DeclareTextSymbol{\j}{T1R}{26} +\DeclareTextVariableSymbol{\l}{T1R}{170} +\DeclareTextVariableSymbol{\ng}{T1R}{173} +\DeclareTextSymbol{\oe}{T1R}{247} +\DeclareTextSymbol{\o}{T1R}{248} +\DeclareTextSymbol{\quotedblbase}{T1R}{18} +\DeclareTextSymbol{\quotesinglbase}{T1R}{13} +\DeclareTextSymbol{\ss}{T1R}{255} +\DeclareTextSymbol{\textasciicircum}{T1R}{`\^} +\DeclareTextSymbol{\textasciitilde}{T1R}{`\~} +\DeclareTextSymbol{\textbackslash}{T1R}{`\\} +\DeclareTextSymbol{\textbar}{T1R}{`\|} +\DeclareTextSymbol{\textbraceleft}{T1R}{`\{} +\DeclareTextSymbol{\textbraceright}{T1R}{`\}} +\DeclareTextSymbol{\textcompwordmark}{T1R}{23} +\DeclareTextSymbol{\textdollar}{T1R}{`\$} +\DeclareTextSymbol{\textemdash}{T1R}{22} +\DeclareTextSymbol{\textendash}{T1R}{21} +\DeclareTextVariableSymbol{\textexclamdown}{T1R}{189} +\DeclareTextSymbol{\textgreater}{T1R}{`\>} +\DeclareTextSymbol{\textless}{T1R}{`\<} +\DeclareTextCommand{\textperthousand}{T1R}{\%\char 24 } +\DeclareTextCommand{\textpertenthousand}{T1R}{\%\char 24\char 24 } +\DeclareTextVariableSymbol{\textquestiondown}{T1R}{190} +\DeclareTextSymbol{\textquotedblleft}{T1R}{16} +\DeclareTextSymbol{\textquotedblright}{T1R}{17} +\DeclareTextSymbol{\textquotedbl}{T1R}{`\"} +\DeclareTextSymbol{\textquoteleft}{T1R}{`\`} +\DeclareTextSymbol{\textquoteright}{T1R}{`\'} +\DeclareTextVariableSymbol{\textsection}{T1R}{159} +\DeclareTextVariableSymbol{\textsterling}{T1R}{191} +\DeclareTextSymbol{\textunderscore}{T1R}{95} +\DeclareTextSymbol{\textvisiblespace}{T1R}{32} +\DeclareTextSymbol{\th}{T1R}{254} +% \end{macrocode} +% +% The last thing to declare are all the compositions. It starts with +% the compositions from block 2 (slots 128--191), which are all in some +% way variable. +% +% $128 = {}$\texttt{"80}. +% \begin{macrocode} +\DefineTextVariantComposition{\.}{T1R}{}{}{}{i}{`\i} +\DefineTextVariantComposition{\u}{T1R}{}{}{}{A}{128} +\DefineTextVariantComposition{\k}{T1R}{}{}{}{A}{129} +\DeclareVariableTextComposition{\'}{T1R}{C} +% \DefineTextCompositionVariant{\'}{T1R}{}{}{}{C}{130} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{C}{131} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{D}{132} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{E}{133} +\DefineTextVariantComposition{\k}{T1R}{}{}{}{E}{134} +\DefineTextVariantComposition{\u}{T1R}{}{}{}{G}{135} +% \end{macrocode} +% +% $136 = {}$\texttt{"88}. +% \begin{macrocode} +\DeclareVariableTextComposition{\'}{T1R}{L} +% \DefineTextCompositionVariant{\'}{T1R}{}{}{}{L}{136} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{L}{137} +\DeclareVariableTextComposition{\'}{T1R}{N} +% \DefineTextCompositionVariant{\'}{T1R}{}{}{}{N}{139} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{N}{140} +\DefineTextVariantComposition{\H}{T1R}{}{}{}{O}{142} +\DeclareVariableTextComposition{\'}{T1R}{R} +% \DefineTextCompositionVariant{\'}{T1R}{}{}{}{R}{143} +% \end{macrocode} +% +% $144 = {}$\texttt{"90}. +% \begin{macrocode} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{R}{144} +\DeclareVariableTextComposition{\'}{T1R}{S} +% \DefineTextCompositionVariant{\'}{T1R}{}{}{}{S}{145} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{S}{146} +\DeclareVariableTextComposition{\c}{T1R}{S} +% \DefineTextCompositionVariant{\c}{T1R}{}{}{}{S}{147} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{T}{148} +\DeclareVariableTextComposition{\c}{T1R}{T} +% \DefineTextCompositionVariant{\c}{T1R}{}{}{}{T}{149} +\DefineTextVariantComposition{\H}{T1R}{}{}{}{U}{150} +\DeclareVariableTextComposition{\r}{T1R}{U} +% \DefineTextCompositionVariant{\r}{T1R}{}{}{}{U}{151} +% \end{macrocode} +% +% $152 = {}$\texttt{"98}. +% \begin{macrocode} +\DeclareVariableTextComposition{\"}{T1R}{Y} +% \DefineTextCompositionVariant{\"}{T1R}{}{}{}{Y}{152} +\DeclareVariableTextComposition{\'}{T1R}{Z} +% \DefineTextCompositionVariant{\'}{T1R}{}{}{}{Z}{153} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{Z}{154} +\DefineTextVariantComposition{\.}{T1R}{}{}{}{Z}{155} +\DefineTextVariantComposition{\.}{T1R}{}{}{}{I}{157} +% \end{macrocode} +% +% $160 = {}$\texttt{"A0}. +% \begin{macrocode} +\DefineTextVariantComposition{\u}{T1R}{}{}{}{a}{160} +\DefineTextVariantComposition{\k}{T1R}{}{}{}{a}{161} +\DeclareVariableTextComposition{\'}{T1R}{c} +% \DefineTextCompositionVariant{\'}{T1R}{}{}{}{c}{162} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{c}{163} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{d}{164} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{e}{165} +\DefineTextVariantComposition{\k}{T1R}{}{}{}{e}{166} +\DefineTextVariantComposition{\u}{T1R}{}{}{}{g}{167} +% \end{macrocode} +% +% $168 = {}$\texttt{"A8}. +% \begin{macrocode} +\DeclareVariableTextComposition{\'}{T1R}{l} +% \DefineTextCompositionVariant{\'}{T1R}{}{}{}{l}{168} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{l}{169} +\DeclareVariableTextComposition{\'}{T1R}{n} +% \DefineTextCompositionVariant{\'}{T1R}{}{}{}{n}{171} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{n}{172} +\DefineTextVariantComposition{\H}{T1R}{}{}{}{o}{174} +\DeclareVariableTextComposition{\'}{T1R}{r} +% \DefineTextCompositionVariant{\'}{T1R}{}{}{}{r}{175} +% \end{macrocode} +% +% $176 = {}$\texttt{"B0}. +% \begin{macrocode} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{r}{176} +\DeclareVariableTextComposition{\'}{T1R}{s} +% \DefineTextCompositionVariant{\'}{T1R}{}{}{}{s}{177} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{s}{178} +\DeclareVariableTextComposition{\c}{T1R}{s} +% \DefineTextCompositionVariant{\c}{T1R}{}{}{}{s}{179} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{t}{180} +\DeclareVariableTextComposition{\c}{T1R}{t} +% \DefineTextCompositionVariant{\c}{T1R}{}{}{}{t}{181} +\DefineTextVariantComposition{\H}{T1R}{}{}{}{u}{182} +\DeclareVariableTextComposition{\r}{T1R}{u} +% \DefineTextCompositionVariant{\r}{T1R}{}{}{}{u}{183} +% \end{macrocode} +% +% $184 = {}$\texttt{"B8}. +% \begin{macrocode} +\DeclareVariableTextComposition{\"}{T1R}{y} +% \DefineTextCompositionVariant{\"}{T1R{}{}{}}{y}{184} +\DeclareVariableTextComposition{\'}{T1R}{z} +% \DefineTextCompositionVariant{\'}{T1R{}{}{}}{z}{185} +\DefineTextVariantComposition{\v}{T1R}{}{}{}{z}{186} +\DefineTextVariantComposition{\.}{T1R}{}{}{}{z}{187} +% \end{macrocode} +% +% Here follows the compositions in block 3 (slots 192--255). They are +% exactly the same as in the \texttt{T1} encoding. +% +% $192 = {}$\texttt{"C0}. +% \begin{macrocode} +\DeclareTextComposite{\`}{T1R}{A}{192} +\DeclareTextComposite{\'}{T1R}{A}{193} +\DeclareTextComposite{\^}{T1R}{A}{194} +\DeclareTextComposite{\~}{T1R}{A}{195} +\DeclareTextComposite{\"}{T1R}{A}{196} +\DeclareTextComposite{\r}{T1R}{A}{197} +\DeclareTextComposite{\c}{T1R}{C}{199} +% \end{macrocode} +% +% $200 = {}$\texttt{"C8}. +% \begin{macrocode} +\DeclareTextComposite{\`}{T1R}{E}{200} +\DeclareTextComposite{\'}{T1R}{E}{201} +\DeclareTextComposite{\^}{T1R}{E}{202} +\DeclareTextComposite{\"}{T1R}{E}{203} +\DeclareTextComposite{\`}{T1R}{I}{204} +\DeclareTextComposite{\'}{T1R}{I}{205} +\DeclareTextComposite{\^}{T1R}{I}{206} +\DeclareTextComposite{\"}{T1R}{I}{207} +% \end{macrocode} +% +% $208 = {}$\texttt{"D0}. +% \begin{macrocode} +\DeclareTextComposite{\~}{T1R}{N}{209} +\DeclareTextComposite{\`}{T1R}{O}{210} +\DeclareTextComposite{\'}{T1R}{O}{211} +\DeclareTextComposite{\^}{T1R}{O}{212} +\DeclareTextComposite{\~}{T1R}{O}{213} +\DeclareTextComposite{\"}{T1R}{O}{214} +% \end{macrocode} +% +% $216 = {}$\texttt{"D8}. +% \begin{macrocode} +\DeclareTextComposite{\`}{T1R}{U}{217} +\DeclareTextComposite{\'}{T1R}{U}{218} +\DeclareTextComposite{\^}{T1R}{U}{219} +\DeclareTextComposite{\"}{T1R}{U}{220} +\DeclareTextComposite{\'}{T1R}{Y}{221} +% \end{macrocode} +% +% $224 = {}$\texttt{"E0}. +% \begin{macrocode} +\DeclareTextComposite{\`}{T1R}{a}{224} +\DeclareTextComposite{\'}{T1R}{a}{225} +\DeclareTextComposite{\^}{T1R}{a}{226} +\DeclareTextComposite{\~}{T1R}{a}{227} +\DeclareTextComposite{\"}{T1R}{a}{228} +\DeclareTextComposite{\r}{T1R}{a}{229} +\DeclareTextComposite{\c}{T1R}{c}{231} +% \end{macrocode} +% +% $232 = {}$\texttt{"E8}. +% \begin{macrocode} +\DeclareTextComposite{\`}{T1R}{e}{232} +\DeclareTextComposite{\'}{T1R}{e}{233} +\DeclareTextComposite{\^}{T1R}{e}{234} +\DeclareTextComposite{\"}{T1R}{e}{235} +\DeclareTextComposite{\`}{T1R}{i}{236} +\DeclareTextComposite{\`}{T1R}{\i}{236} +\DeclareTextComposite{\'}{T1R}{i}{237} +\DeclareTextComposite{\'}{T1R}{\i}{237} +\DeclareTextComposite{\^}{T1R}{i}{238} +\DeclareTextComposite{\^}{T1R}{\i}{238} +\DeclareTextComposite{\"}{T1R}{i}{239} +\DeclareTextComposite{\"}{T1R}{\i}{239} +% \end{macrocode} +% +% $240 = {}$\texttt{"F0}. +% \begin{macrocode} +\DeclareTextComposite{\~}{T1R}{n}{241} +\DeclareTextComposite{\`}{T1R}{o}{242} +\DeclareTextComposite{\'}{T1R}{o}{243} +\DeclareTextComposite{\^}{T1R}{o}{244} +\DeclareTextComposite{\~}{T1R}{o}{245} +\DeclareTextComposite{\"}{T1R}{o}{246} +% \end{macrocode} +% +% $248 = {}$\texttt{"F8}. +% \begin{macrocode} +\DeclareTextComposite{\`}{T1R}{u}{249} +\DeclareTextComposite{\'}{T1R}{u}{250} +\DeclareTextComposite{\^}{T1R}{u}{251} +\DeclareTextComposite{\"}{T1R}{u}{252} +\DeclareTextComposite{\'}{T1R}{y}{253} +%</encoding> +% \end{macrocode} +% +\endinput diff --git a/Master/texmf-dist/source/latex/relenc/t1rzcm.fdd b/Master/texmf-dist/source/latex/relenc/t1rzcm.fdd new file mode 100644 index 00000000000..2be089ec314 --- /dev/null +++ b/Master/texmf-dist/source/latex/relenc/t1rzcm.fdd @@ -0,0 +1,273 @@ +%% \CheckSum{26} +% \iffalse (Comment) +% This file contains a breif description of the T1R/zcm font family, +% the code for its font definition file, and the code the ecsubzcm +% package. +% \fi +% +% \iffalse (Skip the driver code when DocInputting.) +% (The driver code is still enclosed in a macrocode environment, just +% in case.) +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} +\newcommand\package[1]{\textsf{#1}} +\title{The \texttt{zcm} example font family} +\author{Lars Hellstr\"om% + \thanks{E-mail: \texttt{Lars.Hellstrom@math.umu.se}}% +} +\begin{document} +\maketitle +\DocInput{t1rzcm.fdd}\Finale +\begin{thebibliography}{9} +\bibitem{ltoutenc} + Johannes Braams, David Carlisle, Alan Jeffrey, Frank Mittelbach, + Chris Rowley, Rainer Sch\"opf: \texttt{ltoutenc.dtx} (part of the + \LaTeXe\ base distribution). +\end{thebibliography} +\end{document} +%</driver> +% \end{macrocode} +% \fi +% +% \section{The \texttt{zcm} font family and \texttt{reldemo.tex}} +% \label{zcm-family} +% % +% The \texttt{zcm} family of fonts consists of only two fonts and it is +% meant to accompany the \package{relenc} package documentation. These +% fonts are really just combinations of glyphs taken from other fonts, +% primarily the Computer Modern fonts (hence the \texttt{cm}), but +% there are also some glyphs which are taken from some \LaTeX\ symbol +% fonts (\texttt{lasy10} and \texttt{lcircle10}). +% +% The primary reason these fonts exist is that I felt I needed an example +% of what can be done with the \package{relenc} package. As one really +% cannot expect that people will have any font that is not either a +% Computer Modern or a \LaTeX\ font, such an example has to be made +% using these fonts. I am well aware that some of the glyphs look +% terrible, but the \texttt{zcm} family is not intended to be used +% for any serious typesetting. +% +% The font family consists of two fonts: \texttt{zcmr8d} and +% \texttt{zcmra}. The first of these is declared as +% \texttt{T1R}\slash\texttt{zcm}\slash\texttt{m}\slash\texttt{n} and its +% coding scheme is identical to that of the \texttt{T1} encoding. The +% second is declared as \texttt{T1R}\slash\texttt{zcm}\slash +% \texttt{m}\slash\texttt{a} and its coding scheme deviates from that of +% the \texttt{T1} encoding in four slots, which have been reassigned to +% contain ligatures instead of accented letters. +% +% A demonstration of these fonts is generated by typesetting +% \texttt{reldemo.tex}; this document contains a font table listing the +% contents of each slot, a demonstration of all the symbol commands, a +% demonstration of the effects of applying the accenting commands to the +% non-accented letters, and a comprehensive list of character pairs, for +% both fonts. The reason I have put it in a separate file is (i) that +% the \package{relenc} package will have to be installed before these +% fonts can be viewed (the files needed are \texttt{relenc.sty}, +% \texttt{t1renc.def}, and \texttt{t1rzcm.fd}) and (ii) that there +% might be some problems connected to viewing these fonts. +% +% To begin with, both fonts are virtual fonts and some DVI drivers cannot +% handle these. If you only have such drivers, you should get one that +% can (not just for the sake of the \package{relenc} package---virtual +% fonts are in general neat to be able to use). +% +% One of the fonts used to make these virtaul fonts---the +% \texttt{lcircle10} font---occurs under two other names as well: +% \texttt{circle10} and \texttt{lcirc10}. Unfortunately, one cannot +% expect that there is more than one of these in any given \TeX\ ^^A +% installation. Thus you will get some problems if your installation +% uses another name for this font. Some DVI drivers will translate the +% name used in the virtual font to that of the font names which actually +% occurs in the system, and in this case there is no problem, but if not +% then you will have to intervene yourself. +% +% The easiest way to do this is simply to rename a few virtual font +% files, since there are such files accompanying the \package{relenc} +% package for using the \texttt{lcircle10} font under any one of these +% names. What you have to see too is that the ones which use the font +% under the name on your system are the ones which are named +% \texttt{zcmr8d.vf} and \texttt{zcmra.vf} respectively. The following +% table shows what the file names are and which font it uses +% $$ +% \mbox{^^A +% \begin{tabular}{cc} +% Virtual font file& \texttt{lcircle10} name used^^A +% \\[-0.9\ht\strutbox] +% \hrulefill&\hrulefill\\ +% \texttt{zcmr8d.vf}& \texttt{lcricle10}\\ +% \texttt{zcmra.vf}& \texttt{lcricle10}\\ +% \texttt{zcmr8d.vf2}& \texttt{cricle10}\\ +% \texttt{zcmra.vf2}& \texttt{cricle10}\\ +% \texttt{zcmr8d.vf3}& \texttt{lcric10}\\ +% \texttt{zcmra.vf3}& \texttt{lcric10} +% \end{tabular}^^A +% } +% $$ +% Note that all the above files are virtual font files. The reason +% only two have been given the correct suffix \texttt{.vf} is that there +% really are no more than two fonts, so they should not take up any more +% font name space than that either. +% +% Finally, there is one other use for the \texttt{T1R}\slash +% \texttt{zcm}\slash\texttt{m}\slash\texttt{n} font---it is the final +% substitution font in the \texttt{T1R} encoding. \LaTeX\ requires that +% there is such a font, so it might as well be this one. This means that +% you should see to that the files which are this font (\texttt{zcmr8d.tfm} +% and \texttt{zcmr8d.vf}) are put in such locations that \TeX\ and its +% helper programs (DVI drivers etc.) will find them if they are needed. +% You should not need to move them before you typeset \texttt{reldemo.tex} +% for the first time, however, as these fonts are initially in the same +% directory as this and \TeX\ looks for files there first. +% +% If you do have the \texttt{ec} family of fonts however, you may (quite +% understandably) want to use one of them as final substitution font for +% the \texttt{T1R} encoding instead. There is a package called +% \package{ecsubzcm} that is installed with \package{relenc}. This +% package declares the \texttt{zcm} family in encoding \texttt{T1R} and +% \texttt{ecrm1000} under the encoding\slash family\slash series\slash +% shape combination \texttt{T1R}\slash\texttt{zcm}\slash\texttt{m}\slash +% \texttt{n}. After loading this package, \LaTeX\ will not bother to +% input the font definition file \texttt{t1rzcm.fd}, so the ``real'' +% \texttt{zcm} fonts will not get involved. +% +% \section{Implementation} +% \subsection{Font definition file} +% +% \StopEventually{} +% +% As is the custom, the file starts by announcing itself. +% \begin{macrocode} +%<*fd> +\ProvidesFile{t1rzcm.fd}[1999/01/19 Font definitions for T1R/zcm.] +% \end{macrocode} +% +% Then the family is declared. So far, there is nothing out of the +% ordinary. +% \begin{macrocode} +\DeclareFontFamily{T1R}{zcm}{} +% \end{macrocode} +% +% Next the shapes are declared. There is nothing strange about this +% either. +% \begin{macrocode} +\DeclareFontShape{T1R}{zcm}{m}{n}{ + <-> zcmr8d +}{} +% \end{macrocode} +% \begin{macrocode} +\DeclareFontShape{T1R}{zcm}{m}{a}{ + <-> zcmra +}{} +% \end{macrocode} +% +% That would be all in a normal font definition file. This file does +% however go on with defining some variants of commands and +% compositions, to compensate for the differences between the coding +% scheme of the \texttt{zcmra} font and the default coding scheme. +% +% Slot number 128 is used for a ligature instead of the default `\u{A}', +% so this has to be compensated for. In this case it is done by making +% another default definition of the |\u| command and defining all the +% other compositions of that command again. +% \begin{macrocode} +\DefineTextAccentVariant{\u}{T1R}{zcm}{}{a}{8} +\DefineTextVariantComposition{\u}{T1R}{zcm}{}{a}{G}{135} +\DefineTextVariantComposition{\u}{T1R}{zcm}{}{a}{a}{160} +\DefineTextVariantComposition{\u}{T1R}{zcm}{}{a}{g}{167} +% \end{macrocode} +% It should be noted at this point that this font definition file is +% not set up in the most efficient way. Normally, one would want to +% minimize the number of variants that needs to be defined---something +% which the above most certainly does not do---and one often achieves +% this by trying to affect as few accenting commands as possible. The +% four extra ligatures of the \texttt{zcmra} font could have been put in +% slots 128, 135, 160, and 167---that would have made it possible to +% get by with the single variant definition +%\begin{verbatim} +% \DefineTextAccentVariant{\u}{T1R}{zcm}{}{a}{8} +%\end{verbatim} +% although a font designer who frequently use the |\u| command will +% probably prefer to use slots for compositions of some other +% command---but \texttt{zcmra} has been set up more to show what is +% possible than what is optimal. +% +% The same problem occurs with slot 131, which does not contain the +% `\v{C}' glyph that the encoding-level composition of |\v| with |C| +% assumes it does. Another solution to the problem is to give an +% explicit definition of the composition at a lower level, as in +% \begin{macrocode} +\DefineTextVariantCompositionCommand{\v}{T1R}{zcm}{}{a}{C}{% + \add@accent{7}{C}% +} +% \end{macrocode} +% |\add@accent| is standard \LaTeX\ and its definition can be found +% in~\cite{ltoutenc}. This solution gets by using only two variants (the +% \texttt{T1R}\slash\texttt{zcm}\slash\texttt{?}\slash\texttt{a} variant +% of |\v|, and the compositon of that variant with |C|). Had instead +% the first solution been used here, it would have required the code +%\begin{verbatim} +%\DefineTextAccentVariant{\v}{T1R}{zcm}{}{a}{7} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{D}{132} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{E}{133} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{L}{137} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{N}{140} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{R}{144} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{S}{146} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{T}{148} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{Z}{154} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{c}{163} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{d}{164} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{e}{165} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{l}{169} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{n}{172} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{r}{176} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{s}{178} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{t}{180} +%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{z}{186} +%\end{verbatim} +% which defines another 18 control sequences. The |\v| command sure has +% many compositions, hasn't it? +% +% Things are a bit different when the slot is used for a variant of a +% composition, instead of a composition of a variant. In the former case, +% there is a special command that can be used to extract the default +% definition of the accenting command. +% \begin{macrocode} +\DefineTextUncomposedVariant{\'}{T1R}{zcm}{}{a}{C} +% \end{macrocode} +% +% Finally, another example like |\v|. +% \begin{macrocode} +\DefineTextVariantCompositionCommand{\k}{T1R}{zcm}{}{a}{a}% + {a\llap{\char12\kern-0.07em}} +%</fd> +% \end{macrocode} +% This definition demonstrates that there is absolutely no need to base +% the definition of a composition on the default definition; using that +% in this case would (i) be much longer, (ii) be unstable, as the default +% definition of |\k| positions the accent incorrectly if not both the +% height of the accent and the depth of the letter is zero or less, +% and (iii) probably not kern particularly good (at least this definition +% kerns like `a' to the left, the default does not kern at all). +% +% +% \subsection{The \package{ecsubzcm} package} +% +% \begin{macrocode} +%<*package> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{ecsubzcm}[1999/01/19] +% \end{macrocode} +% \begin{macrocode} +\DeclareFontFamily{T1R}{zcm}{} +% \end{macrocode} +% \begin{macrocode} +\DeclareFontShape{T1R}{zcm}{m}{n}{ + <-> ecrm1000 +}{} +%</package> +% \end{macrocode} +\endinput + diff --git a/Master/texmf-dist/source/latex/relenc/zcmr8d.vf2 b/Master/texmf-dist/source/latex/relenc/zcmr8d.vf2 Binary files differnew file mode 100644 index 00000000000..dcb47e3f0d9 --- /dev/null +++ b/Master/texmf-dist/source/latex/relenc/zcmr8d.vf2 diff --git a/Master/texmf-dist/source/latex/relenc/zcmr8d.vf3 b/Master/texmf-dist/source/latex/relenc/zcmr8d.vf3 Binary files differnew file mode 100644 index 00000000000..89eea240094 --- /dev/null +++ b/Master/texmf-dist/source/latex/relenc/zcmr8d.vf3 diff --git a/Master/texmf-dist/source/latex/relenc/zcmra.vf2 b/Master/texmf-dist/source/latex/relenc/zcmra.vf2 Binary files differnew file mode 100644 index 00000000000..17cb9f92a1c --- /dev/null +++ b/Master/texmf-dist/source/latex/relenc/zcmra.vf2 diff --git a/Master/texmf-dist/source/latex/relenc/zcmra.vf3 b/Master/texmf-dist/source/latex/relenc/zcmra.vf3 Binary files differnew file mode 100644 index 00000000000..d4541686a6c --- /dev/null +++ b/Master/texmf-dist/source/latex/relenc/zcmra.vf3 |