From e76b4836b596e047960f65428fdf938ea44f6423 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 18 Nov 2020 22:04:23 +0000 Subject: teubner (18nov20) git-svn-id: svn://tug.org/texlive/trunk@56956 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/teubner/teubner.dtx | 1287 ++++++++++---------- 1 file changed, 634 insertions(+), 653 deletions(-) (limited to 'Master/texmf-dist/source/latex/teubner') diff --git a/Master/texmf-dist/source/latex/teubner/teubner.dtx b/Master/texmf-dist/source/latex/teubner/teubner.dtx index f7b457ada7d..fc126c7554c 100644 --- a/Master/texmf-dist/source/latex/teubner/teubner.dtx +++ b/Master/texmf-dist/source/latex/teubner/teubner.dtx @@ -4,7 +4,7 @@ \input docstrip.tex \keepsilent \preamble -Copyright 2001--2015 Claudio Beccari All rights reserved. +Copyright 2001--2020 Claudio Beccari All rights reserved. This system is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,21 +15,10 @@ dated 2008-05-04 or later as it appears in CTAN/macros/latex/base/lppl.tex. See the end of the file. -IMPORTANT NOTICE: - -You are allowed to distribute this file under the conditions that are -specified in the source file teubner.dtx. - -If you receive only some of these files from someone, complain! - -You are NOT ALLOWED to distribute this file alone. -You are NOT ALLOWED to take money for the distribution or use -of either this file or a changed version, except for a nominal -charge for copying, etc. \endpreamble \postamble It may be distributed and/or modified under the - conditions of the LaTeX Project Public License, either version 1.3 + conditions of the LaTeX Project Public License, either version 1.3c of this license or (at your option) any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt @@ -47,14 +36,14 @@ charge for copying, etc. % % \iffalse %^^A The following trick uses the same date for every file header. -%\NeedsTeXFormat{LaTeX2e} +%\NeedsTeXFormat{LaTeX2e}[2020-01-01] %<*driver> \ProvidesFile{teubner.dtx}[% % %\ProvidesPackage{teubner}[% %\ProvidesPackage{teubnertx}[% %<*driver,package,tbtx> -2016/03/31 v.4.8 +2020/11/17 v.5.0 %Extensions for Greek philology] %Access to the LGR encoded Greek fonts that match the TX fonts] % @@ -78,6 +67,13 @@ charge for copying, etc. \renewcommand*\meta[1]{{\normalfont\textlangle\textit{#1}\textrangle}} \newcommand*\pack[1]{\textsf{#1}} \newcommand*\acro[1]{\expandafter\textsc\expandafter{\MakeLowercase{#1}}} + \providecommand\cs{} + \renewcommand\cs[1]{\textnormal{\texttt{\bslash#1}}} + \providecommand\marg{} + \renewcommand\marg[1]{\textnormal{\ttfamily\{\meta{#1}\}}} + \newcommand\Marg[1]{\textnormal{\ttfamily\{#1\}}} + \renewcommand\oarg[1]{\textnormal{\ttfamily[\meta{#1}]}} + \newcommand\Oarg[1]{\textnormal{\ttfamilt[#1]}} \usepackage{multicol} \usepackage[T1]{fontenc} \usepackage{lmodern,textcomp} @@ -88,7 +84,7 @@ charge for copying, etc. % % \fi % -% \CheckSum{4368} +% \CheckSum{4130} % \begin{multicols}{2}\tableofcontents\end{multicols} % % @@ -97,8 +93,8 @@ charge for copying, etc. % package so as to enable the use of the Lipsian\footnote{What here % are called Lipsian fonts are a family of fonts that in Greece are % called ``Lipsiakos''; they are similar to the ones that were being -% used in the Teubner Printing Company of Lipsia from mid XIX century on.} -% fonts and to use several macros for inserting special annotations +% used in the Teubner Printing Company of Lipsia from mid XIX century +% on.} fonts and to use several macros for inserting special annotations % in the written text, as well as to typeset verses with special % layout. Metric sequences may be defined and typeset by means of a % companion font \texttt{gmtr????} that follows the same conventions @@ -107,15 +103,16 @@ charge for copying, etc. % % Examples and lists of commands are available in the file % \texttt{teubner-doc.pdf} which, as a regular pdf file, embeds all -% the necessary fonts and may be read on screen as well as printed on paper; -% beware, though, that the PostScript fonts that are being used +% the necessary fonts and may be read on screen as well as printed on +% paper; beware, though, that the PostScript fonts that are being used % in \texttt{teubner-doc.pdf} are not installed by default if a basic % installation is sought. % -% This version 4.0 tries to adapt to the new handling of the Greek language -% by \babel, since now this language script is based on the -% LICR (\LaTeX\ Internal Character Representation), and source files now can -% include Greek glyphs, besides the usual transliteration with Latin letters. +% This version 4.0 tries to adapt to the new handling of the Greek +% language by \babel, since now this language script is based on the +% LICR (\LaTeX\ Internal Character Representation), and source files +% now can include Greek glyphs, besides the usual transliteration with +% Latin letters. % \end{abstract} % % \section{Introduction} @@ -143,11 +140,11 @@ charge for copying, etc. % end I think that the new typeface turned out pretty well thanks to % both my friends. % -% The Lipsian font, also called Leipzig, or Lipsiakos in Greece, is one of the -% oblique fonts that used to be employed by the typesetters working in the -% German city of Leipzig, among which the Teubner Printing Company. -% This Company's classical works of ancient Greek poetry are considered among -% the best ever published. The name of this file and this extension +% The Lipsian font, also called Leipzig, or Lipsiakos in Greece, is one of +% the oblique fonts that used to be employed by the typesetters working in +% the German city of Leipzig, among which the Teubner Printing Company. +% This Company's classical works of ancient Greek poetry are considered +% among the best ever published. The name of this file and this extension % package is in honour of that printing company. % % This package documentation does not contain any example written in @@ -162,9 +159,9 @@ charge for copying, etc. % package; should he forget, this package will complain. But once the % |greek| option is properly declared, this package verifies that the % |polutonikogreek| dialect (deprecated) is selected, or that the -% |polutoniko| attribute or modifier is set; if no attribute is set this package -% will set |polutoniko| or |ancient| depending on the presence of an -% updated Greek support to the \babel\ package. This choice depends on +% |polutoniko| attribute or modifier is set; if no attribute is set this +% package will set |polutoniko| or |ancient| depending on the presence of +% an updated Greek support to the \babel\ package. This choice depends on % the particular version of the \babel\ package, but should not concern % the user; switching back and forth between classical Greek and some % modern western language is performed in a transparent way; possibly @@ -180,74 +177,79 @@ charge for copying, etc. % \acro{ctan} in the directory \texttt{/fonts/greek/cb} have % been completed with the new files for the Lipsian fonts, and the metric % symbols font \texttt{gmtr????.*}; the latter does not need a formal font -% definition file, because the necessary definitions are included in this package. -% All fonts are available also as Type~1 scalable fonts. In general, recent -% distributions of the \TeX\ system already contain the necessary -% configuration to use the Type~1 font in one size, 10\,pt, but, thanks to -% scaling, these can be used at any size; this version of \textsf{teubner} -% is compatible with this reduced set. If optical sizes are desired for -% a more professional typesetting, the \acro{ctan} archives contain also -% the \textsf{cbgreek-full} package, which includes also all the Type~1 -% fonts at the various standard (EC) sizes, plus other facilities that allow -% to use the CB fonts also in conjunction with the Latin Modern ones. Complete -% installations of the \TeX\ system include the full CB fonts installation. +% definition file, because the necessary definitions are included in this +% package. All fonts are available also as Type~1 scalable fonts. In +% general, recent distributions of the \TeX\ system already contain the +% necessary configuration to use the Type~1 font in one size, 10\,pt, but, +% thanks to scaling, these can be used at any size; this version of +% \textsf{teubner} is compatible with this reduced set. If optical sizes +% are desired for a more professional typesetting, the \acro{ctan} archives +% contain also the \textsf{cbgreek-full} package, which includes also all +% the Type~1 fonts at the various standard (EC) sizes, plus other +% facilities that allow to use the CB fonts also in conjunction with the +% Latin Modern ones. Complete installations of the \TeX\ system include the +% full CB fonts installation. % % The CB Greek fonts allow to input Greek text with a Latin keyboard and % by employing the prefix notation; with a Greek keyboard and file -% \texttt{iso-8859-7.def} it is possible to directly input Greek text with the -% monotonic spelling; if polytonic spelling is required I fear that the above -% file is of little help and that a Latin keyboard does the job without -% an excessive burden. The recent modifications to the \babel\ package and of the -% Greek language description file allow to enter also polytonic Greek text, -% keyboard permitting, with no effort; it is necessary to use the |utf8| -% input encoding. It's important to notice the Apple computers have available -% a virtual keyboard (called keyboard viewer) that is operable with the mouse -% and, just by selecting the \emph{Greek Polytonic} keyboard driver, the -% author can enter Greek text directly in the source file. Computer with a -% touch screen virtual keyboard allow to switch from the national to -% the Greek keyboard just by a single sweep of the finger. Some platforms -% have the possibility of switching keyboard but they don't show the new -% keyboard layout on the screen, but the user can generally build a personal -% table that describes the correspondence between the key board and the -% physical keyboard layout. Windows operating system Win8 has available -% a virtual keyboard similar to the Mac's. +% \texttt{iso-8859-7.def} it is possible to directly input Greek text with +% the monotonic spelling; if polytonic spelling is required I fear that the +% above file is of little help and that a Latin keyboard does the job +% without an excessive burden. The recent modifications to the \babel\ +% package and of the Greek language description file allow to enter also +% polytonic Greek text, keyboard permitting, with no effort; it is +% necessary to use the |utf8| input encoding. It's important to notice the +% Apple computers have available a virtual keyboard (called keyboard +% viewer) that is susable with the mouse and, just by selecting the +% \emph{Greek Polytonic} keyboard driver, the author can enter Greek text +% directly in the source file. Computers with a touch screen virtual +% keyboard allow to switch from the national to the Greek keyboard just by +% a single sweep of the finger. Some platforms have the possibility of +% switching keyboard but they don't show the new keyboard layout on the +% screen, but the user can generally build a personal table that describes +% the correspondence between the keyboard and the physical keyboard layout. +% Windows operating system Win8 and later has available a virtual keyboard +% similar to the Mac's. % % Nevertheless there is a little point to observe; Lipsian fonts are very % nice but show some kerning errors with more evidence than the traditional -% Didot Greek fonts. With the prefix notation in force, kerning programs may -% result disabled and some diphthongs and some consonant-vowel combinations -% appear poorly matched when the second letter caries any diacritical mark. In -% order to avoid this ``feature'', the accented vowels may be input by means of -% macros, that directly translate to the accented glyph, rather than invoking the -% ligature programs that are implied by the prefix notation; reading a Greek text -% on the screen while editing the input \texttt{.tex} file when a Latin -% keyboard and such macros are used may be very strange, but authors get -% used to it, and agree that the effort is worth the result. The direct input -% of Greek glyphs, evidently is the real solution, even if it may be difficult -% to enter Greek glyphs without a suitable virtual keyboard or a suitable -% keyboard map. +% Didot Greek fonts. With the prefix notation in force, kerning programs +% may result disabled and some diphthongs and some consonant-vowel +% combinations appear poorly matched when the second letter caries any +% diacritical mark. In order to avoid this ``feature'', the accented vowels +% may be input by means of macros, that directly translate to the accented +% glyph, rather than invoking the ligature programs that are implied by the +% prefix notation; reading a Greek text on the screen while editing the +% input \texttt{.tex} file when a Latin keyboard and such macros are used +% may be very strange, but authors get used to it, and agree that the +% effort is worth the result. The direct input of Greek glyphs, evidently +% is the real solution, even if it may be difficult to enter Greek glyphs +% without a suitable virtual keyboard or a suitable keyboard map. % % \section{Environments} -% I apologise if I chose Italian names for verse environments; I wanted to -% use names very different from the corresponding English ones, but at the -% same time easily recognisable; after all \emph{versi} is the plural of -% \emph{verso} and therefore is the exact Italian translation of \emph{verses}. -% If you feel more comfortable with Latin, the alias environment names -% in Latin, |versus|, |Versus|, and |VERSUS|, are also available. +% I apologise if I chose Italian names for verse environments; I wanted +% to use names very different from the corresponding English ones, but +% at the same time easily recognisable; after all \emph{versi} is the +% plural of \emph{verso} and therefore is the exact Italian translation +% of \emph{verses}. If you feel more comfortable with Latin, the alias +% environment names in Latin, |versus|, |Versus|, and |VERSUS|, are also +% available. % % \DescribeEnv{versi} %\DescribeMacro{\verso} % The environment \texttt{versi} (|versus|) is used to typeset verses -% in line, without an implicit end of line at the end of each verse; a vertical -% bar with a number on top of it marks the verse limit while allowing a numeric -% reference to a specific verse; the opening environment statement requires -% a string, a short text, in order to indent the verse lines the amount of -% this string width; the syntax is the following +% in line, without an implicit end of line at the end of each verse; a +% vertical bar with a number on top of it marks the verse limit while +% allowing a numeric reference to a specific verse; the opening environment +% statement requires a string, a short text, in order to indent the verse +% lines the amount of this string width; the syntax is the following % \begin{sintassi} -% \bslash begin\lbr versi\rbr\lbr\meta{string}\rbr{} -% \meta{verse}\bslash verso[\meta{starting number}]\meta{verse}\bslash verso -% \meta{verse}\bslash verso\meta{verse}\dots{} -% \bslash end\lbr versi\rbr +% \cs{begin}\Marg{versi}\marg{string} +% \meta{verse}\cs{verso}\oarg{starting number}\marg{verse} +% \cs{verso} \marg{verse} +% \cs{verso}\marg{verse} +% \dots{} +% \cs{end}\Marg{versi} % \end{sintassi} % where, of course, \meta{starting number} is required only for the first % instance of |\verso| or when numbering must be restarted, for example @@ -255,37 +257,38 @@ charge for copying, etc. % % \DescribeEnv{Versi} % The environment \texttt{Versi} (|Versus|) is similar to the -% standard \LaTeX\ environment \texttt{verse}, except verse lines are numbered -% on multiples of~5; the opening statement requires the \meta{starting -% number} as an optional argument; if this optional argument is not specified, -% the starting number is assumed to be~1. +% standard \LaTeX\ environment \texttt{verse}, except verse lines are +% numbered on multiples of~5; the opening statement requires the +% \meta{starting number} as an optional argument; if this optional argument +% is not specified, the starting number is assumed to be~1. % \begin{sintassi} -% \bslash begin\lbr Versi\rbr[\meta{starting number}] -% \meta{verse}\bslash\bslash{}\meta{*}[\meta{vertical space}] -% \meta{verse}\bslash\bslash{} +% \cs{begin}\Marg{Versi}\oarg{starting number} +% \meta{verse}\cs{\bslash*}\oarg{vertical space} +% \meta{verse}\cs{\bslash} % \dots{} -% \bslash end\lbr Versi\rbr -%\end{sintassi} +% \cs{end}\Marg{Versi} +% \end{sintassi} % % \DescribeEnv{VERSI} % \DescribeMacro{\SubVerso} % \DescribeMacro{\NoSubVerso} -% The environment \texttt{VERSI} (|VERSUS|) allows for two verse -% enumerations; the main enumeration is identical to the one performed by -% the previous environment \texttt{Versi}, while the secondary enumeration -% is in smaller digits and normally numbers consecutive verses, except -% that it can be turned on and off; the verses that lack the secondary -% enumeration are indented by moving them to the right. +% The environment \texttt{VERSI} (|VERSUS|) allows for two +% verse-enumerations; the main enumeration is identical to the one +% performed by the previous environment \texttt{Versi}, while the secondary +% enumeration is typeset with smaller digits and normally numbers +% consecutive verses, except that it can be turned on and off; the verses +% that have the secondary enumeration are indented by moving them to the +% right. % \begin{sintassi} -% \bslash begin\lbr VERSI\rbr[\meta{starting principal number}] -% \meta{verse}\bslash\bslash\meta{*}[\meta{vertical space}] -% \bslash SubVerso[\meta{starting secondary number}] -% \meta{verse}\bslash\bslash\meta{*}[\meta{vertical space}] +% \cs{begin}\Marg{VERSI}\oarg{starting principal number} +% \meta{verse}\cs{\bslash*}\oarg{vertical space} +% \cs{SubVerso}\oarg{starting secondary number} +% \meta{verse}\cs{\bslash*}\oarg{vertical space} +% \dots{} +% \cs{NoSubVerso} +% \meta{verse}\cs{\bslash*}\oarg{vertical space} % \dots{} -% \bslash NoSubVerso -% \meta{verse}\bslash\bslash\meta{*}[\meta{vertical space}] -% \dots -% \bslash end\lbr VERSI\rbr +% \cs{end}\Marg{VERSI} % \end{sintassi} % where if \meta{starting principal number} is missing, 1 is assumed, % while if \meta{starting secondary number} is missing, the enumeration @@ -294,107 +297,138 @@ charge for copying, etc. % enumeration must be restarted; there are no means to restart the % principal enumeration. % -% \DescribeEnv{bracedmetrics} The previous environments accept \meta{verses} -% in any language and in any alphabet, the one that is in force before opening -% the environment; the language and, even less, the alphabet cannot be -% globally changed within the above environments; if such a change is performed, -% it is valid only for one verse, or for the remaining fraction of the verse -% after the language or font change. This means, among the other things, that -% if the default ``alphabet'' is the one that shows the metric symbols, -% the above environments may be used to display ``metric verses'', that is the -% pattern of long, short or ancipital symbols, together with any other metric -% symbol so as to display the metrics without disturbing the written text; when -% doing this metric typesetting, it may happen that some verse patterns exhibit -% some variants; in this case the \texttt{bracedmetrics} environment comes handy, -% because it can display such variants in separate lines but grouped with a large -% right brace; some commands allow to roughly align these variants, so as to -% allow to nest several such environments as if they were single blocks of metric -% symbols. The argument of the opening statement specifies the width of the -% block so as to align properly all the symbols even in nested environments. +% \DescribeEnv{bracedmetrics} +% The previous environments accept \meta{verses} in any language and in +% any alphabet, the one that is in force before opening the environment; +% the language and, even less, the alphabet cannot be globally changed +% within the above environments; if such a change is performed, it is +% valid only for one verse, or for the remaining fraction of the verse +% after the language or font change. This means, among the other things, +% that if the default ``alphabet'' is the one that shows the metric +% symbols, the above environments may be used to display ``metric +% verses'', that is the pattern of long, short or ancipital symbols, +% together with any other metric symbol so as to display the metrics +% without disturbing the written text; when doing this metric +% typesetting, it may happen that some verse patterns exhibit some +% variants; in this case the \texttt{bracedmetrics} environment comes +% handy, because it can display such variants in separate lines but +% grouped with a large right brace; some commands allow to roughly +% align these variants, so as to allow to nest several such +% environments as if they were single blocks of metric symbols. +% The argument of the opening statement specifies the width of the +% block so as to properly align all the symbols even in nested +% environments. % \begin{sintassi} -% \bslash begin\lbr bracedmetrics\rbr\lbr\meta{length}\rbr{} -% \meta{metric pattern}\bslash\bslash -% \meta{metric pattern}\bslash\bslash +% \cs{begin}{bracedmetrics}\marg{length} +% \meta{metric pattern}\cs{\bslash} +% \meta{metric pattern}\cs{\bslash} % \dots{} -% \bslash end\lbr bracedmetrics\rbr +% \cs{end}{bracedmetrics} % \end{sintassi} -% \DescribeMacro{\verseskip}\DescribeMacro{\Hfill} Within the \meta{metric -% pattern} it is possible to flush right the symbols -% by prefixing the whole string with a |\Hfill| command; the \meta{length} may -% be specified as an integer multiple of a ``long'' symbol by means of +% +% \DescribeMacro{\verseskip}\DescribeMacro{\Hfill} +% Within the \meta{metric pattern} it is possible to flush right the +% symbols by prefixing the whole string with a |\Hfill| command; the +% \meta{length} may be specified as an integer multiple of a ``long'' +% symbol by means of %\begin{sintassi} -% \bslash verseskip\lbr\meta{number}\rbr +% \cs{verseskip}\marg{number} %\end{sintassi} % The macro |\verseskip| can be used also within \meta{metric pattern} % in order to space out metric symbols. % % \section{Commands and symbols} -% This package defines a lot of commands for inserting special signs in the middle -% of regular text, for marking zeugmas and synizeses, for putting unusual accents -% on any symbol, for inserting special ``parentheses'' that are used by -% philologists for marking blocks of letters or blocks of text. I suggest that the -% user reads the documentation file \texttt{teubner-doc.pdf} for a complete -% list of commands and symbols. -% -% \DescribeMacro{\newmetrics} Here it might be useful to describe a command -% for defining metric sequences, so as to shorten the definition of metric verses; -% this new command is |\newmetrics| and may be used for the definition of new -% commands whose name \emph{may start with one digit}: precisely this digit may be -% one of~2, 3,~4. Even if \LaTeX\ does not allow macros to contain both digits -% and letters, other service macros have been defined so as to handle these -% special control sequences even if they start with \emph{one} digit strictly -% lower than~5. The syntax is: +% This package defines a lot of commands for inserting special signs +% in the middle of regular text, for marking zeugmas and synizeses, +% for putting unusual accents on any symbol, for inserting special +% ``parentheses'' that are used by philologists for marking blocks of +% letters or blocks of text. I suggest that the user reads the +% documentation file \texttt{teubner-doc.pdf} for a complete list +% of commands and symbols. +% +% \DescribeMacro{\newmetrics} Here it might be useful to describe a +% command for defining metric sequences, so as to shorten the +% definition of metric verses; this new command is |\newmetrics| +% and may be used for the definition of new commands whose name +% \emph{may start with one digit}: precisely this digit may be one +% of~2, 3,~4. Even if \LaTeX\ does not allow macros to contain both +% digits and letters, other service macros have been defined so as +% to handle these special control sequences even if they start with +% \emph{one} digit strictly lower than~5. The syntax is: % \begin{sintassi} -% \bslash newmetrics\lbr\meta{control sequence}\rbr\lbr\meta{definition}\rbr +% \cs{newmetrics}l\marg{control sequence}\marg{definition} % \end{sintassi} -% where \meta{definition} consists in general of a sequence of metric commands -% such as |\longa|, |\brevis|, |\anceps|, etc. +% where \meta{definition} consists in general of a sequence of metric +% commands such as |\longa|, |\brevis|, |\anceps|, etc. % % \section{Acknowledgements} % I must thank with gratitude Paolo Ciacchi that urged me to prepare this -% extension file in order to help him typeset his master thesis of philological -% kind in classical Greek. -% -% I am pleased to thank G\"unter Milde who wrote a definition file for accessing -% the LGR encoded fonts in order to fetch the accented glyphs; I kindly gave me -% permission to use his macros, that I adapted to the conventions used within this -% file. These macros were saved into the definition file |LGRaccent-glyph.def|, so -% that it could be used also without the |teubner| package, for example for -% typesetting without setting the \emph{polutoniko} language attribute. But -% since he became the maintainer of the Greek language support for the \babel\ -% package, he extended this support to the point that the extended macros are +% extension file in order to help him typeset his master thesis of +% philological kind in classical Greek. +% +% I am pleased to thank G\"unter Milde who wrote a definition file for +% accessing the LGR encoded fonts in order to fetch the accented glyphs; +% he kindly gave me permission to use his macros, that I adapted to the +% conventions used within this file. These macros were saved into the +% definition file |LGRaccent-glyph.def|, so that it could be used also +% without the |teubner| package, for example for typesetting without +% setting the \emph{polutoniko} language attribute. But since he became +% the maintainer of the Greek language support for the \babel\ package, +% he extended this support to the point that the extended macros are % already part of the new Greek support files. % -% I got some ideas also from a paper that Werner Lemberg published on Eutypon, the -% magazine of the Hellenic Friends of \TeX, where he discussed in a constructive -% critical way the problems connected with the LGR encoded fonts and the Unicode -% encoding. -% -% Now the new Greek support for the \babel\ package, thanks to G\"unter Milde, -% includes also the support for Unicode input in the source file, in spite of -% using LGR encoded output fonts. The actual support is partially useful also -% with XeLaTeX and LuaLaTeX. +% I thank also Werner Lemberg who wrote a paper published on +% Eutypon, the magazine of the Hellenic Friends of \TeX, where he +% discussed in a constructive critical way the problems connected with +% the LGR encoded fonts and the Unicode encoding; I got some ideas also +% from that paper in order to get around some of his critical +% observations; I could get around all points he commented, and some +% progress was achieved. +% +% Now the new Greek support for the \babel\ package, thanks to G\"unter +% Milde, includes also the support for Unicode input in the source file, +% in spite of using LGR encoded output fonts. The actual support is +% partially useful also with XeLaTeX and LuaLaTeX. +% +% This package is far from perfect, but it allows to do a loto of things +% that is difficult to find elsewhere. I did my best, but I had to cope +% with the limitations of the Type~1 256 glyph fonts; with XeLaTeX or +% LuaLaTeX it might be possible to have more functionalities, but, as +% Werner Lemberg described, in order to type accented Greek letters, +% these programs deal with two different approaches: one directly +% accesses the Unicode page containing such glyphs, and the other +% relies on self combining diacritics; the latter approach appears +% to be more flexible in order to get the multitude of diacritics the +% philology sometimes requires over or under the same letter, but this +% forbids proper kerning; the former approach takes care of the correct +% kerning, but has a limited number of diacritic combinations. These +% approaches are mutually exclusive, therefore the philologist must +% get to compromises; at the same time any program must follow either +% approach, possibly choosing which one with suitable options, but it +% cannot switch back and forth continually and automatically. % % \StopEventually{} % % \section{Code} % \subsection{Preliminaries} -% In order to use the PostScript pfb fonts (CM, EC, and CB) it is necessary to -% know if we are dealing with \LaTeX\ or pdf\LaTeX; this was necessary because -% apparently the pfb math scalable fonts derived from the \textsf{META\-FONT} -% counterparts do not have exactly the same effective dimensions; this is why -% the ``zeugma'' and the ``synizesis'' signs have to be corrected when the pfb -% fonts are used; with these, in facts, the black leader that joins the curved -% extremities appeared a little too fat and did not join exactly the left mark. -% Recently, apparently, the fonts have been corrected and this trick is not -% necessary any more. Nevertheless we define a new boolean that copes with the -% fact that at least since 2007 the \TeX\ engine is \textsf{pdftex} even when DVI -% output is sought; the package \pack{iftex} creates three |\if|s that allow to -% diagnose if the typesetting engine is \textsf{pdftex} in PDF mode, -% \textsf{XeTeX} or \textsf{Luatex}; since at the moment this package -% \pack{teubner} is compatible only with \textsf{pdftex} in PDF mode, we equate -% the |\ifPDF| switch (defined in previous versions of \pack{teubner}) with the -% switch defined by package \pack{iftex}: +% In order to use the PostScript pfb fonts (CM, CM-Super, and CB) it is +% necessary to know if we are dealing with \LaTeX\ or pdf\LaTeX; this was +% necessary because apparently the pfb math scalable fonts derived from the +% \textsf{META\-FONT}% counterparts and do not have exactly the same +% effective dimensions; this is why the ``zeugma'' and the ``synizesis'' +% signs have to be corrected when the pfb fonts are used; with these, in +% facts, the black leader that joins the curved extremities appeared a +% little too fat and did not join exactly the left mark. +% Recently, apparently, the fonts have been corrected and this trick is +% not necessary any more. Nevertheless we define a new boolean that +% copes with the fact that, at least since 2007, the \TeX\ engine is +% \textsf{pdftex} even when DVI output is sought; the package +% \pack{iftex} creates three |\if|s that allow to diagnose if the +% typesetting engine is \textsf{pdftex} in PDF mode, \textsf{XeTeX} +% or \textsf{Luatex}; since at the moment this package \pack{teubner} +% is usable only with \textsf{pdftex} in PDF mode, we equate the +% |\ifPDF| switch (defined in previous versions of \pack{teubner}) with +% the switch defined by package \pack{iftex}: %\iffalse %<*package> %\fi @@ -402,8 +436,9 @@ charge for copying, etc. \RequirePackage{iftex} \let\ifPDF\ifPDFTeX % \end{macrocode} -% When \texttt{teubner.sty} is input the language Greek must have been already -% defined; otherwise an error message is issued and processing is terminated. +% When \texttt{teubner.sty} is input the language Greek must have been +% already defined; otherwise an error message is issued and processing is +% terminated. % \begin{macrocode} \ifx\captionsgreek\undefined \PackageError{teubner}{Greek language unknown!\MessageBreak @@ -413,6 +448,7 @@ Use the babel package greek option.\MessageBreak Type X to exit.}% {Type X to exit.} \fi + % \end{macrocode} % If this test is passed, this means that not only the greek option to the \babel\ % package is set, but also that all the \babel\ machinery is available. @@ -553,58 +589,58 @@ Type X to exit.}% \RequirePackage{ifthen} % \end{macrocode} % -% \begin{macro}{\metricsfont} Similarly the metric symbol font is declared -% together with a command for selecting it: +% \begin{macro}{\metricsfont} Similarly the metric symbol font +% is declared together with a command for selecting it: % \begin{macrocode} \DeclareFontFamily{U}{mtr}{\hyphenchar\font\m@ne} \ifonesizetypeone \DeclareFontShape{U}{mtr}{m}{n}{<-> gmtr1000}{}% \else \DeclareFontShape{U}{mtr}{m}{n}{% - <-5.5> gmtr0500 <5.5-6.5> gmtr0600 - <6.5-7.5> gmtr0700 <7.5-8.5> gmtr0800 - <8.5-9.5> gmtr0900 <9.5-11> gmtr1000 - <11-15> gmtr1200 <15-> gmtr1728}{}% + <-5.5> gmtr0500 <5.5-6.5> gmtr0600 + <6.5-7.5> gmtr0700 <7.5-8.5> gmtr0800 <8.5-9.5> gmtr0900 + <9.5-11> gmtr1000 <11-15> gmtr1200 <15-> gmtr1728}{}% \fi \DeclareFontShape{U}{mtr}{m}{it}{<->ssub*mtr/m/n}{}% \DeclareFontShape{U}{mtr}{b}{it}{<->ssub*mtr/m/n}{}% \DeclareFontShape{U}{mtr}{b}{n}{<->ssub*mtr/m/n}{}% \newcommand*\metricsfont{\fontencoding{U}\fontfamily{mtr}\upshape} % \end{macrocode} -% \end{macro} -% Next we require the package for extensible math fonts; it might be strange to -% use extensible math fonts in Greek philology, but a certain glyph must be picked -% up from such fonts, with the assurance that it changes size together with the -% current font size. +% \end{macro} Next we require the package for extensible math fonts; +% it might be strange to use extensible math fonts in Greek philology, +% but a certain glyph must be picked up from such fonts, with the +% assurance that it changes size together with the current font size. % \begin{macrocode} \RequirePackage{exscale} % \end{macrocode} % -% Some macros are necessary to switch languages; such macros must be independent -% (at least for now) from the particular \babel\ version, whether it be version -% 3.6, 3.7, 3.8, or~3.9; in the former the concept of ``language attribute'' is -% unknown, while the latter recognises varieties of the same language by the -% attribute setting. +% Some macros are necessary to switch languages; such macros must be +% independent (at least for now) from the particular \babel\ version, +% whether it be version 3.6, 3.7, 3.8, or~3.9; in the former the concept +% of ``language attribute'' is unknown, while the latter recognises +% varieties of the same language by the attribute setting. % With \babel\ version 3.9g things have further changed; the attribute -% to a language may be appended to the language name with an interposed dot; -% for example for Greek it might be |greek.polutoniko|. +% to a language may be appended to the language name with an interposed +% dot; for example for Greek it might be |greek.polutoniko|. % Such macros, besides being as robust as possible, must provide the % alphabet changes as required. % %\begin{macro}{\GreekName} % During the language switching operations |\GreekName| % distinguishes the variant or the main language whose attribute -% gets set and, evidently, becomes effective when the main language |greek| -% is in force. Notice that if the |greek.ldf| has a date previous to 2014/09/18, -% the attribute |ancient| may not be defined; in this case the |polutoniko| -% attribute is set, else the |ancient| attribute is selected. The difference -% is that the attribute |polutoniko| selects the polytonic spelling and the -% modern Greek hyphenation, while |ancient| selects the polytonic spelling and -% the classical Greek hyphenation. It is assumed that this |teubner| package -% gets used for philological purposes only for ancient Greek. Nevertheless, -% if some work on modern polytonic Greek philological document is being -% typeset, the |ancient| attribute may work satisfactorily, but with some -% possible ``ancient'' line breaks. +% gets set and, evidently, becomes effective when the main language +% |greek| +% is in force. Notice that if the |greek.ldf| has a date previous to +% 2014/09/18, the attribute |ancient| may not be defined; in this case +% the |polutoniko| attribute is set, else the |ancient| attribute is +% selected. The difference is that the attribute |polutoniko| selects +% the polytonic spelling and the modern Greek hyphenation, while +% |ancient| selects the polytonic spelling and the classical Greek +% hyphenation. It is assumed that this |teubner| package +% gets used for philological purposes only for ancient Greek. +% Nevertheless, if some work on modern polytonic Greek philological +% document is being typeset, the |ancient| attribute may work +% satisfactorily, but with some possible ``ancient'' line breaks. % \begin{macrocode} \ifx\languageattribute\undefined \def\GreekName{polutonikogreek}% @@ -629,13 +665,13 @@ Type X to exit.}% %\begin{macro}{\previouslanguage} %\begin{macro}{\previousencoding} % The ``default'' language is defined as the -% ``previous'' language; similarly the ``default'' encoding is defined as the -% ``previous'' encoding; these are the language and the encoding in force when the -% document starts; this is why such macros are defined at the beginning of the -% document. At the same time we assure that if the CM (or EC) or the LM fonts are -% the default ones, nothing special is done, while if the default fonts are, say, -% the TX ones, they are correctly restored, but the CM families are used for the CB -% ones. +% ``previous'' language; similarly the ``default'' encoding is defined +% as the ``previous'' encoding; these are the language and the encoding +% in force when the document starts; this is why such macros are defined +% at the beginning of the document. At the same time we assure that if +% the CM (or EC) or the LM fonts are the default ones, nothing special +% is done, while if the default fonts are, say, the TX ones, they are +% correctly restored, but the CM families are used for the CB ones. %\end{macro} %\end{macro} % @@ -910,21 +946,22 @@ Type X to exit.}% %\begin{macro}{\textlatin} % |\textlatin| is a redefinition of the standard \babel\ macro that is adapted to % the present situation, where it may be called behind the scenes in certain -% situations that are beyond the control of the typesetter. Therefore every -% precaution is taken in order to be sure that the composition of the command -% argument is really done with the default encoding but maintaining the current -% font familY, series and shape; of course, if the shape is that -% related to the Lipsian font, then the italic shape is temporarily restored -% (local definition). Moreover, with the (default) Latin fonts the tilde is -% restored to a non breaking space by simply making it an active character. +% situations that are beyond the control of the typesetter. Therefore +% every precaution is taken in order to be sure that the composition of the command +% argument is really done with the default encoding and font families, but +% maintaining the current series and shape; of course, if the shape is that related +% to the Lipsian font, then the italic shape is temporarily restored (local +% definition). Moreover, with the (default) Latin fonts the tilde is restored to a +% non breaking space by simply making it an active character. % \begin{macrocode} \DeclareRobustCommand\textlatin[1]{\edef\externalencoding{\f@encoding}{% - \def\itdefault{it}\def\@tempA{li}\ifx\@tempA\f@shape\def\f@shape{it}\fi% - \expandafter\select@language\expandafter{\previouslanguage}% - \fontencoding{\previousencoding}\selectfont - \bbl@activate{~}#1}% - \expandafter\fontencoding\expandafter{\externalencoding}} - + \def\itdefault{it}\def\@tempA{li}\ifx\@tempA\f@shape\def\f@shape{it}\fi + \expandafter\select@language\expandafter{\previouslanguage}% + \fontencoding{\previousencoding}% + \fontfamily{\rmdefault}\selectfont + \bbl@activate{~}#1}% + \expandafter\fontencoding\expandafter{\externalencoding}\rmfamily} + % \end{macrocode} %\end{macro} % @@ -1555,22 +1592,22 @@ Type X to exit.}% %\begin{macro}{\Sampi} %\begin{macro}{\Euro} %\begin{macro}{\permill} S -% These macros, too, are defined by the \texttt{lgrenc.def} file and subsidiaries, -% but with different names; therefore we make some aliases: -% \begin{macrocode} -\let\stigma\textstigma +% These macros, too, are defined by the \texttt{lgrenc.def} file and +% subsidiaries, but with different names; therefore we make some aliases. +% We exclude to use the modern koppa sign (zig-zag koppa) so we let its +% commands equal to the old koppa.; at the same time, for backwards +% compatibility, we let also the variant name |\varkoppa| to address +% the ancient glyph. For the digit~6 in the `units' position, we foresee +% to use either the true stigma glyph or the digamma one. +% \begin{macrocode} +\let\stigma\textstigma \let\Stigma\textStigma \let\varstigma\textvarstigma -\let\koppa\textkoppa +\let\koppa\textkoppa \let\Koppa\textQoppa \let\qoppa\textqoppa -\let\coppa\textqoppa -\let\Koppa\textQoppa -\let\Coppa\textQoppa \let\varkoppa\textqoppa -\let\sampi\textsampi -\let\Stigma\textStigma -\let\Sampi\textsampi -\let\f\textdigamma -\let\F\textDigamma\let\Digamma\F +\let\coppa\textqoppa \let\Coppa\textQoppa +\let\sampi\textsampi \let\Sampi\textSampi +\let\f\textdigamma \let\F\textDigamma \let\Digamma\F \let\Euro\texteuro \let\permill\textperthousand \let\schwa\textschwa @@ -1842,8 +1879,8 @@ Type X to exit.}% %\begin{macro}{\yod} %\begin{macro}{\iod} % Macros |\yod| and |\iod| are used to insert a -% Latin ``j'' while typesetting in Greek; the control sequence |\jod| was avoided in -% order to reduce the possibility of typing |\jot| which is a \TeX\ internal +% Latin ``j'' while typesetting in Greek; the control sequence |\jod| was avoided +% in order to reduce the possibility of typing |\jot| which is a \TeX\ internal % dimension. % \begin{macrocode} \DeclareTextCommand{\h}{\GRencoding@name}% @@ -1864,21 +1901,19 @@ Type X to exit.}% %\begin {macro}{\F} %\begin {macro}{\digamma} %\begin {macro}{\Digamma} -% At the same time it was believed that for inserting lower and upper case -% ``digamma'' it was preferable to use short macros and to avoid the dilemma between -% the |\ddigamma| and the |\digamma| macros, the former being the -% one defined in the |greek| option to \babel, the latter being -% a standard mathematical symbol; initially I believed that philologists do -% not use mathematical symbols so we made |\digamma| an alias for |\f|; -% afterwards I -% found out that mathematicians, physicists, engineers,~\dots\ use the -% \textsf{teubner.sty} package and that the |\digamma| is a symbol already defined -% in the package \textsf{amssymb.sty}; therefore I made a conditional creation of -% this alias; this trick is delayed to the beginning of the document, so as to -% make it independent on the order with which packages are loaded. -% \begin{macrocode} -\AtBeginDocument{\unless\ifcsname digamma\endcsname\let\digamma\textdigamma\fi} -% \end{macrocode} +% At the same time it was believed that for inserting lower and upper +% case ``digamma'' it was preferable to use short macros and to avoid +% the dilemma between the |\ddigamma| and the |\digamma| macros, the +% former being the one defined in the |greek| option to \babel, the +% latter being a standard mathematical symbol; initially I believed +% that philologists do not use mathematical symbols so we made |\digamma|% an alias for |\f|; afterwards I found out that mathematicians, +% physicists, engineers,~\dots\ use the \textsf{teubner.sty} package +% and that the |\digamma| is a symbol already defined in package +% \textsf{amssymb.sty}; therefore I made a conditional creation of +% this alias; this trick is delayed to the beginning of the document, +% so as to make it independent on the order with which packages are +% loaded. Actually, since the introduction of the LICR macros, this is +% irrelevant and I deleted it. %\end{macro} %\end{macro} %\end{macro} @@ -1886,19 +1921,20 @@ Type X to exit.}% % %\begin {macro}{\fLow} %\begin {macro}{\fHigh} -% The digamma glyphs set forth another question because, according to Paolo -% Ciacchi, a different glyph should be used for typesetting text compared with -% the one that is used as a variant in Milesian numerals in place of the standard -% stigma symbol. -% By means of macros |\fLow| or |\fHigh| it is possible to chose the raised or the -% lowered digamma glyphs; Greek numerals always use the lowered one, while when -% text is being typeset the typesetter can chose the version he likes best. +% The digamma glyphs set forth another question because, according to +% Paolo Ciacchi, a different glyph should be used for typesetting text +% compared with the one that is used as a variant in Milesian numerals +% in place of the standard stigma symbol. +% By means of macros |\fLow| or |\fHigh| it is possible to chose the +% raised or the lowered digamma glyphs; Greek numerals always use the +% lowered one, while when text is being typeset the user can chose +% the version s/he likes best. % \begin{macrocode} \DeclareRobustCommand{\fLow}% {{\setbox\z@\hbox{\f}\dimen@\ht\z@ - \advance\dimen@-1ex\raise-\dimen@\hbox{\box\z@}}} + \advance\dimen@-1ex\raisebox{-\dimen@}{\f}}} \DeclareRobustCommand{\fHigh}% - {{\setbox\z@\hbox{\f}\dimen@\dp\z@\raise\dimen@\hbox{\box\z@}}} + {{\setbox\z@\hbox{\f}\dimen@\dp\z@\raisebox{\dimen@}{\f}}} % \end{macrocode} %\end{macro} @@ -1911,13 +1947,14 @@ Type X to exit.}% % Here we start a set of miscellaneous macros. We begin with some parentheses % that should turn out in upright shape, even if the default font is the Lipsian % one which is oblique; its parentheses are oblique as in all oblique fonts, -% therefore we need to quietly change fonts behind the scenes. The same is true with -% the question mark that, philologically speaking, represents an uncertain element, -% not the termination of a real question; it should therefore always come out -% between parentheses and in upright shape from a Latin font. While the -% parenthesized question mark comes from the OT1 Latin upright font, the parentheses -% obtained with |\lpar| and |\rpar| are taken from the metric symbols font, as well -% as the parentheses used in the parenthesized text processed with macro |\frapar|. +% therefore we need to quietly change fonts behind the scenes. The same is true +% with the question mark that, philologically speaking, represents an uncertain +% element, not the termination of a real question; it should therefore always +% come out between parentheses and in upright shape from a Latin font. While the +% parenthesized question mark comes from the OT1 Latin upright font, the +% parentheses obtained with |\lpar| and |\rpar| are taken from the metric +% symbols font, as well as the parentheses used in the parenthesized text +% processed with macro |\frapar|. % \begin{macrocode} \DeclareRobustCommand\qmark{\hskip.16ex{\fontencoding{OT1}\upshape(?)}} \DeclareRobustCommand\lpar{{\metricsfont(}} @@ -1932,8 +1969,8 @@ Type X to exit.}% % %\begin{macro}{\ap} % The apex/superscript macro |\ap| does not differ much from the plain standard -% \LaTeX\ macro |\textsuperscript|, the only difference being the italic correction -% that precedes |\textsuperscript|. +% \LaTeX\ macro |\textsuperscript|, the only difference being the italic +% correction that precedes |\textsuperscript|. % \begin{macrocode} \DeclareRobustCommand{\ap}[1]{\/\textsuperscript{#1}} @@ -2730,7 +2767,8 @@ Type X to exit.}% \multiply\count255by5\relax \advance\count255-\value{verso}% \ifnum\count255=\z@ - {\fontseries{m}\small\expandafter\oldstylenums\expandafter{\the\c@verso}}% + {\fontseries{m}\small + \expandafter\oldstylenums\expandafter{\the\c@verso}}% \else \empty \fi}% @@ -2933,62 +2971,49 @@ Type X to exit.}% % \begin{macrocode} \\% \egroup\endlist} -\let\VERSUS\VERSI \let\endVERSUS\endVERSUS +\let\VERSUS\VERSI \let\endVERSUS\endVERSI % \end{macrocode} %\end{environment} % -% \subsection{Metrics symbols, macros and environmnets} -% Now we start defining many macros concerned with metrics; the metric symbol font -% has been developed mainly for this purpose. We start defining some macros for -% inputting specific symbols; many such macros have their own aliases in Latin. +% \subsection{Metrics symbols, macros and environments} +% Now we start defining many macros concerned with metrics; the metric +% symbol font has been developed mainly for this purpose. We start +% defining some macros for inputting specific symbols. +% +% Previous versions of this package defined the metric sign using both +% Italian and Latin names; then a user\footnote{Thank you Heinrich +% Fleck!} discovered a conflict with the |amsmath| package, especially +% due to the macro |\breve|, the Italian version of |\brevis|. It is +% unusual to use |teubner| with the advanced mathematics functionalities +% of |amsmath|, and package |teubner| has been in use for so many years, +% that such conflicts were never experienced. But Heinrich is a fond +% admirer of Archimedes and wrote several critical papers on Archimedes' +% works, some of which required advanced mathematics. +% +% We therefore decided that the Italian metric symbol names could be done +% without, and we eliminated all or most such ‘Italian’ macros. Those +% now available are the following. % -%\begin{macro}{\lunga} %\begin{macro}{\longa} -%\begin{macro}{\breve} %\begin{macro}{\brevis} -%\begin{macro}{\bbreve} %\begin{macro}{\bbrevis} -%\begin{macro}{\barbreve} %\begin{macro}{\barbrevis} -%\begin{macro}{\barbbrev} %\begin{macro}{\barbbrevis} -%\begin{macro}{\ubarbreve} %\begin{macro}{\ubarbrevis} -%\begin{macro}{\ubarbbreve} %\begin{macro}{\ubarbbrevis} -%\begin{macro}{\ubarsbreve} %\begin{macro}{\ubarsbrevis} -%\begin{macro}{\ubrevelunga} %\begin{macro}{\ubrevislonga} -% The following definitions are straightforward; a small comment on |\breve|: since -% it is also a math command in standard \LaTeX, its meaning is saved in a service -% macro |\br@ve| and the |\breve| macro is redefined taking into account whether the -% typesetting is being done in text or in math mode. The unusual letters that appear -% in the definitions of the various metric symbols have no mysterious meaning; they -% might have been specified by |\char|\meta{number}, but it seemed shorter to -% specify the corresponding letters that would occupy the same slots in literal -% fonts. % \begin{macrocode} -\DeclareRobustCommand\lunga{{\metricsfont l}} -\let\longa\lunga -\let\br@ve\breve -\DeclareRobustCommand\breve{\textormath{{{\metricsfont b}}}{\br@ve}} -\let\brevis\breve -\DeclareRobustCommand\bbreve{{\metricsfont c}} -\let\bbrevis\bbreve -\DeclareRobustCommand\barbreve{{\metricsfont i}} -\let\barbrevis\barbreve -\DeclareRobustCommand\barbbreve{{\metricsfont j}} -\let\barbbrevis\barbbreve -\DeclareRobustCommand\ubarbreve{{\metricsfont d}} -\let\ubarbrevis\ubarbreve -\DeclareRobustCommand\ubarbbreve{{\metricsfont e}} -\let\ubarbbrevis\ubarbbreve -\DeclareRobustCommand\ubarsbreve{{\metricsfont f}} -\let\ubarsbrevis\ubarsbreve -\DeclareRobustCommand{\ubrevelunga}{{\metricsfont\char107}} -\let\ubrevislonga\ubrevelunga +\DeclareRobustCommand\longa{{\metricsfont l}} +\DeclareRobustCommand\brevis{\textormath{{{\metricsfont b}}}{\br@ve}} +\DeclareRobustCommand\bbrevis{{\metricsfont c}} +\DeclareRobustCommand\barbrevis{{\metricsfont i}} +\DeclareRobustCommand\barbbrevis{{\metricsfont j}} +\DeclareRobustCommand\ubarbrevis{{\metricsfont d}} +\DeclareRobustCommand\ubarbbrevis{{\metricsfont e}} +\DeclareRobustCommand\ubarsbrevis{{\metricsfont f}} +\DeclareRobustCommand{\ubrevislonga}{{\metricsfont\char107}} % \end{macrocode} %\end{macro} @@ -3000,15 +3025,6 @@ Type X to exit.}% %\end{macro} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} -%\end{macro} -%\end{macro} -%\end{macro} -%\end{macro} -%\end{macro} -%\end{macro} -%\end{macro} % %\begin {macro}{\corona} %\begin {macro}{\ElemInd} @@ -3024,19 +3040,22 @@ Type X to exit.}% %\begin {macro}{\aeolicbii} %\begin {macro}{\aeolicbiii} %\begin {macro}{\aeolicbiv} -% Similarly the following symbols have straightforward definitions. Only |\hiatus| -% and |\Hiatus| require a small explanation; |\hiatus| inserts a small capital `H' -% in superscript position; in a first moment it was chosen the solution of designing -% a specific sans serif glyph in superscript position directly in the metric symbol -% font (actually this symbol is still part of the font), but while testing it, Paolo -% Ciacchi observed that a regular `H' with serifs was better looking than the sans -% serif counterpart. Therefore the definition was changed in order to use the -% current font upright shape; by specifying `H', it is irrelevant if the current one -% is a Latin font, and the letter is a capital 'h', or if the current one is a Greek -% font and the letter is a capital `eta'. |\Hiatus| displays the same symbol in a -% zero width box so that it does not occupy any horizontal space; it is useful while -% writing down complicated metric sequences. Macro|\X| may be considered, thanks to -% its shape, a mnemonic shortcut in place of the full name |\anceps|. +% Similarly the following symbols have straightforward definitions. +% Only |\hiatus| and |\Hiatus| require a small explanation; |\hiatus| +% inserts a small capital `H' in superscript position; initially it was +% chosen the solution of designing a specific sans serif glyph in +% superscript position directly in the metric symbol font (actually this +% symbol is still part of the font), but while testing it, Paolo Ciacchi +% observed that a regular `H' with serifs was better looking than the +% sans serif counterpart. Therefore the definition was changed in order +% to use the current font upright shape; by specifying `H', it is +% irrelevant if the current one is a Latin font, and the letter is a +% capital 'h', or if the current font is a Greek one and the letter is a +% capital `eta'. |\Hiatus| displays the same symbol in a zero width box +% so that it does not occupy any horizontal space; it is useful while +% writing down complicated metric sequences. Macro|\X| may be considered, +% thanks to its shape, a mnemonic shortcut in place of the full name +% |\anceps|. % \begin{macrocode} \DeclareRobustCommand\corona{{\metricsfont\char20}} \let\ElemInd\corona @@ -3073,20 +3092,25 @@ Type X to exit.}% %\begin{macro}{\2} %\begin{macro}{\3} %\begin{macro}{\4} -% Here we prepare for the definition of a very useful macro, |\newmetrics|, that -% should ease quite a lot writing complicated and repetitive metric sequences. -% We shall define |\newmetrics| by means of the internal \LaTeX\ macro |\@namedef| -% which accepts a macro name containing any character, provided this name does not -% contain the initial back slash (if it does this back slash becomes part of the -% macro name; see the \TeX{}book where there is an example for the definition of -% |\\TeX|). Therefore we need a service macro |\stripsl@sh| that strips the first -% token from the control sequence, so that the na\"if user does not have to treat -% the new metrics control sequence differently from the control sequences it uses -% for example with |\newcommand|. Next we define three numeric control sequences -% that should be followed by the rest of the macro name. -% The na\"if user can then type in something like \verb*+\2iamb + in order to -% activate a macro whose name is formed by the tokens |2iamb|, which is normally -% impossible in \LaTeX. Notice, though, the compulsory space after the macro name. +% Here we prepare for the definition of a very useful macro, +% |\newmetrics|, that should ease quite a lot writing complicated and +% repetitive metric sequences. +% We shall define |\newmetrics| by means of the internal \LaTeX\ +% macro |\@namedef| which accepts a macro name containing any +% character, provided this name does not +% contain the initial back slash (if it does this back slash +% becomes part of the macro name; see the \TeX{}book where there +% is an example for the definition of |\\TeX|). Therefore we need +% a service macro |\stripsl@sh| that strips the first token from +% the control sequence, so that the na\"if user does not have to +% treat the new metrics control sequence differently from the +% control sequences it uses for example with |\newcommand|. +% Next we define three numeric control sequences that should be +% followed by the rest of the macro name. The na\"if user can then +% type-in something like \verb*+\2iamb + in order to activate +% a macro whose name is formed by the tokens |2iamb|, which is +% normally impossible in \LaTeX. Notice, though, the compulsory +% space after the macro name. % \begin{macrocode} \newif\ifmetricsfont\metricsfontfalse \def\stripsl@sh#1{\expandafter\@gobble\string#1} @@ -3100,10 +3124,10 @@ Type X to exit.}% %\end{macro} %\end{macro} %\begin {macro}{\newmetrics} -% Here is the user macro |\newmetrics|, to be used just as |\newcommand|, except it -% accepts a macro name starting with one of the digits `2', `3', or `4', and sets -% the suitable boolean variable to true so that in a long metric sequence the metric -% font might be selected just once. +% Here is the user macro |\newmetrics|, to be used just as |\newcommand|, +% except it accepts a macro name starting with one of the digits `2', +% `3', or `4', and sets the suitable boolean variable to true so that in +% a long metric sequence the metric font might be selected just once. % \begin{macrocode} \newcommand\newmetrics[2]{% \expandafter\@namedef\expandafter{\stripsl@sh#1}% @@ -3120,27 +3144,28 @@ Type X to exit.}% %\begin {macro}{\hexam} %\begin {macro}{\pentam} %\begin {macro}{\2tr} -% Here some common metric sequences are defined; some define single measures, such -% as the `iambus' or the `choriambus', while some define complete verses such as the -% `hexameter' or the `pentameter'. +% Here some common metric sequences are defined; some define single +% measures, such as the `iambus' or the `choriambus', while some +% define complete verses such as the `hexameter' or the `pentameter'. % \begin{macrocode} -\newmetrics\iam{\barbreve\lunga\breve\lunga} -\newmetrics\chor{\lunga\breve\breve\lunga} -\newmetrics\enopl{\breve\lunga\breve\breve\lunga\breve\breve\lunga} -\newmetrics{\4MACRO}{\lunga\lunga\lunga\lunga} -\newmetrics{\aeolchorsor}{\lunga\zeugma{\breve\breve}\breve - \breve\zeugma{\breve\breve}} -\newmetrics{\hexam}{\lunga\breve\breve\lunga\breve\breve - \lunga\breve\breve\lunga\breve\breve\lunga\breve\breve - \lunga\lunga} -\newmetrics{\pentam}{\lunga\barbbreve\lunga\barbbreve\lunga\dBar - \lunga\breve\breve\lunga\breve\breve\lunga} -\newmetrics{\2tr}{\lunga\breve\lunga\X\ \lunga\breve\lunga\X\ } +\newmetrics\iam{\barbrevis\longa\brevis\longa} +\newmetrics\chor{\longa\brevis\brevis\longa} +\newmetrics\enopl{\brevis\longa\brevis\brevis\longa\brevis\brevis\longa} +\newmetrics{\4MACRO}{\longa\longa\longa\longa} +\newmetrics{\aeolchorsor}{\longa\zeugma{\brevis\brevis}\brevis + \brevis\zeugma{\brevis\brevis}} +\newmetrics{\hexam}{\longa\brevis\brevis\longa\brevis\brevis + \longa\brevis\brevis\longa\brevis\brevis\longa\brevis\brevis + \longa\longa} +\newmetrics{\pentam}{\longa\barbbrevis\longa\barbbrevis\longa\dBar + \longa\brevis\brevis\longa\brevis\brevis\longa} +\newmetrics{\2tr}{\longa\brevis\longa\X\ \longa\brevis\longa\X\ } % \end{macrocode} -% As it may be seen, the definition of such metric sequences may contain almost -% anything; here |\zeugma| was used as well as \verb*+\ +, but almost every -% macro defined in the previous parts may be freely used. +% As it may be seen, the definition of such metric sequences may +% contain almost anything; here |\zeugma| was used as well as +% \verb*+\ +, but almost every macro defined in the previous parts +% may be freely used. %\end{macro} %\end{macro} %\end{macro} @@ -3151,12 +3176,13 @@ Type X to exit.}% %\end{macro} % %\begin{macro}{\metricstack} -% |\metricstack| is a command similar to |\shortstack| used to stack something over -% something else; specifically the second argument over the third one; it was -% specifically designed for use while typesetting metric sequences, but actually -% there is nothing that forbids to use it with any base character (typeset in text -% LR mode) and any superscript character belonging to a math alphabet (which is -% being set in script--script style, not in script style, as it happens with +% |\metricstack| is a command similar to |\shortstack| used to stack +% something over something else; specifically the second argument over +% the third one; it was specifically designed for use while typesetting +% metric sequences, but actually there is nothing that forbids to use it +% with any base character (typeset in text LR mode) and any superscript +% character belonging to a math alphabet (which is being set in +% script--script style, not in script style, as it happens with % |\shortstack|. % \begin{macrocode} \DeclareRobustCommand*{\metricstack}[2]% @@ -3168,16 +3194,17 @@ Type X to exit.}% % %\begin{macro}{\svert} % |\svert| is a short vertical rule that may be used, for example, with -% |\metricstack| for putting a small number over a dividing vertical bar in metric -% sequences. +% |\metricstack| for putting a small number over a dividing vertical bar +% in metric sequences. % \begin{macrocode} \newcommand*{\svert}{\vrule\@height.8ex\@depth.2ex\relax} % \end{macrocode} %\end{macro} % %\begin{macro}{\textoverline} -% \LaTeX\ has macro |\underline| that can be used in both text and math mode; there -% is nothing similar for overlining, therefore we defined a new command for this +% \LaTeX\ has macro |\underline| that can be used in both text and +% math mode; there is nothing similar for overlining, therefore we +% defined a new command for this % task. % \begin{macrocode} \DeclareRobustCommand*{\textoverline}[1]{% @@ -3192,15 +3219,17 @@ Type X to exit.}% % %\begin{macro}{\verseskip} %\begin {environment}{bracedmetrics} -% The environment |bracedmetrics| is used primarily for setting some metric -% sequences one atop the other, with a certain alignment and grouped together with a -% right brace. We need therefore a length name |\br@cedmetrics| for measuring the -% width of this large metrics sequence stack; we need a command |\verseskip| for -% inserting a blank space before, after or in the middle of a metric sequence, that -% more or less is as wide as an integer number of metric symbols, and, last but not -% least, the environment itself for typesetting this large object containing the -% said metric sequences; see the documentation file \texttt{teubner-doc.pdf} for -% examining some examples. +% The environment |bracedmetrics| is used primarily for setting +% some metric sequences one atop the other, with a certain alignment +% and grouped together with a right brace. We need therefore a length +% name |\br@cedmetrics| for measuring the width of this large metrics +% sequence stack; we need a command |\verseskip| for inserting a blank +% space before, after or in the middle of a metric sequence, that +% more or less is as wide as an integer number of metric symbols, +% and, last but not least, the environment itself for typesetting +% this large object containing the said metric sequences; see the +% documentation file \texttt{teubner-doc.pdf} for examining some +% examples. % \begin{macrocode} \newlength{\br@cedmetrics} \newcommand*{\verseskip}[1]{{% @@ -3224,30 +3253,37 @@ $\displaystyle\left.% %\begin{macro}{\GTROF} %\begin{macro}{\treceon} %\begin{macro}{\traceoff} -% Here there are some macros for turning on and off the tracing facilities of \TeX, -% that turn out to be useful while debugging; they are accessible also to the end -% user. Global settings must be turned on and off globally; local settings -% die out by themselves when a group is closed, but it is a good habit to explicitly -% turn them out regardless of groups. Attention that when the tracing facilities are -% on and a page ship out takes place, the |.log| file receives a lot of material, -% and this file gets very large. In order to avoid logging too much information the -% |trace| package is loaded; this package give access to the macros |\traceon| and -% |\traceoff| that log a lot of information, except the redundant one, specifically -% all the macros executed during any font change. Users don't realize the amount of -% processing done behind the scenes when with the New Font Selection Scheme (NFSS) a -% font change takes place; luckily enough modern processors are quite fast so that -% the compilation CPU time does not become too heavy. But if the \TeX\ processing is -% logged, this amount of work implies thousands of lines of almost meaningless -% information when the purpose of logging depends on errors that are difficult to -% spot; Font changes are almost exempt from errors, so the processing of the inner -% workings need not be logged down. -% -% If the user needs to trace something in order to spot errors, s/he is invited to -% use the commands |\traceon| and |\traceoff|; commands |\TRON| and |\TROF| do log -% much more material, in particular font changes, but at least they action may be -% confined within groups or environments; |\GTRON| and |\GTROF| are global settings -% and can't be confined within groups or environments; sometimes they are necessary, -% but it's important to turn off global tracing as soon as possible. +% Here there are some macros for turning on and off the tracing +% facilities of \TeX, that turn out to be useful while debugging; +% they are accessible also to the end user. Global settings must +% be turned on and off globally; local settings die out by themselves +% when a group is closed, but it is a good habit to explicitly +% turn them out regardless of groups. Attention that when the +% tracing facilities are on and a page ship out takes place, the +% |.log| file receives a lot of material, and this file gets very +% large. In order to avoid logging too much information the +% |trace| package is loaded; this package give access to the +% macros |\traceon| and |\traceoff| that log a lot of information, +% except the redundant one, specifically all the macros executed +% during any font change. Users don't realise the amount of +% processing done behind the scenes when with the New Font Selection +% Scheme (NFSS) a font change takes place; luckily enough modern +% processors are quite fast so that the compilation CPU time does +% not become too heavy. But if the \TeX\ processing is logged, +% this amount of work implies thousands of lines of almost +% meaningless information when the purpose of logging depends +% on errors that are difficult to spot; Font changes are almost +% exempt from errors, so the processing of the inner workings need +% not be logged down. +% +% If the user needs to trace something in order to spot errors, +% s/he is invited to use the commands |\traceon| and |\traceoff|; +% commands |\TRON| and |\TROF| do log much more material, in +% particular font changes, but at least they action may be +% confined within groups or environments; |\GTRON| and |\GTROF| +% are global settings and can't be confined within groups or +% environments; sometimes they are necessary, but it's important +% to turn off global tracing as soon as possible. % \begin{macrocode} \RequirePackage{trace} \def\GTRON{\global\tracingcommands=\tw@ \global\tracingmacros=\tw@} @@ -3264,202 +3300,124 @@ $\displaystyle\left.% %\end{macro} % % \subsection{Classical Greek numerals} -% When typesetting Greek it may occur to specify numbers written out as Milesian -% numerals; the |greek| option to the \babel\ package defines a couple of -% macros for transforming explicit arabic numerals or counter contents as Milesian -% numerals. Since this package offers more possibilities in the choice of those -% ``non alphabetic'' characters used in the Milesian notation, such macros have to -% be redefined. On the occasion we changed some little internal details so as to make such macros a little faster and more robust. +% When typesetting Greek it may occur to specify numbers written +% out as Milesian numerals; the |greek| option to the \babel\ +% package defines a couple of macros for transforming explicit +% Arabic numerals or counter contents as Milesian numerals. Since +% this package offers more possibilities in the choice of those +% ``non alphabetic'' characters used in the Milesian notation, +% such macros have to be redefined. On the occasion we changed +% some little internal details so as to make such macros a little +% faster and more robust. +% %\begin{macro}{\Greeknumeral} %\begin{macro}{\greeknumeral} -%\begin{macro}{\@ifStar} %\begin{macro}{\grtoday} -% Both |\greeknumeral| and |\Greeknumeral|, the latter producing upper case Greek -% numerals, while the former produces lower case ones, resort to a service macro -% |\gr@@numeral|. But the new definition accepts the starred version; without the -% star the digit value~6 is represented with a ``stigma'', while with the star that -% value is represented with a lowered ``digamma''. The upper case version requires -% intermediate macros before using |\MakeUppercase| on the result in order to -% convert lower to upper case Milesian value symbols. This means that |\gr@@numeral| -% may work only with lower case symbols. -% It turned out that the normal redefinition command |\renewcommand| produced -% fragile commands that broke out when used as arguments of other commands, -% specifically the Greek date was broken when it was passed as the argument to the -% |\date| command of the class \textsf{memoir}; therefore I decided to redefine the -% |\@ifstar| macro into another |\@ifStar| one so as not to fiddle with \LaTeX\ -% kernel commands. I defined also the lowercase version of the |\grtoday| date, -% since the \babel\ package provides only the |\today| command with no control over -% the use of which type of numerals; |\grtoday| uses the lowercase Milesian numerals -% through the redefined |\greeknumeral| macro. -% \begin{macrocode} -\def\@ifStar#1#2{\def\@tempA{#1}\def\@tempB{#2}\futurelet\@tempC\@testStar} -\def\@testStar{\ifx\@tempC*\bbl@afterelse\expandafter\@tempA\@gobble\else - \bbl@afterfi\@tempB\fi} - -\DeclareRobustCommand*{\Greeknumeral}{% - \let\n@vanta\textQoppa\let\n@vecento\textSampi - \@ifStar{\Gr@@kn@meral}{\Gr@@knum@ral}} - -\DeclareRobustCommand*{\greeknumeral}{% - \let\n@vanta\textqoppa\let\n@vecento\textsampi - \@ifStar{\let\s@i\textstigma\gr@@numeral}{\let\s@i\fLow\gr@@numeral}} - -\def\Gr@@kn@meral#1{\let\s@i\textStigma - \expandafter\MakeUppercase\expandafter{\gr@@numeral{#1}}} - -\def\Gr@@knum@ral#1{\let\s@i\textDigamma - \expandafter\MakeUppercase\expandafter{\gr@@numeral{#1}}} - -\def\grtoday{{\expandafter\greeknumeral\expandafter{\the\day}}\space -\gr@c@month\space{\expandafter\greeknumeral\expandafter{\the\year}}} - -% \end{macrocode} -%\end{macro} -%\end{macro} -%\end{macro} -%\end{macro} -%\begin{macro}{\gr@@numeral} -% |\gr@@numeral| must do most of the processing; it must check that the argument is -% within the allowable range $1\sim999\,999$ and issue suitable warnings if not. On -% the other side, if the number is within the correct range, it must check in which -% decade it falls and must call other macros so as to produce the correct decimal -% digit~$\leftrightarrow$ Milesian symbol. Six such macros are needed because the -% allowable range contains at maximum six decimal places. Apparently Milesian -% symbology allows to go beyond one million, but Apostolos Syropoulos, who -% originally wrote the code thought (correctly) that Milesian numbers would not be -% used for ``acrobatic performances'' but possibly for writing the Greek date with -% the AD year; six decimal places are more than enough for this purpose. -% |\gr@ill@value| was not redefined from Apostolos Syropoulos' \babel\ definition; -% it simply issues a warning message about an argument out of range. The presence -% of the primitive command |number| in these macros is for two purposes: -% (a) transforms a counter contents into a sequence of digits tokens, and -% (b) if the argument is already a digit string, it removes any leading zeros. -% No braces are present because this string is examined sequentially one digit -% at a time from the leading position to the least significant position; of -% course this means that the decimal zero is treated correctly even if Milesian -% symbols do not have the equivalent of a zero. -% The double opening and closing braces are necessary to avoid a space vanishing -% after using the |\gr@@numeral| macro; the six levels of digit reprentation are -% corrected with the LICR macoros. -% \begin{macrocode} -\def\gr@@numeral#1{{% - \ifnum#1<\@ne\space\gr@ill@value{#1}% - \else - \ifnum#1<10\relax\expandafter\gr@num@i\number#1% - \else - \ifnum#1<100\relax\expandafter\gr@num@ii\number#1% - \else - \ifnum#1<\@m\relax\expandafter\gr@num@iii\number#1% - \else - \ifnum#1<\@M\relax\expandafter\gr@num@iv\number#1% - \else - \ifnum#1<100000\relax\expandafter\gr@num@v\number#1% - \else - \ifnum#1<1000000\relax\expandafter\gr@num@vi\number#1% - \else - \space\gr@ill@value{#1}% - \fi - \fi - \fi - \fi - \fi - \fi - \fi -}} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\gr@num@i} -%\begin{macro}{\gr@num@ii} -%\begin{macro}{\gr@num@iii} -%\begin{macro}{\gr@num@iv} -%\begin{macro}{\gr@num@v} -%\begin{macro}{\gr@num@vi} -% The next six macros transform single decimal digits into Milesian symbols. The -% argument to each macro is a single decimal digit; their positional value is -% determined by the calling a macro that invokes a different transformation routine -% for every position. -% To the right of the least significant position there must be the symbol -% ``anwtonos'', similar to an apostrophe, while to the left of each most significant -% symbol whose value is greater than 999 there must be a ``katwtonos'' symbol, -% similar to a lowered and inverted apostrophe. Zeros are examined in all macros, -% except the one for ``units'', because their value cannot be printed but there -% still is the possibility that there are no more digits higher than zero, so that -% the anwtonos must be set. -% Macros |\n@vanta| and |\n@vecento| are set by the calling macros so as to be the -% correct lower or upper case `qoppa' or sampi' respectively. -% \begin{macrocode} -\def\gr@num@i#1{% - \ifcase#1\or \textalpha\or \textbeta\or \textgamma\or - \textdelta\or \textepsilon - \or \s@i\or \textzeta\or \texteta\or \texttheta\fi - \ifnum#1=\z@\else\anw@true\fi\anw@print} -\def\gr@num@ii#1{% - \ifcase#1\or \textiota\or \textkappa\or \textlambda\or \textmu\or \textnu% - \or \textxi\or \textomicron\or \textpi\or \n@vanta\fi - \ifnum#1=\z@\else\anw@true\fi\gr@num@i} -\def\gr@num@iii#1{% - \ifcase#1\or \textrho\or \textsigma\or \texttau\or \textupsilon - \or \textphi\or \textchi\or \textpsi\or \textomega\or \n@vecento\fi - \ifnum#1=\z@\anw@false\else\anw@true\fi\gr@num@ii} -\def\gr@num@iv#1{% - \ifnum#1=\z@\else\katwtonos\fi - \ifcase#1\or \textalpha\or \textbeta\or \textgamma\or \textdelta - \or \textepsilon\or \s@i\or \textzeta\or \texteta\or \texttheta\fi - \gr@num@iii} -\def\gr@num@v#1{% - \ifnum#1=\z@\else\katwtonos\fi - \ifcase#1\or \textiota\or \textkappa\or \textlambda\or - \textmu\or \textnu\or \textxi\or \textomicron\or \textpi\or \n@vanta\fi - \gr@num@iv} -\def\gr@num@vi#1{% - \katwtonos - \ifcase#1\or \textrho\or \textsigma\or \texttau\or \textupsilon - \or \textphi\or \textchi\or \textpsi\or \textomega\or \n@vecento\fi - \gr@num@v} - +% Both |\greeknumeral| and |\Greeknumeral|, the latter producing +% upper case Greek numerals, while the former produces lower case +% ones, resort to robust internal macros if the |greek.ldf| language +% description style; they are renamed versions of the original macros +% that ar perfect for modern Greek usage; therefore we simply let the +% glyph placeholders for the vales 6, 90, and 900, originally indicated +% with the place hoders |\textstigma| and |\textkoppa|, (together with +% their capital glyph counterparts) the the place holders for +% |\textdigamma| and |\textqoppa|; with the value~6, we decided to use +% either the stigma or the digamma sign by using the usual asterisk +% added to the macro names; the \LaTeX\,3 language greatly simplifies +% this task. +% +% Therefore |\Greeknumeral| and% |\greeknumeral| macros are redefined +% by means of |\RenewDocumentCommand| that assures solidity and by +% resorting to the internal |greek.ldf| macros, we avoid all the tests +% that the previous version had to make in order to handle the +% |\anwtonos|; furthermore the code is much simpler to maintain. +% Notice that the glyph for ‘90’ is the old styled ‘qoppa’ and +% for ‘900’ it is the 'sampi’; if the asterisk is specified, the +% glyph for ‘6’ is the lowered digamma, wile without the asterisk +% it is the ‘stigma’, the other Milesian numerals are the other +% 26 Greek letters. +% the Greek date in capital letters is already provided by the +% |greek.ldf| file; we define the |\grtoday| date in lower case +% letters that differs from the |\today| one, because the numerals +% for the day and the year are composed with the Greek numeral macros +% just defined, The optional asterisk ti |\grtoday| is passed directly to the |\greeknumeral| macros, although in a complicated way in order to avoid messing the |\expandafter| workings +% \begin{macrocode} +% + +\RenewDocumentCommand\Greeknumeral{s m}{\bgroup% + \let\textkoppa\textqoppa \let\textKoppa\textQoppa + \IfBooleanTF{#1}% + {\let\textstigmagreek\textstigma \let\textStigmagreek\textStigma}% + {\let\textstigmagreek\textdigamma \let\textStigmagreek\textDigamma}% + \bbl@greek@GreekNum\@secondoftwo{#2}\egroup} + +\RenewDocumentCommand\greeknumeral{s m}{\bgroup% + \let\textkoppa\textqoppa \let\textKoppa\textQoppa + \IfBooleanTF{#1}% + {\let\textstigmagreek\textstigma \let\textStigmagreek\textStigma}% + {\let\textstigmagreek\textdigamma \let\textStigmagreek\textDigamma}% + \bbl@greek@GreekNum\@firstoftwo{#2}\egroup} + +\NewDocumentCommand\grtoday{ s }% +{\bgroup\IfBooleanTF{#1}% +{\greeknumeral*{\the\day}\space\gr@c@month\space\greeknumeral*{\the\year}}% +{\greeknumeral{\the\day}\space\gr@c@month\space\greeknumeral{\the\year}}% +\egroup} + % \end{macrocode} -%\end{macro} -%\end{macro} -%\end{macro} +% %\end{macro} %\end{macro} %\end{macro} % %\subsection{Attic numerals} -% It's true that Apostolos Siropoulos wrote also the |athnum.sty| extension package -% in order to typeset integer numbers with the Athenian or Attic notation; this -% representation of integer strictly positive integers was similar in a way to the -% Roman notation, based on a biquinalry representation of decimal digits (taking -% into account that there was not a symbol for zero) so as the Romans had the -% symbols for 1, 5, 10, 50, 100, 500 and 1000 (I, V, X, L, C, D, M) the Attic -% notation has symbols for the same sequence of decimal values extended with -% 10\,000 and 50\,000. While typesetting philological texts in Greek it might be -% necessary to use also the Attic notation. % As the original Roman notation used -% to be purely additive (i.e.\ 9\,=\,VIIII), so is the Attic notation. +% It's true that Apostolos Siropoulos wrote also the |athnum.sty| +% extension package in order to typeset integer numbers with the +% Athenian or Attic notation; this representation of strictly +% positive integers was similar in a way to the Roman notation, +% based on a biquinary\footnote{The word \emph{biquinary} +% does not appear in the Oxford dictionary, but its etymology +% is pretty clear: couples of quintets. After all we have two +% hands with five fingers each, and we started counting on our +% hands since we were little children.} representation of decimal +% digits (taking into account that there was not a symbol for zero) +% so as the Romans had the symbols for 1, 5, 10, 50, 100, 500 and +% 1000 (I, V, X, L, C, D, M). The Attic notation has symbols for +% the same sequence of decimal values extended with 10\,000 and +% 50\,000. +% +% While typesetting philological texts in Greek it might be +% necessary to use also the Attic notation. As the original +% Roman notation used to be purely additive (i.e. +% $9\to\mathrm{VIIII}$ different from the subtractive one +% $9\to\mathrm{IX}$), so is the Attic notation. % %\begin{macro}{\AtticNumeral} %\begin{macro}{\AtticCycl@} -% Therefore another conversion macro was devised that receives the value to be -% converted as its argument and checks that it falls between the boundaries; -% actually the lower boundary is zero, while the upper boundary was chosen to be -% 99\,999, for no other reason that the lack of further symbols, beyond the value -% 50\,000, would force to long sequences of identical symbols that are difficult -% to read. The |athnum.sty| package allows to extend this range to 249\,9999; -% should it be necessary, the user is invited to load that package and its +% Therefore another conversion macro was devised that receives +% the value to be converted as its argument: first it checks +% that such argument falls in the allowed range; actually the lower +% boundary is zero, while the upper boundary was chosen to be +% 99\,999, for no other reason than the lack of further symbols +% beyond the value 50\,000, that would force to long sequences of +% identical symbols that are difficult to read. The |athnum.sty| +% package allows to extend this range to 249\,9999; should it be +% necessary, the user is invited to load that package and its % transformation command |\athnum|. % -% The user command |\AtticNumeral| is very simple, but it must be preceded by the -% definitions of the quinary symbols for 50, 500, 5000, and 50\,000; such symbols -% are present in all the CB Greek fonts in all sizes, series and shapes; therefore -% the definitions must be subject to the LGR enconding: +% The user command |\AtticNumeral| must be preceded by the +% definitions of the biquinary symbols for 50, 500, 5000, and +% 50\,000; such symbols are present in all the CB Greek fonts +% in all sizes, series and shapes; therefore the definitions +% must be subject to the LGR encoding: % \begin{macrocode} \DeclareTextSymbol{\Vmiria}{\GRencoding@name}{5} \DeclareTextSymbol{\Vkilo}{\GRencoding@name}{4} \DeclareTextSymbol{\Vetto}{\GRencoding@name}{3} \DeclareTextSymbol{\Vdeka}{\GRencoding@name}{2} % \end{macrocode} -% The we need a command for issuing a warning message if the number to be -% transformed is out of range: +% The we need a command to issue a warning message if the number +% to be transformed is out of range: % \begin{macrocode} \newcommand*\attic@ill@value[1]{\PackageWarning{teubner}{% Illegal value (\number#1) for \string\ActicNumeral\space}} @@ -3474,40 +3432,60 @@ Illegal value (\number#1) for \string\ActicNumeral\space}} \fi} % \end{macrocode} -% The real transformation algorithm is transfered to the auxiliary macro -% |\AttiCycl@|, where successive division by 10 allow to extract the various decimal -% digits of various weights maintaining the remainder in the original counter; each -% decimal digit is possibly divided into the quinary value and the remaining units -% up to 4; the the cycle is repeated untile the decimal units, that do not require -% the computation of the remainder and terminate the cycle. Notice that we use also -% the $\varepsilon$-\TeX\ extended commands for integer computations; this implies -% that |teubner| mus be run with a suitably recent version of the typesetting engine +% The real transformation algorithm is transferred to the +% auxiliary macro |\AttiCycl@|, where successive division by +% 10 allow to extract the various decimal digits of various +% weights maintaining the remainder in the original counter; +% each decimal digit is possibly divided into the biquinary value +% and the remaining units up to~4; the the cycle is repeated +% until the decimal units that do not require the computation +% of the remainder and terminate the cycle. Notice that we use +% also the $\varepsilon$-\TeX\ extended commands for integer +% computations; this implies that |teubner| must be run with +% a suitably recent version of the typesetting engine % that embeds the above extensions. % \begin{macrocode} \def\AtticCycl@#1{% - \bgroup - \countdef\valore=252\countdef\cifra=250\relax - \valore=#1\relax - \cifra=\valore\divide\cifra10000\relax - \valore=\numexpr\valore-\cifra*10000\relax - \ifnum\cifra>4\relax\Vmiria \advance\cifra-5\relax\fi - \@whilenum\cifra>\z@\do{M\advance\cifra\m@ne}% - \cifra=\valore\divide\cifra1000\relax - \valore=\numexpr\valore-\cifra*1000\relax - \ifnum\cifra>4\relax\Vkilo \advance\cifra-5\relax\fi - \@whilenum\cifra>\z@\do{Q\advance\cifra\m@ne}% - \cifra=\valore\divide\cifra100\relax - \valore=\numexpr\valore-\cifra*100\relax - \ifnum\cifra>4\relax\Vetto \advance\cifra-5\relax\fi - \@whilenum\cifra>\z@\do{H\advance\cifra\m@ne}% - \cifra=\valore\divide\cifra10\relax - \valore=\numexpr\valore-\cifra*10\relax - \ifnum\cifra>4\relax\Vdeka \advance\cifra-5\relax\fi - \@whilenum\cifra>\z@\do{D\advance\cifra\m@ne}% - \cifra=\valore - \ifnum\cifra>4\relax P\advance\cifra-5\relax\fi - \@whilenum\cifra>\z@\do{I\advance\cifra\m@ne}% - \egroup} + \bgroup + \countdef\valore=252\countdef\cifra=250\relax + \valore=#1\relax + \@whilenum\valore>0\do{% + \ifnum\valore>9999\relax + \cifra=\valore\divide\cifra10000\relax + \valore=\numexpr\valore-\cifra*10000\relax + \ifnum\cifra>4\relax\Vmiria \advance\cifra-5\relax\fi + \@whilenum\cifra>\z@\do{M\advance\cifra\m@ne}% + \else + \ifnum\valore>999\relax + \cifra=\valore\divide\cifra1000\relax + \valore=\numexpr\valore-\cifra*1000\relax + \ifnum\cifra>4\relax\Vkilo \advance\cifra-5\relax\fi + \@whilenum\cifra>\z@\do{Q\advance\cifra\m@ne}% + \else + \ifnum\valore>99\relax + \cifra=\valore\divide\cifra100\relax + \valore=\numexpr\valore-\cifra*100\relax + \ifnum\cifra>4\relax\Vetto \advance\cifra-5\relax\fi + \@whilenum\cifra>\z@\do{H\advance\cifra\m@ne}% + \else + \ifnum\valore>9\relax + \cifra=\valore\divide\cifra10\relax + \valore=\numexpr\valore-\cifra*10\relax + \ifnum\cifra>4\relax\Vdeka \advance\cifra-5\relax\fi + \@whilenum\cifra>\z@\do{D\advance\cifra\m@ne}% + \else + \ifnum\valore>0\relax + \cifra=\valore + \ifnum\cifra>4\relax P\advance\cifra-5\relax\fi + \@whilenum\cifra>\z@\do{I\advance\cifra\m@ne}% + \valore=\cifra + \fi + \fi + \fi + \fi + \fi + }% + \egroup} % \end{macrocode} %\end{macro} @@ -3520,12 +3498,13 @@ Illegal value (\number#1) for \string\ActicNumeral\space}} %<*tbtx> %\fi %\section{Accessing the CBgreek fonts when the TX fonts are selected} -% During the year 2010 this package \textsf{teubner.sty} was upgraded in order to allow -% using the CBgreek fonts even when other Latin fonts, different from the ``standard'' CM -% and LM ones are selected for typesetting text with the Latin script. +% During the year 2010 this package \textsf{teubner.sty} was upgraded +% in order to allow using the CBgreek fonts even when other Latin +% fonts, different from the ``standard'' CM and LM ones are selected +% for typesetting text with the Latin script. -% At the same time Antonis Tsolomitis uploaded a new package in order to let -% Greek users use some Greek fonts that match the Times eXtended +% At the same time Antonis Tsolomitis uploaded a new package in order +% to let Greek users use some Greek fonts that match the Times eXtended % ones\footnote{Probably Antonis Tsolomitis' Greek fonts match also the % newer Times eXtended fonts produced by Michael Sharpe. The newer fonts % have different font family names than the previous TX fonts; in order @@ -3536,23 +3515,25 @@ Illegal value (\number#1) for \string\ActicNumeral\space}} % |lgrtxss.fd|, |lgrtxtt.fd|, font definition files that allow the font % switching implied by the |greek| option to the \textsf{babel} package. % These files take precedence over the mechanism outlined in -% section~\ref{ssec:LatinFontComp}, because command |\substitutefontfamily| -% first tests the existence of |lgrtxr.fd|, and, if this is not available, -% it may generate a specific one suitable for working smoothly with +% section~\ref{ssec:LatinFontComp}, because command +% |\substitutefontfamily| first tests the existence of |lgrtxr.fd|, +% and, if this is not available, it may generate a specific one +% suitable for working smoothly with % \textsf{teubner.sty}. % % Now if Tsolomitis' files are available on the main system tree, these % take precedence and the \textsf{teubner} compatible files are not % generated. Unfortunately Tsolomitis' fonts, although better suited to -% match the TX fonts, are well matched to modern Greek typesettin, +% match the TX fonts, are well matched to modern Greek typesetting, % but they are incomplete for philological typesetting. % -% We therefore avoid this clash by creating a \textsf{teubnertx.sty} file. -% This extension defines the families and shapes available with the -% familiar fond definition files, but the information gets input by +% We therefore avoid this clash by creating a \textsf{teubnertx.sty} +% file. This extension defines the families and shapes available with +% the familiar font definition files, but the information gets input by % \textsf{teubner.sty} at the ``begin document'' time, without resorting -% to any |.fd| file. May be more information is loaded than is strictly -% necessary, but it better to do this way than to clash with other packages. +% to any |.fd| file. Maybe more information is loaded than is strictly +% necessary, but it is better to do this way than to clash with other +% packages. % \begin{macrocode} \DeclareFontFamily{LGR}{txr}{} \DeclareFontShape{LGR}{txr}{m}{n}{<->ssub * cmr/m/n}{} -- cgit v1.2.3