diff options
Diffstat (limited to 'macros')
37 files changed, 2754 insertions, 1280 deletions
diff --git a/macros/latex/contrib/crefthe/crefthe-doc.pdf b/macros/latex/contrib/crefthe/crefthe-doc.pdf Binary files differindex 67f9587e8f..734263af64 100644 --- a/macros/latex/contrib/crefthe/crefthe-doc.pdf +++ b/macros/latex/contrib/crefthe/crefthe-doc.pdf diff --git a/macros/latex/contrib/crefthe/crefthe-doc.tex b/macros/latex/contrib/crefthe/crefthe-doc.tex index 80597e3b61..877e68119b 100644 --- a/macros/latex/contrib/crefthe/crefthe-doc.tex +++ b/macros/latex/contrib/crefthe/crefthe-doc.tex @@ -43,9 +43,13 @@ { cref,crefname, Cref,Crefname, + namecref,namecrefs, + nameCref,nameCrefs, crefformat, crefthe,crefthename, Crefthe,Crefthename, + namecrefthe,namecrefsthe, + nameCrefthe,nameCrefsthe, crefthemark, crefthepatchname, selectlanguage, @@ -112,7 +116,7 @@ \begin{document} -\def\PackageVersion{2022/07/24} +\def\PackageVersion{2022/08/28} \title{\crefthepackage{}\\\smallskip\itshape Cross referencing with proper definite articles} \author{Jinwen XU} @@ -200,7 +204,10 @@ Then you can use the command \lstinline|\crefthe| as follows: \end{itemize} \begin{tip} - There is also a stared version \lstinline|\crefthe*| for generating the same referencing text but without creating hyperlinks. + \begin{itemize} + \item There is also a stared version \lstinline|\crefthe*| for generating the same referencing text without creating hyperlinks. + \item The name-only relatives are also available: \lstinline|\namecrefthe| and \lstinline|\namecrefsthe|. + \end{itemize} \end{tip} % However, before using it, you should first define the \lstinline|\crefname|s carefully. The definite article in \lstinline|\crefname|s needs to be marked manually using \lstinline|\crefthemark|, for example: @@ -236,7 +243,7 @@ Voilà ! \section{Regarding the upper and lower cases} -The commands also have correspoding uppercased version: \lstinline|\Crefthename| and \lstinline|\Crefthe|, similar to \textsf{cleveref}'s \lstinline|\Crefname| and \lstinline|\Cref|, reserved for use at the beginning of a sentence. \lstinline|\Crefthe| can handle case changing automatically: for example, with \lstinline|\Crefthe[À]{thm1,thm2,prop3}|, you will get something like +As in \textsf{cleveref}, these commands have corresponding uppercased version: \lstinline|\Crefthename|,\linebreak \lstinline|\Crefthe|, \lstinline|\nameCrefthe| and \lstinline|\nameCrefsthe|, similar to \lstinline|\Crefname|, \lstinline|\Cref|, \lstinline|\nameCref|\linebreak and \lstinline|\nameCrefs|, reserved for using at the beginning of a sentence. \lstinline|\Crefthe| (and the name-only relatives) can handle case changing automatically: for example, with \lstinline|\Crefthe[À]{thm1,thm2,prop3}|, you will get something like \begin{demo} \textbf{Aux} théorèmes 1 et 2 et \textbf{à la} proposition 3 @@ -251,7 +258,7 @@ Of course you will have to define the \lstinline|\Crefthename|s separately, for \section{For writing multi-language documents} -To place hyperlinks at the right place, \lstinline|\crefthename| touches the corresponding \lstinline|\crefformat| internally, which makes the format language-dependent. If you are writing multi-language documents, you may consider putting \lstinline|\crefthename| inside your language configuration so as to reset it each time you select a new language. +To place hyperlinks at the correct place, \lstinline|\crefthename| touches the corresponding format macro \lstinline|\crefformat| internally, which makes the format language-dependent. If you are writing multi-language documents, you may consider putting \lstinline|\crefthename| inside your language configuration so as to reset it each time you select a new language. \section{Dealing with existed \texttt{cref} / \texttt{Cref} names} diff --git a/macros/latex/contrib/crefthe/crefthe.sty b/macros/latex/contrib/crefthe/crefthe.sty index 8a1aefe4a2..8fc93018ce 100644 --- a/macros/latex/contrib/crefthe/crefthe.sty +++ b/macros/latex/contrib/crefthe/crefthe.sty @@ -12,7 +12,7 @@ \NeedsTeXFormat{LaTeX2e}[2022-06-01] \ProvidesExplPackage {crefthe} - {2022/07/24} {} + {2022/08/28} {} {Cross referencing with proper definite articles} \keys_define:nn { crefthe } @@ -34,10 +34,14 @@ \RequirePackage { cleveref } \RequirePackage { regexpatch } -\NewCommandCopy \crefthe_cref_original:w \cref -\NewCommandCopy \crefthe_Cref_original:w \Cref -\NewCommandCopy \crefthe_crefname_original:w \crefname -\NewCommandCopy \crefthe_Crefname_original:w \Crefname +\NewCommandCopy \crefthe_cref_original:w \cref +\NewCommandCopy \crefthe_Cref_original:w \Cref +\NewCommandCopy \crefthe_crefname_original:w \crefname +\NewCommandCopy \crefthe_Crefname_original:w \Crefname +\NewCommandCopy \crefthe_namecref_original:w \namecref +\NewCommandCopy \crefthe_nameCref_original:w \nameCref +\NewCommandCopy \crefthe_namecrefs_original:w \namecrefs +\NewCommandCopy \crefthe_nameCrefs_original:w \nameCrefs \str_new:N \l__crefthe_tmpa_str @@ -61,6 +65,28 @@ \bool_gset_true:N \g__crefthe_uppercase_bool \__crefthe_cref_general:NNNnnN #1 #2 #3 { #4 } { #5 } \crefthe_Cref_original:w } + +\NewDocumentCommand \namecrefthe { t- t+ O{} m } + { + \bool_gset_false:N \g__crefthe_uppercase_bool + \__crefthe_cref_general:NNNnnN \c_false_bool #1 #2 { #3 } { #4 } \crefthe_namecref_original:w + } +\NewDocumentCommand \nameCrefthe { t- t+ O{} m } + { + \bool_gset_true:N \g__crefthe_uppercase_bool + \__crefthe_cref_general:NNNnnN \c_false_bool #1 #2 { #3 } { #4 } \crefthe_nameCref_original:w + } +\NewDocumentCommand \namecrefsthe { t- t+ O{} m } + { + \bool_gset_false:N \g__crefthe_uppercase_bool + \__crefthe_cref_general:NNNnnN \c_false_bool #1 #2 { #3 } { #4 } \crefthe_namecrefs_original:w + } +\NewDocumentCommand \nameCrefsthe { t- t+ O{} m } + { + \bool_gset_true:N \g__crefthe_uppercase_bool + \__crefthe_cref_general:NNNnnN \c_false_bool #1 #2 { #3 } { #4 } \crefthe_nameCrefs_original:w + } + \cs_new_protected:Nn \__crefthe_cref_general:NNNnnN { \tl_if_blank:eTF { #4 } diff --git a/macros/latex/contrib/teubner/README b/macros/latex/contrib/teubner/README index cc4b9fbb4a..097e845f1d 100644 --- a/macros/latex/contrib/teubner/README +++ b/macros/latex/contrib/teubner/README @@ -1,6 +1,6 @@ -This accompanies the teubner bundle version 5.4 dated February 2021 or later. +This accompanies the teubner bundle version 6.x dated November 2020 or later. -Copyright 2010-2021 Claudio Beccari +Copyright 2010-2020 Claudio Beccari The bundle contains the files @@ -11,40 +11,40 @@ teubner-doc.tex an extended documentation file teubner.pdf general and technical documentation teubner-doc.pdf specific documentation with examples -The bundle is distributed under the LPPL license version 1.3c or any later version. +The bundle is distributed under the LPPL license version 1.3c or any later +version. The bundle has the status of author maintained. The main purpose of this bundle is to provide classical philologists with some means for typesetting their documents that usually contain very specific mark up. -This version allows the typesetter to use both "italic" shapes: the Olga-like -and the Lipsian-like ones; it complies with the LICR (LaTeX Internal -Character Representation) of the Greek glyphs that avoid the kerning problems -that arise with the ligature mechanism embedded in the LGR encoded default -CBfonts; it is compatible with the use of different vector Latin Type 1 -fonts; contains new designs for the horizontally stretchable markers, et -cetera. +This version allows the typesetter to use both "italic" shapes: the +Olga-like and the Lipsian-like ones; it complies with the LICR (LaTeX +Internal Character Representation) of the Greek glyphs that avoid the +kerning problems that arise with the ligature mechanism embedded in the +LGR encoded default CBfonts; it is compatible with the use of different +vector Latin Type 1 fonts; contains new designs for the horizontally stretchable markers, et cetera. Running pdflatex on the .dtx file produces both the documentation and extracts the byproduct files teubner.sty, teubnertx.sty, teubner.pdf. The readable extended documentation file teubner-doc.pdf is obtained by running pdflatex on the teubner-doc.tex file. -Moreover this teubner package generates on the fly the font description files -necessary to use the LGR encoded Greek fonts with some non standard TeX -PostScript fonts; for example, it automatically generates the necessary +Moreover this teubner package generates on the fly the font description +files necessary to use the LGR encoded Greek fonts with some non standard +TeX PostScript fonts; for example, it automatically generates the necessary files if using the TX or the PX fonts; with other Type 1 fonts the necessary .fd files require manual intervention, which simply means giving a suitable command from within another open file that loads teubner. -Please, be sure to work with a *2010* updated collection of the CBfonts; -moreover with a *2019* or later updated version of the TeX system; with a -babel version 3.9g or later; with the language description file greek.ldf -version 1.9b or later; package teubner, version 5.2 and later, patches the -modifications of greek.ldf 1.10 so as cope with the ancient Greek numbering -system. The teubner package does not work with previous versions of -the above pieces of software; it may even produce fatal errors; therefore be sure to work only with a complete and up-to-date TeX system installation. +Please, be sure to work with a 2010 updated collection of the CBfonts; +with a *2020* updated version of the TeX system; with a babel version +3.9g or later; with the language description file greek.ldf version 1.9b +or later; teubner version 6.2 and later patches the modifications of +greek.ldf 1.10 so as cope with the ancient Greek numbering system. The +teubner package works also with previous versions of the above pieces of +software, but with limited performances. Claudio Beccari claudio dot beccari at gmail dot com
\ No newline at end of file diff --git a/macros/latex/contrib/teubner/teubner-doc.pdf b/macros/latex/contrib/teubner/teubner-doc.pdf Binary files differindex b9b8b39554..99117e0e59 100644 --- a/macros/latex/contrib/teubner/teubner-doc.pdf +++ b/macros/latex/contrib/teubner/teubner-doc.pdf diff --git a/macros/latex/contrib/teubner/teubner-doc.tex b/macros/latex/contrib/teubner/teubner-doc.tex index c0e8e11d49..a0928ce0c1 100644 --- a/macros/latex/contrib/teubner/teubner-doc.tex +++ b/macros/latex/contrib/teubner/teubner-doc.tex @@ -41,17 +41,20 @@ \usepackage{graphicx} \usepackage{microtype} \usepackage{multicol} -\title{\texttt{teubner.sty}% -\thanks{This paper documents \texttt{teubner.sty} version \fileversion\ of \filedate.}\\ -A package to extend the \textsf{greek} option\\ of the \babel\ package} +\title{\texttt{teubner}% +\thanks{This paper documents \texttt{teubner} version \fileversion\ of \filedate.}\\ +An extension for Greek philology\\ +User manual} \author{Claudio Beccari\thanks{\texttt{claudio dot beccari at gmail dot com}}} -\date{February 2021}% <---- this is the date of the teubenr-doc document! +\date{August 2022}% <---- this is the date of the teubenr-doc document! \def\comando#1{\expandafter\texttt\expandafter{\string#1}} \def\cs#1{\texttt{\char92#1}} \def\ARG#1{\texttt{\char123}\meta{#1}\texttt{\char125}} \def\meta#1{$\langle${\normalfont\itshape#1}$\rangle$} \let\marg\ARG\let\Arg\meta \def\Marg#1{\texttt{\char123#1\char125}}\let\brArg\Marg +\def\oarg#1{\texttt{[\meta{#1}]}} +\def\Oarg#1{\texttt{[#1]}} \def\opt#1{\texttt{[}\meta{#1}\texttt{]}} \def\g#1 {\textDidot{#1}} \def\l#1 {\textLipsias{#1}} @@ -78,6 +81,8 @@ A package to extend the \textsf{greek} option\\ of the \babel\ package} \DeclareRobustCommand*\setfontsize[2][1.2]{% \linespread{#1}\fontsize{#2}{#2}\selectfont} +\listfiles + \begin{document}\errorcontextlines=20 @@ -118,7 +123,6 @@ Since \pack{teubner} is a module that adds to the |greek.ldf| support for \pack{ \section{Package options} The options available to \pack{teubner} are collected in table~\ref{t:opzioni} with their meaning and usefulness. - \begin{table} \thrule \centering\def\R{\rule[-1ex]{0pt}{3ex}}\let \i\itshape @@ -218,9 +222,11 @@ You can see that the family name \texttt{futs}, corresponding to the regular Fou Notice the \verb|\Lipsiantrue| command before issuing the matching command \verb|\ifFamily}|. This command is optional and is used only if the composer wishes to use the Lipsian fonts; in this case the \texttt{li} shape is also defined, so that the \verb|\textli| and \verb|\lishape| commands do not issue any error message. At the end of the execution of the \verb|\ifFamily| command, the boolean switch is automatically reset to \verb|\Lipsianfalse|. -\noindent\textbf{Warning}: According to several maintainers of the language support packages, the procedure used with \verb|\ifFamily|, that produces in the local working directory a real, permanent \texttt{.fd} file, is not the best approach to create such pairing of fonts. G\"unter Milde, for example, produced a \pack{substitutefontfamily} package that defines the command \comando\subtitutefontfamily\ which creates a similar association, but does not write anything to the disk; simply the created association declarations are stored in the job memory, so that when the typesetting job is over, no traces remain on disk; this certainly avoids clogging the disk with the same files scattered all over in different directories that were the working ones for different typesetting jobs. +\noindent\textbf{Warning}: According to several maintainers of the language support packages, the procedure used with \verb|\ifFamily|, that produces in the local working directory a real, permanent \texttt{.fd} file, is not the best approach to create such pairing of fonts. G\"unter Milde, for example, produced a \pack{substitutefontfamily} package that defines the command \comando\subtitutefontfamily\ which creates a similar association, but does not write anything to the disk; simply the created association declarations are stored in the \TeX\ working memory, so that when the typesetting job is over, no traces remain on disk; this certainly avoids clogging the disk with the same files scattered all over in different directories that were the working ones for different typesetting jobs. + +\noindent\textbf{A small caveat}: when you issue for the first time the \verb|\ifFamily| command you might not see the expected result (while with Milde's package you immediately obtain the expected result), and your Greek text might be typeset with the default “Greek error font”. But the second time you typeset your document the expected result is obtained with the correct fonts. This is because with the very first run a new font description file is generated, and this file will be available only in subsequent typesetting runs. -A small caveat: when you issue for the first time the \verb|\ifFamily| command you might not see the expected result (while with Milde's package you immediately obtain the expected result), and your Greek text might be typeset with the default “Greek error font”. But the second time you typeset your document the expected result is obtained with the correct fonts. This is because with the very first run a new font description file is generated, and this file will be available only in subsequent typesetting runs. +\noindent\textbf{Another warning}: this \pack{teubner} package sometimes uses the “bold not extended” series, typical with the Lipsian fonts, so as to better match their medium blackness with darker fonts such as, for example, the Times extend ones. Sometimes the Lipsian shape is in force, but the metric symbols (see below) are also used, but such fonts lack the Lipsian shape. It might happen that you use some math symbols; the math symbols with \pdfLaTeX\ do not have anything similar to the Lipsian shape.In such cases the typesetting program issues a warning and at the end of the job you might read in the \texttt{.log} file a message such as \emph{Some font shapes were not available, defaults substituted.} No worry; the message is correct, but no errors are actually visible in the output PDF file. See below what you can do if you find such warning messages as “annoying” ones. Nevertheless this does not imply that the correct fonts are used if the font switching macros are used without scoping groups or environments. Sometimes, when you use declarations instead of commands, it might be necessary to issue an apparently redundant \verb|\rmfamily| or \verb|\selectfont| command in order to re-establish the correct defaults. @@ -229,13 +235,17 @@ In order to insert \emph{short texts} in Greek, either in Didot upright or in Li The \emph{text commands}, contrary to the corresponding \emph{text declarations}, typeset their argument within a group, so that the font characteristics are also correctly restored after the command execution is completed. -Therefore I suggest you to either use the text commands or to use the declarations as environment names (without the initial backslash), so that they provide the necessary group delimiters; it is syntactically correct and useful to input something such as: +Therefore we suggest you to either use the text commands or to use the declarations as environment names (without the initial backslash), so that they provide the necessary group delimiters; it is syntactically correct and useful to input something such as: \begin{quote} \verb|\begin{Lipsiakostext}|\\ \meta{Greek text to be typeset with the Lipsian font}\\ \verb|\end{Lipsiakostext}| \end{quote} +Some authors have defined themselves the environments \amb{GRD} and \amb{GRL} to typeset longer texts with Didot or, respectively, Lipsian fonts and such definitions are included in the \pack{teubner} package; see the documentation of the code in the \file{teubner.pdf} file. + +Such environments have been tested with the Latin Modern, extended Times and extended Palatino fonts and with the standard classes besides the \class{memoir} and \class{scrbook} ones. No kludges were necessary with the Latin Modern fonts and the standard classes; some kludges were necessary in order to get the expected results with the other tested fonts and classes; such kludges are described in the above code documentation file. They are not complicated, but users that use different fonts and/or different classes might need to apply similar kludges to their software. + \section{Font installation} In order to use the Greek CB fonts and the facilities provided by this @@ -307,7 +317,7 @@ Greek diacritical marks; extended accent macros are also shown; notice that a co \end{table} Macrons and breves are just single glyphs and do not appear in combination with any letter, due to the limitation of 256 glyphs per font; but they may be input by means of commands \verb|\M| and \verb|\B| respectively when typesetting in Greek in order to use them as single diacritics; for more than one diacritic superimposed to one another, when macrons and breves are involved, some other commands are available as shown in table~\ref{t:accentmacros}. - +f The new (2013) Greek support for \babel\ contains now the LICR encoded accent macros that allow to use any encoding input method, including direct input of Greek characters. The internal representation of accent macros resorts to the same symbols shown in table~\ref{t:accenti}; simply they are prefixed by a backslash and/or the accent sequence is prefixed with one backslash; therefore \textDidot{>'a|} may be obtained with \verb+>'a|+, or \verb+\>\'a|+, or \verb+\>'a|+. The last form is to be preferred with some shapes as discussed in the following paragraphs. But the LICR (\LaTeX\ Internal Character Representation) is much more than this; it separates the input encoding from the output font encoding, so that direct literal greek input is possible (of course with the \opt{utf8} encoding) and the output is useful for both LGR encoded 8-bit fonts and the UNICODE encoded OpentType fonts; this way \pack{babel} and the Greek support for \babel, provided by the new \file{greek.ldf}, may be used also with \XeLaTeX\ and \LuaLaTeX. Moreover now (October 2014) file \file{greek.ldf} can select the ancient Greek hyphenation when typesetting with \pdfLaTeX\footnote{This is why with this release of the \pack{teubner} package, the default language attribute is set to \texttt{ancient}.}; with \pack{polyglossia} this possibility was available from the very beginning of the Greek support by this package. The 2020 version of the \file{greek.ldf} file introduces some new coding incompatible with the extension provided by this module (up to version~48) to get Greek Milesian and Attic numerals. From \pack{teubner} version~5.0, the LICR codes used by the new \file{greek.ldf} file are extended in oder to get Greek numerals that use the ancient glyphs, and therefore some macros are redefined. On the occasion of this update, the necessary macros for the Greek numerals have been redefined by means of the \LaTeX\,3 language through the interface macros previously defined by the \pack{xparse} package and now (2020) integral part of the \LaTeX\ kernel; see below for further details. @@ -563,8 +573,15 @@ This package introduces many new commands for typesetting Greek in a philologica A short remark on the command \comando\ap: this useful command inserts \emph{anything} as a superscript of anything else; it works both in text mode and in math mode\footnote{Numerical superscripts or apices do not require math mode; numerical footnote labels are automatically inserted by \LaTeX's \comando\footnote\ command; non numerical footnote labels are easily inserted with \LaTeX's \comando\footnotemark\ and \comando\footnotetext\ commands with their optional arguments.}. In particular while typesetting a philological text in different languages and with different alphabets, \comando\ap\ typesets the superscript with the current language and alphabet; if any change is required, the \comando\ap's argument can contain any language or alphabet specific declaration. You can typeset something such as \textLipsias{Baq\'ulides\,\ap{\textlatin{a}}} by switching language and alphabet as required; the specific declarations and the commands contained in table~\ref{t:extcomandi} come handy also in these cases. +Please, read the \file{teubner.pdf} file for what concerns command \cs{LLadd}; it accepts two optional kerning values in order to adapt the internal spaces in accordance with the nature of the \meta{text} argument; with capital letters and/or sloping fonts, such kerning values may come handy for a perfect final result. +Its new syntax is the following: +\begin{quote} +\cs{LLadd}\oarg{left kerning}\marg{text}\oarg{right kerning} +\end{quote} +where both kerning values imply a reduction of space if they are specified as positive values; use o font size units, such as \texttt{ex} or \texttt{em} are recommended, since they assure the automatic correct value even when changing font size. -\begin{table}[!p]\thrule%\centering + +\begin{table}[!p]\thrule \let\c\comando \resizebox*{\textwidth}{!}{\footnotesize \begin{tabular}{cl|cl} @@ -1006,5 +1023,4 @@ which produces: \section*{Acknowledgements} This project was initially carried on with the help of Mr Paolo Ciacchi when he was writing his ancient Greek philology master thesis. After he got his master's degree at the University of Trieste, I continued by myself, but I remain really indebted to Mr~Ciacchi. - \end{document} diff --git a/macros/latex/contrib/teubner/teubner.dtx b/macros/latex/contrib/teubner/teubner.dtx index 6383a88a93..04a2072d5d 100644 --- a/macros/latex/contrib/teubner/teubner.dtx +++ b/macros/latex/contrib/teubner/teubner.dtx @@ -4,7 +4,7 @@ \input docstrip.tex \keepsilent \preamble -Copyright 2001--2021 Claudio Beccari All rights reserved. +Copyright 2001--2022 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 @@ -43,7 +43,7 @@ See the end of the file. %<package>\ProvidesPackage{teubner}[% %<tbtx>\ProvidesPackage{teubnertx}[% %<*driver,package,tbtx> -2021/02/08 v.5.4 +2022/08/27 v.5.7 %<package>Extensions for Greek philology] %<tbtx>Access to the LGR encoded Greek fonts that match the TX fonts] %</driver,package,tbtx> @@ -84,7 +84,7 @@ See the end of the file. %</driver> % \fi % -% \CheckSum{4133} +% \CheckSum{4189} % \begin{multicols}{2}\tableofcontents\end{multicols} % % @@ -92,7 +92,7 @@ See the end of the file. % This extension package complements the greek option of the \babel\ % 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 +% 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 % in the written text, as well as to typeset verses with special @@ -124,12 +124,12 @@ See the end of the file. % option of the \babel\ package. % % I must warmly thank Paolo Ciacchi of the University of Trieste who -% invited me in this ``adventure'', since I know nothing about +% invited me in this “adventure”, since I know nothing about % philology; he assisted me with all his competence, so that I % could learn so many new things and I could appreciate the world of % philologists. % -% Paolo Ciacchi's ``invitation'' arrived when I was almost finished +% Paolo Ciacchi's “invitation” arrived when I was almost finished % with the design of the Lipsian font family; I was working on this new % typeface after a kind request by Dimitri Filippou, with whom I % already collaborated for other questions related to Greek @@ -168,10 +168,10 @@ See the end of the file. % there might be some problem switching from classical to modern spelling % in Greek itself, but since in modern spelling the multiplicity of Greek % diacritical marks is not forbidden, it's the author choice to select -% classical or modern words, Lipsian or Didot fonts, polytonic or monotonic -% accentuation. The worst it can happen is that \babel\ uses just one -% hyphenation pattern set, so that in one of the three Greek versions some -% words might turn out with the wrong hyphens points. +% classical or modern words, Lipsian or Didot fonts, polytonic or +% monotonic accentuation. The worst it can happen is that \babel\ uses +% just one hyphenation pattern set, so that in one of the three Greek +% versions some words might turn out with the wrong hyphens points. % % The CB Greek fonts, which have been available for some years now on % \acro{ctan} in the directory \texttt{/fonts/greek/cb} have @@ -183,18 +183,18 @@ See the end of the file. % 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 +% 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. +% 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 +% 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 @@ -207,24 +207,25 @@ See the end of the file. % 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. +% 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. +% 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. % % \section{Environments} % I apologise if I chose Italian names for verse environments; I wanted @@ -240,9 +241,10 @@ See the end of the file. % 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 +% 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} % \cs{begin}\Marg{versi}\marg{string} % \meta{verse}\cs{verso}\oarg{starting number}\marg{verse} @@ -259,8 +261,8 @@ See the end of the file. % 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. +% \meta{starting number} as an optional argument; if this optional +% argument is not specified, the starting number is assumed to be~1. % \begin{sintassi} % \cs{begin}\Marg{Versi}\oarg{starting number} % \meta{verse}\cs{\bslash*}\oarg{vertical space} @@ -274,11 +276,11 @@ See the end of the file. % \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 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. +% 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} % \cs{begin}\Marg{VERSI}\oarg{starting principal number} % \meta{verse}\cs{\bslash*}\oarg{vertical space} @@ -304,9 +306,9 @@ See the end of the file. % 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, +% 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 @@ -329,7 +331,7 @@ See the end of the file. % \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'' +% \meta{length} may be specified as an integer multiple of a “long” % symbol by means of %\begin{sintassi} % \cs{verseskip}\marg{number} @@ -341,7 +343,7 @@ See the end of the file. % 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 +% “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. @@ -390,7 +392,7 @@ See the end of the 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 +% This package is far from perfect, but it allows to do a lot 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 @@ -413,9 +415,9 @@ See the end of the file. % \subsection{Preliminaries} % 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'' +% 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. @@ -450,18 +452,20 @@ Type X <return> 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. +% 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. % -% Since \texttt{teubner.sty} accepts some options it is necessary to provide -% their definitions; in particular the |\or| control sequence conflicts -% with the |\or| primitive command used within the syntax of |\ifcase|\footnote{With -% version 2002/07/18 v.1.0d this has been eliminated; the option remains for -% compatibility with older versions, but the only legal command is now -% \texttt{\string\oR}.}; |\oR| is a little exception since all the other -% accent-vowel macros contain only lowercase letters; |og| is another exception, -% and the accent macros have to be used; |\og| collided with the French command -% for inserting the opening guillemets (see below). The point is that accent vowel +% Since \texttt{teubner.sty} accepts some options it is necessary to +% provide their definitions; in particular the |\or| control sequence +% conflicts with the |\or| primitive command used within the syntax of +% |\ifcase|\footnote{With version 2002/07/18 v.1.0d this has been +% eliminated; the option remains for compatibility with older versions, +% but the only legal command is now \texttt{\string\oR}.}; |\oR| is a +% little exception since all the other accent-vowel macros contain only +% lowercase letters; |og| is another exception, and the accent macros have +% to be used; |\og| collided with the French command for inserting the +% opening guillemets (see below). The point is that accent vowel % sequences that directly access the accented glyph are made up as such: % \begin{sintassi} % \bslash \meta{base character}\meta{first diacritic}\meta{second diacritic}\meta{third diacritic} @@ -470,82 +474,90 @@ Type X <return> to exit.}% % \meta{second diacritic} \textrm{is \texttt{c} or \texttt{a} or \texttt{g} for circumflex or acute or grave} % \meta{third diacritic} \textrm{is \texttt{i} for iota subscript or adscript} % \end{sintassi} -% Evidently none of the diacritical marks is compulsory, but at least one must -% be present; if more than one is present it must be given in that sequence. Since -% |\oR| means omicron with rough breath, it is not very important that it is -% declared with the standard sequence |<o| or with |\oR| or with |\<o|, because -% it never falls after another letter, so that it never breaks any ligature or -% kerning command. The command is there just for completeness. More or less the -% same is true with the |\og| sequence; it fails to work correctly when the main -% language is French and the |french| option to the |babel| package is in force; -% matter of facts, |\og| conflicts with the homonymous command defined by that -% option to mean ``ouvrir guillemets''; therefore it's necessary to use +% Evidently none of the diacritical marks is compulsory, but at least one +% must be present; if more than one is present it must be given in that +% sequence. Since |\oR| means omicron with rough breath, it is not very +% important that it is declared with the standard sequence |<o| or with +% |\oR| or with |\<o|, because it never falls after another letter, so +% that it never breaks any ligature or kerning command. The command is +% there just for completeness. More or less the same is true with the +% |\og| sequence; it fails to work correctly when the main language is +% French and the |french| option to the |babel| package is in force; +% matter of facts, |\og| conflicts with the homonymous command defined by +% that option to mean “ouvrir guillemets”; therefore it's necessary to use % either the plain sequence |`o| or the extended accent macro |\`o|. % -% At the same time since all accent combinations are defined as ``text commands'', -% in \LaTeX\ jargon, when their commands are followed by a vowel (or `r') they -% define a ``text symbol'' i.e.\ they fetch directly the glyph of the accented -% character; therefore |<o|, |\oR| and |\r{o}| are all equivalent (at the -% beginning of a word where omicron with rough breath is the only place where you -% might find it). See more on this point in the following sections. -% -% These glyph name macros are not defined by default, because the |GlyphNames| -% boolean variable is false by default; you can specify the option -% \emph{GlyphNames} for activating these macro names. +% At the same time since all accent combinations are defined as “text +% commands”, in \LaTeX\ jargon, when their commands are followed by a +% vowel (or `r') they define a “text symbol” i.e.\ they fetch directly the +% glyph of the accented character; therefore |<o|, |\oR| and |\r{o}| are +% all equivalent (at the beginning of a word where omicron with rough +% breath is the only place where you might find it). See more on this +% point in the following sections. +% +% These glyph name macros are not defined by default, because the +% |GlyphNames| boolean variable is false by default; you can specify the +% option \emph{GlyphNames} for activating these macro names. % In any case the same result is more comfortably obtained by using the % extended accent macros whose behaviour is specified by the new % \babel\-greek settings. % -% Another unusual option is set up for being used with non standard \TeX\ system -% fonts; we have noticed that the Lipsian fonts appear a little too light when -% used together with the Times or the Palatino fonts; probably this is true also -% with other PostScript fonts. In this case the user might specify the option -% |boldLipsian| and the Lipsian fonts used in medium series will be substituted -% with those of the semi\-bold one. -% -% At the same time, from July 2005 and for a few years, the full collection -% of the complete size set of the CB fonts has not been available any more -% \emph{as the default \TeX\ system set up}; only the 10pt size were available -% unless the \texttt{cbgreek-full} font package was loaded; for this reason -% a new option was needed in order to instruct \texttt{teubner.sty} to use -% the specific file \texttt{type1ec.sty} dated at least 2002/09/07, so as to -% scale up or down all the EC and CB fonts from an original 10\,pt size. -% In order that the \texttt{10pt} plays its role correctly, it was convenient, -% if not compulsory, to require first the \texttt{babel} package, then the -% \texttt{teubner} one with the option \texttt{10pt}, then all other packages -% required for a specific document, in particular the \texttt{fontenc} -% one if the \texttt{T1} encoding is requested. All this is maintained for -% backward compatibility, and should not be necessary any more; now the -% complete set of the CB fonts gets installed with every full installation -% of the \TeX\ system, but with partial or basic installations, such option -% might turn out to be useful even now. -% -% This kludge is necessary for all fonts that have description files that use the -% |\EC@family| command for describing the available shapes and sizes; in practice -% this happens only with the EC fonts, even when the \texttt{cm-super} scalable -% implementation is used. For using the Latin Modern fonts (LM) new specific font -% description files for the CB fonts are part of the \babel\ package, so this -% problem does not exist; when using other fonts, such as the TX, PX, ZE,~\dots, -% other kludges are necessary, because their font family names are different from -% those normally used with \TeX: |cmr| for serifed fonts, |cmss| for sans serif -% ones, and |cmtt| for monospaced ones.\footnote{Even the Latin Modern fonts have -% different family names, but, due to their importance, specific font description -% files have been added to the \babel\ package. The LM fonts are more comfortable -% than the EC ones, when scalable fonts are to be used, because they are -% continuously scalable and download into the produced files less font files than -% the EC o cm-super ones. Unless specifically requested, the LM fonts should -% always be preferred to the EC and cm-super ones. When using the LM fonts, its -% better to use the full collection of the CB fonts, even if the CB font -% description files are compatible with the single 10\,pt size.} -% -% Notice that when using, for example, the TX fonts and no kludge is available, -% the CB fonts are loaded only as the ``error font'', since the TX fonts have -% different family names than the CB ones; in many cases this might pass -% un-noticed, but if real Greek text in different shapes and series has to be -% typeset, the unaware typesetter might get crazy trying to force shape and series -% changes in the Greek text; it would not be impossible, but it would be very, -% very boring. In any case see in the next sections the implemented kludges in -% order to run successful compilations also with non standard \TeX\ system fonts. +% Another unusual option is set up for being used with non standard \TeX\ +% system fonts; we have noticed that the Lipsian fonts appear a little too +% light when used together with the Times or the Palatino fonts; probably +% this is true also with other PostScript fonts. In this case the user +% might specify the option |boldLipsian| and the Lipsian fonts used in +% medium series will be substituted with those of the semi\-bold one. But +% see below how it is possible to override the global setting of this +% option, when you need the regular extended bold series. +% +% At the same time, from July 2005 and for a few years, the full +% collection of the complete size set of the CB fonts has not been +% available any more \emph{as the default \TeX\ system set up}; only the +% 10pt size were available unless the \texttt{cbgreek-full} font package +% was loaded; for this reason a new option was needed in order to instruct +% \texttt{teubner.sty} to use the specific file \texttt{type1ec.sty} dated +% at least 2002/09/07, so as to scale up or down all the EC and CB fonts +% from an original 10\,pt size. In order that the \texttt{10pt} plays its +% role correctly, it was convenient, if not compulsory, to require first +% the \texttt{babel} package, then the \texttt{teubner} one with the +% option \texttt{10pt}, then all other packages required for a specific +% document, in particular the \texttt{fontenc} one if the \texttt{T1} +% encoding is requested. All this is maintained for backward +% compatibility, and should not be necessary any more; now the complete +% set of the CB fonts gets installed with every full installation of the +% \TeX\ system, but with partial or basic installations, such option might +% turn out to be useful even now. +% +% This kludge is necessary for all fonts that have description files that +% use the |\EC@family| command for describing the available shapes and +% sizes; in practice this happens only with the EC fonts, even when the +% \texttt{cm-super} scalable implementation is used. For using the Latin +% Modern fonts (LM) new specific font description files for the CB fonts +% are part of the \babel\ package, so this problem does not exist; when +% using other fonts, such as the TX, PX, ZE,~\dots, other kludges are +% necessary, because their font family names are different from those +% normally used with \TeX: |cmr| for serifed fonts, |cmss| for sans serif +% ones, and |cmtt| for monospaced ones.\footnote{Even the Latin Modern +% fonts have different family names, but, due to their importance, +% specific font description files have been added to the \babel\ package. +% The LM fonts are more comfortable than the EC ones, when scalable fonts +% are to be used, because they are continuously scalable and download into +% the produced files less font files than the EC o cm-super ones. Unless +% specifically requested, the LM fonts should always be preferred to the +% EC and cm-super ones. When using the LM fonts, its better to use the +% full collection of the CB fonts, even if the CB font description files +% are compatible with the single 10\,pt size.} +% +% Notice that when using, for example, the TX fonts and no kludge is +% available, the CB fonts are loaded only as the “error font”, since the +% TX fonts have different family names than the CB ones; in many cases +% this might pass un-noticed, but if real Greek text in different shapes +% and series has to be typeset, the unaware typesetter might get crazy +% trying to force shape and series changes in the Greek text; it would not +% be impossible, but it would be very, very boring. In any case see in the +% next sections the implemented kludges in order to run successful +% compilations also with non standard \TeX\ system fonts. % \begin{macrocode} \newif\ifor\orfalse % Compatibility with older versions \DeclareOption{or}{\relax} @@ -559,28 +571,29 @@ Type X <return> to exit.}% \ProcessOptions* % \end{macrocode} % -% In the next sections we frequently use the acronym for the Greek font encoding; -% we hope it will eventually become \texttt{GR} or, following the actual 256 glyph -% font encodings, \texttt{T7} or \texttt{X7}\footnote{Apparently \texttt{T7} has been -% reserved to define an encoding where the first 128 glyphs are the standard -% \texttt{OT1} encoded Latin fonts, and the second group, again of 128 glyphs, -% contains the Greek characters; therefore, since polytonic spelling requires more -% than 128 glyphs, the extended encoding \texttt{X7} will probably become the one -% applicable to the whole set of the CB fonts. Time passing by, the \texttt{X7} -% encoding name apparently has been used for some nordic language.}. -% Meanwhile the acronym is \texttt{LGR}, so we'd better define a symbolic name, so -% that we can change the definitive name in just one place. +% In the next sections we frequently use the acronym for the Greek font +% encoding; we hope it will eventually become \texttt{GR} or, following +% the actual 256 glyph font encodings, \texttt{T7} or +% \texttt{X7}\footnote{Apparently \texttt{T7} has been reserved to define +% an encoding where the first 128 glyphs are the standard \texttt{OT1} +% encoded Latin fonts, and the second group, again of 128 glyphs, +% contains the Greek characters; therefore, since polytonic spelling +% requires more than 128 glyphs, the extended encoding \texttt{X7} will +% probably become the one applicable to the whole set of the CB fonts. +% Time passing by, the \texttt{X7} encoding name apparently has been used +% for some nordic language.}. Meanwhile the acronym is \texttt{LGR}, so +% we'd better define a symbolic name, so that we can change the definitive +% name in just one place. % \begin{macrocode} -\def\GRencoding@name{LGR} +\def\GRenc@name{LGR} % \end{macrocode} % -% Now the default Olga Greek fonts, used for rendering the ``Greek italic shape'' -% are an alternative with the Lipsian ones. +% Now the default Olga Greek fonts, used for rendering the “Greek italic +% shape” are an alternative with the Lipsian ones. % -% If the \texttt{10pt} option was -% specified it is necessary to load also the package texttt{type1ec.sty}. -% In any case we load also packages |graphicx| and |ifthen| that shall be useful -% for some commands. +% If the \texttt{10pt} option was specified it is necessary to load also +% the package texttt{type1ec.sty}. In any case we load also packages +% |graphicx| and |ifthen| that shall be useful for some commands. % \begin{macrocode} \ifonesizetypeone \RequirePackage[10pt]{type1ec}[2002/09/07] @@ -604,8 +617,8 @@ Type X <return> to exit.}% \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} +\DeclareFontShape{U}{mtr}{bx}{n}{<->ssub*mtr/m/n}{}% +\newcommand*\metricsfont{\fontencoding{U}\fontfamily{mtr}\normalshape} % \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, @@ -618,7 +631,7 @@ Type X <return> to exit.}% % 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 +% 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 @@ -630,9 +643,8 @@ Type X <return> to exit.}% % 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 +% |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 @@ -641,7 +653,7 @@ Type X <return> to exit.}% % 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. +% satisfactorily, but with some possible “ancient” line breaks. % \begin{macrocode} \ifx\languageattribute\undefined \def\GreekName{polutonikogreek}% @@ -663,47 +675,50 @@ Type X <return> to exit.}% % % \subsection{Compatibility with Latin fonts}\label{ssec:LatinFontComp} +% %\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. +% 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. %\end{macro} %\end{macro} % %\begin{macro}{\substitutefontfamily} %\begin{macro}{\ifLipsian} -% The font macro |\substitutefontfamily| is already present in the \babel\ kernel, but -% with version 3.9g it is deprecated, although maintained for backwards compatibility; -% it copes only with the standard families, series and shapes, therefore it does not -% consider the Lipsian shape and its series. I had to redefine it together with a -% new conditional macro in order to do the same job as the original one but taking -% into consideration also the Lipsian shape; the purpose of this macro is to write -% in the working directory a number of font description files that refer to the LGR -% Greek encoding, but have the names of the Latin font families; such font -% description files, simply substitute these non existent encoding-family series and -% shapes with the existing series and shapes of any other LGR encoded Greek font, in -% particular the CB ones. -% Things might change in the future, so as to use the package by G\"unter Milde -% \texttt{substitutefont} package (already present in the \acro{ctan} archive) or -% other solutions by the core of \babel. Meanwhile we cope with what is available -% right now. +% The font macro |\substitutefontfamily| is already present in the \babel\ +% kernel, but with version 3.9g it is deprecated, although maintained for +% backwards compatibility; it copes only with the standard families, +% series and shapes, therefore it does not consider the Lipsian shape and +% its series. I had to redefine it together with a new conditional macro +% in order to do the same job as the original one but taking into +% consideration also the Lipsian shape; the purpose of this macro is to +% write in the working directory a number of font description files that +% refer to the LGR Greek encoding, but have the names of the Latin font +% families; such font description files, simply substitute these non +% existent encoding-family series and shapes with the existing series and +% shapes of any other LGR encoded Greek font, in particular the CB ones. +% Things might change in the future, so as to use the package by G\"unter +% Milde \texttt{substitutefont} package (already present in the +% \acro{ctan} archive) or other solutions by the core of \babel. Meanwhile +% we cope with what is available right now. % % By issuing a command such as: % \begin{sintassi}\ttfamily % \texttt{\string\ifFamily}\{pxr\}\{cmr\} % \end{sintassi} -% an association is made with all the series and shapes of the Palatino serifed -% fonts to the corresponding CB serifed series and shapes; therefore when a language -% shift changes the default encoding from, say, \texttt{T1} to \texttt{LGR} the -% font family \texttt{LGR+pxr} is mapped to the font family \texttt{LGR+cmr} and -% everything is supposed to work fine; when another language change resets the -% encoding to \texttt{T1}, the original Latin script is used again. The redefined +% an association is made with all the series and shapes of the Palatino +% serifed fonts to the corresponding CB serifed series and shapes; +% therefore when a language shift changes the default encoding from, say, +% \texttt{T1} to \texttt{LGR} the font family \texttt{LGR+pxr} is mapped +% to the font family \texttt{LGR+cmr} and everything is supposed to work +% fine; when another language change resets the encoding to \texttt{T1}, +% the original Latin script is used again. The redefined % |\substitutefontfamily| macro is as such: % \begin{macrocode} \newif\ifLipsian @@ -747,25 +762,27 @@ Type X <return> to exit.}% }% \global\Lipsianfalse\fi \closeout15}% - }} + }% +} % \end{macrocode} -% Notice that together with the Lipsian fonts the upright italics (Olga) and upright -% serifed lowercase alphabets are defined. In a while there are the definition for -% selecting these shapes. Of course you are not obliged to use them, but in case you -% wanted\dots +% Notice that together with the Lipsian fonts the upright italics (Olga) +% and upright serifed lowercase alphabets are defined. In a while there +% are the definition for selecting these shapes. Of course you are not +% obliged to use them, but in case you wanted\dots % % These results are obtained by means of the following macros. %\begin{macro}{\ifCMLM} %\begin{macro}{\ifFamily} -% The |\ifCMLM| processes the necessary test in order to set the auxiliary macro -% |\n@xt| to be an alias to |\iftrue| or |iffalse| depending on the fact that the -% CM (or EC) fonts or the LM fonts are the default Latin ones, in this case it sets -% the |\n@xt| macro equivalent to |\iftrue|, otherwise it sets it to |\iffalse|. In -% order to succeed, it requires to analyse the first two letters of the default -% family name; if these letters form one of the sequences |cm| or |lm|, the CM or -% LM fonts have been loaded, otherwise some other fonts are in force. We need -% therefore a macro with delimited arguments in order to extract the first two +% The |\ifCMLM| processes the necessary test in order to set the auxiliary +% macro |\n@xt| to be an alias to |\iftrue| or |iffalse| depending on the +% fact that the CM (or EC) fonts or the LM fonts are the default Latin +% ones, in this case it sets the |\n@xt| macro equivalent to |\iftrue|, +% otherwise it sets it to |\iffalse|. In order to succeed, it requires to +% analyse the first two letters of the default family name; if these +% letters form one of the sequences |cm| or |lm|, the CM or LM fonts have +% been loaded, otherwise some other fonts are in force. We need therefore +% a macro with delimited arguments in order to extract the first two % letters of the family name. % % \begin{macrocode} @@ -774,74 +791,104 @@ Type X <return> to exit.}% {\let\n@xt\iftrue}{\def\f@milyprefix{cmr}\let\n@xt\iffalse}\n@xt} % \end{macrocode} -% The other macro |\ifFamily| uses the previous macro and according to the test -% result, possibly runs the |\substitutefontfamily| macro that, if -% necessary, creates the description file that map the specified family font -% description file to the second specified font family, both connected to the LGR -% encoding. Therefore, after these font definition files exist, \LaTeX\ can fetch -% the Greek fonts by way of substitution. Let's explain again: if you specify +% The other macro |\ifFamily| uses the previous macro and according to the +% test result, possibly runs the |\substitutefontfamily| macro that, if +% necessary, creates the description file that map the specified family +% font description file to the second specified font family, both +% connected to the LGR encoding. Therefore, after these font definition +% files exist, \LaTeX\ can fetch the Greek fonts by way of substitution. +% Let's explain again: if you specify % \begin{verbatim} % \Lipsiantrue\ifFamily{pxr}{lmr} % \end{verbatim} -% you state that you want to run the macro on the serifed Palatino font family, by -% associating the |pxr| family to the |lmr| one\footnote{If you have the full CB -% Greek font collection it's more convenient to map the missing fonts to the Latin -% Modern Greek ones, while if you need to use the \emph{10pt} option, you'd better -% map the missing family to the ordinary Computer Modern ones; the actual fonts are -% the same, but the latter font definition files cope with the \emph{10pt} option, -% while the former don't.}; by specifying |\Lipsiantrue| you state that you want to -% create entries also for the Lipsian series and shape; the macro provides to reset -% |\Lipsianfalse| in order to avoid that other calls of that macro on non serifed -% or monospaced fonts try to create entries that in any case do not exist: the -% Lipsian font comes only as a serifed font! In this way, if you are using -% Palatino fonts through the \textsf{pxfonts} package, the |teubner| macros provide -% to create the necessary font description files so that while you are typesetting -% in medium normal Latin Palatino and you switch to Greek, the built in macros -% change the encoding to LGR; the LGR Palatino serifed medium normal Greek font -% does not exist, but that family, series and shape are mapped by the font -% description file to the corresponding LGR encoded Latin Modern CB fonts in medium -% series and normal shape, and typesetting goes on with the right Greek fonts. +% you state that you want to run the macro on the serifed Palatino font +% family, by associating the |pxr| family to the |lmr| one\footnote{If you +% have the full CB Greek font collection it's more convenient to map the +% missing fonts to the Latin Modern Greek ones, while if you need to use +% the \emph{10pt} option, you'd better map the missing family to the +% ordinary Computer Modern ones; the actual fonts are the same, but the +% latter font definition files cope with the \emph{10pt} option, while the +% former don't.}; by specifying |\Lipsiantrue| you state that you want to +% create entries also for the Lipsian series and shape; the macro provides +% to reset |\Lipsianfalse| in order to avoid that other calls of that +% macro on non serifed or monospaced fonts try to create entries that in +% any case do not exist: the Lipsian font comes only as a serifed font! In +% this way, if you are using Palatino fonts through the \textsf{pxfonts} +% package, the |teubner| macros provide to create the necessary font +% description files so that while you are typesetting in medium normal +% Latin Palatino and you switch to Greek, the built in macros change the +% encoding to LGR; the LGR Palatino serifed medium normal Greek font does +% not exist, but that family, series and shape are mapped by the font +% description file to the corresponding LGR encoded Latin Modern CB fonts +% in medium series and normal shape, and typesetting goes on with the +% right Greek fonts. % \begin{macrocode} \newcommand*\ifFamily[2]{% \expandafter\ifCMLM#1!\else\substitutefontfamily{LGR}{#1}{#2}\fi} % \end{macrocode} -% You don't actually need to use that macro for the Times or the Palatino eXtended -% fonts loaded by means of the corresponding packages \textsf{txfonts} or -% \textsf{pxfonts}, because a hook is set up so that ``at begin document'' the -% loading of those packages is tested, and if the test is true, the necessary font -% description files are possibly created. If you load the Times or the Palatino or -% any other non standard font by means of other packages, it's up to you to issue -% the |\substitutefontfamily| macro right after calling that font package and by -% using the correct family names; similarly you might substitute the new Latin font -% family names to other Greek font family names, if you have other fonts available. -% At the same time at begin document we memorise the name and encoding of the Latin -% font used for the default language, so that when returning to Latin font -% typesetting after Greek font typesetting, the proper language typesetting rules -% and encoding are restored. -% \begin{macrocode} +% You don't actually need to use that macro for the Times or the Palatino +% eXtended fonts loaded by means of the corresponding packages +% \textsf{txfonts} or \textsf{pxfonts}, because a hook is set up so that +% “at begin document” the loading of those packages is tested, and if the +% test is true, the necessary font description files are possibly created. +% If you load the Times or the Palatino or any other non standard font by +% means of other packages, it's up to you to issue the +% |\substitutefontfamily| macro right after calling that font package and +% by using the correct family names; similarly you might substitute the +% new Latin font family names to other Greek font family names, if you +% have other fonts available. At the same time at begin document we +% memorise the name and encoding of the Latin font used for the default +% language, so that when returning to Latin font typesetting after Greek +% font typesetting, the proper language typesetting rules and encoding +% are restored. +% +% Please notice the tricks for replacing the Lipsian shape for the +% families used in mathematics and/or to produce the extra symbols +% provided by the \TeX\ Companion font with the |TS1| encoding; there +% are no similar Lipsian glyphs, so that it is necessary to replace +% those shapes with the normal italic one. It is unusual to require +% those missing Lipsian glyphs in a philological text, but some +% symbols used in philological mark up require them, therefore such +% kludges become necessary. Here we prod=vide such kludges for the +% Palatino and Times extended fonts; but final users might need to use +% them with other fonts; the following code, then, becomes a model to +% use when other fonts are preferred. +% \begin{macrocode} \AtBeginDocument{% +\input{ot1cmr.fd} +\DeclareFontShape{OT1}{cmr}{m}{li}{<->ssub* cmr/m/it}{} \@ifpackageloaded{pxfonts}{\typeout{Palatino fonts loaded}% -\Lipsiantrue\ifFamily{pxr}{cmr}\Lipsianfalse -\ifFamily{pxss}{cmss}\ifFamily{pxtt}{cmtt}}{\relax}} - -\AtBeginDocument{% +\Lipsiantrue\ifFamily{pxr}{cmr} +\input{ot1pxr.fd}\input{t1pxr.fd}\input{ts1pxr.fd}% +\DeclareFontShape{OT1}{pxr}{b}{li}{<->ssub* pxr/b/it}{}% +\DeclareFontShape{T1}{pxr}{b}{li}{<->ssub* pxr/b/it}{}% +\DeclareFontShape{TS1}{pxr}{m}{li}{<->ssub* pxr/m/it}{}% +\Lipsianfalse +\ifFamily{pxss}{cmss}\ifFamily{pxtt}{cmtt}}{\relax} +% \@ifpackageloaded{txfonts}{\typeout{Times fonts loaded}% -\RequirePackage{teubnertx}}{}} +\RequirePackage{teubnertx}% +\input{ot1txr.fd}\input{t1txr.fd}\input{ts1txr.fd}% +\DeclareFontShape{OT1}{txr}{b}{li}{<->ssub* txr/b/it}{}% +\DeclareFontShape{T1}{txr}{b}{li}{<->ssub* txr/b/it}{}% +\DeclareFontShape{TS1}{txr}{m}{li}{<->ssub* txr/m/it}{}% +}{}} \AtBeginDocument{% \edef\previouslanguage{\languagename}% \edef\previousencoding{\f@encoding}} % \end{macrocode} % -% Nevertheless all this requires a minimum of attention in specifying the options -% for the \babel\ package and in the order extensions packages are input. The -% |teubner.sty| package should be read \emph{after} any other package that sets or -% resets the Latin font encoding; for example if the T1 encoding is selected as the -% default one, in place of the OT1 encoding, then this choice must be made before -% this package is read in. Similarly when the \babel\ options are specified, -% remember that the last language name becomes the default language at begin -% document; never specify |greek| as the last +% Nevertheless all this requires a minimum of attention in specifying +% the options for the \babel\ package and in the order extensions +% packages are input. The |teubner.sty| package should be read +% \emph{after} any other package that sets or resets the Latin font +% encoding; for example if the T1 encoding is selected as the default +% one, in place of the OT1 encoding, then this choice must be made +% before this package is read in. Similarly when the \babel\ options +% are specified, remember that the last language name becomes the +% default language at begin document; never specify |greek| as the last % language option! %\end{macro} %\end{macro} @@ -851,29 +898,32 @@ Type X <return> to exit.}% %\begin{macro}{\Lipsiakostext} %\begin{macro}{\lishape} %\begin{macro}{\textli} -% |\lishape| is the normal declaration, modelled on the other similar macros in the -% \LaTeX\ kernel, made up to chose the Lipsian shape. Nevertheless since it is a -% light character, if it must blend well with the other PostScript fonts, not only -% the CM and LM, but also the other ones available for typesetting with the \TeX\ -% system, it is necessary to chose the |b| (bold) series in place of the |m| -% (medium) one, while maintaining the |bx| (bold extended) series when the other -% fonts are set with the blacker and larger series. This is why the |\lishape| -% declaration is a little more complicate than normal, since it has to test the -% value of the current series. The text command |\textli| matches the similar -% commands for Latin fonts. But the |\lishape| declaration is used also within the -% more complicated macros for declaring or setting the Lipsian font. +% |\lishape| is the normal declaration, modelled on the other similar +% macros in the \LaTeX\ kernel, made up to chose the Lipsian shape. +% Nevertheless since it is a light character, if it must blend well with +% the other PostScript fonts, not only the CM and LM, but also the other +% ones available for typesetting with the \TeX\ system, it is necessary +% to chose the |b| (bold) series in place of the |m| (medium) one, while +% maintaining the |bx| (bold extended) series when the other fonts are set +% with the blacker and larger series. This is why the |\lishape| +% declaration is a little more complicate than normal, since it has to +% test the value of the current series. The text command |\textli| +% matches the similar commands for Latin fonts. But the |\lishape| +% declaration is used also within the more complicated macros for +% declaring or setting the Lipsian font. % % |\Lipsiakostext| is a \emph{declaration} stating that from now on -% typesetting will be done with the Lipsian fonts; notice that the encoding and the -% language name in force before this declaration are memorised, then the current -% Greek version is selected; the |\let\~\accperispomeni| is required because -% switching on and off may reset the active tilde and connected macros definitions. -% |\~| in Greek must set the circumflex accent, so we make sure that this really +% typesetting will be done with the Lipsian fonts; notice that the +% encoding and the language name in force before this declaration are +% memorised, then the current Greek version is selected; the +% |\let\~\accperispomeni| is required because switching on and off may +% reset the active tilde and connected macros definitions. |\~| in Greek +% must set the circumflex accent, so we make sure that this really % occurs. % \begin{macrocode} \DeclareRobustCommand{\lishape}{% \not@math@alphabet\lishape\relax -\ifthenelse{\equal{\f@encoding}{\GRencoding@name}}{% +\ifthenelse{\equal{\f@encoding}{\GRenc@name}}{% \ifboldLipsian \ifthenelse{\equal{\f@series}{m}}% {\fontseries{b}\fontshape{li}\rmfamily}% @@ -891,35 +941,38 @@ Type X <return> to exit.}% %\end{macro} %\end{macro} %\begin{macro}{\textLipsias} -% |\textLipsias| is a command that typesets its argument with the |\Lipsiakostext| -% declaration in force. The \LaTeX\ command declaration used here makes sure that -% possible italic corrections are taken into account; the actual font switching is -% made through the same |\Lipsiakostext| declaration, but the inner working -% maintain local this declaration; for this reason we suggest to use this text -% command rather than the font declaration. +% |\textLipsias| is a command that typesets its argument with the +% |\Lipsiakostext| declaration in force. The \LaTeX\ command declaration +% used here makes sure that possible italic corrections are taken into +% account; the actual font switching is made through the same +% |\Lipsiakostext| declaration, but the inner working maintain local this +% declaration; for this reason we suggest to use this text command rather +% than the font declaration. % \begin{macrocode} \DeclareTextFontCommand{\textLipsias}{\Lipsiakostext} % \end{macrocode} %\end{macro} -%\begin{macro}{\NoLipsiakostext} |\NoLipsiakostext| is the opposite declaration -% that undoes everything that was done with |\Lipsiakostext|. Probably it is -% superfluous, but it has been asked for. If |\Lipsiakostext| is delimited within a -% scope by means of an explicit group or an environment, it stops its effectiveness -% with the end of its scope. +%\begin{macro}{\NoLipsiakostext} +% |\NoLipsiakostext| is the opposite declaration that undoes everything +% that was done with |\Lipsiakostext|. Probably it is superfluous, but +% it has been asked for. If |\Lipsiakostext| is delimited within +% a scope by means of an explicit group or an environment, it stops its +% effectiveness with the end of its scope. % -% It is worth noting that, in order to delimit within a scope the action of this and -% of the other declarations, it is possible to use them as environments with the -% same name without the backslash. for example one might input in the source file -% something as: +% It is worth noting that, in order to delimit within a scope the action +% of this and of the other declarations, it is possible to use them as +% environments with the same name without the backslash. for example one +% might input in the source file something as: %\begin{quote}\obeylines % |\begin{Lipsiakostext}| % \meta{Greek text to be typeset with the Lipsian font} % |\end{Lipsiakostext}| %\end{quote} -% Remember also that these Greek text declarations may be issued while typesetting -% with Latin fonts; they provide also the language switch, so that they do not -% require the typesetter to first switch to Greek and then to choose a certain Greek +% Remember also that these Greek text declarations may be issued while +% typesetting with Latin fonts; they provide also the language switch, +% so that they do not require the typesetter to first switch to Greek +% and then to choose a certain Greek % font. % \begin{macrocode} \DeclareRobustCommand\NoLipsiakostext{% @@ -931,10 +984,11 @@ Type X <return> to exit.}% % \end{macrocode} %\end{macro} %\begin{macro}{\textDidot} -% |\textDidot| is a similar macro where the common upright Greek characters are -% selected; it goes by itself that if |\textli| is specified within the -% |\textDidot| argument, the typesetting is or becomes identical with what -% one can obtain with the |\textLipsias| command. +% |\textDidot| is a similar macro where the common upright Greek +% characters are selected; it goes by itself that if |\textli| is +% specified within the |\textDidot| argument, the typesetting is or +% becomes identical with what one can obtain with the |\textLipsias| +% command. % \begin{macrocode} \DeclareRobustCommand\textDidot[1]{{% \expandafter\select@language\expandafter{\GreekName}% @@ -944,16 +998,58 @@ Type X <return> to exit.}% % \end{macrocode} %\end{macro} % +%\begin{environment}{GRD} +%\begin{environment}{GRL} +% In the past years some users, among which Einrich Flech, whom I thank +% very much for his substantial feedback, defined the environments |GRL| +% and |GRD| in order to avoid repeating again and again the above +% described declarations and commands. Some new definitions are given +% to simplify the optional selection of the font series. Nevertheless it +% is necessary to delay such definitions to the begin document stage, so +% as to possibly redefine the older personal definitions. The redefinition +% does not consist only in the use of some \LaTeX\,3 commands, but allows +% to set the font series by means of the opening statement optional +% argument. They also redefine the basic command |\bfseries| when the +% classes |memoir| o |scrbook| are directly or indirectly used, because +% such almighty classes redefine such command for their internal purposes; +% such redefinitions render this command inactive within other user +% defined environments; of course we cannot foresee all possible classes +% the users might use for themselves, therefore it is possible that such +% corrections might be necessary also with other classes or packages. +% The workaround is very simple, but the final users should find by +% themselves how to insert it into their own codes in an effective way. +% \begin{macrocode} +\AtBeginDocument{% + \ProvideDocumentEnvironment{GRD}{m}{}{} + \ProvideDocumentEnvironment{GRL}{m}{}{} + +\RenewDocumentEnvironment{GRL}{o}{\begin{otherlanguage*}{greek}% +\@ifclassloaded{memoir}{\def\bfseries{\fontseries{bx}\selectfont}}{\relax} +\@ifclassloaded{scrbook}{\def\bfseries{\fontseries{bx}\selectfont}}{\relax} +\IfValueTF{#1}{\fontseries{#1}}{}% + \fontshape{li}\selectfont}{\end{otherlanguage*}} + +\RenewDocumentEnvironment{GRD}{o}{\begin{otherlanguage*}{greek}% +\@ifclassloaded{memoir}{\def\bfseries{\fontseries{bx}\selectfont}}{\relax} +\@ifclassloaded{scrbook}{\def\bfseries{\fontseries{bx}\selectfont}}{\relax} +\IfValueTF{#1}{\fontseries{#1}}{}% + \fontshape{up}\selectfont}{\end{otherlanguage*}} +} +% \end{macrocode} +%\end{environment} +%\end{environment} +% %\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 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. +% |\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 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 @@ -975,12 +1071,12 @@ Type X <return> to exit.}% % encoding is therefore LGR. % \begin{macrocode} \DeclareRobustCommand\uishape{% -\ifthenelse{\equal{\f@encoding}{\GRencoding@name}}% +\ifthenelse{\equal{\f@encoding}{\GRenc@name}}% {\fontshape{ui}\selectfont}{\relax}} \DeclareTextFontCommand{\textui}{\uishape} \DeclareRobustCommand\rsshape{% -\ifthenelse{\equal{\f@encoding}{\GRencoding@name}}% +\ifthenelse{\equal{\f@encoding}{\GRenc@name}}% {\fontshape{rs}\selectfont}{\relax}} \DeclareTextFontCommand{\textrs}{\rsshape} @@ -994,26 +1090,26 @@ Type X <return> to exit.}% % Now we start the specific additions introduced with this package. % % \begin{macro}{\strip@pt} -% The \LaTeX\ kernel has the macro |\strip@pt| that strips off the pt part from the -% expanded value of a dimension register and makes available the measure in pt -% of the contained length (the register contains the length measure in scaled -% points; the expansion performed by \TeX\ with the command |\the| converts the -% scaled points to printer points and shows the result with a string of decimal -% digits with, possibly, a decimal fraction); its argument is supposed -% to be a dimension register name, not its expanded contents. The |\strip@pt| -% command eliminates the decimal point and the fractional part if the latter is -% nought. -% -% With the help of such service macro we are going to define a certain number of -% ``lift accent'' macros or ``put cedilla'' macros that work with both upright and -% slanted fonts, although they contain different parameters for Latin compared to -% Greek alphabets. +% The \LaTeX\ kernel has the macro |\strip@pt| that strips off the pt part +% from the expanded value of a dimension register and makes available the +% measure in pt of the contained length (the register contains the length +% measure in scaled points; the expansion performed by \TeX\ with the +% command |\the| converts the scaled points to printer points and shows +% the result with a string of decimal digits with, possibly, a decimal +% fraction); its argument is supposed to be a dimension register name, not +% its expanded contents. The |\strip@pt| command eliminates the decimal +% point and the fractional part if the latter is nought. +% +% With the help of such service macro we are going to define a certain +% number of “lift accent” macros or “put cedilla” macros that work with +% both upright and slanted fonts, although they contain different +% parameters for Latin compared to Greek alphabets. % \end{macro} % % \begin{macro}{\lift@accent} -% The first ``lift accent'' macro just puts an accent over -% a letter, without inserting any space between them; the first argument is the -% accent code (decimal, hexadecimal or octal; I prefer decimal), while the second +% The first “lift accent” macro just puts an accent over a letter, without +% inserting any space between them; the first argument is the accent code +% (decimal, hexadecimal or octal; I prefer decimal), while the second % argument is the letter --~any letter, even if it is not a vowel! % \begin{macrocode} \newcommand*\lift@accent[2]{\leavevmode @@ -1031,8 +1127,8 @@ Type X <return> to exit.}% % \end{macro} % % \begin{macro}{\Lift@accent} -% The second ``lift accent'' macro behaves as the first one except it interposes a -% small vertical distance between the accent and the letter: +% The second “lift accent” macro behaves as the first one except it +% interposes a small vertical distance between the accent and the letter: % \begin{macrocode} \newcommand*\Lift@accent[2]{\leavevmode {\edef\slant@{\strip@pt\fontdimen1\font}% @@ -1050,9 +1146,9 @@ Type X <return> to exit.}% % \end{macro} % % \begin{macro}{\LIFT@accent} -% The third ``lift accent'' macro behaves as the first one, except it interposes a -% specified vertical space between the letter and the accent; this space is -% specified as the second argument: +% The third “lift accent” macro behaves as the first one, except it +% interposes a specified vertical space between the letter and the accent; +% this space is specified as the second argument: % \begin{macrocode} \newcommand*\LIFT@accent[3]{\leavevmode {\edef\slant@{\strip@pt\fontdimen1\font}% @@ -1071,71 +1167,74 @@ Type X <return> to exit.}% % \end{macrocode} % \end{macro} % -% All these macros will be used in subsequent ``put accent'' macros, that will -% stack also several accents one above the other; the necessity arises for example -% when the macron or breve diacritical marks have to be put over accented letters; -% according to typographical practice the accents must go over the macron or the -% breve. -% In a similar way philologists often must use other diacritical marks in addition -% to the traditional Greek ones, therefore these macros will be used, for example, -% for setting the Scandinavian ring (from a Latin font) over a Greek letter (from a -% Greek font). +% All these macros will be used in subsequent “put accent” macros, that +% will stack also several accents one above the other; the necessity +% arises for example when the macron or breve diacritical marks have to be +% put over accented letters; according to typographical practice the +% accents must go over the macron or the breve. +% In a similar way philologists often must use other diacritical marks in +% addition to the traditional Greek ones, therefore these macros will be +% used, for example, for setting the Scandinavian ring (from a Latin font) +% over a Greek letter (from a Greek font). % % \begin{macro}{\cap@} -% The first such unusual diacritical mark is a small cap, a small upside down breve -% sign, that is in position~1 of the Greek font table. +% The first such unusual diacritical mark is a small cap, a small upside +% down breve sign, that is in position~1 of the Greek font table. % \begin{macrocode} \DeclareRobustCommand{\cap@}[1]{\leavevmode {\edef\slant@{\strip@pt\fontdimen1\font}% -\setbox\tw@\hbox{\fontencoding{\GRencoding@name}\selectfont +\setbox\tw@\hbox{\fontencoding{\GRenc@name}\selectfont \char1}\dimen@-.5\wd\tw@ \setbox\z@\hbox{#1}% \advance\dimen@ .5\wd\z@ \@tempdima\ht\z@\advance\@tempdima.55ex\relax \advance\dimen@\slant@\@tempdima -\ifx\cf@encoding\GRencoding@name\else +\ifx\cf@encoding\GRenc@name\else \ifx#1k\advance\dimen@-.3\wd\tw@\fi\fi \raise\@tempdima\hbox to\z@{\kern\dimen@\box\tw@\relax\hss}\box\z@}} % \end{macrocode} -% The |\ifx\cf@encoding\GRencoding@name| conditional construct shows that this -% macro behaves differently with different font encodings; the following |\ifx#1k| -% checks the argument against the Greek letter kappa, which shows very clearly -% that these macros operate on any letter, not only on vowels. +% The |\ifx\cf@encoding\GRenc@name| conditional construct shows that +% this macro behaves differently with different font encodings; the +% following |\ifx#1k| checks the argument against the Greek letter kappa, +% which shows very clearly that these macros operate on any letter, not +% only on vowels. % \end{macro} % % \begin{macro}{\cap} -% By means of the above |\cap@| macro we can define three equivalent commands to be -% used either when the Greek encoding is in force, or when one of the Latin -% encodings is in force; but we must pay attention, because there exist already -% the command |\cap| to be used in mathematics; therefore we better exclude this -% possibility through a clever use of the |\textormath| macro. Therefore we -% first save the math command into an alia |\mcap|; then we define three -% textual commands for the various encodings |\tcap|; finnally we use +% By means of the above |\cap@| macro we can define three equivalent +% commands to be used either when the Greek encoding is in force, or when +% one of the Latin encodings is in force; but we must pay attention, +% because there exist already the command |\cap| to be used in +% mathematics; therefore we better exclude this possibility through a +% clever use of the |\textormath| macro. Therefore we first save the math +% command into an alia |\mcap|; then we define three textual commands for +% the various encodings |\tcap|; finnally we use % |\textormath|: % \begin{macrocode} \let\mcap\cap -\DeclareTextCommand{\tcap}{\GRencoding@name}{\cap@} +\DeclareTextCommand{\tcap}{\GRenc@name}{\cap@} \DeclareTextCommand{\tcap}{OT1}{\cap@} \DeclareTextCommand{\tcap}{T1}{\cap@} \DeclareRobustCommand*\cap{\textormath{\tcap}{\mcap}} % \end{macrocode} -% Probably one definition would be sufficient, but on one side the presence of three -% encoding dependent macros are the remains of initial works, while on the other -% side they prevent to use these macros with encodings for which the macro might not -% work well, because it was not tested with them. +% Probably one definition would be sufficient, but on one side the +% presence of three encoding dependent macros are the remains of initial +% works, while on the other side they prevent to use these macros with +% encodings for which the macro might not work well, because it was not +% tested with them. % \end{macro} % % \begin{macro}{\cap@cedilla} -% Similarly a small cap can be put under another letter as it was a cedilla; for -% this task another macro is defined, which makes use of the same glyph in -% position~1 in the Greek font table: +% Similarly a small cap can be put under another letter as it was a +% cedilla; for this task another macro is defined, which makes use of the +% same glyph in position~1 in the Greek font table: % \begin{macrocode} \newcommand*\cap@cedilla[1]{\leavevmode -{\setbox4\hbox{\fontencoding{\GRencoding@name}\selectfont\char1}% +{\setbox4\hbox{\fontencoding{\GRenc@name}\selectfont\char1}% \dimen@-.5\wd4 \setbox\z@\hbox{#1}% -\ifx\cf@encoding\GRencoding@name +\ifx\cf@encoding\GRenc@name \ifx#1i\advance\dimen@ .65\wd\z@\else\advance\dimen@ .5\wd\z@\fi \else \ifx#1i\advance\dimen@ .55\wd\z@\else\advance\dimen@ .5\wd\z@\fi @@ -1146,18 +1245,18 @@ Type X <return> to exit.}% % \end{macro} % % \begin{macro}{\ring@cedilla} -% Another cedilla like diacritical mark is the Scandinavian ring put under a letter; -% the ring is taken from the metrics font, so its slot position does not depend -% on the various Latin encodings; the correct positioning requires careful -% examination of the letter under which it is to be placed, distinguishing the Greek -% from the Latin encodings: +% Another cedilla like diacritical mark is the Scandinavian ring put +% under a letter; the ring is taken from the metrics font, so its slot +% position does not depend on the various Latin encodings; the correct +% positioning requires careful examination of the letter under which it +% is to be placed, distinguishing the Greek from the Latin encodings: % \begin{macrocode} \newcommand*\ring@cedilla[1]{\leavevmode {\setbox4\hbox{\metricsfont\char26}% \edef\slant@{\strip@pt\fontdimen1\font}% \dimen@-.5\wd4\ifdim\slant@\p@>\z@\advance\dimen@-.04ex\fi \setbox\z@\hbox{#1}% -\ifx\cf@encoding\GRencoding@name +\ifx\cf@encoding\GRenc@name \advance\dimen@ .45\wd\z@ \ifx#1h\advance\dimen@-.13\wd\z@\fi \ifx#1a\advance\dimen@-.07\wd\z@\fi @@ -1177,14 +1276,15 @@ Type X <return> to exit.}% % \end{macro} % % \begin{macro}{\dot@cedilla} -% Even the standard \LaTeX\ macro |dot| must be redefined with a cedilla like macro, -% so as to make use of a special dot from the metric symbols font: +% Even the standard \LaTeX\ macro |dot| must be redefined with a cedilla +% like macro, so as to make use of a special dot from the metric symbols +% font: % \begin{macrocode} \newcommand*\dot@cedilla[1]{\leavevmode {\setbox4\hbox{\metricsfont\char27}% \dimen@-.5\wd4 \setbox\tw@\hbox{i}\setbox\z@\hbox{#1}% -\ifx\cf@encoding\GRencoding@name +\ifx\cf@encoding\GRenc@name \advance\dimen@ .5\wd\z@ \ifx#1h\advance\dimen@-.13\wd\z@\fi \else @@ -1198,15 +1298,15 @@ Type X <return> to exit.}% %\end{macro} % % \begin{macro}{\tie@cedilla} -% \LaTeX\ has the macro |\t| for placing a ``tie'' over two letters; philologists -% require also a tie under two letters; this is why another cedilla like macro is -% needed: +% \LaTeX\ has the macro |\t| for placing a “tie” over two letters; +% philologists require also a tie under two letters; this is why another +% cedilla like macro is needed: % \begin{macrocode} \newcommand*\tie@cedilla[1]{\leavevmode -{\setbox4\hbox{\fontencoding{\GRencoding@name}\selectfont\char20}% +{\setbox4\hbox{\fontencoding{\GRenc@name}\selectfont\char20}% \dimen@-.5\wd4 \setbox\tw@\hbox{i}\setbox\z@\hbox{#1}% -\ifx\cf@encoding\GRencoding@name +\ifx\cf@encoding\GRenc@name \advance\dimen@.5\wd\z@ \ifx#1h\advance\dimen@-.1\wd\z@\fi \ifx#1u\advance\dimen@.15\wd\z@\fi @@ -1221,81 +1321,87 @@ Type X <return> to exit.}% % \end{macro} % % \subsection{Extended accent definitions} -% We will use those service macros in the definition of several accent like macros -% that keep all the intricacies away from the user. -% -% In particular the \LaTeX\ kernel macros are used in order to declare accents, -% composite glyphs, composite commands, and the like; these are used as the default -% definitions; afterwards other definitions will be given that work when these -% composite macros don't work. -% -% In other words, while |\~| and |u| in Greek form the composite glyph ``upsilon -% with circumflex'' that exists in the Greek font table, the same macro |\~| and the -% letter |k| produce the superposition of a circumflex on top of a ``kappa'' glyph, -% since this glyph does not exist in the Greek font table. +% We will use those service macros in the definition of several accent +% like macros that keep all the intricacies away from the user. +% +% In particular the \LaTeX\ kernel macros are used in order to declare +% accents, composite glyphs, composite commands, and the like; these are +% used as the default definitions; afterwards other definitions will be +% given that work when these composite macros don't work. +% +% In other words, while |\~| and |u| in Greek form the composite glyph +% “upsilon with circumflex” that exists in the Greek font table, the same +% macro |\~| and the letter |k| produce the superposition of a circumflex +% on top of a “kappa” glyph, since this glyph does not exist in the Greek +% font table. %^^A %^^A NON SEMBRA CHE FUNZIONI CON TUTTI I COMANDI; CHIEDERE A GÜNTER %^^A -% Notice that all these declarations are restricted to the Greek font encoding -% so they are usable only when such encoding is in force. See the +% Notice that all these declarations are restricted to the Greek font +% encoding so they are usable only when such encoding is in force. See the % |teubner-doc.pdf| file for more details concerning the usefulness of the -% extended accent macros vs.~the ligature mechanism. In any case, with version -% 3.9g of \babel\ and the modifications introduced by G\"unter Milde, the -% actual \babel\-greek maintainer, during the year 2013, such extended accent -% macros are LICR encoded and may always be used when typesetting in Greek; -% see file \texttt{greek-fontenc.def} and \texttt{lgrenc.def} for further -% details, remembering that such files are always loaded when typesetting -% Greek texts, irrespective of the input encoding; if the encoding is -% \texttt{utf8} direct Greek glyph input is possible (if your keyboard -% allows you to do such input). +% extended accent macros vs.~the ligature mechanism. In any case, with +% version 3.9g of \babel\ and the modifications introduced by G\"unter +% Milde, the actual \babel\-greek maintainer, during the year 2013, such +% extended accent macros are LICR encoded and may always be used when +% typesetting in Greek; see file \texttt{greek-fontenc.def} and +% \texttt{lgrenc.def} for further details, remembering that such files are +% always loaded when typesetting Greek texts, irrespective of the input +% encoding; if the encoding is \texttt{utf8} direct Greek glyph input is +% possible (if your keyboard allows you to do such input). % %\section{Avoiding conflicts} -% Some LICR definitions are necessary to use \pack{teubner}, but some of them -% are really important; therefore G\"unter Milde developed package -% \pack{textslpha} that comes with the other special files for the Greek LICR -% encoding, that avoids any conflict; we load it at the |\begin{document}| -% execution so that it will be loaded only if necessary: +% Some LICR definitions are necessary to use \pack{teubner}, but some of +% them are really important; therefore G\"unter Milde developed package +% \pack{textslpha} that comes with the other special files for the Greek +% LICR encoding, that avoids any conflict; we load it at the +% |\begin{document}| execution so that it will be loaded only if +% necessary: % \begin{macrocode} \AtEndPreamble{\RequirePackage{textalpha}} % \end{macrocode} % % \subsection{Special accent macros} -% Now we come back to the ``accent like'' and ``cedilla like'' general macros we -% defined above, and that will be extensively used in the following definitions. -% Note that for what the circumflex is concerned, when |teubner| is in effect it -% is not defined as an active character and does not work as a non breaking space. -% The command |\~| is just an accent macro; how do you put a non breaking space in -% a Greek context? By simply using the \LaTeX\ kernel macro |\nobreakspace|; when -% typesetting with non-Greek fonts the |~| is certainly handy -% to insert a non breaking space (a tie), but for polytonic Greek spelling in the -% past 15 years or so the Greek language definition file has always used the |~| -% sign a letter, not as an active character. If you look in the \babel\ package -% documentation related to the Greek language, you find that for what concerns the -% |~| with polytonic spelling a number of ``dirty tricks'' have been used, but -% nothing has been done to replace the ``tie'' function of this character when -% typesetting in languages that use the Latin script; the only action related to -% this point has been to redefine the kernel macros for typesetting figure and -% table% captions so as to substitute the |~| character with its explicit -% definition |\nobreakspace|. It is necessary to do the same when this package is -% used, although a shorter alias command |\nbs| is provided in order to simplify -% the input keying. +% Now we come back to the “accent like” and “cedilla like” general macros +% we defined above, and that will be extensively used in the following +% definitions. +% Note that for what the circumflex is concerned, when |teubner| is in +% effect it is not defined as an active character and does not work as a +% non breaking space. The command |\~| is just an accent macro; how do +% you put a non breaking space in a Greek context? By simply using the +% \LaTeX\ kernel macro |\nobreakspace|; when typesetting with non-Greek +% fonts the |~| is certainly handy to insert a non breaking space +% (a tie), but for polytonic Greek spelling in the past 15 years or so +% the Greek language definition file has always used the |~| sign a +% letter, not as an active character. If you look in the \babel\ package +% documentation related to the Greek language, you find that for what +% concerns the |~| with polytonic spelling a number of “dirty tricks” +% have been used, but nothing has been done to replace the “tie” function +% of this character when typesetting in languages that use the Latin +% script; the only action related to this point has been to redefine the +% kernel macros for typesetting figure and table% captions so as to +% substitute the |~| character with its explicit definition +% |\nobreakspace|. It is necessary to do the same when this package is +% used, although a shorter alias command |\nbs| is provided in order to +% simplify the input keying. % \begin{macrocode} \let\nbs\nobreakspace % \end{macrocode} % -% Before defining the Greek accents with the extended macros input with the -% LICR accent macros, we have to define the accent superpositioning macros that -% with \pack{teubner} allow to stack from one to more accent over the base letter, -% taking into account the slant of the font from which the base letter is taken. -% Notice that these macros allow to set an accent on any base latter, even if that -% might be meaningless. At the same time we redefine the standard macros so as to -% let them do the same work when the LGR encoding is not in force. This duality is -% necessary, not only for backward compatibility, but also for avoiding that the +% Before defining the Greek accents with the extended macros input with +% the LICR accent macros, we have to define the accent superpositioning +% macros that with \pack{teubner} allow to stack from one to more accent +% over the base letter, taking into account the slant of the font from +% which the base letter is taken. Notice that these macros allow to set +% an accent on any base latter, even if that might be meaningless. At the +% same time we redefine the standard macros so as to let them do the same +% work when the LGR encoding is not in force. This duality is necessary, +% not only for backward compatibility, but also for avoiding that the % normal redefined macros highjack the LICR facility. % % We first define aliases for the standard \LaTeX\ accents, so that when -% entering Greek typesetting mode we can save the \LaTeX\ macros, and restore -% them upon exiting: +% entering Greek typesetting mode we can save the \LaTeX\ macros, and +% restore them upon exiting: % \begin{macrocode} \let\accacuto\' \let\accgrave\` @@ -1305,27 +1411,28 @@ Type X <return> to exit.}% \let\accmacron\= % \end{macrocode} % -% Then we define alternate macros for these accents, as ``lifting'' accent macros, -% so that they can put their respective accent over any letter. -% For the diaeresis we need to put an invisible character (|v| in the LGR encoded -% CB fonts, that with LICR becomes |\textcompwordmark|) in order to avoid any -% ligature with an implied end of word (boundarychar) that turns the diaeresis -% into an apostrophe. -% \begin{macrocode} -\DeclareTextCommand{\G}{\GRencoding@name}[1]{\lift@accent{96}{#1}} -\DeclareTextCommand{\A}{\GRencoding@name}[1]{\lift@accent{39}{#1}} -\DeclareTextCommand{\C}{\GRencoding@name}[1]{\lift@accent{126}{#1}} -\DeclareTextCommand{\D}{\GRencoding@name}[1]{\lift@accent{34\textcompwordmark}{#1}} -\DeclareTextCommand{\B}{\GRencoding@name}[1]{\lift@accent{30}{#1}} -\DeclareTextCommand{\M}{\GRencoding@name}[1]{\lift@accent{31}{#1}} -% -% \end{macrocode} -% But we have to provide also the means for disabling the |~| shorthand that is -% reset every time the Greek language is selected again in a multi language document -% where language shifts take place quite often; we must also counteract the -% resetting of the |\~| definition performed by the |greek.ld| file in every -% language shift; we add the accent definition to the |\extrasgreek| macro, -% and we reset them at |\noextrasgreek| execution. +% Then we define alternate macros for these accents, as “lifting” accent +% macros, so that they can put their respective accent over any letter. +% For the diaeresis we need to put an invisible character (|v| in the LGR +% encoded CB fonts, that with LICR becomes |\textcompwordmark|) in order +% to avoid any ligature with an implied end of word (boundarychar) that +% turns the diaeresis into an apostrophe. +% \begin{macrocode} +\DeclareTextCommand{\G}{\GRenc@name}[1]{\lift@accent{96}{#1}} +\DeclareTextCommand{\A}{\GRenc@name}[1]{\lift@accent{39}{#1}} +\DeclareTextCommand{\C}{\GRenc@name}[1]{\lift@accent{126}{#1}} +\DeclareTextCommand{\D}{\GRenc@name}[1]{\lift@accent{34\textcompwordmark}{#1}} +\DeclareTextCommand{\B}{\GRenc@name}[1]{\lift@accent{30}{#1}} +\DeclareTextCommand{\M}{\GRenc@name}[1]{\lift@accent{31}{#1}} +% +% \end{macrocode} +% But we have to provide also the means for disabling the |~| shorthand +% that is reset every time the Greek language is selected again in a multi +% language document where language shifts take place quite often; we must +% also counteract the resetting of the |\~| definition performed by the +% |greek.ld| file in every language shift; we add the accent definition +% to the |\extrasgreek| macro, and we reset them at |\noextrasgreek| +% execution. % \begin{macrocode} \addto\extrasgreek{\shorthandoff{~}\let\~\accperispomeni \let\"\accdialytika\let\'\acctonos\let\`\accvaria} @@ -1334,138 +1441,140 @@ Type X <return> to exit.}% % \end{macrocode} % -% Besides the normal |\B| command for setting a breve command, another ``large -% breve'' is required by philologists, who need to mark a diphthong, or in general -% two letters; the macro |\U| does the job, but it is the typesetter's -% responsibility to input the macro argument as made of two letters (possibly with -% their own accents): +% Besides the normal |\B| command for setting a breve command, another +% “large breve” is required by philologists, who need to mark a diphthong, +% or in general two letters; the macro |\U| does the job, but it is the +% typesetter's responsibility to input the macro argument as made of two +% letters (possibly with their own accents): % \begin{macrocode} -\DeclareTextCommand{\U}{\GRencoding@name}[1]{\lift@accent{151}{#1}} +% brevis +\DeclareTextCommand{\U}{\GRenc@name}[1]{\lift@accent{151}{#1}} % rough -\DeclareTextCommand{\r}{\GRencoding@name}[1]{\lift@accent{60}{#1}} +\DeclareTextCommand{\r}{\GRenc@name}[1]{\lift@accent{60}{#1}} % smooth -\DeclareTextCommand{\s}{\GRencoding@name}[1]{\lift@accent{62}{#1}} -% acute+diaeresis -\DeclareTextCommand{\Ad}{\GRencoding@name}[1]{\lift@accent{35}{#1}} -% grave+diaeresis -\DeclareTextCommand{\Gd}{\GRencoding@name}[1]{\lift@accent{36}{#1}} -% circumflex+diaeresis -\DeclareTextCommand{\Cd}{\GRencoding@name}[1]{\lift@accent{32}{#1}} +\DeclareTextCommand{\s}{\GRenc@name}[1]{\lift@accent{62}{#1}} +% acute+dir +\DeclareTextCommand{\Ad}{\GRenc@name}[1]{\lift@accent{35}{#1}} +% grave+dier +\DeclareTextCommand{\Gd}{\GRenc@name}[1]{\lift@accent{36}{#1}} +% circ+dier +\DeclareTextCommand{\Cd}{\GRenc@name}[1]{\lift@accent{32}{#1}} % acute+rough -\DeclareTextCommand{\Ar}{\GRencoding@name}[1]{\lift@accent{86}{#1}} +\DeclareTextCommand{\Ar}{\GRenc@name}[1]{\lift@accent{86}{#1}} % grave+rough -\DeclareTextCommand{\Gr}{\GRencoding@name}[1]{\lift@accent{67}{#1}} +\DeclareTextCommand{\Gr}{\GRenc@name}[1]{\lift@accent{67}{#1}} % circumflex+rough -\DeclareTextCommand{\Cr}{\GRencoding@name}[1]{\lift@accent{64}{#1}} +\DeclareTextCommand{\Cr}{\GRenc@name}[1]{\lift@accent{64}{#1}} % acute+smooth -\DeclareTextCommand{\As}{\GRencoding@name}[1]{\lift@accent{94}{#1}} +\DeclareTextCommand{\As}{\GRenc@name}[1]{\lift@accent{94}{#1}} % grave+smooth -\DeclareTextCommand{\Gs}{\GRencoding@name}[1]{\lift@accent{95}{#1}} +\DeclareTextCommand{\Gs}{\GRenc@name}[1]{\lift@accent{95}{#1}} % circumflex+smooth -\DeclareTextCommand{\Cs}{\GRencoding@name}[1]{\lift@accent{92}{#1}} -% \end{macrocode} -% Most of the above accent commands are used again in order to tie a text symbol -% meaning to certain combinations, that is when they receive as argument a vowel -% whose accented glyph is present in the font; in this way in order to type -% ``alpha with rough breath, acute accent and iota subscript'' you can type -% \verb"<'a|", or \verb"\Ar{a}|" or |\arai| or \verb+\<'a|+, if you use the new standard -% accent macros; the advantage of using the first notation is its short string; the -% advantage of the second is that it does not break kerning commands with a -% preceding letter; the advantage of the third is that it does not break any -% kerning either before or after; the fourth solution produces the same result as -% the third, but it's easier to make up and you don't have to memorise any specific -% naming rule for accented glyphs. With the Lipsian font this trick is particularly -% useful for any sequence of alpha and upsilon each one with its own accents and/or -% diaeresis. -% -% In Greek the regular cedilla is meaningless, so that |\c| may be redefined -% as a semivowel command; at the same time the typesetter might be more -% comfortable if he could always use the same, although longer, macro for -% marking a vowel as a semivowel one; therefore |\c| plays the same role -% in Greek as |\semiv|. +\DeclareTextCommand{\Cs}{\GRenc@name}[1]{\lift@accent{92}{#1}} +% \end{macrocode} +% Most of the above accent commands are used again in order to tie a text +% symbol meaning to certain combinations, that is when they receive as +% argument a vowel whose accented glyph is present in the font; in this +% way in order to type “alpha with rough breath, acute accent and iota +% subscript” you can type \verb"<'a|", or \verb"\Ar{a}|" or |\arai| or +% \verb+\<'a|+, if you use the new standard accent macros; the advantage +% of using the first notation is its short string; the advantage of the +% second is that it does not break kerning commands with a preceding +% letter; the advantage of the third is that it does not break any +% kerning either before or after; the fourth solution produces the same +% result as the third, but it's easier to make up and you don't have to +% memorise any specific naming rule for accented glyphs. With the Lipsian +% font this trick is particularly useful for any sequence of alpha and +% upsilon each one with its own accents and/or diaeresis. +% +% In Greek the regular cedilla is meaningless, so that |\c| may be +% redefined as a semivowel command; at the same time the typesetter might +% be more comfortable if he could always use the same, although longer, +% macro for marking a vowel as a semivowel one; therefore |\c| plays the +% same role in Greek as |\semiv|. % \begin{macrocode} % cap cedilla -\DeclareTextCommand{\c}{\GRencoding@name}[1]{\cap@cedilla{#1}} -\DeclareTextCommand{\semiv}{\GRencoding@name}[1]{\cap@cedilla{#1}} +\DeclareTextCommand{\c}{\GRenc@name}[1]{\cap@cedilla{#1}} +\DeclareTextCommand{\semiv}{\GRenc@name}[1]{\cap@cedilla{#1}} \DeclareTextCommand{\semiv}{OT1}[1]{\cap@cedilla{#1}} \DeclareTextCommand{\semiv}{T1}[1]{\cap@cedilla{#1}} % ring cedilla -\DeclareTextCommand{\ring}{\GRencoding@name}[1]{\ring@cedilla{#1}} +\DeclareTextCommand{\ring}{\GRenc@name}[1]{\ring@cedilla{#1}} \DeclareTextCommand{\ring}{OT1}[1]{\ring@cedilla{#1}} \DeclareTextCommand{\ring}{T1}[1]{\ring@cedilla{#1}} % dot cedilla -\DeclareTextCommand{\Dot}{\GRencoding@name}[1]{\dot@cedilla{#1}} +\DeclareTextCommand{\Dot}{\GRenc@name}[1]{\dot@cedilla{#1}} \DeclareTextCommand{\Dot}{OT1}[1]{\dot@cedilla{#1}} \DeclareTextCommand{\Dot}{T1}[1]{\dot@cedilla{#1}} % tie cedilla -\DeclareTextCommand{\ut}{\GRencoding@name}[1]{\tie@cedilla{#1}} +\DeclareTextCommand{\ut}{\GRenc@name}[1]{\tie@cedilla{#1}} \DeclareTextCommand{\ut}{OT1}[1]{\tie@cedilla{#1}} \DeclareTextCommand{\ut}{T1}[1]{\tie@cedilla{#1}} % % Acute breve -\DeclareTextCommand{\Ab}{\GRencoding@name}[1]% +\DeclareTextCommand{\Ab}{\GRenc@name}[1]% {\LIFT@accent{39}{-.15ex}{\lift@accent{30}{#1}}} % Grave breve -\DeclareTextCommand{\Gb}{\GRencoding@name}[1]% +\DeclareTextCommand{\Gb}{\GRenc@name}[1]% {\LIFT@accent{96}{-.15ex}{\lift@accent{30}{#1}}} % Acute rough breve -\DeclareTextCommand{\Arb}{\GRencoding@name}[1]% +\DeclareTextCommand{\Arb}{\GRenc@name}[1]% {\LIFT@accent{86}{-.15ex}{\lift@accent{30}{#1}}} % Grave rough breve -\DeclareTextCommand{\Grb}{\GRencoding@name}[1]% +\DeclareTextCommand{\Grb}{\GRenc@name}[1]% {\LIFT@accent{67}{-.15ex}{\lift@accent{30}{#1}}} % Acute smooth breve -\DeclareTextCommand{\Asb}{\GRencoding@name}[1]% +\DeclareTextCommand{\Asb}{\GRenc@name}[1]% {\LIFT@accent{94}{-.15ex}{\lift@accent{30}{#1}}} % Grave smooth breve -\DeclareTextCommand{\Gsb}{\GRencoding@name}[1]% +\DeclareTextCommand{\Gsb}{\GRenc@name}[1]% {\LIFT@accent{95}{-.15ex}{\lift@accent{30}{#1}}} % % Acute macron -\DeclareTextCommand{\Am}{\GRencoding@name}[1]% +\DeclareTextCommand{\Am}{\GRenc@name}[1]% {\Lift@accent{39}{\lift@accent{31}{#1}}} % Grave macron -\DeclareTextCommand{\Gm}{\GRencoding@name}[1]% +\DeclareTextCommand{\Gm}{\GRenc@name}[1]% {\Lift@accent{96}{\lift@accent{31}{#1}}} % Circumflex macron -\DeclareTextCommand{\Cm}{\GRencoding@name}[1]% +\DeclareTextCommand{\Cm}{\GRenc@name}[1]% {\Lift@accent{126}{\lift@accent{31}{#1}}} % Acute rough macron -\DeclareTextCommand{\Arm}{\GRencoding@name}[1]% +\DeclareTextCommand{\Arm}{\GRenc@name}[1]% {\Lift@accent{86}{\lift@accent{31}{#1}}} % Grave rough macron -\DeclareTextCommand{\Grm}{\GRencoding@name}[1]% +\DeclareTextCommand{\Grm}{\GRenc@name}[1]% {\Lift@accent{67}{\lift@accent{31}{#1}}} % Circumflex rough macron -\DeclareTextCommand{\Crm}{\GRencoding@name}[1]% +\DeclareTextCommand{\Crm}{\GRenc@name}[1]% {\Lift@accent{64}{\lift@accent{31}{#1}}} % Acute smooth macron -\DeclareTextCommand{\Asm}{\GRencoding@name}[1]% +\DeclareTextCommand{\Asm}{\GRenc@name}[1]% {\Lift@accent{94}{\lift@accent{31}{#1}}} % Grave smooth macron -\DeclareTextCommand{\Gsm}{\GRencoding@name}[1]% +\DeclareTextCommand{\Gsm}{\GRenc@name}[1]% {\Lift@accent{95}{\lift@accent{31}{#1}}} % Circumflex smooth macron -\DeclareTextCommand{\Csm}{\GRencoding@name}[1]% +\DeclareTextCommand{\Csm}{\GRenc@name}[1]% {\Lift@accent{92}{\lift@accent{31}{#1}}} % smooth macron -\DeclareTextCommand{\Sm}{\GRencoding@name}[1]% +\DeclareTextCommand{\Sm}{\GRenc@name}[1]% {\Lift@accent{62}{\lift@accent{31}{#1}}} % rough macron -\DeclareTextCommand{\Rm}{\GRencoding@name}[1]% +\DeclareTextCommand{\Rm}{\GRenc@name}[1]% {\Lift@accent{60}{\lift@accent{31}{#1}}} % smooth breve -\DeclareTextCommand{\Sb}{\GRencoding@name}[1]% +\DeclareTextCommand{\Sb}{\GRenc@name}[1]% {\LIFT@accent{62}{-0.15ex}{\lift@accent{30}{#1}}} % rough breve -\DeclareTextCommand{\Rb}{\GRencoding@name}[1]% +\DeclareTextCommand{\Rb}{\GRenc@name}[1]% {\LIFT@accent{60}{-0.15ex}{\lift@accent{30}{#1}}} % breve and dieresis -\DeclareTextCommand{\bd}{\GRencoding@name}[1]% +\DeclareTextCommand{\bd}{\GRenc@name}[1]% {\LIFT@accent{30}{-.1ex}{\lift@accent{34v}{#1}}} % % iota subscript -\DeclareTextCommand{\iS}{\GRencoding@name}[1] +\DeclareTextCommand{\iS}{\GRenc@name}[1] {\ooalign{#1\crcr\hidewidth\char124\hidewidth}} % \end{macrocode} @@ -1473,7 +1582,7 @@ Type X <return> to exit.}% % \begin{macro}{\d} % The |\d| macro must be made available also with the Greek encoding % \begin{macrocode} -\DeclareTextCommand{\d}{\GRencoding@name}[1]% +\DeclareTextCommand{\d}{\GRenc@name}[1]% {\leavevmode\bgroup\o@lign{\relax#1\crcr \hidewidth\sh@ft{10}.\hidewidth}\egroup} @@ -1490,7 +1599,7 @@ Type X <return> to exit.}% {\setbox4\hbox{\raise-.33ex\hbox{\metricsfont\char14}}% \dimen@-.5\wd4 \setbox\tw@\hbox{i}\setbox\z@\hbox{#1}% -\ifx\cf@encoding\GRencoding@name +\ifx\cf@encoding\GRenc@name \advance\dimen@ .5\wd\z@ \setbox\tw@\hbox{h}\ifdim\wd\z@=\wd\tw@\advance\dimen@-.13\wd\z@\fi \else @@ -1509,7 +1618,7 @@ Type X <return> to exit.}% {\setbox4\hbox{\raise-1.7ex\hbox{\GEcq}}% \dimen@-.5\wd4 \setbox\tw@\hbox{i}\setbox\z@\hbox{#1}% -\ifx\cf@encoding\GRencoding@name +\ifx\cf@encoding\GRenc@name \advance\dimen@ .5\wd\z@ \setbox\tw@\hbox{h}\ifdim\wd\z@=\wd\tw@\advance\dimen@-.13\wd\z@\fi \else @@ -1522,34 +1631,35 @@ Type X <return> to exit.}% % \end{macrocode} % \end{macro} %\begin {macro}{\tenaspir} -% Similarly |\tenaspir| marks a ``tenuis aspiratio'' +% Similarly |\tenaspir| marks a “tenuis aspiratio” % \begin{macrocode} \DeclareRobustCommand{\tenaspir}[1]{#1\/% - {\fontencoding{\GRencoding@name}\selectfont<v}} + {\fontencoding{\GRenc@name}\selectfont<v}} % \end{macrocode} % \end{macro} %\begin{macro}{\palat} % |\palat| marks a palatal pronunciation of some consonants. % \begin{macrocode} \DeclareRobustCommand{\palat}[1]{#1{% - \expandafter\fontencoding\expandafter{\GRencoding@name}\selectfont + \expandafter\fontencoding\expandafter{\GRenc@name}\selectfont \anwtonos}} % \end{macrocode} %\end{macro} % % With the help of the previous macros some new commands get defined so as -% to use a simple more or less mnemonic macro instead of having the typesetter type -% in nested macros; these macros are valid only in the Greek and Latin encodings. +% to use a simple more or less mnemonic macro instead of having the +% typesetter type in nested macros; these macros are valid only in the +% Greek and Latin encodings. % \begin{macrocode} % dot and breve -\DeclareTextCommand{\Ud}{\GRencoding@name}[1]{\d{\u{#1}}} +\DeclareTextCommand{\Ud}{\GRenc@name}[1]{\d{\u{#1}}} % dot and macron -\DeclareTextCommand{\md}{\GRencoding@name}[1]{\d{\={#1}}} +\DeclareTextCommand{\md}{\GRenc@name}[1]{\d{\={#1}}} % open and breve -\DeclareTextCommand{\UO}{\GRencoding@name}[1]{\Open{\u{#1}}} +\DeclareTextCommand{\UO}{\GRenc@name}[1]{\Open{\u{#1}}} % open and macron -\DeclareTextCommand{\mO}{\GRencoding@name}[1]{\Open{\={#1}}} +\DeclareTextCommand{\mO}{\GRenc@name}[1]{\Open{\={#1}}} % \DeclareTextCommand{\Ud}{T1}[1]{\d{\u{#1}}} @@ -1573,7 +1683,9 @@ Type X <return> to exit.}% % \begin{macro}{\textemdash} % \begin{macro}{emdash} % \begin{macro}{\textendash} -% All these macros are defined by the new \texttt{lgrenc.def} file, so it is not necessary to redefine them.% \end{macro} +% All these macros are defined by the new \texttt{lgrenc.def} file, so +% it is not necessary to redefine them. +% \end{macro} % \end{macro} % \end{macro} % \end{macro} @@ -1630,22 +1742,22 @@ Type X <return> to exit.}% %\begin{macro}{\textsterling} %\begin{macro}{\textunderscore} %\begin{macro}{\textvisiblespace} -% More important, although unlikely to be found in a philological text, is the -% question of standard \LaTeX\ commands that are defined with reference to some -% encoding; if Greek text is being typeset, the Greek encoding is being used and -% such symbols would not be available any more; \LaTeX would issue warning messages -% complaining for their absence. Therefore we redefined them also for the Greek -% encoding. -% \begin{macrocode} -\DeclareTextCommand{\textdollar}{\GRencoding@name}% +% More important, although unlikely to be found in a philological text, +% is the question of standard \LaTeX\ commands that are defined with +% reference to some encoding; if Greek text is being typeset, the Greek +% encoding is being used and such symbols would not be available any +% more; \LaTeX would issue warning messages complaining for their +% absence. Therefore we redefined them also for the Greek encoding. +% \begin{macrocode} +\DeclareTextCommand{\textdollar}{\GRenc@name}% {{\fontencoding{T1}\selectfont\char36}} -\DeclareTextCommand{\textsection}{\GRencoding@name}% +\DeclareTextCommand{\textsection}{\GRenc@name}% {{\fontencoding{T1}\selectfont\char159}} -\DeclareTextCommand{\textsterling}{\GRencoding@name}% +\DeclareTextCommand{\textsterling}{\GRenc@name}% {{\fontencoding{T1}\selectfont\char191}} -\DeclareTextCommand{\textunderscore}{\GRencoding@name}% +\DeclareTextCommand{\textunderscore}{\GRenc@name}% {{\fontencoding{T1}\selectfont\char95}} -\DeclareTextCommand{\textvisiblespace}{\GRencoding@name}% +\DeclareTextCommand{\textvisiblespace}{\GRenc@name}% {{\fontencoding{T1}\selectfont\char32}} % \end{macrocode} @@ -1657,238 +1769,242 @@ Type X <return> to exit.}% % % % \subsection{Accent macros and glyph names} -% Now come dozens of macros that allow to access Greek accented vowels (plus rho -% with rough and smooth breaths) with macros instead of ligatures; such macros -% allow the kerning information to be used by \TeX, while the ligature mechanism -% would sometimes impeach the use of such kerning information. Notice that the -% same glyphs are often accessed with a ``text symbol'' or a ``text composite -% symbol''; as explained above the opportunity of using either one derives from -% the necessity of maintaining the kerning mechanism embedded in the font; if the -% CB fonts had a postfixed accent notation, instead of a prefixed one, none of -% these macros would be necessary (probably\dots!), but there would be other -% inconveniences. -% -% Notice that the following code is subject to the boolean variable |GlyphNames| -% which is set to \emph{false} by default, just for compatibility with the past; -% I suggest to use the \emph{GlyphNames} option when when you really want to use -% such macros; remember though that all these glyphs are more easily specified by -% means of the extended accent macros that are also less restricted in their -% names; for a letter marked with a smooth breath and an acute accent you can -% indifferently type before the letter one of the following |\>\'|, |\>'|, |\'\>|, -% |\'>| at your choice. Moreover you can always postfix the mark for the iota -% subscribed at the right of the letter, without any need o memorising complicated -% names. -% -% Notice the macros |\oR| and |\oG| that have the second letter capitalised in -% order to avoid conflicts with otherwise homonymous macros defined in the \LaTeX\ -% kernel or in other packages; by maintaining the false value to the boolean -% variable |GlyphNames| you are sure to avoid conflicts. +% +% Now come dozens of macros that allow to access Greek accented vowels +% (plus rho with rough and smooth breaths) with macros instead of +% ligatures; such macros allow the kerning information to be used by +% \TeX, while the ligature mechanism would sometimes impeach the use of +% such kerning information. Notice that the same glyphs are often +% accessed with a “text symbol” or a “text composite symbol”; as +% explained above the opportunity of using either one derives from +% the necessity of maintaining the kerning mechanism embedded in the +% font; if the CB fonts had a postfixed accent notation, instead of +% a prefixed one, none of these macros would be necessary +% (probably\dots!), but there would be other inconveniences. +% +% Notice that the following code is subject to the boolean variable +% |GlyphNames| which is set to \emph{false} by default, just for +% compatibility with the past; I suggest to use the \emph{GlyphNames} +% option when when you really want to use such macros; remember though +% that all these glyphs are more easily specified by means of the +% extended accent macros that are also less restricted in their names; +% for a letter marked with a smooth breath and an acute accent you can +% indifferently type before the letter one of the following +% |\>\'|, |\>'|, |\'\>|, |\'>| at your choice. Moreover you can always +% postfix the mark for the iota subscribed at the right of the letter, +% without any need o memorising complicated names. +% +% Notice the macros |\oR| and |\oG| that have the second letter +% capitalised in order to avoid conflicts with otherwise homonymous +% macros defined in the \LaTeX\ kernel or in other packages; by +% maintaining the false value to the boolean variable |GlyphNames| you +% are sure to avoid conflicts. % \begin{macrocode} \ifGlyphNames -\DeclareTextSymbol{\ag}{\GRencoding@name}{128} -\DeclareTextSymbol{\ar}{\GRencoding@name}{129} -\DeclareTextComposite{\r}{\GRencoding@name}{a}{129} -\DeclareTextSymbol{\as}{\GRencoding@name}{130} -\DeclareTextComposite{\s}{\GRencoding@name}{a}{130} -\DeclareTextSymbol{\aa}{\GRencoding@name}{136} -\DeclareTextSymbol{\ac}{\GRencoding@name}{144} -\DeclareTextSymbol{\ai}{\GRencoding@name}{248} -\DeclareTextSymbol{\aai}{\GRencoding@name}{140} -\DeclareTextSymbol{\aci}{\GRencoding@name}{148} -\DeclareTextSymbol{\agi}{\GRencoding@name}{132} -\DeclareTextSymbol{\ara}{\GRencoding@name}{137} -\DeclareTextComposite{\Ar}{\GRencoding@name}{a}{137} -\DeclareTextSymbol{\arc}{\GRencoding@name}{145} -\DeclareTextComposite{\Cr}{\GRencoding@name}{a}{145} -\DeclareTextSymbol{\arg}{\GRencoding@name}{131} -\DeclareTextComposite{\Gr}{\GRencoding@name}{a}{131} -\DeclareTextSymbol{\ari}{\GRencoding@name}{133} -\DeclareTextSymbol{\asa}{\GRencoding@name}{138} -\DeclareTextComposite{\As}{\GRencoding@name}{a}{138} -\DeclareTextSymbol{\asc}{\GRencoding@name}{146} -\DeclareTextComposite{\Cs}{\GRencoding@name}{a}{146} -\DeclareTextSymbol{\asg}{\GRencoding@name}{139} -\DeclareTextComposite{\Gs}{\GRencoding@name}{a}{139} -\DeclareTextSymbol{\asi}{\GRencoding@name}{134} -\DeclareTextSymbol{\argi}{\GRencoding@name}{135} -\DeclareTextSymbol{\arai}{\GRencoding@name}{141} -\DeclareTextSymbol{\arci}{\GRencoding@name}{149} -\DeclareTextSymbol{\asai}{\GRencoding@name}{142} -\DeclareTextSymbol{\asgi}{\GRencoding@name}{143} -\DeclareTextSymbol{\asci}{\GRencoding@name}{150} -\DeclareTextSymbol{\hg}{\GRencoding@name}{152} -\DeclareTextSymbol{\hr}{\GRencoding@name}{153} -\DeclareTextComposite{\r}{\GRencoding@name}{h}{153} -\DeclareTextSymbol{\hs}{\GRencoding@name}{154} -\DeclareTextComposite{\s}{\GRencoding@name}{h}{154} -\DeclareTextSymbol{\hrg}{\GRencoding@name}{163} -\DeclareTextComposite{\Gr}{\GRencoding@name}{h}{163} -\DeclareTextSymbol{\hgi}{\GRencoding@name}{156} -\DeclareTextSymbol{\hri}{\GRencoding@name}{157} -\DeclareTextSymbol{\hsi}{\GRencoding@name}{158} -\DeclareTextSymbol{\hrgi}{\GRencoding@name}{167} -\DeclareTextSymbol{\ha}{\GRencoding@name}{160} -\DeclareTextSymbol{\hra}{\GRencoding@name}{161} -\DeclareTextComposite{\Ar}{\GRencoding@name}{h}{161} -\DeclareTextSymbol{\hsa}{\GRencoding@name}{162} -\DeclareTextComposite{\As}{\GRencoding@name}{h}{162} -\DeclareTextSymbol{\hsg}{\GRencoding@name}{171} -\DeclareTextComposite{\Gs}{\GRencoding@name}{h}{171} -\DeclareTextSymbol{\hai}{\GRencoding@name}{164} -\DeclareTextSymbol{\hrai}{\GRencoding@name}{165} -\DeclareTextSymbol{\hsai}{\GRencoding@name}{166} -\DeclareTextSymbol{\hsgi}{\GRencoding@name}{175} -\DeclareTextSymbol{\hc}{\GRencoding@name}{168} -\DeclareTextSymbol{\hrc}{\GRencoding@name}{169} -\DeclareTextComposite{\Cr}{\GRencoding@name}{h}{169} -\DeclareTextSymbol{\hsc}{\GRencoding@name}{170} -\DeclareTextComposite{\Cs}{\GRencoding@name}{h}{170} -\DeclareTextSymbol{\hci}{\GRencoding@name}{172} -\DeclareTextSymbol{\hrci}{\GRencoding@name}{173} -\DeclareTextSymbol{\hsci}{\GRencoding@name}{174} -\DeclareTextSymbol{\hi}{\GRencoding@name}{249} -\DeclareTextSymbol{\wg}{\GRencoding@name}{176} -\DeclareTextSymbol{\wr}{\GRencoding@name}{177} -\DeclareTextComposite{\r}{\GRencoding@name}{w}{177} -\DeclareTextSymbol{\ws}{\GRencoding@name}{178} -\DeclareTextComposite{\s}{\GRencoding@name}{w}{178} -\DeclareTextSymbol{\wrg}{\GRencoding@name}{179} -\DeclareTextComposite{\Gr}{\GRencoding@name}{w}{179} -\DeclareTextSymbol{\wgi}{\GRencoding@name}{180} -\DeclareTextSymbol{\wri}{\GRencoding@name}{181} -\DeclareTextSymbol{\wsi}{\GRencoding@name}{182} -\DeclareTextSymbol{\wrgi}{\GRencoding@name}{183} -\DeclareTextSymbol{\wa}{\GRencoding@name}{184} -\DeclareTextSymbol{\wra}{\GRencoding@name}{185} -\DeclareTextComposite{\Ar}{\GRencoding@name}{w}{185} -\DeclareTextSymbol{\wsa}{\GRencoding@name}{186} -\DeclareTextComposite{\As}{\GRencoding@name}{w}{186} -\DeclareTextSymbol{\wsg}{\GRencoding@name}{187} -\DeclareTextComposite{\Gs}{\GRencoding@name}{w}{187} -\DeclareTextSymbol{\wai}{\GRencoding@name}{188} -\DeclareTextSymbol{\wrai}{\GRencoding@name}{189} -\DeclareTextSymbol{\wsai}{\GRencoding@name}{190} -\DeclareTextSymbol{\wsgi}{\GRencoding@name}{191} -\DeclareTextSymbol{\wc}{\GRencoding@name}{192} -\DeclareTextSymbol{\wrc}{\GRencoding@name}{193} -\DeclareTextComposite{\Cr}{\GRencoding@name}{w}{193} -\DeclareTextSymbol{\wsc}{\GRencoding@name}{194} -\DeclareTextComposite{\Cs}{\GRencoding@name}{w}{194} -\DeclareTextSymbol{\wci}{\GRencoding@name}{196} -\DeclareTextSymbol{\wrci}{\GRencoding@name}{197} -\DeclareTextSymbol{\wsci}{\GRencoding@name}{198} -\DeclareTextSymbol{\wi}{\GRencoding@name}{250} -\DeclareTextSymbol{\ig}{\GRencoding@name}{200} -\DeclareTextSymbol{\ir}{\GRencoding@name}{201} -\DeclareTextComposite{\r}{\GRencoding@name}{i}{201} -\DeclareTextSymbol{\is}{\GRencoding@name}{202} -\DeclareTextComposite{\s}{\GRencoding@name}{i}{202} -\DeclareTextSymbol{\irg}{\GRencoding@name}{203} -\DeclareTextComposite{\Gr}{\GRencoding@name}{i}{203} -\DeclareTextSymbol{\ia}{\GRencoding@name}{208} -\DeclareTextSymbol{\ira}{\GRencoding@name}{209} -\DeclareTextComposite{\Ar}{\GRencoding@name}{i}{209} -\DeclareTextSymbol{\isa}{\GRencoding@name}{210} -\DeclareTextComposite{\As}{\GRencoding@name}{i}{210} -\DeclareTextSymbol{\isg}{\GRencoding@name}{211} -\DeclareTextComposite{\Gs}{\GRencoding@name}{i}{211} -\DeclareTextSymbol{\ic}{\GRencoding@name}{216} -\DeclareTextSymbol{\irc}{\GRencoding@name}{217} -\DeclareTextComposite{\Cr}{\GRencoding@name}{i}{217} -\DeclareTextSymbol{\isc}{\GRencoding@name}{218} -\DeclareTextComposite{\Cs}{\GRencoding@name}{i}{218} -\DeclareTextSymbol{\id}{\GRencoding@name}{240} -\DeclareTextSymbol{\idg}{\GRencoding@name}{241} -\DeclareTextComposite{\Gd}{\GRencoding@name}{i}{241} -\DeclareTextSymbol{\ida}{\GRencoding@name}{242} -\DeclareTextComposite{\Ad}{\GRencoding@name}{i}{242} -\DeclareTextSymbol{\idc}{\GRencoding@name}{243} -\DeclareTextComposite{\Cd}{\GRencoding@name}{i}{243} -\DeclareTextSymbol{\ug}{\GRencoding@name}{204} -\DeclareTextSymbol{\ur}{\GRencoding@name}{205} -\DeclareTextComposite{\r}{\GRencoding@name}{u}{205} -\DeclareTextSymbol{\us}{\GRencoding@name}{206} -\DeclareTextComposite{\s}{\GRencoding@name}{u}{206} -\DeclareTextSymbol{\urg}{\GRencoding@name}{207} -\DeclareTextComposite{\Gr}{\GRencoding@name}{u}{207} -\DeclareTextSymbol{\ua}{\GRencoding@name}{212} -\DeclareTextSymbol{\ura}{\GRencoding@name}{213} -\DeclareTextComposite{\Ar}{\GRencoding@name}{u}{213} -\DeclareTextSymbol{\usa}{\GRencoding@name}{214} -\DeclareTextComposite{\As}{\GRencoding@name}{u}{214} -\DeclareTextSymbol{\usg}{\GRencoding@name}{215} -\DeclareTextComposite{\Gs}{\GRencoding@name}{u}{215} -\DeclareTextSymbol{\uc}{\GRencoding@name}{220} -\DeclareTextSymbol{\urc}{\GRencoding@name}{221} -\DeclareTextComposite{\Cr}{\GRencoding@name}{u}{221} -\DeclareTextSymbol{\usc}{\GRencoding@name}{222} -\DeclareTextComposite{\Cs}{\GRencoding@name}{u}{222} -\DeclareTextSymbol{\ud}{\GRencoding@name}{244} -\DeclareTextSymbol{\udg}{\GRencoding@name}{245} -\DeclareTextComposite{\Gd}{\GRencoding@name}{u}{245} -\DeclareTextSymbol{\uda}{\GRencoding@name}{246} -\DeclareTextComposite{\Ad}{\GRencoding@name}{u}{246} -\DeclareTextSymbol{\udc}{\GRencoding@name}{247} -\DeclareTextComposite{\Cd}{\GRencoding@name}{u}{247} -\DeclareTextSymbol{\eg}{\GRencoding@name}{224} -\DeclareTextSymbol{\er}{\GRencoding@name}{225} -\DeclareTextComposite{\r}{\GRencoding@name}{e}{225} -\DeclareTextSymbol{\es}{\GRencoding@name}{226} -\DeclareTextComposite{\s}{\GRencoding@name}{e}{226} -\DeclareTextSymbol{\erg}{\GRencoding@name}{227} -\DeclareTextComposite{\Gr}{\GRencoding@name}{e}{227} -\DeclareTextSymbol{\ea}{\GRencoding@name}{232} -\DeclareTextSymbol{\era}{\GRencoding@name}{233} -\DeclareTextComposite{\Ar}{\GRencoding@name}{e}{233} -\DeclareTextSymbol{\esa}{\GRencoding@name}{234} -\DeclareTextComposite{\As}{\GRencoding@name}{e}{234} -\DeclareTextSymbol{\esg}{\GRencoding@name}{235} -\DeclareTextComposite{\Gs}{\GRencoding@name}{e}{235} -\DeclareTextSymbol{\oR}{\GRencoding@name}{229} -\DeclareTextComposite{\r}{\GRencoding@name}{o}{229} -\DeclareTextSymbol{\oG}{\GRencoding@name}{228} -\DeclareTextSymbol{\os}{\GRencoding@name}{230} -\DeclareTextComposite{\s}{\GRencoding@name}{o}{230} -\DeclareTextSymbol{\org}{\GRencoding@name}{231} -\DeclareTextComposite{\Gr}{\GRencoding@name}{o}{231} -\DeclareTextSymbol{\oa}{\GRencoding@name}{236} -\DeclareTextSymbol{\ora}{\GRencoding@name}{237} -\DeclareTextComposite{\Ar}{\GRencoding@name}{o}{237} -\DeclareTextSymbol{\osa}{\GRencoding@name}{238} -\DeclareTextComposite{\As}{\GRencoding@name}{o}{238} -\DeclareTextSymbol{\osg}{\GRencoding@name}{239} -\DeclareTextComposite{\Gs}{\GRencoding@name}{o}{239} -\DeclareTextSymbol{\rr}{\GRencoding@name}{251} -\DeclareTextComposite{\r}{\GRencoding@name}{r}{251} -\DeclareTextSymbol{\rs}{\GRencoding@name}{252} -\DeclareTextComposite{\s}{\GRencoding@name}{r}{252} -\DeclareTextSymbol{\Id}{\GRencoding@name}{219} -\DeclareTextSymbol{\Ud}{\GRencoding@name}{223} -\DeclareTextComposite{\"}{\GRencoding@name}{U}{223} +\DeclareTextSymbol{\ag}{\GRenc@name}{128} +\DeclareTextSymbol{\ar}{\GRenc@name}{129} +\DeclareTextComposite{\r}{\GRenc@name}{a}{129} +\DeclareTextSymbol{\as}{\GRenc@name}{130} +\DeclareTextComposite{\s}{\GRenc@name}{a}{130} +\DeclareTextSymbol{\aa}{\GRenc@name}{136} +\DeclareTextSymbol{\ac}{\GRenc@name}{144} +\DeclareTextSymbol{\ai}{\GRenc@name}{248} +\DeclareTextSymbol{\aai}{\GRenc@name}{140} +\DeclareTextSymbol{\aci}{\GRenc@name}{148} +\DeclareTextSymbol{\agi}{\GRenc@name}{132} +\DeclareTextSymbol{\ara}{\GRenc@name}{137} +\DeclareTextComposite{\Ar}{\GRenc@name}{a}{137} +\DeclareTextSymbol{\arc}{\GRenc@name}{145} +\DeclareTextComposite{\Cr}{\GRenc@name}{a}{145} +\DeclareTextSymbol{\arg}{\GRenc@name}{131} +\DeclareTextComposite{\Gr}{\GRenc@name}{a}{131} +\DeclareTextSymbol{\ari}{\GRenc@name}{133} +\DeclareTextSymbol{\asa}{\GRenc@name}{138} +\DeclareTextComposite{\As}{\GRenc@name}{a}{138} +\DeclareTextSymbol{\asc}{\GRenc@name}{146} +\DeclareTextComposite{\Cs}{\GRenc@name}{a}{146} +\DeclareTextSymbol{\asg}{\GRenc@name}{139} +\DeclareTextComposite{\Gs}{\GRenc@name}{a}{139} +\DeclareTextSymbol{\asi}{\GRenc@name}{134} +\DeclareTextSymbol{\argi}{\GRenc@name}{135} +\DeclareTextSymbol{\arai}{\GRenc@name}{141} +\DeclareTextSymbol{\arci}{\GRenc@name}{149} +\DeclareTextSymbol{\asai}{\GRenc@name}{142} +\DeclareTextSymbol{\asgi}{\GRenc@name}{143} +\DeclareTextSymbol{\asci}{\GRenc@name}{150} +\DeclareTextSymbol{\hg}{\GRenc@name}{152} +\DeclareTextSymbol{\hr}{\GRenc@name}{153} +\DeclareTextComposite{\r}{\GRenc@name}{h}{153} +\DeclareTextSymbol{\hs}{\GRenc@name}{154} +\DeclareTextComposite{\s}{\GRenc@name}{h}{154} +\DeclareTextSymbol{\hrg}{\GRenc@name}{163} +\DeclareTextComposite{\Gr}{\GRenc@name}{h}{163} +\DeclareTextSymbol{\hgi}{\GRenc@name}{156} +\DeclareTextSymbol{\hri}{\GRenc@name}{157} +\DeclareTextSymbol{\hsi}{\GRenc@name}{158} +\DeclareTextSymbol{\hrgi}{\GRenc@name}{167} +\DeclareTextSymbol{\ha}{\GRenc@name}{160} +\DeclareTextSymbol{\hra}{\GRenc@name}{161} +\DeclareTextComposite{\Ar}{\GRenc@name}{h}{161} +\DeclareTextSymbol{\hsa}{\GRenc@name}{162} +\DeclareTextComposite{\As}{\GRenc@name}{h}{162} +\DeclareTextSymbol{\hsg}{\GRenc@name}{171} +\DeclareTextComposite{\Gs}{\GRenc@name}{h}{171} +\DeclareTextSymbol{\hai}{\GRenc@name}{164} +\DeclareTextSymbol{\hrai}{\GRenc@name}{165} +\DeclareTextSymbol{\hsai}{\GRenc@name}{166} +\DeclareTextSymbol{\hsgi}{\GRenc@name}{175} +\DeclareTextSymbol{\hc}{\GRenc@name}{168} +\DeclareTextSymbol{\hrc}{\GRenc@name}{169} +\DeclareTextComposite{\Cr}{\GRenc@name}{h}{169} +\DeclareTextSymbol{\hsc}{\GRenc@name}{170} +\DeclareTextComposite{\Cs}{\GRenc@name}{h}{170} +\DeclareTextSymbol{\hci}{\GRenc@name}{172} +\DeclareTextSymbol{\hrci}{\GRenc@name}{173} +\DeclareTextSymbol{\hsci}{\GRenc@name}{174} +\DeclareTextSymbol{\hi}{\GRenc@name}{249} +\DeclareTextSymbol{\wg}{\GRenc@name}{176} +\DeclareTextSymbol{\wr}{\GRenc@name}{177} +\DeclareTextComposite{\r}{\GRenc@name}{w}{177} +\DeclareTextSymbol{\ws}{\GRenc@name}{178} +\DeclareTextComposite{\s}{\GRenc@name}{w}{178} +\DeclareTextSymbol{\wrg}{\GRenc@name}{179} +\DeclareTextComposite{\Gr}{\GRenc@name}{w}{179} +\DeclareTextSymbol{\wgi}{\GRenc@name}{180} +\DeclareTextSymbol{\wri}{\GRenc@name}{181} +\DeclareTextSymbol{\wsi}{\GRenc@name}{182} +\DeclareTextSymbol{\wrgi}{\GRenc@name}{183} +\DeclareTextSymbol{\wa}{\GRenc@name}{184} +\DeclareTextSymbol{\wra}{\GRenc@name}{185} +\DeclareTextComposite{\Ar}{\GRenc@name}{w}{185} +\DeclareTextSymbol{\wsa}{\GRenc@name}{186} +\DeclareTextComposite{\As}{\GRenc@name}{w}{186} +\DeclareTextSymbol{\wsg}{\GRenc@name}{187} +\DeclareTextComposite{\Gs}{\GRenc@name}{w}{187} +\DeclareTextSymbol{\wai}{\GRenc@name}{188} +\DeclareTextSymbol{\wrai}{\GRenc@name}{189} +\DeclareTextSymbol{\wsai}{\GRenc@name}{190} +\DeclareTextSymbol{\wsgi}{\GRenc@name}{191} +\DeclareTextSymbol{\wc}{\GRenc@name}{192} +\DeclareTextSymbol{\wrc}{\GRenc@name}{193} +\DeclareTextComposite{\Cr}{\GRenc@name}{w}{193} +\DeclareTextSymbol{\wsc}{\GRenc@name}{194} +\DeclareTextComposite{\Cs}{\GRenc@name}{w}{194} +\DeclareTextSymbol{\wci}{\GRenc@name}{196} +\DeclareTextSymbol{\wrci}{\GRenc@name}{197} +\DeclareTextSymbol{\wsci}{\GRenc@name}{198} +\DeclareTextSymbol{\wi}{\GRenc@name}{250} +\DeclareTextSymbol{\ig}{\GRenc@name}{200} +\DeclareTextSymbol{\ir}{\GRenc@name}{201} +\DeclareTextComposite{\r}{\GRenc@name}{i}{201} +\DeclareTextSymbol{\is}{\GRenc@name}{202} +\DeclareTextComposite{\s}{\GRenc@name}{i}{202} +\DeclareTextSymbol{\irg}{\GRenc@name}{203} +\DeclareTextComposite{\Gr}{\GRenc@name}{i}{203} +\DeclareTextSymbol{\ia}{\GRenc@name}{208} +\DeclareTextSymbol{\ira}{\GRenc@name}{209} +\DeclareTextComposite{\Ar}{\GRenc@name}{i}{209} +\DeclareTextSymbol{\isa}{\GRenc@name}{210} +\DeclareTextComposite{\As}{\GRenc@name}{i}{210} +\DeclareTextSymbol{\isg}{\GRenc@name}{211} +\DeclareTextComposite{\Gs}{\GRenc@name}{i}{211} +\DeclareTextSymbol{\ic}{\GRenc@name}{216} +\DeclareTextSymbol{\irc}{\GRenc@name}{217} +\DeclareTextComposite{\Cr}{\GRenc@name}{i}{217} +\DeclareTextSymbol{\isc}{\GRenc@name}{218} +\DeclareTextComposite{\Cs}{\GRenc@name}{i}{218} +\DeclareTextSymbol{\id}{\GRenc@name}{240} +\DeclareTextSymbol{\idg}{\GRenc@name}{241} +\DeclareTextComposite{\Gd}{\GRenc@name}{i}{241} +\DeclareTextSymbol{\ida}{\GRenc@name}{242} +\DeclareTextComposite{\Ad}{\GRenc@name}{i}{242} +\DeclareTextSymbol{\idc}{\GRenc@name}{243} +\DeclareTextComposite{\Cd}{\GRenc@name}{i}{243} +\DeclareTextSymbol{\ug}{\GRenc@name}{204} +\DeclareTextSymbol{\ur}{\GRenc@name}{205} +\DeclareTextComposite{\r}{\GRenc@name}{u}{205} +\DeclareTextSymbol{\us}{\GRenc@name}{206} +\DeclareTextComposite{\s}{\GRenc@name}{u}{206} +\DeclareTextSymbol{\urg}{\GRenc@name}{207} +\DeclareTextComposite{\Gr}{\GRenc@name}{u}{207} +\DeclareTextSymbol{\ua}{\GRenc@name}{212} +\DeclareTextSymbol{\ura}{\GRenc@name}{213} +\DeclareTextComposite{\Ar}{\GRenc@name}{u}{213} +\DeclareTextSymbol{\usa}{\GRenc@name}{214} +\DeclareTextComposite{\As}{\GRenc@name}{u}{214} +\DeclareTextSymbol{\usg}{\GRenc@name}{215} +\DeclareTextComposite{\Gs}{\GRenc@name}{u}{215} +\DeclareTextSymbol{\uc}{\GRenc@name}{220} +\DeclareTextSymbol{\urc}{\GRenc@name}{221} +\DeclareTextComposite{\Cr}{\GRenc@name}{u}{221} +\DeclareTextSymbol{\usc}{\GRenc@name}{222} +\DeclareTextComposite{\Cs}{\GRenc@name}{u}{222} +\DeclareTextSymbol{\ud}{\GRenc@name}{244} +\DeclareTextSymbol{\udg}{\GRenc@name}{245} +\DeclareTextComposite{\Gd}{\GRenc@name}{u}{245} +\DeclareTextSymbol{\uda}{\GRenc@name}{246} +\DeclareTextComposite{\Ad}{\GRenc@name}{u}{246} +\DeclareTextSymbol{\udc}{\GRenc@name}{247} +\DeclareTextComposite{\Cd}{\GRenc@name}{u}{247} +\DeclareTextSymbol{\eg}{\GRenc@name}{224} +\DeclareTextSymbol{\er}{\GRenc@name}{225} +\DeclareTextComposite{\r}{\GRenc@name}{e}{225} +\DeclareTextSymbol{\es}{\GRenc@name}{226} +\DeclareTextComposite{\s}{\GRenc@name}{e}{226} +\DeclareTextSymbol{\erg}{\GRenc@name}{227} +\DeclareTextComposite{\Gr}{\GRenc@name}{e}{227} +\DeclareTextSymbol{\ea}{\GRenc@name}{232} +\DeclareTextSymbol{\era}{\GRenc@name}{233} +\DeclareTextComposite{\Ar}{\GRenc@name}{e}{233} +\DeclareTextSymbol{\esa}{\GRenc@name}{234} +\DeclareTextComposite{\As}{\GRenc@name}{e}{234} +\DeclareTextSymbol{\esg}{\GRenc@name}{235} +\DeclareTextComposite{\Gs}{\GRenc@name}{e}{235} +\DeclareTextSymbol{\oR}{\GRenc@name}{229} +\DeclareTextComposite{\r}{\GRenc@name}{o}{229} +\DeclareTextSymbol{\oG}{\GRenc@name}{228} +\DeclareTextSymbol{\os}{\GRenc@name}{230} +\DeclareTextComposite{\s}{\GRenc@name}{o}{230} +\DeclareTextSymbol{\org}{\GRenc@name}{231} +\DeclareTextComposite{\Gr}{\GRenc@name}{o}{231} +\DeclareTextSymbol{\oa}{\GRenc@name}{236} +\DeclareTextSymbol{\ora}{\GRenc@name}{237} +\DeclareTextComposite{\Ar}{\GRenc@name}{o}{237} +\DeclareTextSymbol{\osa}{\GRenc@name}{238} +\DeclareTextComposite{\As}{\GRenc@name}{o}{238} +\DeclareTextSymbol{\osg}{\GRenc@name}{239} +\DeclareTextComposite{\Gs}{\GRenc@name}{o}{239} +\DeclareTextSymbol{\rr}{\GRenc@name}{251} +\DeclareTextComposite{\r}{\GRenc@name}{r}{251} +\DeclareTextSymbol{\rs}{\GRenc@name}{252} +\DeclareTextComposite{\s}{\GRenc@name}{r}{252} +\DeclareTextSymbol{\Id}{\GRenc@name}{219} +\DeclareTextSymbol{\Ud}{\GRenc@name}{223} +\DeclareTextComposite{\"}{\GRenc@name}{U}{223} \fi -% % \end{macrocode} % % \subsection{Text philological symbols and macros} -% Next come some short macros for inserting special symbols that philologists -% use quite often in Greek. +% +% Next come some short macros for inserting special symbols that +% philologists use quite often in Greek. %\begin{macro}{\h} -% Macro |\h| is used to insert a Latin ``h'' while typesetting in Greek. +% Macro |\h| is used to insert a Latin “h” while typesetting in Greek. %\begin{macro}{\q} -% Macro |\q| is used to insert a Latin ``q'' while typesetting in Greek. +% Macro |\q| is used to insert a Latin “q” while typesetting in Greek. %\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 +% 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 % dimension. % \begin{macrocode} -\DeclareTextCommand{\h}{\GRencoding@name}% +\DeclareTextCommand{\h}{\GRenc@name}% {{\fontencoding{OT1}\selectfont h}} -\DeclareTextCommand{\q}{\GRencoding@name}% +\DeclareTextCommand{\q}{\GRenc@name}% {{\fontencoding{OT1}\selectfont q}} -\DeclareTextCommand{\yod}{\GRencoding@name}% +\DeclareTextCommand{\yod}{\GRenc@name}% {{\fontencoding{OT1}\selectfont j}}% \let\iod\yod @@ -1903,11 +2019,12 @@ Type X <return> to exit.}% %\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 +% 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, +% 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 @@ -1945,19 +2062,20 @@ Type X <return> to exit.}% %\begin{macro}{\lpar} %\begin{macro}{\rpar} %\begin{macro}{\frapar} -% 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 +% 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|. % \begin{macrocode} -\DeclareRobustCommand\qmark{\hskip.16ex{\fontencoding{OT1}\upshape(?)}} +\DeclareRobustCommand\qmark{\hskip.16ex{\fontencoding{OT1}\normalshape(?)}} \DeclareRobustCommand\lpar{{\metricsfont(}} \DeclareRobustCommand\rpar{{\metricsfont)}} \DeclareRobustCommand\frapar[1]{\lpar#1\rpar} @@ -1969,9 +2087,9 @@ Type X <return> to exit.}% %\end{macro} % %\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|. +% 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|. % \begin{macrocode} \DeclareRobustCommand{\ap}[1]{\/\textsuperscript{#1}} @@ -1982,10 +2100,10 @@ Type X <return> to exit.}% %\begin{macro}{\DOTS} %\begin{macro}{\Dashes} %\begin{macro}{\DASHES} -% Four macros are defined so as to insert a certain number of dots or dashes as -% specified in the optional command argument; |\Dots| and |\Dashes| fit the dots or -% the dashes pretty close together, while |\DOTS| and |\DASHES| fit them more -% loosely apart. +% Four macros are defined so as to insert a certain number of dots or +% dashes as specified in the optional command argument; |\Dots| and +% |\Dashes| fit the dots or the dashes pretty close together, while +% |\DOTS| and |\DASHES| fit them more loosely apart. % \begin{macrocode} \newcommand\Dots[1][1]{{\count255=#1\@whilenum\count255>\z@ \do{\kern.4ex\d{v}\kern.4ex\advance\count255\m@ne}}} @@ -2006,11 +2124,12 @@ Type X <return> to exit.}% %\begin{macro}{\;} %\begin{macro}{\?} %\begin{macro}{\MutPers} -% Greek text or poetry sometimes requires some stacked dots; here we prepared macros -% for two (|\:|), three (|\;|), and four (|\?|) stacked dots. Two stacked dots in a -% row indicate that the speaker of a drama or comedy has changed (\textit{mutatio -% personae}). For |\:| and |\;| it is necessary to preserve the mathematical -% meaning, while |\?| apparently does not have any previous use in standard \LaTeX. +% Greek text or poetry sometimes requires some stacked dots; here we +% prepared macros for two (|\:|), three (|\;|), and four (|\?|) stacked +% dots. Two stacked dots in a row indicate that the speaker of a drama +% or comedy has changed (\textit{mutatio personae}). For |\:| and |\;| +% it is necessary to preserve the mathematical meaning, while |\?| +% apparently does not have any previous use in standard \LaTeX. % The real macros are |\tw@dots|, |\thre@dots|, % and |\f@urdots|. % \begin{macrocode} @@ -2036,9 +2155,9 @@ Type X <return> to exit.}% % \MakeShortVerb{\|} %\begin{macro}{\dBar} %\begin{macro}{\tBar} -% Similarly Greek text and poetry require certain \emph{cesurae} indicated with -% vertical bars; we provided commands for one (\verb"\|"), two (|\dBar|), and -% three (|\tBar|) vertical bars. +% Similarly Greek text and poetry require certain \emph{cesurae} +% indicated with vertical bars; we provided commands for one (\verb"\|"), +% two (|\dBar|), and three (|\tBar|) vertical bars. % \begin{macrocode} \DeclareRobustCommand{\|}{\relax\ensuremath{\mskip2mu\vert}} \DeclareRobustCommand{\dBar}{\ensuremath{\vert\vert}} @@ -2054,11 +2173,12 @@ Type X <return> to exit.}% %\begin{macro}{\posthindspace} %\begin{macro}{\,} %\begin{macro}{\!} -% The following are mostly service macros for adjusting the spacing within macro -% definitions. Nevertheless they are available also to the typesetter, because -% sometimes certain glyph combinations require a little adjustment. Of course the -% typesetter will not use them at the very beginning, but only during proof -% revision, so as to introduce them only where really necessary. +% The following are mostly service macros for adjusting the spacing +% within macro definitions. Nevertheless they are available also to the +% typesetter, because sometimes certain glyph combinations require a +% little adjustment. Of course the typesetter will not use them at the +% very beginning, but only during draft revision, so as to introduce +% them only where really necessary. % \begin{macrocode} \def\negthinspace{\nobreak\hskip-0.07em} \def\posthinspace{\nobreak\hskip0.07em} @@ -2089,24 +2209,40 @@ Type X <return> to exit.}% %\begin{macro}{\ldel} % Philologists require a certain number of special parentheses in order to % enclose parts of text that are doubtful or that have been added although -% they are missing from the original manuscripts; even letter strings that have -% been modified under the assumption that the copyist made some error. +% they are missing from the original manuscripts; even letter strings that +% have been modified under the assumption that the copyist made some +% error. % Such enclosing marks include angle brackets, square brackets, upper part % of square brackets, lower part of square brackets. Such symbols may even -% appear doubled. Most of these glyphs have been designed anew, because they -% are missing or are inadequate if they are taken from the usual CM fonts (either -% text or math fonts). Brackets for example have been designed as to be higher -% and deeper than the font total height, so as not to interfere with Greek -% accents and to accomodate for at least one level of nesting (for example square -% brackets enclosing lower part of square brackets. The single glyphs may be used -% directly by the typesetter, but we think that the commands requiring some text are -% far more useful. |\Ladd| and its double version |\LLadd| enclose text that should -% be added for sure. -% |\ladd| and its double version |\lladd| enclose text that probably should be -% added. |\lesp| and its synonymous |\ldel| enclose text that should be deleted. -% |\mqi| surrounds some text with the lower part of open and closed square brackets. -% |\mqs| surrounds some text with the upper part of open and closed square brackets. +% appear doubled. Most of these glyphs have been designed anew, because +% they are missing or are inadequate if they are taken from the usual CM +% fonts (either text or math fonts). Brackets for example have been +% designed as to be higher and deeper than the font total height, so as +% not to interfere with Greek accents and to accomodate for at least one +% level of nesting (for example square brackets enclosing lower part of +% square brackets. The single glyphs may be used directly by the +% typesetter, but we think that the commands requiring some text are +% far more useful. |\Ladd| and its double version |\LLadd| enclose text +% that should be added for sure. |\ladd| and its double version |\lladd| +% enclose text that probably should be added. |\lesp| and its synonymous +% |\ldel| enclose text that should be deleted. |\mqi| surrounds some text +% with the lower part of open and closed square brackets. |\mqs| surrounds +% some text with the upper part of open and closed square brackets. % See \texttt{teubenr-doc.pdf} for samples of such commands. +% Command |\LLadd| has been modified since |teubner| previous version +% because it contained a spurios space; in addition it has been +% rewritten with the |\NewDocumentCommand| in \LaTeX\,3 language, so as +% to accept two optional kerning values so as to get the double square +% brackets closer to the enclosed text; it syntax is now +%\begin{sintassi} +%\cs{LLadd}\oarg{left kerning}\marg{text}\oarg{right kerning} +%\end{sintassi} +% Both kerning values are positive in order to get the square brackets +% closer to the text; this facility is especially useful with slanted +% text. In any case such kernings should be set only while reviewing the +% document draft. We suggest to use units of measure depending on the +% font body (|ex| or |em|) so that if the body is changed the corrections +% keep working properly. % \begin{macrocode} \DeclareRobustCommand{\lbrk}{{\metricsfont\posthindspace[\negthinspace}} \DeclareRobustCommand{\rbrk}{{\metricsfont]}} @@ -2118,9 +2254,12 @@ Type X <return> to exit.}% {#1\/}\rmqi}\let\mezzeq\mqi \DeclareRobustCommand\mqs[1]{\lmqs{#1\/}\rmqs} \DeclareRobustCommand{\Ladd}[1]{{\metricsfont<}{\!\!#1\/}% - {\metricsfont>}}% litterae certe addendae -\DeclareRobustCommand{\LLadd}[1]{{\metricsfont<\kern-.3ex<} - {\!\!#1\/}{\metricsfont>\kern-.3ex>}}% litterae certe addendae + {\metricsfont>}}% litterae certe addendae +\providecommand\LLadd{} +\RenewDocumentCommand{\LLadd}{O{0pt}m O{0pt}}{% + {\metricsfont<\kern-0.3ex<}{\kern-#1\relax#2\kern-#3}% + {\metricsfont>\kern-0.3ex>}% +}% litterae certe addendae \DeclareRobustCommand{\ladd}[1]{{\metricsfont\kern.15ex[\negthinspace}% {#1\/}{\metricsfont]\kern-.15ex}}% litterae addendae \DeclareRobustCommand{\lladd}[1]{{\metricsfont\kern.15ex[\kern-.3ex[% @@ -2151,21 +2290,23 @@ Type X <return> to exit.}% %\begin{macro}{\itclosedquotes} %\begin{macro}{\itoq} %\begin{macro}{\itcq} -% The following macros allow to set Italian\slash English high quotes even while -% typing in Greek; such quotes are standard in Italian and in English typesetting -% and their commands preserve the font family shape and series of the surrounding -% font. In French typography, as well in the typographic traditions of other -% countries, different quotes are used. In that case the typesetter must resort to a -% change of language, for example returning to German, inputting the German quotes, -% then turning back to Greek. He might as well define his own macros, or he might -% clone the following definitions and change them according to his country -% typographic traditions. If he decides to modify these definitions he should either -% rename this file or he should put his redefinitions in a private package to be -% input \emph{after} \texttt{teubner.sty}. -% \begin{macrocode} -\DeclareTextCommand{\itopenquotes}{\GRencoding@name}% +% The following macros allow to set Italian\slash English high quotes +% even while typing in Greek; such quotes are standard in Italian and +% in English typesetting and their commands preserve the font family +% shape and series of the surrounding font. In French typography, as +% well in the typographic traditions of othe countries, different quotes +% are used. In that case the typesetter must resort to a change of +% language, for example returning to German, inputting the German quotes, +% then turning back to Greek. He might as well define his own macros, or +% he might clone the following definitions and change them according to +% his country typographic traditions. If he decides to modify these +% definitions he should either rename this file or he should put his +% redefinitions in a private package to be input \emph{after} +% \texttt{teubner.sty}. +% \begin{macrocode} +\DeclareTextCommand{\itopenquotes}{\GRenc@name}% {{\fontencoding{OT1}\selectfont\char92}}% -\DeclareTextCommand{\itclosedquotes}{\GRencoding@name}% +\DeclareTextCommand{\itclosedquotes}{\GRenc@name}% {{\fontencoding{OT1}\selectfont\char34}}% \let\itoq\itopenquotes \let\itcq\itclosedquotes @@ -2185,16 +2326,17 @@ Type X <return> to exit.}% %\begin{macro}{\ENodq} %\begin{macro}{\ENcdq} %\begin{macro}{\ENdqtext} -% On the opposite the following German and English quotes are redesigned and -% included in the metric symbols font. Since this font is in one shape and one -% series, these quotes do not change as the outside font does, but remain fixed; the -% most useful commands are |\GEdqtext| for enclosing some text within German double -% quotes, |\GEqtext| for enclosing some text within German single quotes, and -% |\ENdqtext| for enclosing some text in English double quotes. Apparently -% while setting Greek poetry in stacked, possibly enumerated, verses, German double -% or single quotes are often used, since they cannot be misunderstood with Greek -% diacritical marks. Modern Greek double quotes apparently are not appreciated by -% philologists, at least outside Greece. +% On the opposite the following German and English quotes are redesigned +% and included in the metric symbols font. Since this font is in one +% shape and one series, these quotes do not change as the outside font +% does, but remain fixed; the most useful commands are |\GEdqtext| for +% enclosing some text within German double quotes, |\GEqtext| for +% enclosing some text within German single quotes, and |\ENdqtext| for +% enclosing some text in English double quotes. Apparently while setting +% Greek poetry in stacked, possibly enumerated, verses, German double +% or single quotes are often used, since they cannot be misunderstood +% with Greek diacritical marks. Modern Greek double quotes apparently +% are not appreciated by philologists, at least outside Greece. % \begin{macrocode} \newcommand\GEodq{\bgroup\futurelet\@tempA\GE@dq} \def\GE@dq{{\metricsfont\char18}\ifx\@tempA m\posthinspace\fi\egroup} @@ -2220,6 +2362,7 @@ Type X <return> to exit.}% %\end{macro} % % \subsection{Other philological symbols and macros} +% % \begin{macro}{\LitNil} % \begin{macro}{\litnil} % The next synonymous macros indicate the \emph{littera nihil}. @@ -2233,25 +2376,26 @@ Type X <return> to exit.}% %\begin{macro}{\sva} %\begin{macro}{\shva} %\begin{macro}{\shwa} -% The CB fonts include also the letter ``shwa'', the glyph that -% appears as a roman ``e'' rotated 180$^\circ$ around its center. Philologists -% need it even when writing Greek. In order to make it available also when the -% Latin encodings are in force, suitable definitions have been given so that the -% suitable CB font was changed behind the scenes without any intervention by the -% typesetter. With this version of |teubner.sty| a new definition is made up that -% uses the |\rotatebox| facility of the |graphicx| package; In a future revision of -% the CB fonts the |\schwa| slot shall be freed so that Greek glyphs only populate -% it, without extraneous presences. The |\schwa| glyph is made available also with -% the Latin encodings. -% \begin{macrocode} -%\DeclareTextSymbol{\sva}{\GRencoding@name}{26} -\DeclareTextCommand{\sva}{\GRencoding@name}{% +% The CB fonts include also the letter “shwa”, the glyph that +% appears as a roman “e” rotated 180$^\circ$ around its center. +% Philologists need it even when writing Greek. In order to make it +% available also when the Latin encodings are in force, suitable +% definitions have been given so that the suitable CB font was changed +% behind the scenes without any intervention by the typesetter. With +% this version of |teubner.sty| a new definition is made up that +% uses the |\rotatebox| facility of the |graphicx| package; In a future +% revision of the CB fonts the |\schwa| slot shall be freed so that Greek +% glyphs only populate it, without extraneous presences. The |\schwa| +% glyph is made available also with the Latin encodings. +% \begin{macrocode} +%\DeclareTextSymbol{\sva}{\GRenc@name}{26} +\DeclareTextCommand{\sva}{\GRenc@name}{% \rotatebox[origin=c]{180}{\def\@tempA{li}% \fontencoding{OT1}\ifx\f@shape\@tempA\fontshape{it}\fi\selectfont e}} \DeclareTextCommand\sva{OT1}{{\expandafter\fontencoding - \expandafter{\GRencoding@name}\selectfont\sva}} + \expandafter{\GRenc@name}\selectfont\sva}} \DeclareTextCommand\sva{T1}{{\expandafter\fontencoding - \expandafter{\GRencoding@name}\selectfont\sva}} + \expandafter{\GRenc@name}\selectfont\sva}} \let\shva\sva\let\shwa\sva % \end{macrocode} @@ -2260,13 +2404,15 @@ Type X <return> to exit.}% %\end{macro} % %\begin{macro}{\skewstack} -% The |\skewstack| command stacks two arguments not one on top of the other, but the -% second argument is placed to the right and upwards relative to the first argument. -% The second argument is set in script font size. Although there are similarities -% with the |\textsuperscript| command, the exact placement of the second argument -% depends on the shape (height and depth) of both arguments. This command will be -% used for creating some philologist's symbols, but is readily available to the -% typesetter both for direct use and for writing macros defining new symbols. +% The |\skewstack| command stacks two arguments not one on top of the +% other, but the second argument is placed to the right and upwards +% relative to the first argument. +% The second argument is set in script font size. Although there are +% similarities with the |\textsuperscript| command, the exact placement +% of the second argument depends on the shape (height and depth) of both +% arguments. This command will be used for creating some philologist's +% symbols, but is readily available to the typesetter both for direct +% use and for writing macros defining new symbols. % \begin{macrocode} \DeclareRobustCommand\skewstack[2]{{% \edef\slant@{\strip@pt\fontdimen1\font}% @@ -2285,9 +2431,10 @@ Type X <return> to exit.}% %\begin{macro}{\gusv} %\begin{macro}{\qusv} %\begin{macro}{\qu} -% Matter of fact some common Latin stacked symbols are defined here in terms of -% |\skewstack|. As it may bee seen, the second argument (the first as well, but here -% there are no examples) may in turn contain other macros for composite symbols. +% Matter of fact some common Latin stacked symbols are defined here in +% terms of |\skewstack|. As it may bee seen, the second argument (the +% first as well, but here there are no examples) may in turn contain other +% macros for composite symbols. % \begin{macrocode} \DeclareRobustCommand\hv{{\fontencoding{OT1}\selectfont \skewstack{h}{v}}} @@ -2311,20 +2458,21 @@ Type X <return> to exit.}% %\end{macro} % %\begin{macro}{\dz} -% Without using |\skewstack| other symbols may be defined; here |\dz| is just an -% example, where the kerning between `d' and `z' has been found by cut and try. With -% other glyphs may be different kerning is necessary. +% Without using |\skewstack| other symbols may be defined; here |\dz| +% is just an example, where the kerning between `d' and `z' has been +% found by cut and try. With other glyphs may be different kerning is +% necessary. % \begin{macrocode} \DeclareRobustCommand\dz{{\fontencoding{OT1}\selectfont d\kern-.33ex z}} % \end{macrocode} %\end{macro} % -% Now we come to another set of commands like the ones needed to mark the syneresis -% or the zeugma and other similar marks. +% Now we come to another set of commands like those needed to mark the +% syneresis or the zeugma and other similar marks. %\begin{macro}{\Utie} -% This first macro sets a ``smile'' symbol under a couple of letters. The glyph is -% fine but is good only for two adjacent letters, therefore +% This first macro sets a “smile” symbol under a couple of letters. +% The glyph is fine but is good only for two adjacent letters, therefore % it is necessary to have a stretchable symbol. % \begin{macrocode} \DeclareRobustCommand\Utie[1]{% @@ -2338,10 +2486,11 @@ Type X <return> to exit.}% % %\begin{macro}{\siner} %\begin{macro}{\siniz} -% This is why the |\siner| and |\siniz| synonymous commands have been defined; in -% place of or in addition to the ``smile'' symbol; they contain a stretchable -% filler |\upfill| that behaves almost as the stretchable horizontal brace that is -% used in the definition of the \LaTeX\ commands |\underbrace| or |\overbrace|. +% This is why the |\siner| and |\siniz| synonymous commands have been +% defined; in place of or in addition to the “smile” symbol; they contain +% a stretchable filler |\upfill| that behaves almost as the stretchable +% horizontal brace that is used in the definition of the \LaTeX\ commands +% |\underbrace| or |\overbrace|. % \begin{macrocode} \DeclareRobustCommand{\siner}[1]{% \mbox{\vtop{\ialign{##\crcr @@ -2355,8 +2504,8 @@ Type X <return> to exit.}% %\end{macro} % %\begin{macro}{\upfill} -% The |\upfill| is defined as a leader, the same way as the corresponding \LaTeX\ -% stretchable horizontal brace. +% The |\upfill| is defined as a leader, the same way as the +% corresponding \LaTeX\ stretchable horizontal brace. % \begin{macrocode} \def\upfill{$\m@th \scriptstyle\setbox\z@\hbox{$\scriptstyle\bracelu$}% \kern.16ex\bracelu\ifPDF\kern-.15ex\fi @@ -2367,8 +2516,9 @@ Type X <return> to exit.}% %\end{macro} % %\begin{macro}{\downfill} -% The |\downfill| arc is totally similar to the |\upfill| one, except for its -% terminating elements that change the shape of the arc from ``up'' to ``down''. +% The |\downfill| arc is totally similar to the |\upfill| one, except +% for its terminating elements that change the shape of the arc from +% “up” to “down”. % \begin{macrocode} \def\downfill{$\m@th\scriptstyle\setbox\z@\hbox{$\scriptstyle\braceld$}% \kern.16ex\braceld\ifPDF\kern-.15ex\fi @@ -2379,8 +2529,9 @@ Type X <return> to exit.}% %\end{macro} % %\begin{macro}{\zeugma} -% Similarly |\zeugma| puts a stretchable arc over its argument; it must take into -% account the slant of the argument font so as to skew the placement of the arc. +% Similarly |\zeugma| puts a stretchable arc over its argument; it must +% take into account the slant of the argument font so as to skew the +% placement of the arc. % \begin{macrocode} \newcommand*\zeugma[1]{{\vbox{\setbox\z@\hbox{#1}\dimen@=\ht\z@ \edef\@slant{\strip@pt\fontdimen1\font}% @@ -2400,14 +2551,16 @@ Type X <return> to exit.}% % %\begin{macro}{\slzeugma} %\begin{macro}{\rszeugma} -% Although the shape of oblique zeugma arcs cannot be changed depending on the width -% and height of the zeugma argument, in certain circumstances the philologists want -% to use oblique zeugma marks. This is why we defined a ``sloping zeugma arc'' -% |\slzeugma|, and a ``rising zeugma arc'' |\rszeugma| that can be used with poor -% results, if such arcs are superimposed over the ``wrong'' letters. There is -% nothing automatic in the choice of the oblique arc and is totally on the -% typesetter responsibility to use the correct command. These slanted zeugma signs -% are possibly useful only for two letters since they are not stretchable. +% Although the shape of oblique zeugma arcs cannot be changed depending +% on the width and height of the zeugma argument, in certain +% circumstances the philologists want to use oblique zeugma marks. This +% is why we defined a “sloping zeugma arc” |\slzeugma|, and a “rising +% zeugma arc” |\rszeugma| that can be used with poor results, if such +% arcs are superimposed over the “wrong” letters. There is nothing +% automatic in the choice of the oblique arc and is totally on the +% typesetter responsibility to use the correct command. These slanted +% zeugma signs are possibly useful only for two letters since they are +% not stretchable. % \begin{macrocode} \newcommand*\slzeugma[1]{{\leavevmode \setbox\tw@\hbox{\metricsfont\char120}% @@ -2433,7 +2586,15 @@ Type X <return> to exit.}% % %\begin{macro}{\nexus} %\begin{macro}{\nesso} -% Originally I had two different macros for marking a \emph{nexus}; one made use of a ``up stretchable turtle bracket'', and the user used a leader of Latin circumflex signs. Both were unsatisfactory; the latter was really ugly, but I kept the macro name as a synonym for compatibility with the past. The good looking marker is obtained from a mathematical |\widehat| sign by stretching it to the width of the string the marcher should mark; the new macro |\nexus| (that replaces the stretchable turtle bracket) relies on the facilities offered by the |\resizebox| of the package |graphicx|. +% Originally I had two different macros for marking a \emph{nexus}; +% one made use of a “up stretchable turtle bracket”, and the user used +% a leader of Latin circumflex signs. Both were unsatisfactory; the +% latter was really ugly, but I kept the macro name as a synonym for +% compatibility with the past. The good looking marker is obtained +% from a mathematical |\widehat| sign by stretching it to the width +% of the string the marcher should mark; the new macro |\nexus| (that +% replaces the stretchable turtle bracket) relies on the facilities +% offered by the |\resizebox| of the package |graphicx|. % \begin{macrocode} \newcommand*{\nexus}[1]{{\setbox\tw@\hbox{#1\/}% \edef\slant@{\strip@pt\fontdimen1\font}% @@ -2456,16 +2617,17 @@ Type X <return> to exit.}% %\begin {macro}{\Coronis} %\begin {macro}{\paragr} % \begin {macro}{\dpar} -% While setting poetry it is necessary to mark the end of paragraphs, which do not -% necessarily coincide with the ends of stanzas. After the verse that concludes a -% logical paragraph philologists insert a mark called ``coronis'' (synonymous of -% paragraph, therefore the command |\paragr|) or a ``stronger'' mark called -% ``Coronis'', which differs from the common ``coronis'' because it bears an -% inverted semilunar sign on its left. Both marks are input by means of their -% respective commands |\paragr| (preferred to |\coronis|) or |\Coronis| inserted +% While setting poetry it is necessary to mark the end of paragraphs, +% which do not necessarily coincide with the ends of stanzas. After the +% verse that concludes a logical paragraph philologists insert a mark +% called “coronis” (synonymous of paragraph, therefore the command +% |\paragr|) or a “stronger” mark called “Coronis”, which differs from +% the common “coronis” because it bears an inverted semilunar sign on +% its left. Both marks are input by means of their respective commands +% |\paragr| (preferred to |\coronis|) or |\Coronis| inserted % \emph{at the beginning of the paragraph terminating verse}. -% The command |\dparagr| inserts a double coronis mark, which is sometimes required -% in place of the ordinary single mark. +% The command |\dparagr| inserts a double coronis mark, which is +% sometimes required in place of the ordinary single mark. % \begin{macrocode} \def\C@rule{\vrule\@height.45ex\@depth-.35ex\@width1.5em} \def\coronis@rule{\hbox to\z@{\hss\C@rule\hss}} @@ -2494,18 +2656,19 @@ Type X <return> to exit.}% %\begin {macro}{\dstar} %\begin {macro}{\tstar} %\begin {macro}{\responsio} -% The next group of commands are intended to insert special symbols in the -% philological text; just the command |\apici| requires an argument, a block of text -% that shall be enclosed within straight vertical apices, irrespective of the font -% slant. The command |\FinisCarmen| although very descriptive, is long to type, -% therefore a shorter alias |\FinCar| has been defined. |\apex| was the initial name -% given to the command, but on a second time it was changed to |\positio|, and the -% latter should always be used in place of the former. For what concerns |\star| -% which is a standard \LaTeX\ math command, the original definition is saved in the -% service macro |\m@thst@r| and the command is redefined so as to perform as it -% should both in text and in math mode. The symbol $\int$, on the contrary, was -% redefined so as not to mix math with text, even if its rendering resorts to -% mathematics. +% The next group of commands are intended to insert special symbols in +% the philological text; just the command |\apici| requires an argument, +% a block of text that shall be enclosed within straight vertical apices, +% irrespective of the font slant. The command |\FinisCarmen| although +% very descriptive, is long to type, therefore a shorter alias +% |\FinCar| has been defined. |\apex| was the initial name given to the +% command, but on a second time it was changed to |\positio|, and the +% latter should always be used in place of the former. For what concerns +% |\star| which is a standard \LaTeX\ math command, the original +% definition is saved in the service macro |\m@thst@r| and the command +% is redefined so as to perform as it should both in text and in math +% mode. The symbol $\int$, on the contrary, was redefined so as not to +% mix math with text, even if its rendering resorts to mathematics. % \begin{macrocode} \DeclareRobustCommand*\sinafia{{\metricsfont s}} \DeclareRobustCommand*{\crux}{{\metricsfont\char'171}} @@ -2519,9 +2682,9 @@ Type X <return> to exit.}% \let\positio\apex \DeclareRobustCommand*{\Int}{\ensuremath{\int}} \let\m@thst@r\star -\DeclareRobustCommand*{\star}{\textormath{{{\upshape *}}}{\m@thst@r}} -\DeclareRobustCommand*{\dstar}{{\upshape **}} -\DeclareRobustCommand*{\tstar}{{\upshape ***}} +\DeclareRobustCommand*{\star}{\textormath{{{\normalshape *}}}{\m@thst@r}} +\DeclareRobustCommand*{\dstar}{{\normalshape **}} +\DeclareRobustCommand*{\tstar}{{\normalshape ***}} \DeclareRobustCommand*{\responsio}{{\boldmath\ensuremath{\sim}}} % \end{macrocode} @@ -2537,9 +2700,9 @@ Type X <return> to exit.}% %\end{macro} % %\begin{macro}{\thorn} -%\begin{macro}{\Thorn} |\thorn| and |\Thorn| are the exact equivalents of |\th| -% and |\Th| that are defined only for the T1 encoding. Therefore such encoding is -% selected in an implicit way. +%\begin{macro}{\Thorn} |\thorn| and |\Thorn| are the exact equivalents +% of |\th| and |\Th| that are defined only for the T1 encoding. Therefore +% such encoding is selected in an implicit way. % \begin{macrocode} \DeclareRobustCommand{\thorn}{{\fontencoding{T1}\selectfont\th}} \DeclareRobustCommand{\Thorn}{{\fontencoding{T1}\selectfont\TH}} @@ -2555,10 +2718,10 @@ Type X <return> to exit.}% %\begin {macro}{\stater} %\begin {macro}{\denarius} %\begin {macro}{\etos} -% This set of symbols, taken from the metrics symbol font (which by this time is -% evident does not contain only metrics symbols) represents the unit symbols of some -% coins of ancient Greece, as they were found on many ``ostraka'' in several -% archeological sites. +% This set of symbols, taken from the metrics symbol font (which by this +% time is evident does not contain only metrics symbols) represents the +% unit symbols of some coins of ancient Greece, as they were found on +% many “ostraka” in several archeological sites. % \begin{macrocode} \DeclareRobustCommand{\dracma}{{\metricsfont D}} \DeclareRobustCommand{\hemiobelion}{{\metricsfont A}} @@ -2580,18 +2743,19 @@ Type X <return> to exit.}% %\begin{macro}{\dcutbar} %\begin{macro}{\bcutbar} %\begin{macro}{\gcutbar} -% The following set of macros are all connected with the principal macro |\cut|, -% which should position a horizontal tie or bar across a certain number of latin -% letters, specifically `d', `b', and `g'; due to their different shapes, such bars -% are of different length and located at different heights; if they are in italics -% the bar position must change again. Therefore even if the user command |\cut| is -% the same for all these letters, its action must change depending on different -% circumstances. -% It merely checks its argument (it must be \emph{one} letter and unpredictable -% results are obtained if more that one token is passed as an argument to |\cut|) -% and selects the proper bar. The specific bar commands |\dcutbar|, |\bcutbar|, and -% |\gcutbar|, are defined in such a way as to cope only with the their initial -% letter. +% The following set of macros are all connected with the principal +% macro |\cut|, which should position a horizontal tie or bar across +% a certain number of latin letters, specifically `d', `b', and `g'; +% due to their different shapes, such bars are of different length and +% located at different heights; if they are in italics the bar position +% must change again. Therefore even if the user command |\cut| is +% the same for all these letters, its action must change depending on +% different circumstances. +% It merely checks its argument (it must be \emph{one} letter and +% unpredictable results are obtained if more that one token is passed +% as an argument to |\cut|) and selects the proper bar. The specific +% bar commands |\dcutbar|, |\bcutbar|, and |\gcutbar|, are defined in +% such a way as to cope only with the their initial letter. % \begin{macrocode} \DeclareRobustCommand{\cut}[1]{% \ifx#1d\dcutbar\else @@ -2636,9 +2800,10 @@ Type X <return> to exit.}% %\begin{macro}{\splus} %\begin{macro}{\stimes} %\begin{macro}{\kclick} -% The next three macros are used in glottology; the first two ones are used to -% mark special pronunciations of the sibilant, while the last one is used to mark -% a special pronunciation of the guttural that produces a ``click''. +% The next three macros are used in glottology; the first two ones are +% used to mark special pronunciations of the sibilant, while the last +% one is used to mark a special pronunciation of the guttural that +% produces a “click”. %\begin{macrocode} \newcommand\splus{\leavevmode{% \edef\slant@{\strip@pt\fontdimen1\font}% @@ -2663,7 +2828,7 @@ Type X <return> to exit.}% \newcommand\kclick{\leavevmode{% \edef\slant@{\strip@pt\fontdimen1\font}% \setbox\z@\hbox{k}% - \setbox\tw@\hbox{\fontencoding\GRencoding@name\selectfont\s{v}}% + \setbox\tw@\hbox{\fontencoding\GRenc@name\selectfont\s{v}}% \dimen@\wd\z@ \ifdim\slant@\p@=\z@ \advance\dimen@-.1\wd\z@\else\advance\dimen@\wd\tw@ @@ -2679,26 +2844,27 @@ Type X <return> to exit.}% % \subsection{Poetry environments and macros} %\begin {macro}{\verso} %\begin{environment}{versi} -% Here we start with verse environments; we already explained that we defined three -% new verse environments that typeset poetry in ``in-line'' verses, -% ``numbered by five'' verses, and ``numbered by five and subnumbered'' verses. -% For the environment |versi| we first need a counter and a little macro for -% generating the short bar that has to receive the verse number as a ``limits'' -% superscript. +% Here we start with verse environments; we already explained that we +% defined three new verse environments that typeset poetry in “in-line” +% verses, “numbered by five” verses, and “numbered by five and +% subnumbered” verses. For the environment |versi| we first need a +% counter and a little macro for generating the short bar that has to +% receive the verse number as a “limits” superscript. % \begin{macrocode} \newcounter{verso}\setcounter{verso}{0} \newcommand{\smallvert}{\vrule\@height.6ex\@depth.4ex} % \end{macrocode} -% Next we define the macro |\verso| that sets the small bar with the verse number on -% top. Since the initial numbering might be different from~1, |\verso| accepts an -% optional argument, which is intended to be the initial counter value. Since -% |\verso| steps up the counter a different action must be taken if the optional -% argument is present; in order to be able to reference such verse by means of the -% |\label|--|\ref| cross reference mechanism, this stepping up must be done by means -% of |\refstepcounter|; therefore we have to leave |\refstepcounter| outside the -% conditional code, and step down the counter by one unit only in case the initial -% value is specified. +% Next we define the macro |\verso| that sets the small bar with the +% verse number on top. Since the initial numbering might be different +% from~1, |\verso| accepts an optional argument, which is intended to +% be the initial counter value. Since |\verso| steps up the counter a +% different action must be taken if the optional argument is present; +% in order to be able to reference such verse by means of the +% |\label|--|\ref| cross reference mechanism, this stepping up must +% be done by means of |\refstepcounter|; therefore we have to leave +% |\refstepcounter| outside the conditional code, and step down the +% counter by one unit only in case the initial value is specified. % \begin{macrocode} \DeclareRobustCommand\verso[1][]{% \def\@tempA{#1}\ifx\@tempA\empty @@ -2711,13 +2877,14 @@ Type X <return> to exit.}% \space\ignorespaces} % \end{macrocode} -% Now that the verse separation macro is ready we can define the environment; the -% required opening statement argument represents a short text whose width is taken -% as a measure for indentation, so that verses are typeset with a left margin that -% leaves out this short text. Substantially this environment is a \texttt{list} one, -% and the left margin variable width is totally similar to the one used in -% |thebibiography| environment. Also the |\makelabel| command has been modified -% accordingly. +% Now that the verse separation macro is ready we can define the +% environment; the required opening statement argument represents a +% short text whose width is taken as a measure for indentation, so that +% verses are typeset with a left margin that leaves out this short text. +% Substantially this environment is a \texttt{list} one, and the left +% margin variable width is totally similar to the one used in +% |thebibiography| environment. Also the |\makelabel| command has been +% modified accordingly. % \begin{macrocode} \newenvironment{versi}[1]{% \def\makelabel##1{##1} @@ -2734,22 +2901,24 @@ Type X <return> to exit.}% %\end{macro} % %\begin{environment}{Versi} -% The second environment |Versi| accepts an optional starting number in the opening, -% statement, whose default value is~1: verses are composed as in the standard -% \LaTeX\ |verse| environment (with one minor difference) except they are numbered -% in the left margin with a progression of five; only verse numbers that are integer -% multiples of five are displayed. The minor difference is that stanzas cannot be -% marked with a blank line in the input |.tex| file, as it is customary with -% the standard environment, but if a visual mark is desired, such as extra vertical -% space, it is necessary to resort to the optional spacing parameter that can be -% specified to the |\\| command. This environment uses the same verse counting -% counter, defined for use with the |versi| environment. +% The second environment |Versi| accepts an optional starting number in +% the opening, statement, whose default value is~1: verses are composed +% as in the standard \LaTeX\ |verse| environment (with one minor +% difference) except they are numbered in the left margin with a +% progression of five; only verse numbers that are integer multiples +% of five are displayed. The minor difference is that stanzas cannot be +% marked with a blank line in the input |.tex| file, as it is customary +% with the standard environment, but if a visual mark is desired, such +% as extra vertical space, it is necessary to resort to the optional +% spacing parameter that can be specified to the |\\| command. This +% environment uses the same verse counting counter, defined for use +% with the |versi| environment. % %\begin{macro}{\BreakVersotrue} %\begin{macro}{\BreakVersofalse} -% For specific purposes it is necessary to have a boolean variable for allowing or -% prohibiting verses to split up at the end of line; the default is not -% to split. +% For specific purposes it is necessary to have a boolean variable for +% allowing or prohibiting verses to split up at the end of line; the +% default is not to split. % \begin{macrocode} \newif\ifBreakVersi \BreakVersifalse @@ -2758,10 +2927,11 @@ Type X <return> to exit.}% % \end{macrocode} %\end{macro} %\end{macro} -% An internal macro |\writ@verso| does not actually write out the complete, possibly -% numbered verse, but provides for checking that the verse counter contains a -% multiple of~5, and to write it out using old stile numbers; in case the number is -% not an integer multiple of~5 the number is written out as the |\empty| macro. +% An internal macro |\writ@verso| does not actually write out the +% complete, possibly numbered verse, but provides for checking that +% the verse counter contains a multiple of~5, and to write it out using +% old stile numbers; in case the number is not an integer multiple of~5 +% the number is written out as the |\empty| macro. % \begin{macrocode} \def\writ@verso{% \count255=\value{verso}\divide\count255by5\relax @@ -2774,11 +2944,12 @@ Type X <return> to exit.}% \empty \fi}% % \end{macrocode} -% Since the |\\| command should provide the same functionality as the regular -% \LaTeX\ command, while in this environment it should provide other -% functionalities, such as triggering the display of the verse number. It is -% necessary to define an intermediate command |\v@rscr|, that examines the possible -% optional arguments, such as the optional star or the brackets enclosing vertical +% Since the |\\| command should provide the same functionality as the +% regular \LaTeX\ command, while in this environment it should provide +% other functionalities, such as triggering the display of the verse +% number. It is necessary to define an intermediate command |\v@rscr|, +% that examines the possible optional arguments, such as the optional +% star or the brackets enclosing vertical % spacing % \begin{macrocode} \def\acapo{\@ifstar{\v@rscr{\@M}}{\v@rscr{\z@}}}% @@ -2786,30 +2957,34 @@ Type X <return> to exit.}% \def\v@rscr##1{\@ifnextchar[{\wr@teverse{##1}}% {\wr@teverse{##1}[\z@]}}% % \end{macrocode} -% Finally the |\wr@teverse| macro does the actual typesetting of the verse. Notice -% that the environment opening statement and every succeeding previous verse starts -% an horizontal box where the contents of the current verse is stored. Therefore the -% first thing to do is to close the box with the |\egroup| command, then a line of -% text is output that contains a possibly empty box or the verse number and the -% command for stepping up the verse counter, followed by the verse box number~0 and -% an end of paragraph; in this way the |\\| operates always in vertical mode, -% contrary to what happens in the |verse| standard \LaTeX\ environment. Even in this -% environment the actual typesetting is done within a |list| environment, whose -% parameters are set differently from what they are in the |verse| environment. -% Notice in any case that the command |\wr@teverse| reopens the~0 box, so on the -% last verse, upon closing the environment, it is necessary to remember to close -% such box, whose contents is irrelevant and can be thrown away. -% -% I have experienced some problems in typesetting verses in two-column format; the -% column width might be too short for setting up verses even if verses are not that -% long, because in the left margin there must be room for the verse numbering; for -% homogeneity the spacing must conform also with the following environment -% \texttt{VERSI} that has a secondary verse numbering, therefore it can't be too -% small. The result is that there might be a test for controlling the two-column -% format, but I think that it is more useful for the typesetter to be able to switch +% Finally the |\wr@teverse| macro does the actual typesetting of the +% verse. Notice that the environment opening statement and every +% succeeding previous verse starts an horizontal box where the contents +% of the current verse is stored. Therefore the first thing to do is to +% close the box with the |\egroup| command, then a line of text is output +% that contains a possibly empty box or the verse number and the command +% for stepping up the verse counter, followed by the verse box number~0 +% and an end of paragraph; in this way the |\\| operates always in +% vertical mode, contrary to what happens in the |verse| standard +% \LaTeX\ environment. Even in this environment the actual typesetting +% is done within a |list| environment, whose parameters are set +% differently from what they are in the |verse| environment. +% Notice in any case that the command |\wr@teverse| reopens the~0 box, +% so on the last verse, upon closing the environment, it is necessary +% to remember to close such box, whose contents is irrelevant and can +% be thrown away. +% +% I have experienced some problems in typesetting verses in two-column +% format; the column width might be too short for setting up verses even +% if verses are not that long, because in the left margin there must be +% room for the verse numbering; for homogeneity the spacing must conform +% also with the following environment \texttt{VERSI} that has a secondary +% verse numbering, therefore it can't be too small. The result is that +% there might be a test for controlling the two-column format, but I +% think that it is more useful for the typesetter to be able to switch % on and off the possibility of breaking long verses on more lines. -% On two-column format in any case it is better to leave the right margin to -% coincide with the column right margin. +% On two-column format in any case it is better to leave the right +% margin to coincide with the column right margin. % \begin{macrocode} \def\wr@teverse##1[##2]{\egroup \makebox[3em][r]{% @@ -2840,9 +3015,10 @@ Type X <return> to exit.}% \item\leavevmode\setbox\z@\hbox\bgroup\ignorespaces }{% % \end{macrocode} -% Upon closing it is necessary to activate the writing out of the last verse that is -% still in the~0 box, but since this box is immediately reopened, it is necessary to -% close it again before exiting the environment. +% Upon closing it is necessary to activate the writing out of the last +% verse that is still in the~0 box, but since this box is immediately +% reopened, it is necessary to close it again before exiting the +% environment. % \begin{macrocode} \\% \egroup @@ -2853,31 +3029,34 @@ Type X <return> to exit.}% % \end{macrocode} %\end{environment} % -%\begin{environment}{VERSI} The third environment |VERSI| set verses in the -% traditional way, but numbers them with two different enumerations; the principal -% one is by multiples of five, while the secondary one counts by units, and may be -% turned on and off, or reset at will. We therefore need another counter for the -% secondary enumeration and commands for turning it on and off and for resetting the -% counter. We need also a new length and a new boolean variable in order to manage -% the secondary enumeration. -% The new length represents an indentation of those verses that do no have the -% secondary enumeration, while secondary enumerated verses are not indented. For -% \texttt{VERSI} there is the same possibility of turning on and off the possibility -% of breaking verses at the end of line as it happens for the environment +%\begin{environment}{VERSI} The third environment |VERSI| set verses in +% the traditional way, but numbers them with two different enumerations; +% the principal one is by multiples of five, while the secondary one +% counts by units, and may be turned on and off, or reset at will. We +% therefore need another counter for the secondary enumeration and +% commands for turning it on and off and for resetting the counter. +% We need also a new length and a new boolean variable in order to +% manage the secondary enumeration. +% The new length represents an indentation of those verses that do no +% have the secondary enumeration, while secondary enumerated verses are +% not indented. For \texttt{VERSI} there is the same possibility of +% turning on and off the possibility of breaking verses at the end of +% line as it happens for the environment % \texttt{Versi}. % \begin {macro}{\SubVerso} % \begin {macro}{\NoSubVerso} -% Macro |\NoSubVerso| turns off the secondary enumeration; macro |\SubVerso| turns -% on the secondary enumeration, but it accepts an optional argument for resetting -% the secondary counter; the default value is~0; if no optional argument is -% specified, and therefore if the optional argument has its default value~0, no -% resetting is performed and the enumeration keeps going from the last contents of -% the secondary counter; if the first use of |\SubVerso| does not contain the -% optional argument, the secondary enumeration keeps going from the old contents of -% the secondary counter which is unpredictable, depending upon the previous -% occurrences of the environment |VERSI|. The typesetter, therefore, must remember -% to specify the optional argument to |\SubVerso| the first time he uses it in this -% environment. +% Macro |\NoSubVerso| turns off the secondary enumeration; macro +% |\SubVerso| turns on the secondary enumeration, but it accepts an +% optional argument for resetting the secondary counter; the default +% value is~0; if no optional argument is specified, and therefore if +% the optional argument has its default value~0, no resetting is +% performed and the enumeration keeps going from the last contents +% of the secondary counter; if the first use of |\SubVerso| does not +% contain the optional argument, the secondary enumeration keeps going +% from the old contents of the secondary counter which is unpredictable, +% depending upon the previous occurrences of the environment |VERSI|. +% The typesetter, therefore, must remember to specify the optional +% argument to |\SubVerso| the first time he uses it in this environment. % \begin{macrocode} \newcounter{subverso} \setcounter{subverso}{0} \newif\ifSubVerso @@ -2894,16 +3073,18 @@ Type X <return> to exit.}% % \end{macrocode} %\end{macro} %\end{macro} -% The opening environment statement accepts an optional argument (default equals~1) -% which represents the primary enumeration starting number: +% The opening environment statement accepts an optional argument +% (default equals~1) which represents the primary enumeration +% starting number: % \begin{macrocode} \newenvironment{VERSI}[1][1]{% \setcounter{verso}{#1}% % \end{macrocode} -% We need two macros |\writ@verso| and |\writ@subverso|, that typeset the primary -% and secondary enumeration; the first one is similar to the one used in the |Versi| -% environment, while the second one has no special features except the conditional -% construct needed to check if the secondary enumeration has to be printed out. +% We need two macros |\writ@verso| and |\writ@subverso|, that typeset +% the primary and secondary enumeration; the first one is similar to +% the one used in the |Versi| environment, while the second one has no +% special features except the conditional construct needed to check +% if the secondary enumeration has to be printed out. % \begin{macrocode} \def\writ@verso{% \count255=\value{verso}\divide\count255by5\relax @@ -2921,12 +3102,13 @@ Type X <return> to exit.}% \expandafter{\the\c@subverso}}% \fi}% % \end{macrocode} -% Similarly to the previous environment, the |\\| command must be redefined -% so as to perform more or less as the standard one, while doing all the necessary -% actions needed in this environment. It must check the presence of the optional -% star and of the optional vertical skip and it has to pass control to a service -% macro |\v@rscr| that does the actual job; actually it passes control to a third -% macro |\writ@verse| that effectively outputs the current verse. +% Similarly to the previous environment, the |\\| command must be +% redefined so as to perform more or less as the standard one, while +% doing all the necessary actions needed in this environment. It must +% check the presence of the optional star and of the optional vertical +% skip and it has to pass control to a service macro |\v@rscr| that +% does the actual job; actually it passes control to a third macro +% |\writ@verse| that effectively outputs the current verse. % \begin{macrocode} \def\\% {\@ifstar{\v@rscr{\@M}}{\v@rscr{\z@}}}% @@ -2947,8 +3129,8 @@ Type X <return> to exit.}% \penalty##1\vskip##2\relax \setbox\z@\hbox\bgroup\ignorespaces}% % \end{macrocode} -% For the remaining part, the environment is a normal |list| environment with -% specific initial parameters. +% For the remaining part, the environment is a normal |list| environment +% with specific initial parameters. % \begin{macrocode} \list{}{\parsep\z@\itemsep\z@ \if@twocolumn @@ -2966,9 +3148,10 @@ Type X <return> to exit.}% \item\leavevmode\setbox\z@\hbox\bgroup\ignorespaces }{% % \end{macrocode} -% The closing statement must output the last verse, which is still contained in -% box~0; since box~0 is automatically reopened, it must be closed again and its -% contents, of no significance now, can be lost upon closing the environment group. +% The closing statement must output the last verse, which is still +% contained in box~0; since box~0 is automatically reopened, it must +% be closed again and its contents, of no significance now, can be lost +% upon closing the environment group. % \begin{macrocode} \\% \egroup\endlist} @@ -2978,6 +3161,7 @@ Type X <return> to exit.}% %\end{environment} % % \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. @@ -3063,7 +3247,7 @@ Type X <return> to exit.}% \DeclareRobustCommand\coronainv{{\metricsfont\char21}} \DeclareRobustCommand\catal{{\metricsfont g}} \DeclareRobustCommand\ipercatal{{\metricsfont h}} -\DeclareRobustCommand\hiatus{\textsuperscript{\upshape H}} +\DeclareRobustCommand\hiatus{\textsuperscript{\normalshape H}} \DeclareRobustCommand\Hiatus{\makebox[\z@]{\hiatus}} \DeclareRobustCommand\X{{\metricsfont X}} \let\anceps\X @@ -3252,7 +3436,7 @@ $\displaystyle\left.% %\begin{macro}{\GTRON} %\begin{macro}{\TROF} %\begin{macro}{\GTROF} -%\begin{macro}{\treceon} +%\begin{macro}{\traceon} %\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; @@ -3306,7 +3490,7 @@ $\displaystyle\left.% % 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, +% “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. @@ -3319,10 +3503,10 @@ $\displaystyle\left.% % ones, resort to robust internal macros if the |greek.ldf| language % description style is active; they are renamed versions of the original % macros that are perfect for modern Greek usage; therefore we simply let -% the glyph placeholders for the vales 6, 90, and 900, originally indicated -% with the place holders |\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 +% the glyph placeholders for the vales 6, 90, and 900, originally +% indicated with the place holders |\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. @@ -3375,6 +3559,7 @@ $\displaystyle\left.% %\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 strictly @@ -3415,10 +3600,10 @@ $\displaystyle\left.% % 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} +\DeclareTextSymbol{\Vmiria}{\GRenc@name}{5} +\DeclareTextSymbol{\Vkilo}{\GRenc@name}{4} +\DeclareTextSymbol{\Vetto}{\GRenc@name}{3} +\DeclareTextSymbol{\Vdeka}{\GRenc@name}{2} % \end{macrocode} % The we need a command to issue a warning message if the number % to be transformed is out of range: @@ -3504,7 +3689,7 @@ Illegal value (\number#1) for \string\ActicNumeral\space}} %\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 +% 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 @@ -3534,7 +3719,7 @@ Illegal value (\number#1) for \string\ActicNumeral\space}} % 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 +% \textsf{teubner.sty} at the “begin document” time, without resorting % 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. diff --git a/macros/latex/contrib/teubner/teubner.pdf b/macros/latex/contrib/teubner/teubner.pdf Binary files differindex 2440e1eb7d..362ca69f6a 100644 --- a/macros/latex/contrib/teubner/teubner.pdf +++ b/macros/latex/contrib/teubner/teubner.pdf diff --git a/macros/latex/contrib/teubner/teubner.txt b/macros/latex/contrib/teubner/teubner.txt index 64db196c6f..1c088910a2 100644 --- a/macros/latex/contrib/teubner/teubner.txt +++ b/macros/latex/contrib/teubner/teubner.txt @@ -1,9 +1,9 @@ - THE TEUBNER PACKAGE VERSION 5.4 OF FEBRUARY 2021 + THE TEUBNER PACKAGE VERSION 5.7 OF AUGUST 2022 EXTENSION FOR PHILOLOGICAL TYPESETTING -Copyright 2001-2004-2021 Claudio Beccari +Copyright 2001-2022 Claudio Beccari The programs contained in this bundle can be distributed and/or modified under the terms of the LaTeX Project Public License (LPPL), version 1.3c @@ -13,40 +13,42 @@ dated 2008-05-04 or later as it appears in This bundle contains the following files -README short information abut installing this bundle +README short description of this bundle teubner.txt this file -teubner.dtx documented TeX file -teubner-doc.tex documentation file +teubner.dtx technical documented TeX source file +teubner-doc.tex user documentation TeX source file teubner.pdf technical documentation -teubner-doc.pdf usage documentation +teubner-doc.pdf user documentation -By running pdflatex on teubner.dtx in addition to the documentation -file teubner.pdf, the byproduct files teubner.sty, teubnertx.sty, are -generated; teubner-doc.pdf must be generated by running pdflatex on the -source file teubner-doc.tex file. +By running pdflatex on teubner.dtx in addition to the technical +documentation file teubner.pdf, the byproduct files teubner.sty, + teubnertx.sty, are generated; teubner-doc.pdf must be generated + by running pdflatex on the source file teubner-doc.tex source file. These two .pdf files are already contained in the bundle. File teubner-doc.pdf is the documentation file that shows what can be done with this extension package and displays several examples. -Version 5.2 of the teubner package is compliant with the Greek language -support to babel version 3.9g, that makes use of the encoding independent -LICR (LaTeX Internal Character Representation) of the Greek characters & -diacritics; it contains also the macros that allow using the LGR encoded -CBfonts together with other PostScript scalable fonts; the compatibility -with the Times and the Palatino eXtended fonts, through the packages -txfonts and pxfonts, are already built in; the compatibility with the -Latin Modern fonts was already available with version 2.x of this package. -With the upgrade of the Greek support to babel through file greek.ldf -version 1.10, teubner package versions previous to 5.0 became unable to -transform Arabic numerals into the classical Milesian and Attic number -representations. From version 5.0 the teubner package has been patched -in order to re-establish the above number transformations; some other +Versiosn 5.2 and later of the teubner package is compliant with the Greek +language support to babel version 3.9g, that makes use of the encoding +independent LICR (LaTeX Internal Character Representation) of the Greek +characters & diacritics; it contains also the macros that allow using +the LGR encoded CBfonts together with other PostScript scalable fonts; +the compatibility with the Times and the Palatino eXtended fonts, +through the packages txfonts and pxfonts, are already built in; the +compatibility with the Latin Modern fonts was already available with +version 2.x of this package. + +With the upgrade of the Greek support to babel through file greek.ldf +version 1.10, teubner package versions previous to 5.0 became unable to +transform Arabic numerals into the classical Milesian and Attic number +representations. From version 5.0 the teubner package has been patched +in order to re-establish the above number transformations; some other improvements have been added that are transparent to the end user, since -they deal with the package internal workings. But these improvements -require a recent installation of the TeX system, because they use +they deal with the package internal workings. But these improvements +require a recent installation of the TeX system, because they use interfaces to the new LaTeX 3 language; the minimum date of the LaTeX -kernel should not be earlier than January 2019. +kernel should not be earlier than January 2020. Some time ago Antonis Tsolomitis uploaded the package txfontsb which adds the possibility of using nice TX compatible Greek fonts when using @@ -66,7 +68,7 @@ Although Tsolomitis' fonts satisfy very well the everyday typesetting necessities of the Greek users and blend well also with the TX math fonts, they do not satisfy the requirements of the teubner package. This is why the processing of the teubner.dtx file generates also the file -teubnertx.sty that is being input at begin document time if the user +teubnertx.sty that is being input at begin document time when the user specified the TX fonts by calling the txfonts package. In order to use this extension package with LaTeX you have to install it. @@ -75,7 +77,7 @@ already provided for this task; may be your TeX system is configured to load missing packages on the fly. In any case you can check and possibly run your Package Manager (with MiKTeX follow the path: Programs|MiKTeX Settings|Packages; -with TeXlive and MacTeX (if their installation configuration was not +with TeXlive and MacTeX (if their installation configuration was not the default complete one) run tlmgr. If you feel more comfortable to do everything by yourself and/or want to @@ -167,7 +169,7 @@ you use LaTeX, you know what are its pros and cons. Happy philological LaTeXing! -Claudio Beccari February 2021 +Claudio Beccari Professor Emeritus Politecnico di Torino, Italy claudio dot beccari at gmail dot com diff --git a/macros/luatex/latex/luaquotes/README b/macros/luatex/latex/luaquotes/README index b4e06d6d0c..d63430075b 100644 --- a/macros/luatex/latex/luaquotes/README +++ b/macros/luatex/latex/luaquotes/README @@ -1,6 +1,6 @@ luaquotes - smart quotes with lua -version: 1.0.0 +version: 1.0.1 This package automatically creates smart quotes using lua filters and provides auxiliary commands for typesetting specific lua punctuation @@ -11,4 +11,6 @@ LaTeX Project Public License (LPPL), version 1.3 or later. For suggestions, feature requests, and bug reports, please use the project's GitHub site: https://github.com/ezgranet/luaquotes -Version history: 24/08/2022 —package creation +Version history: +28/08/2022—resolving bug with language versions +24/08/2022 —package creation diff --git a/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf b/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf Binary files differindex 6383205e0a..cd0dbc092b 100644 --- a/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf +++ b/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf diff --git a/macros/luatex/latex/luaquotes/luaquotes-documentation.tex b/macros/luatex/latex/luaquotes/luaquotes-documentation.tex index f6cbf32a17..f06a12e25c 100644 --- a/macros/luatex/latex/luaquotes/luaquotes-documentation.tex +++ b/macros/luatex/latex/luaquotes/luaquotes-documentation.tex @@ -255,7 +255,7 @@ breaklines, firstnumber=last ] {latex} -\def\luaquotesversionnumber{1.0.0} +\def\luaquotesversionnumber{1.0.1} \ProvidesPackage{luaquotes} [2022/08/01\luaquotesversionnumber smart quotes with lua] % !TeX program = lualatex @@ -703,12 +703,15 @@ firstnumber=last ] {latex} - \DeclareOption{en}{ - -\AtBeginDocument{\smartquotes} -\renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}}\dumbquotes #1}} - + \DeclareOption{en}{ +\AtBeginDocument{ +\frsmartquotes +\frdumbquotes +\desmartquotes +\dedumbquotes\smartquotes} +\renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}} } + \end{minted} \subsection{Auxiliary punctuation} \begin{minted}[ @@ -1057,18 +1060,13 @@ firstnumber=last }} \newcommand{\desmartquotes}{\dedoublequoteson \desinglequotelinestarton -\desinglequoteson \desinglequotescloseon} \newcommand{\dedumbquotes}{\dedoublequotesoff \desinglequotelinestartoff -\desinglequotesoff \desinglequotescloseoff} \DeclareOption{de}{ - \AtBeginDocument{\desmartquotes} -\renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}}\dedumbquotes #1}} - - +\renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}} } \end{minted} \subsection{The French option} @@ -1344,16 +1342,14 @@ firstnumber=last ] {latex} }} - \newcommand{\frsmartquotes}{\frdoublequoteson \frsinglequotelinestarton \frsinglequotescloseon} \newcommand{\frdumbquotes}{\frdoublequotesoff \frsinglequotelinestartoff -\frsinglequotescloseoff} \DeclareOption{fr}{ - -\AtBeginDocument{\frsmartquotes} -\renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}}\frdumbquotes #1}} - +\frsinglequotescloseoff} + \DeclareOption{fr}{ +\AtBeginDocument{\desmartquotes\dedumbquotes\smartquotes\dumbquotes\frsmartquotes} +\renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}} } \end{minted} @@ -1380,6 +1376,11 @@ firstnumber=last \end{minted} \section{Version History} +\subsection{\texttt{1.0.1}} + +\ttfamily 28 August 2022: Change bug preventing non-English usage + + \subsection{\texttt{1.0.0}} \ttfamily 21 August 2022: Package creation diff --git a/macros/luatex/latex/luaquotes/luaquotes.sty b/macros/luatex/latex/luaquotes/luaquotes.sty index f753df8183..954891af13 100644 --- a/macros/luatex/latex/luaquotes/luaquotes.sty +++ b/macros/luatex/latex/luaquotes/luaquotes.sty @@ -1,4 +1,4 @@ -\def\luaquotesversionnumber{1.0.0} +\def\luaquotesversionnumber{1.0.1} \ProvidesPackage{luaquotes} [2022/08/01\luaquotesversionnumber smart quotes with lua] % !TeX program = lualatex @@ -136,7 +136,7 @@ luatexbase.add_to_callback ( \singlequotesoff} \DeclareOption{en}{ -\AtBeginDocument{\smartquotes} +\AtBeginDocument{\frsmartquotes\frdumbquotes\desmartquotes\dedumbquotes\smartquotes} \renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}} } @@ -240,18 +240,13 @@ return ( s:gsub ( " '(..-)'", " ‚\%1`" ) ) "process_input_buffer" , "desinglequotesclose" )}} \newcommand{\desmartquotes}{\dedoublequoteson \desinglequotelinestarton -\desinglequoteson \desinglequotescloseon} \newcommand{\dedumbquotes}{\dedoublequotesoff \desinglequotelinestartoff -\desinglequotesoff \desinglequotescloseoff} \DeclareOption{de}{ - \AtBeginDocument{\desmartquotes} \renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}} - - } %%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -291,8 +286,7 @@ return ( s:gsub ( " '(..-)'", " ‹\\,\%1\\,›" ) ) \frsinglequotelinestartoff \frsinglequotescloseoff} \DeclareOption{fr}{ - -\AtBeginDocument{\frsmartquotes} +\AtBeginDocument{\desmartquotes\dedumbquotes\smartquotes\dumbquotes\frsmartquotes} \renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}} diff --git a/macros/texinfo/latest/texinfo.tex b/macros/texinfo/latest/texinfo.tex index 4a5c74e6f4..80b1addae7 100644 --- a/macros/texinfo/latest/texinfo.tex +++ b/macros/texinfo/latest/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2022-08-20.19} +\def\texinfoversion{2022-08-27.12} % % Copyright 1985, 1986, 1988, 1990-2022 Free Software Foundation, Inc. % @@ -2803,14 +2803,23 @@ end % @var unconditionally uses \sl. This gives consistency for % parameter names whether they are in @def, @table @code or a % regular paragraph. +% To get ttsl font for @var when used in code context, @set txicodevaristt. % The \null is to reset \spacefactor. \def\aftersmartic{} \def\var#1{% \let\saveaftersmartic = \aftersmartic \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% - {\sl #1}\smartitaliccorrection + \ifusingtt{% + \ifflagclear{txicodevaristt}% + {{\sl #1}}% + {{\ttsl #1}}% + }{{\sl #1}}% + \smartitaliccorrection } +% To be removed after next release +\def\SETtxicodevaristt{}% @set txicodevaristt + \let\i=\smartitalic \let\slanted=\smartslanted \let\dfn=\smartslanted @@ -3448,10 +3457,16 @@ $$% \ifx\textnominalsize\xwordpt % for 10pt running text, lllsize (8pt) is too small for the A in LaTeX. % Revert to plain's \scriptsize, which is 7pt. - \count255=\the\fam $\fam\count255 \scriptstyle A$% + % \count255=\the\fam $\fam\count255 \scriptstyle A$% + \switchtolllsize A% \else - % For 11pt, we can use our lllsize. - \switchtolllsize A% + \iffalse % x\curfontsize\smallword + % For footnotes and indices + \count255=\the\fam $\fam\count255 \scriptstyle A$% + \else + % For 11pt, we can use our lllsize. + \switchtolllsize A% + \fi \fi }% \vss @@ -3459,6 +3474,7 @@ $$% \kern-.15em \TeX } +\def\smallword{small} % Some math mode symbols. Define \ensuremath to switch into math mode % unless we are already there. Expansion tricks may not be needed here, diff --git a/macros/xetex/latex/exam-zh/CHANGELOG.md b/macros/xetex/latex/exam-zh/CHANGELOG.md index f785a3fc42..b4197df61e 100644 --- a/macros/xetex/latex/exam-zh/CHANGELOG.md +++ b/macros/xetex/latex/exam-zh/CHANGELOG.md @@ -5,6 +5,33 @@ 格式参照 [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 并且此项目遵守 [Semantic Versioning](https://semver.org/spec/v2.0.0.html)。 +## [0.1.19] - 2022-08-27 + +### Added + +- 增加 `choices` 的 `top-sep`, `bottom-sep`, `linesep` 键值 +- 增加对 `minipage` 的最小行距的控制 +- 增加 `\fillin` 的 `depth` 键值控制下划线的深度 +- 增加图文排版模块 `exam-zh-textfigure.sty` +- 增加示例文件的图文排版 + +### Changed + +- 修改列表环境 `enumerate` 参数 +- `show-columnline` 默认值改为 `false` + +### Fixed + +- 修复不同字体可能导致的 `bigstar` 缺失问题 +- 修复 `\ExamPrintAnswer` 的未设置编译报错问题 + +## [0.1.19] - 2022-08-17 + +### Added + +- 增加 `solution/show-solution` 的等效键值:`solution/show-answer` + + ## [0.1.18] - 2022-08-15 ### Added diff --git a/macros/xetex/latex/exam-zh/README.md b/macros/xetex/latex/exam-zh/README.md index d3bd71fab2..786d845d0c 100644 --- a/macros/xetex/latex/exam-zh/README.md +++ b/macros/xetex/latex/exam-zh/README.md @@ -13,14 +13,14 @@ In exam-zh, you can - ... (for more that you can do with it, please read the manual(in Chinese): `exam-zh-doc.pdf` -Repository: https://gitee.com/zepinglee/exam-zh +Repository: https://gitee.com/xkwxdyy/exam-zh Author: Zeping Lee Maintainer: Kangwei Xia, Lijun Guo -Issues and pull requests are welcome: [issues]( https://gitee.com/zepinglee/exam-zh/issues) and [pulls](https://gitee.com/zepinglee/exam-zh/pulls) +Issues and pull requests are welcome: [issues]( https://gitee.com/xkwxdyy/exam-zh/issues) and [pulls](https://gitee.com/xkwxdyy/exam-zh/pulls) # exam-zh:中国试卷 LaTeX 模板 -- 项目主页:<https://gitee.com/zepinglee/exam-zh> +- 项目主页:<https://gitee.com/xkwxdyy/exam-zh> - 作者:Zeping Lee - 维护者:Kangwei Xia, Lijun Guo - 授权:[LaTeX Project Public License 1.3c](https://www.latex-project.org/lppl.txt) @@ -33,7 +33,7 @@ Issues and pull requests are welcome: [issues]( https://gitee.com/zepinglee/exam 3. 通过用户接口可以方便更改密封线样式; 4. 在 Windows, macOS 和 Linux 跨平台编译。 -使用前请仔细阅读 [发行版](https://gitee.com/zepinglee/exam-zh/releases) 的用户手册 `exam-zh-doc.pdf`。 +使用前请仔细阅读 [发行版](https://gitee.com/xkwxdyy/exam-zh/releases) 的用户手册 `exam-zh-doc.pdf`。 ## 示例(simple example) diff --git a/macros/xetex/latex/exam-zh/doc/back/development.tex b/macros/xetex/latex/exam-zh/doc/back/development.tex index a2ae5b6737..23d9108039 100644 --- a/macros/xetex/latex/exam-zh/doc/back/development.tex +++ b/macros/xetex/latex/exam-zh/doc/back/development.tex @@ -3,7 +3,7 @@ \section{参与开发} \begin{itemize} - \item 如果您有任何改进意见或者功能需求,欢迎前往 \href{https://gitee.com/zepinglee/exam-zh/issues}{gitee 仓库 issues} 提交 issue + \item 如果您有任何改进意见或者功能需求,欢迎前往 \href{https://gitee.com/xkwxdyy/exam-zh/issues}{gitee 仓库 issues} 提交 issue \item 欢迎 \cmd{fork} 本项目,提 \cmd{pr} 的形式参与开发 \item 建议阅读 \href{https://zhuanlan.zhihu.com/typography-and-latex/}{muzimuzhi} 写的 \href{https://gitee.com/ustctug/ustcthesis/wiki/%E5%8F%82%E4%B8%8E%E5%BC%80%E5%8F%91}{参与开发} \item 参考阅读 diff --git a/macros/xetex/latex/exam-zh/doc/back/package.tex b/macros/xetex/latex/exam-zh/doc/back/package.tex index 6a67ac1504..d12f085d58 100644 --- a/macros/xetex/latex/exam-zh/doc/back/package.tex +++ b/macros/xetex/latex/exam-zh/doc/back/package.tex @@ -22,4 +22,14 @@ \item \pkg{ulem}:下划线 \item \pkg{tcolorbox}:彩框 \item \pkg{varwidth}:“弹性”的 \env{minipage} +\end{itemize} + + +\file{exam-zh-textfigure.sty} 的宏包依赖: + +\begin{itemize} + \item \pkg{wrapstuff}:图文混排 + \item \pkg{tabularray}:表格 + \item \pkg{varwidth}:“弹性”的 \env{minipage} + \item \pkg{graphicx}:插图 \end{itemize}
\ No newline at end of file diff --git a/macros/xetex/latex/exam-zh/doc/body/installation.tex b/macros/xetex/latex/exam-zh/doc/body/installation.tex index 04c414caac..a632fa8059 100644 --- a/macros/xetex/latex/exam-zh/doc/body/installation.tex +++ b/macros/xetex/latex/exam-zh/doc/body/installation.tex @@ -21,10 +21,10 @@ 您也可以通过访问 gitee 项目主页的方式获取最新版本的 \cls{exam-zh}(通常情况下,gitee 的版本会大于等于CTAN 的版本(因为 CTAN 从上传到审核到用户可以下载需要一天左右))。主要以「下载发行版」的方式获取最新版本的 \cls{exam-zh}: \begin{enumerate} - \item 进入项目主页(\href{https://gitee.com/zepinglee/exam-zh}{gitee 项目主页} (界面见图~\ref{figure:gitee项目主页} ) + \item 进入项目主页(\href{https://gitee.com/xkwxdyy/exam-zh}{gitee 项目主页} (界面见图~\ref{figure:gitee项目主页} ) \item 在右侧一列有“发行版”(gitee),并且有一个标签图标并有“vx.x.x - 20xx-xx-xx”字样,表示最新的发行版版本和发布时间,点击即可查看相关信息(如果想查看历史所有发行版信息,可以点击“发行版”右侧的“全部”(gitee))。 - 发行版中一般由以下信息构成(\href{https://gitee.com/zepinglee/exam-zh/releases}{gitee 发行版} 界面见图~\ref{figure:gitee发行版}) + 发行版中一般由以下信息构成(\href{https://gitee.com/xkwxdyy/exam-zh/releases}{gitee 发行版} 界面见图~\ref{figure:gitee发行版}) \begin{itemize} \item 更新文件的特别说明。如果没有,则表明此次更新只需要更新 \file{exam-zh.cls} 文件至最新\footnote{“更新 \meta{文件} 至最新”目前表示在发行版中下载最新版本的模板,并用其中所需要更新的 \meta{文件} 去替换本地的旧 \meta{文件}} 即可 \item 更新日志。 主要为此次发行版与上次发行版的不同,一般为“Added”、“Changed”、“Fixed”等信息 @@ -76,6 +76,7 @@ \file{exam-zh-font.sty} & 模版的字体模块宏包\\ \file{exam-zh-symbols.sty} & 模版的符号模块宏包\\ \file{exam-zh-chinese-english.sty} & 模版的语文英语模块宏包\\ + \file{exam-zh-textfigure.sty} & 模版的图文排版模块宏包\\ \file{README.md} & 简要自述 \\ \file{CHANGELOG.md} & 模板更新日志 \\ \file{LICENSE} & 模版发布许可证 diff --git a/macros/xetex/latex/exam-zh/doc/body/usage.tex b/macros/xetex/latex/exam-zh/doc/body/usage.tex index 56e0f25739..71e57ad21f 100644 --- a/macros/xetex/latex/exam-zh/doc/body/usage.tex +++ b/macros/xetex/latex/exam-zh/doc/body/usage.tex @@ -684,7 +684,7 @@ \end{function} \begin{function}{\chapter} - 用于排一份的试卷标题。并可以用 \opt{page/show-chapter} 键值控制显示与否。 + 用于排一份的试卷标题。并可以用 \opt{page/show-chapter} 键值控制显示与否。新的 \tn{chapter} 下 \env{question} 环境计数器会重置。 \end{function} 其余的见~\ref{subsubsec:抬头} 节。 @@ -886,6 +886,113 @@ +\subsubsection{图文排版} + +图文排版模块为 \file{exam-zh-textfigure.sty},基于 xkwxdyy 的 \href{https://gitee.com/xkwxdyy/text-figure}{text-figure} 宏包优化而来,\pkg{text-figure} 宏包不再维护。 + +试卷中的图文排版主要有三种类型: +\begin{enumerate} + \item 多张图片并排,文字处于上方和下方; + \item 文字和图片左右或上下排版 + \item 文字绕排(主要基于李清的 \pkg{wrapstuff} 宏包(\file{exam-zh-textfigure.sty} 中已加载)) +\end{enumerate} + +其中,文字绕排一般用于语文英语等文字较多的情形。 + +\begin{function}[added = 2022-08-28]{multifigures 环境} + \begin{ccnusyntax}[emph={[2]multifigures}] + \begin{multifigures}(*\oarg{键值列表}*) + \item[标签1] (*\meta{内容1}*) + \item[标签2] (*\meta{内容2}*) + ... + \end{multifigures} + \end{ccnusyntax} + 多张图片(无超链接引用)排版环境。\meta{键值列表} 见~\ref{subsubsec:参数-图文排版}。 +\end{function} + +\begin{latexexample}{\env{multifigures} 环境示例1} + \begin{multifigures} + \item[题 9 图:勾股数] \includegraphics[width=3cm]{example-image.png} + \item[题 11 图:圆锥曲线] \includegraphics[width=3cm]{example-image.png} + \end{multifigures} +\end{latexexample} + +\begin{latexexample}{\env{multifigures} 环境示例2} + \begin{multifigures}[columns=2] + \item[题 9 图] \includegraphics[width=3cm]{example-image.png} + \item[题 10 图] \includegraphics[width=3cm]{example-image.png} + \item[题 11 图] \includegraphics[width=3cm]{example-image.png} + \item[题 12 图] \includegraphics[width=3cm]{example-image.png} + \end{multifigures} +\end{latexexample} + + +\begin{function}[added = 2022-08-28]{\textfigure} + \begin{ccnusyntax}[emph={[2]textfigure}] + \textfigure(*\oarg{参数列表}\marg{文本}\marg{图片}*) + \end{ccnusyntax} + 图文排版命令。\meta{键值列表} 见~\ref{subsubsec:参数-图文排版}。 +\end{function} + +\begin{latexexample}{\tn{textfigure} 命令示例1} + \textfigure{ + 江州司马平安否? 惠远东林住得无? \par + 湓浦曾闻似衣带,庐峰见说胜香炉。\par + 题诗岁晏离鸿断,望阙天遥病鹤孤。\par + 莫谩拘牵雨花社,青云依旧是前途。 + }{ + \includegraphics[width=3cm]{example-image.png} + } +\end{latexexample} + +\begin{latexexample}{\tn{textfigure} 命令示例2} + \textfigure[text-width=\columnwidth,fig-pos=bottom-flushright]{ + 如图,在三棱锥 $A$-$BCD$ 中,$\text{平面} ABD \perp \text{平面} BCD$, + $AB = AD$,$O$ 为 $BD$ 的重点。 + \begin{enumerate} + \item 证明:$OA \perp CD$; + \item 若 $\triangle OCD$ 是变长为 $1$ 的等边三角形,点 $E$ 在棱 $AD$ 上, + $DE = 2 EA$,且二面角 $E$-$BC$-$D$ 的大小为 $45^{\circ}$, + 求三棱锥 $A$-$BCD$ 的体积。 + \end{enumerate} + }{ + \includegraphics[width=3cm]{example-image.png} + } +\end{latexexample} + + +\begin{latexexample}{\tn{textfigure} 命令示例3} + \textfigure{ + \begin{question} + 双曲线 $C: \frac{x^{2}}{4}-\frac{y^{2}}{2}=1$ 的右焦点为 $F$, 为点 $P$ 在 $C$ 的一条渐近线上, $O$ 为坐标原点, 若 $|P O|=|P F|$, 则 $\triangle P F O$ 的面积为 \paren + \begin{choices} + \item $\frac{3 \sqrt{2}}{4}$ + \item $\frac{3 \sqrt{2}}{2}$ + \item $2 \sqrt{2}$ + \item $3 \sqrt{2}$ + \end{choices} + \end{question} + + \begin{question} + 设 $f(x)$ 是定义域为 $\mathbf{R}$ 的偶函数, 且在 $(0,+\infty)$ 单调递减, 则 + \begin{choices} + \item $f\left(\log _{3} \frac{1}{4}\right)>f\left(2^{-\frac{3}{2}}\right)>f\left(2^{-\frac{2}{3}}\right)$ + \item $f\left(\log _{3} \frac{1}{4}\right)>f\left(2^{-\frac{2}{3}}\right)>f\left(2^{-\frac{3}{2}}\right)$ + \item $f\left(2^{-\frac{3}{2}}\right)>f\left(2^{-\frac{2}{3}}\right)>f\left(\log _{3} \frac{1}{4}\right)$ + \item $f\left(2^{-\frac{2}{3}}\right)>f\left(2^{-\frac{3}{2}}\right)>f\left(\log _{3} \frac{1}{4}\right)$ + \end{choices} + \end{question} + }{ + \includegraphics[width = 2cm, height = 5cm]{example-image.png} \\ (第 9 题) + } +\end{latexexample} + + +\begin{function}{wrapstuff 环境} + \file{exam-zh-textfigure.sty} 模块默认加载 \pkg{wrapstuff} 宏包。具体 \env{wrapstuff} 环境使用请阅读手册。 +\end{function} + + \subsection{参数设置} \begin{function}{\examsetup} @@ -1826,6 +1933,27 @@ 选项的最大列数。排版选项时会优先尝试该列数,如果无法排下内容,依次将列数除以 2 并取整再进行尝试,直到可以排下全部选项。默认为 |4| 。 \end{function} +\begin{function}[added = 2022-08-28]{choices/top-sep} + \begin{ccnusyntax}[emph={[1]top-sep}] + top-sep = (*\meta{dimension}*) + \end{ccnusyntax} + \env{choices} 环境上方弹性间距。默认为 |0pt|。 +\end{function} + +\begin{function}[added = 2022-08-28]{choices/bottom-sep} + \begin{ccnusyntax}[emph={[1]bottom-sep}] + bottom-sep = (*\meta{dimension}*) + \end{ccnusyntax} + \env{choices} 环境下方弹性间距。默认为 |0pt|。 +\end{function} + +\begin{function}[added = 2022-08-28]{choices/linesep} + \begin{ccnusyntax}[emph={[1]linesep}] + linesep = (*\meta{dimension}*) + \end{ccnusyntax} + \env{choices} 环境的行数多于 1 时的行额外弹性间距。默认为 |0pt plus .5ex|。 +\end{function} + \begin{function}{paren} @@ -1912,6 +2040,7 @@ \end{function} + \subsubsection{填空题} \label{subsubsec:参数-填空题} @@ -2045,11 +2174,12 @@ \end{function} -\begin{function}[added = 2022-07-01]{solution/show-solution} - \begin{ccnusyntax}[emph={[1]show-solution}] +\begin{function}[added = 2022-07-01,updated = 2022-08-17]{solution/show-solution,solution/show-answer} + \begin{ccnusyntax}[emph={[1]show-solution,show-answer}] show-solution = (*\TTF*) + show-answer = (*\TTF*) \end{ccnusyntax} - 是否显示解答环境 \env{solution} 的内容。 + 是否显示解答环境 \env{solution} 的内容。\opt{show-solution} 和 \opt{show-answer} 两者等效。 \end{function} \begin{function}[added = 2022-07-20]{solution/parbreak} @@ -2181,19 +2311,6 @@ \env{solution} 环境内容的颜色。默认为 |black|。 \end{function} -\begin{function}[added = 2022-07-19]{solution/top-sep} - \begin{ccnusyntax}[emph={[1]top-sep}] - top-sep = (*\meta{dimension}*) - \end{ccnusyntax} - \env{solution} 环境上方间距。默认为 |.5em plus .5em minus .2em|。 -\end{function} - -\begin{function}[added = 2022-07-19]{solution/bottom-sep} - \begin{ccnusyntax}[emph={[1]bottom-sep}] - bottom-sep = (*\meta{dimension}*) - \end{ccnusyntax} - \env{solution} 环境下方间距。默认为 |.5em plus .5em minus .2em|。 -\end{function} \begin{function}[added = 2022-07-19]{solution/blank-type} \begin{ccnusyntax}[emph={[1]blank-type}] @@ -2635,4 +2752,174 @@ zhu-circlednumber-base = (*<tikz|(font)>*) \end{ccnusyntax} 在 \kvopt{poem/type}{chinese} 键值下,\tn{zhu} 的带圈数字的源。\opt{tikz} 表示此时带圈数字基于 \TikZ,\opt{font} 表示此时带圈数字基于字体。 +\end{function} + + +\subsubsection{图文排版} \label{subsubsec:参数-图文排版} + + +\begin{function}[updated = 2022-08-28]{multifigures} + \begin{ccnusyntax}[emph={[1]multifigures}] + multifigures = (*\marg{键值列表}*) + multifigures/(*\meta{key}*) = (*\meta{value}*) + \end{ccnusyntax} + 该选项包含多个子项目。用于设置 \env{multifigures} 环境。可以在 \tn{examsetup} 中使用,也可以在 \env{multifigures} 环境的可选参数中使用。 +\end{function} + +\begin{function}[added = 2022-08-28]{multifigures/columns} + \begin{ccnusyntax}[emph={[1]columns}] + columns = (*\meta{integer}*) + \end{ccnusyntax} + 每行多少项。默认为 |3|。 +\end{function} + +\begin{function}[added = 2022-08-28]{multifigures/fig-pos} + \begin{ccnusyntax}[emph={[1]fig-pos}] + fig-pos = (*<top|(above)|bottom|below|left|right>*) + \end{ccnusyntax} + 图片相对于标签的位置。\opt{top} 和 \opt{above} 同义、\opt{bottom} 和 \opt{below} 同义。 +\end{function} + +\begin{function}[added = 2022-08-28]{multifigures/top-sep} + \begin{ccnusyntax}[emph={[1]top-sep}] + top-sep = (*\meta{dimension}*) + \end{ccnusyntax} + \env{multifigures} 环境上方额外弹性间距。默认为 |1ex plus .5ex minus .5ex|。 +\end{function} + +\begin{function}[added = 2022-08-28]{multifigures/bottom-sep} + \begin{ccnusyntax}[emph={[1]bottom-sep}] + bottom-sep = (*\meta{dimension}*) + \end{ccnusyntax} + \env{multifigures} 环境下方额外弹性间距。默认为 |0pt|。 +\end{function} + +\begin{function}[added = 2022-08-28]{multifigures/align} + \begin{ccnusyntax}[emph={[1]align}] + align = (*<t|m|(b)>*) + \end{ccnusyntax} + 图片和标签的整体对齐方式。\opt{t} 表示顶部对齐、\opt{m} 表示居中对齐、\opt{b} 表示底部对齐。 +\end{function} + +\begin{function}[added = 2022-08-28]{multifigures/xshift,multifigures/hshift,multifigures/yshift,multifigures/vshift} + \begin{ccnusyntax}[emph={[1]xshift,hshift,yshift,vshift}] + xshift = (*\meta{dimension}*) + hshift = (*\meta{dimension}*) + yshift = (*\meta{dimension}*) + vshift = (*\meta{dimension}*) + \end{ccnusyntax} + 图片和标签整体的水平和垂直的偏移量。\opt{xshift} 和 \opt{hshift} 同义,表示水平;\opt{yshift} 和 \opt{vshift} 同义,表示垂直。 +\end{function} + +\begin{function}[added = 2022-08-28]{multifigures/label-xshift,multifigures/label-hshift,multifigures/label-yshift,multifigures/label-vshift} + \begin{ccnusyntax}[emph={[1]xshift,hshift,yshift,vshift}] + label-xshift = (*\meta{dimension}*) + label-hshift = (*\meta{dimension}*) + label-yshift = (*\meta{dimension}*) + label-vshift = (*\meta{dimension}*) + \end{ccnusyntax} + 标签相对图片的水平和垂直的偏移量。\opt{label-xshift} 和 \opt{label-hshift} 同义,表示水平;\opt{label-yshift} 和 \opt{label-vshift} 同义,表示垂直。 +\end{function} + + + + +\begin{function}[updated = 2022-08-28]{textfigure} + \begin{ccnusyntax}[emph={[1]textfigure}] + textfigure = (*\marg{键值列表}*) + textfigure/(*\meta{key}*) = (*\meta{value}*) + \end{ccnusyntax} + 该选项包含多个子项目。用于设置 \tn{textfigure} 命令。可以在 \tn{examsetup} 中使用,也可以在 \tn{textfigure} 命令的可选参数中使用。 +\end{function} + +\begin{function}[added = 2022-08-28]{textfigure/fig-pos} + \begin{ccnusyntax}[emph={[1]fig-pos}] + fig-pos = (*\meta{postion}*) + \end{ccnusyntax} + 图片相对于文本的方位。方位可选参数见下列表,默认为 \opt{right} +\end{function} +\begin{itemize} + \item \opt{top}:图片在文本上方 + \item \opt{bottom}:图片在文本下方 + \item \opt{left}:图片在文本左边,垂直中心对齐 + \item \opt{right}:图片在文本右边,垂直中心对齐 + \item \opt{top-left}:图片在文本的左上方 + \item \opt{top-center}:图片在文本的上方,位于整行的水平中心 + \item \opt{top-right}:图片在文本的右上方 + \item \opt{top-flushright}:图片在文本的右上方,位于水平末端 + \item \opt{bottom-left}:图片在文本的左下方 + \item \opt{bottom-center}:图片在文本的下方,位于整行的水平中心 + \item \opt{bottom-right}:图片在文本的右下方 + \item \opt{bottom-flushright}:图片在文本的右下方,位于水平末端 + \item \opt{left-top}:图片在文本左边,顶部对齐 + \item \opt{left-center}:等价于 \opt{left} + \item \opt{left-bottom}:图片在文本左边,底部对齐 + \item \opt{right-top}:图片在文本右边边,顶部对齐 + \item \opt{right-center}:等价于 \opt{right} + \item \opt{right-bottom}:图片在文本右边,底部对齐 +\end{itemize} + + +\begin{function}[added = 2022-08-28]{textfigure/xshift,textfigure/hshift,textfigure/yshift,textfigure/vshift} + \begin{ccnusyntax}[emph={[1]xshift,hshift,yshift,vshift}] + xshift = (*\meta{dimension}*) + hshift = (*\meta{dimension}*) + yshift = (*\meta{dimension}*) + vshift = (*\meta{dimension}*) + \end{ccnusyntax} + 图片和文本整体的水平和垂直的偏移量。\opt{xshift} 和 \opt{hshift} 同义,表示水平;\opt{yshift} 和 \opt{vshift} 同义,表示垂直。\opt{yshift} 的默认值为 |.5\baselineskip|。 +\end{function} + +\begin{function}[added = 2022-08-28]{textfigure/figure-xshift,textfigure/figure-hshift,textfigure/figure-yshift,textfigure/figure-vshift} + \begin{ccnusyntax}[emph={[1]xshift,hshift,yshift,vshift}] + figure-xshift = (*\meta{dimension}*) + figure-hshift = (*\meta{dimension}*) + figure-yshift = (*\meta{dimension}*) + figure-vshift = (*\meta{dimension}*) + \end{ccnusyntax} + 图片相对于文本的水平和垂直的偏移量。\opt{figure-xshift} 和 \opt{figure-hshift} 同义,表示水平;\opt{figure-yshift} 和 \opt{figure-vshift} 同义,表示垂直。 +\end{function} + + +\begin{function}[added = 2022-08-28]{textfigure/top-sep} + \begin{ccnusyntax}[emph={[1]top-sep}] + top-sep = (*\meta{dimension}*) + \end{ccnusyntax} + \tn{textfigure} 命令上方弹性间距。默认为 |0pt|。 +\end{function} + +\begin{function}[added = 2022-08-28]{textfigure/bottom-sep} + \begin{ccnusyntax}[emph={[1]bottom-sep}] + bottom-sep = (*\meta{dimension}*) + \end{ccnusyntax} + \tn{textfigure} 命令下方弹性间距。默认为 |1.5ex plus .5ex minus 0.5ex|。 +\end{function} + +\begin{function}[added = 2022-08-28]{textfigure/text-width} + \begin{ccnusyntax}[emph={[1]text-width}] + text-width = (*\meta{dimension}*) + \end{ccnusyntax} + 文本部分的 \env{varwidth} 宽度。默认为 |\columnwidth|。但有时需要手动输入 \kvopt{text-width}{\textbackslash columnwidth} 才会变成整行,比如解答题。 +\end{function} + +\begin{function}[added = 2022-08-28]{textfigure/figure-width} + \begin{ccnusyntax}[emph={[1]figure-width}] + figure-width = (*\meta{dimension}*) + \end{ccnusyntax} + 图片部分的 \env{varwidth} 宽度。默认为 |\columnwidth|。 +\end{function} + +\begin{function}[added = 2022-08-28]{textfigure/ratio,textfigure/text-ratio} + \begin{ccnusyntax}[emph={[1]ratio,text-ratio}] + ratio = (*\meta{比例}*) + text-ratio = (*\meta{比例}*) + \end{ccnusyntax} + 图片部分占比。默认为 |0.95|。有时 |1| 的效果并不是整行,这主要和使用了 \env{varwidth} 环境有关,此时建议改 \opt{text-width}。 +\end{function} + +\begin{function}[added = 2022-08-28]{textfigure/top} + \begin{ccnusyntax}[emph={[1]top}] + top = (*\meta{integer}*) + \end{ccnusyntax} + \kvopt{fig-pos}{left-top} 时,图片顶部从文本的第几行开始排,效果和 \pkg{wrapstuff} 宏包的 \opt{top} 键值效果类似。 \end{function}
\ No newline at end of file diff --git a/macros/xetex/latex/exam-zh/doc/exam-zh-doc-setup.tex b/macros/xetex/latex/exam-zh/doc/exam-zh-doc-setup.tex index d6aa6a6a0b..e0a12cc402 100644 --- a/macros/xetex/latex/exam-zh/doc/exam-zh-doc-setup.tex +++ b/macros/xetex/latex/exam-zh/doc/exam-zh-doc-setup.tex @@ -6,6 +6,7 @@ \usepackage{../exam-zh-question} \usepackage{../exam-zh-symbols} \usepackage{../exam-zh-chinese-english} +\usepackage{../exam-zh-textfigure} \ExplSyntaxOn \NewDocumentCommand \examsetup { m } @@ -32,9 +33,9 @@ \title{\textcolor{MaterialIndigo800}{% \textbf{exam-zh: 高考试卷 \LaTeX \xpinyin[font=\sffamily,format=\color{MaterialIndigo800}]{模}{mu2}板}}} \author{李泽平,夏康玮,郭李军} -\date{2022/08/15\quad v0.1.18% +\date{2022/08/28\quad v0.1.19% \thanks{% - \url{https://gitee.com/zepinglee/exam-zh} + \url{https://gitee.com/xkwxdyy/exam-zh} } } @@ -61,4 +62,11 @@ \rule[-0.7em]{0pt}{2em} \\\hline \end{tabular} } -\ExplSyntaxOff
\ No newline at end of file +\ExplSyntaxOff + +\AddToHook{env/latexexample/after} + {% + \examsetup{ + question/index=1 + } + }
\ No newline at end of file diff --git a/macros/xetex/latex/exam-zh/doc/exam-zh-doc.pdf b/macros/xetex/latex/exam-zh/doc/exam-zh-doc.pdf Binary files differindex f4ee4463f3..b3732b8ebc 100644 --- a/macros/xetex/latex/exam-zh/doc/exam-zh-doc.pdf +++ b/macros/xetex/latex/exam-zh/doc/exam-zh-doc.pdf diff --git a/macros/xetex/latex/exam-zh/examples/example-multiple.pdf b/macros/xetex/latex/exam-zh/examples/example-multiple.pdf Binary files differindex 7e2e1ca87e..917fbee430 100644 --- a/macros/xetex/latex/exam-zh/examples/example-multiple.pdf +++ b/macros/xetex/latex/exam-zh/examples/example-multiple.pdf diff --git a/macros/xetex/latex/exam-zh/examples/example-multiple.tex b/macros/xetex/latex/exam-zh/examples/example-multiple.tex index 0a134480a6..94c5471205 100644 --- a/macros/xetex/latex/exam-zh/examples/example-multiple.tex +++ b/macros/xetex/latex/exam-zh/examples/example-multiple.tex @@ -316,14 +316,18 @@ % 20. \begin{problem}[points = 12] - 如图,在三棱锥 $A$-$BCD$ 中,$\text{平面} ABD \perp \text{平面} BCD$, - $AB = AD$,$O$ 为 $BD$ 的重点。 - \begin{enumerate} - \item 证明:$OA \perp CD$; - \item 若 $\triangle OCD$ 是变长为 $1$ 的等边三角形,点 $E$ 在棱 $AD$ 上, - $DE = 2 EA$,且二面角 $E$-$BC$-$D$ 的大小为 \ang{45}, - 求三棱锥 $A$-$BCD$ 的体积。 - \end{enumerate} + \textfigure[text-width=\columnwidth, fig-pos=bottom-flushright]{ + 如图,在三棱锥 $A$-$BCD$ 中,$\text{平面} ABD \perp \text{平面} BCD$, + $AB = AD$,$O$ 为 $BD$ 的重点。 + \begin{enumerate} + \item 证明:$OA \perp CD$; + \item 若 $\triangle OCD$ 是变长为 $1$ 的等边三角形,点 $E$ 在棱 $AD$ 上, + $DE = 2 EA$,且二面角 $E$-$BC$-$D$ 的大小为 \ang{45}, + 求三棱锥 $A$-$BCD$ 的体积。 + \end{enumerate} + }{ + \includegraphics[width=5cm]{example-image.png} + } \end{problem} % 21. diff --git a/macros/xetex/latex/exam-zh/examples/example-single.pdf b/macros/xetex/latex/exam-zh/examples/example-single.pdf Binary files differindex d70946bd46..358ed54196 100644 --- a/macros/xetex/latex/exam-zh/examples/example-single.pdf +++ b/macros/xetex/latex/exam-zh/examples/example-single.pdf diff --git a/macros/xetex/latex/exam-zh/examples/example-single.tex b/macros/xetex/latex/exam-zh/examples/example-single.tex index 89c04bf74d..d70cb9ae92 100644 --- a/macros/xetex/latex/exam-zh/examples/example-single.tex +++ b/macros/xetex/latex/exam-zh/examples/example-single.tex @@ -294,14 +294,18 @@ % 20. \begin{problem}[points = 12] - 如图,在三棱锥 $A$-$BCD$ 中,$\text{平面} ABD \perp \text{平面} BCD$, - $AB = AD$,$O$ 为 $BD$ 的重点。 - \begin{enumerate} - \item 证明:$OA \perp CD$; - \item 若 $\triangle OCD$ 是变长为 $1$ 的等边三角形,点 $E$ 在棱 $AD$ 上, - $DE = 2 EA$,且二面角 $E$-$BC$-$D$ 的大小为 \ang{45}, - 求三棱锥 $A$-$BCD$ 的体积。 - \end{enumerate} + \textfigure{ + 如图,在三棱锥 $A$-$BCD$ 中,$\text{平面} ABD \perp \text{平面} BCD$, + $AB = AD$,$O$ 为 $BD$ 的重点。 + \begin{enumerate} + \item 证明:$OA \perp CD$; + \item 若 $\triangle OCD$ 是变长为 $1$ 的等边三角形,点 $E$ 在棱 $AD$ 上, + $DE = 2 EA$,且二面角 $E$-$BC$-$D$ 的大小为 \ang{45}, + 求三棱锥 $A$-$BCD$ 的体积。 + \end{enumerate} + }{ + \includegraphics[width=3cm]{example-image.png} + } \end{problem} % 21. diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh-chinese-english.sty b/macros/xetex/latex/exam-zh/tex/exam-zh-chinese-english.sty index b2d1d39baf..eefffdac7d 100644 --- a/macros/xetex/latex/exam-zh/tex/exam-zh-chinese-english.sty +++ b/macros/xetex/latex/exam-zh/tex/exam-zh-chinese-english.sty @@ -1,14 +1,14 @@ % % Copyright (c) 2022 Kangwei Xia, Lijun Guo % Released under the LaTeX Project Public License v1.3c License. -% Repository: https://gitee.com/zepinglee/exam-zh +% Repository: https://gitee.com/xkwxdyy/exam-zh % \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\ProvidesExplPackage {exam-zh-chinese-english} {2022-08-15} {v0.1.18} +\ProvidesExplPackage {exam-zh-chinese-english} {2022-08-28} {v0.1.19} {exam-zh chinese and english module} \PassOptionsToPackage { tcolorbox } { most } diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh-choices.sty b/macros/xetex/latex/exam-zh/tex/exam-zh-choices.sty index ef7c39ba88..05f66871c3 100644 --- a/macros/xetex/latex/exam-zh/tex/exam-zh-choices.sty +++ b/macros/xetex/latex/exam-zh/tex/exam-zh-choices.sty @@ -9,7 +9,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} -\ProvidesExplPackage {exam-zh-choices} {2022-08-15} {v0.1.18} +\ProvidesExplPackage {exam-zh-choices} {2022-08-28} {v0.1.19} {exam-zh choices module} \dim_new:N \l__examzh_choices_column_sep_dim @@ -36,7 +36,13 @@ label-sep .dim_set:N = \l__examzh_choices_label_sep_dim , label-width .dim_set:N = \l__examzh_choices_label_width_dim , max-columns .int_set:N = \l__examzh_choices_max_columns_int , - index .int_set:N = \l__examzh_choices_item_index_int + index .int_set:N = \l__examzh_choices_item_index_int, + % 环境上方的额外距离 + top-sep .skip_set:N = \l__examzh_choices_top_sep_skip, + % 环境下方的额外距离 + bottom-sep .skip_set:N = \l__examzh_choices_bottom_sep_skip, + % 若不是单行排版,则可以控制行之间的额外间距 + linesep .skip_set:N = \l__examzh_choices_line_sep_skip } \keys_set:nn { exam-zh / choices } @@ -45,11 +51,14 @@ columns = 0 , label = \Alph*. , label-pos = auto , - label-align = right , + label-align = left , label-sep = .5em , label-width = 0pt , max-columns = 4 , index = 1, + top-sep = 0pt, + bottom-sep = 0pt, + linesep = 0pt plus .5ex } \NewDocumentCommand \setchoices { m } @@ -83,17 +92,19 @@ \NewDocumentEnvironment { choices } { O { } +b } { + \keys_set:nn { exam-zh / choices } {#1} \par \nopagebreak % 严格禁止孤行和寡行 \int_set:Nn \clubpenalty { 10000 } \int_set:Nn \widowpenalty { 10000 } % 尽量避免在选项中间换行 \int_set:Nn \interlinepenalty { 301 } + \vspace* { \l__examzh_choices_top_sep_skip } \noindent - \dim_set_eq:NN \l__examzh_choices_total_width_dim \linewidth + % \dim_set_eq:NN \l__examzh_choices_total_width_dim \linewidth + \dim_set:Nn \l__examzh_choices_total_width_dim { \linewidth - \leftskip - \rightskip } \int_zero:N \l__examzh_choices_columns_int \dim_zero:N \l__examzh_choices_label_width_dim - \keys_set:nn { exam-zh / choices } {#1} } { % 用 \item 分割选项 @@ -119,6 +130,7 @@ \__examzh_print_choices:N \l__examzh_choices_seq % 输出正确选项 \__examzh_print_correctchoice: + \vspace* { \l__examzh_choices_bottom_sep_skip } } % 用来存正确选项的序号(entry) @@ -368,7 +380,9 @@ { \l__examzh_choices_current_col_int } > { \l__examzh_choices_columns_int } { % \par \noindent - \newline + \\[ \l__examzh_choices_line_sep_skip ] + % \newline + % \skip_vertical:N \l__examzh_choices_line_sep_skip \int_set:Nn \l__examzh_choices_current_col_int {1} } % TODO 为什么 > 1 才加呢? 这样的话第 1 列和第 2 列之间就没有这个间距? @@ -386,52 +400,116 @@ \coffin_new:N \l__examzh_choices_item_coffin \coffin_new:N \l__examzh_choices_label_coffin - +% \box_new:N \l__examzh_choices_item_box +% \box_new:N \l__examzh_choices_label_box \cs_new:Npn \__examzh_print_single_choice:nn #1#2 { % 选项标签 \__examzh_choices_make_label_coffin:n {#1} + % \__examzh_choices_make_label_box:n {#1} % 选项内容 \__examzh_choices_make_item_coffin:n {#2} + % \__examzh_choices_make_item_box:n {#2} % 合并选项的标签和内容 \str_case:Vn \l__examzh_choices_label_pos_tl { { top-left } { \coffin_join:NnnNnnnn - \l__examzh_choices_item_coffin {l} {H} \l__examzh_choices_label_coffin {r} {H} - { - \l__examzh_choices_label_sep_dim } + \l__examzh_choices_item_coffin {l} {H} + { \l__examzh_choices_label_sep_dim } { 0pt } + % \hbox_set:Nn \l__examzh_choices_item_box + % { + % \box_use_drop:N \l__examzh_choices_label_box + % \kern \l__examzh_choices_label_sep_dim + % \box_use_drop:N \l__examzh_choices_item_box + % } } { left } { \coffin_join:NnnNnnnn - \l__examzh_choices_item_coffin {l} {vc} \l__examzh_choices_label_coffin {r} {vc} - { - \l__examzh_choices_label_sep_dim } + \l__examzh_choices_item_coffin {l} {vc} + { \l__examzh_choices_label_sep_dim } { 0pt } + % \hbox_set:Nn \l__examzh_choices_item_box + % { + % \box_move_down:nn + % { + % ( + % \box_ht:N \l__examzh_choices_label_box - + % \box_dp:N \l__examzh_choices_label_box - + % \box_ht:N \l__examzh_choices_item_box + + % \box_dp:N \l__examzh_choices_item_box + % ) / 2 + % } + % { \box_use_drop:N \l__examzh_choices_label_box } + % \kern \l__examzh_choices_label_sep_dim + % \box_use_drop:N \l__examzh_choices_item_box + % } } { bottom } { \coffin_join:NnnNnnnn - \l__examzh_choices_item_coffin {hc} {b} \l__examzh_choices_label_coffin {hc} {t} + \l__examzh_choices_item_coffin {hc} {b} { 0pt } % { - \l__examzh_choices_label_sep_dim } { 0pt } + % \hbox_set:Nn \l__examzh_choices_item_box + % { + % % \vbox_top:n + % % { + % % \box_use:N \l__examzh_choices_item_box + % % \nointerlineskip + % % % \kern \l__examzh_choices_label_sep_dim + % % \box_move_left:nn + % % { + % % ( + % % \box_wd:N \l__examzh_choices_label_box - + % % \box_wd:N \l__examzh_choices_item_box + % % ) / 2 + % % } + % % { \box_use_drop:N \l__examzh_choices_label_box } + % % \box_clear:N \l__examzh_choices_item_box + % % } + % \hbox_set:Nn \l__examzh_choices_item_box + % { + % \box_use:N \l__examzh_choices_item_box + % \kern \dim_eval:n + % { + % ( - \box_wd:N \l__examzh_choices_label_box + % - \box_wd:N \l__examzh_choices_item_box ) / 2 + % } + % \box_move_down:nn + % { + % \box_ht:N \l__examzh_choices_label_box + + % \box_dp:N \l__examzh_choices_item_box + % % + \l__examzh_choices_label_sep_dim + % } + % { \box_use_drop:N \l__examzh_choices_label_box } + % \box_clear:N \l__examzh_choices_item_box + % } + % } } } % 输出合并后 - \coffin_typeset:Nnnnn \l__examzh_choices_item_coffin {l} {H} {0pt} {0pt} + % \coffin_typeset:Nnnnn \l__examzh_choices_item_coffin {l} {H} {0pt} {0pt} + \coffin_typeset:Nnnnn \l__examzh_choices_label_coffin {l} {H} {0pt} {0pt} \coffin_clear:N \l__examzh_choices_item_coffin \coffin_clear:N \l__examzh_choices_label_coffin + % \box_use_drop:N \l__examzh_choices_item_box } % 将标签内容存入 coffin \cs_new:Npn \__examzh_choices_make_label_coffin:n #1 +% 将标签内容存入 box +% \cs_new:Npn \__examzh_choices_make_label_box:n #1 { \hcoffin_set:Nn \l__examzh_choices_label_coffin + % \hbox_set:Nn \l__examzh_choices_label_box { \hbox_to_wd:nn { \l__examzh_choices_label_width_dim } { \__examzh_choices_make_label:n {#1} \strut } @@ -452,10 +530,13 @@ % 将选项内容存入 coffin \cs_new:Npn \__examzh_choices_make_item_coffin:n #1 +% 将选项内容存入 box +% \cs_new:Npn \__examzh_choices_make_item_box:n #1 { \hcoffin_set:Nn \l__examzh_choices_item_coffin + % \hbox_set:Nn \l__examzh_choices_item_box { - % 优先尝试使用 hbox,这是因为在 \vcoffin_set 外部能保留原来的 \linewidth 和 + % 优先尝试使用 hbox,这是因为在 \vbox_set 外部能保留原来的 \linewidth 和 % \textwidth,方便用户在 \includegraphics 中使用 \hbox_set:Nn \l_tmpa_box {#1} % 若盒子的自然高度大于 2 行,且深度为 0pt,设置为插图模式 @@ -468,9 +549,17 @@ { \bool_set_true:N \l__examzh_choices_figure_mode_bool } \vcoffin_set:Nnn \l_tmpa_coffin { \l__examzh_choices_item_width_dim } + % \vbox_set:Nn \l_tmpa_box { + % \dim_set_eq:NN \parskip \c_zero_dim + % \dim_set_eq:NN \parindent \listparindent + \dim_set_eq:NN \hsize \l__examzh_choices_item_width_dim + \dim_set_eq:NN \linewidth \hsize + \dim_set_eq:NN \columnwidth \hsize \dim_set_eq:NN \parskip \c_zero_dim \dim_set_eq:NN \parindent \listparindent + \dim_set:Nn \leftskip { 0pt } + \dim_set:Nn \rightskip { 0pt } \noindent % \strut % 若标签在底部,将图片居中对齐。 @@ -485,9 +574,15 @@ } \dim_set:Nn \l_tmpa_dim { \coffin_ht:N \l_tmpa_coffin } \bool_if:NT \l__examzh_choices_figure_mode_bool + % \dim_set:Nn \l_tmpa_dim { \box_ht:N \l_tmpa_box } + % \bool_if:NTF \l__examzh_choices_figure_mode_bool + % { + % \box_move_up:nn { \l_tmpa_dim - 0.7 \baselineskip } { \box_use_drop:N \l_tmpa_box } + % } { \coffin_set_horizontal_pole:Nnn \l_tmpa_coffin {T} { \l_tmpa_dim - 0.7 \baselineskip } + % \vbox_top:n { \vbox_unpack_drop:N \l_tmpa_box } } \coffin_typeset:Nnnnn \l_tmpa_coffin {l} {T} {0pt} {0pt} \coffin_clear:N \l_tmpa_coffin diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh-font.sty b/macros/xetex/latex/exam-zh/tex/exam-zh-font.sty index cda4062101..76f943de1d 100644 --- a/macros/xetex/latex/exam-zh/tex/exam-zh-font.sty +++ b/macros/xetex/latex/exam-zh/tex/exam-zh-font.sty @@ -1,7 +1,7 @@ % % Copyright (c) 2022 Zeping Lee and AlphaZTX % Released under the LaTeX Project Public License v1.3c License. -% Repository: https://gitee.com/zepinglee/exam-zh +% Repository: https://gitee.com/xkwxdyy/exam-zh % \NeedsTeXFormat{LaTeX2e} @@ -9,7 +9,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} -\ProvidesExplPackage {exam-zh-font} {2022-08-15} {v0.1.18} +\ProvidesExplPackage {exam-zh-font} {2022-08-28} {v0.1.19} {exam-zh font module} \RequirePackage { unicode-math } @@ -456,7 +456,7 @@ \setmathfont { \g__examzh_font_font_name_stix_math_tl } [ Extension = .otf, - range = { \complement } , + range = { \complement, \bigstar } , ] \setmathrm { NewCM10 } [ @@ -495,7 +495,7 @@ \setmathfont { \g__examzh_font_font_name_stix_math_tl } [ Extension = .otf, - range = { \complement } , + range = { \complement, \bigstar } , ] \setmathrm { lmroman10 } [ @@ -600,7 +600,7 @@ \setmathfont { \g__examzh_font_font_name_stix_math_tl } [ Extension = .otf, - range = { \complement } , + range = { \complement, \bigstar } , ] \message { @@ -638,7 +638,7 @@ \setmathfont { \g__examzh_font_font_name_stix_math_tl } [ Extension = .otf, - range = { \complement } , + range = { \complement, \bigstar } , ] } diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh-question.sty b/macros/xetex/latex/exam-zh/tex/exam-zh-question.sty index 7cf7524e08..9afcba5f7b 100644 --- a/macros/xetex/latex/exam-zh/tex/exam-zh-question.sty +++ b/macros/xetex/latex/exam-zh/tex/exam-zh-question.sty @@ -1,7 +1,7 @@ % % Copyright (c) 2022 Zeping Lee % Released under the LaTeX Project Public License v1.3c License. -% Repository: https://gitee.com/zepinglee/exam-zh +% Repository: https://gitee.com/xkwxdyy/exam-zh % \NeedsTeXFormat{LaTeX2e} @@ -9,7 +9,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} -\ProvidesExplPackage {exam-zh-question} {2022-08-15} {v0.1.18} +\ProvidesExplPackage {exam-zh-question} {2022-08-28} {v0.1.19} {exam-zh question module} @@ -755,6 +755,7 @@ { \bool_set_true:N \l__examzh_fillin_paren_banjiao_bool }, paren-type / quanjiao .code:n = { \bool_set_false:N \l__examzh_fillin_paren_banjiao_bool }, + depth .dim_set:N = \l__examzh_fillin_line_depth_dim } \keys_set:nn { exam-zh / fillin } { @@ -767,7 +768,8 @@ no-answer-counter-index = 1, no-answer-counter-label = \arabic*, paren-type = banjiao, - width-type = fill, + width-type = normal, + depth = 0.4em } \keys_define:nn { exam-zh } @@ -801,7 +803,9 @@ } { % 不显示答案 - \__examzh_fillin_no_answer_typeset: + \IfBooleanTF {#1} + { \__examzh_fillin_no_answer_breakble_typeset: } + { \__examzh_fillin_no_answer_unbreakble_typeset: } } } { @@ -821,7 +825,9 @@ } { % 不显示答案 - \__examzh_fillin_no_answer_typeset: + \IfBooleanTF {#1} + { \__examzh_fillin_no_answer_breakble_typeset: } + { \__examzh_fillin_no_answer_unbreakble_typeset: } } } \group_end: @@ -832,13 +838,26 @@ There~is~no~such~noanswertype~named~#1!\\ Please~read~the~manual~carefully! } -\cs_new:Npn \__examzh_fillin_no_answer_typeset: +\cs_new:Npn \__examzh_fillin_no_answer_unbreakble_typeset: + { + \str_case:VnF \l__examzh_fillin_no_answer_type_str + { + { blacktriangle } { \__examzh_fillin_no_answer_typeset_blacktriangle: } + { counter } { \__examzh_fillin_no_answer_typeset_counter: } + { none } { \__examzh_fillin_output_unbreakable_F: } + } + { + \msg_error:nnx { exam-zh / fillin } { no-such-noanswertype } + { \l__examzh_fillin_no_answer_type_str } + } + } +\cs_new:Npn \__examzh_fillin_no_answer_breakble_typeset: { \str_case:VnF \l__examzh_fillin_no_answer_type_str { { blacktriangle } { \__examzh_fillin_no_answer_typeset_blacktriangle: } { counter } { \__examzh_fillin_no_answer_typeset_counter: } - { none } { \__examzh_fillin_no_answer_typeset_none: } + { none } { \__examzh_fillin_output_breakable_F: } } { \msg_error:nnx { exam-zh / fillin } { no-such-noanswertype } @@ -856,10 +875,6 @@ { \__examzh_fillin_the_label: } % { \int_eval:n { \g__examzh_fillin_no_answer_counter_int - 1 } } } -\cs_new:Npn \__examzh_fillin_no_answer_typeset_none: - { - \__examzh_fillin_output_F: - } \cs_new:Npn \__examzh_fillin_without_judge:n #1 { % \ULdepth 是 \uline 的下划线的深度 @@ -887,7 +902,7 @@ \__examzh_fillin_output_T: } { - \__examzh_fillin_output_F: + \__examzh_fillin_output_unbreakable_F: } } \cs_new:Npn \__examzh_fillin_breakline:n #1 @@ -900,7 +915,7 @@ \__examzh_fillin_output_breakline_T: } { - \__examzh_fillin_output_F: + \__examzh_fillin_output_breakable_F: } } \msg_new:nnn { exam-zh } { no-fillin-type } @@ -940,14 +955,29 @@ { The~type~:~#1~ cannot~be~used~in~breakable~fillin~cmd. } -\cs_new:Npn \__examzh_fillin_output_F: +\cs_new:Npn \__examzh_fillin_output_breakable_F: + { + \str_case:VnF \l__examzh_fillin_type_str + { + { line } { \__examzh_fillin_uline_breakable_F: } + { paren } { \__examzh_fillin_paren_breakable_F: } + { circle } { \__examzh_fillin_circle_F: } + { blank } { \__examzh_fillin_blank_breakable_F: } + { rectangle } { \__examzh_fillin_rectangle_F: } + } + { + \msg_error:nnx { exam-zh } { no-fillin-type } + { \l__examzh_fillin_type_str } + } + } +\cs_new:Npn \__examzh_fillin_output_unbreakable_F: { \str_case:VnF \l__examzh_fillin_type_str { - { line } { \__examzh_fillin_uline_F: } - { paren } { \__examzh_fillin_paren_F: } + { line } { \__examzh_fillin_uline_unbreakable_F: } + { paren } { \__examzh_fillin_paren_unbreakable_F: } { circle } { \__examzh_fillin_circle_F: } - { blank } { \__examzh_fillin_blank_F: } + { blank } { \__examzh_fillin_blank_unbreakable_F: } { rectangle } { \__examzh_fillin_rectangle_F: } } { @@ -957,7 +987,9 @@ } \cs_new:Npn \__examzh_fillin_uline_T: { - \uline + % \uline + \CJKunderline* + [ depth = \l__examzh_fillin_line_depth_dim ] { \hspace* { 0.5em plus .5em minus .5em } \dim_compare:nNnTF { \l__examzh_question_answer_depth_dim } > { 0.2em } @@ -970,11 +1002,18 @@ \hspace* { 0.5em plus .5em minus .5em } } } -\cs_new:Npn \__examzh_fillin_uline_F: +\cs_new:Npn \__examzh_fillin_uline_breakable_F: { % \uline { \hspace* { \l__examzh_fillin_F_width_dim } } \__examzh_fillin_breakable_hspace:NN \CJKunderline \allowbreak } +\cs_new:Npn \__examzh_fillin_uline_unbreakable_F: + { + \unskip + \hspace* { 0.5em plus .5em minus .5em } + \uline { \hspace* { \l__examzh_fillin_F_width_dim } } + \ignorespaces + } % \cs_new:Nn \__examzh_fillin_uline: % { % \bgroup @@ -1006,6 +1045,7 @@ \cs_new:Npn \__examzh_fillin_uline_breakline_T: { \CJKunderline* + [ depth = \l__examzh_fillin_line_depth_dim ] % \uline % \__examzh_fillin_uline: { @@ -1018,6 +1058,7 @@ } \cs_new:Npn \__examzh_fillin_paren_T: { + \unskip \bool_if:NTF \l__examzh_fillin_paren_banjiao_bool { ( @@ -1037,9 +1078,11 @@ \hspace* { 0.5em plus .5em minus .5em } ) } + \ignorespaces } \cs_new:Npn \__examzh_fillin_paren_breakline_T: { + \unskip \bool_if:NTF \l__examzh_fillin_paren_banjiao_bool { ( @@ -1059,6 +1102,7 @@ \hspace* { 0.5em plus .5em minus .5em } ) } + \ignorespaces } \box_new:N \c__examzh_banjiao_right_brace_box \box_new:N \c__examzh_quanjiao_right_brace_box @@ -1068,8 +1112,10 @@ { \box_wd:N \c__examzh_banjiao_right_brace_box } \dim_const:Nn \c__examzh_quanjiao_right_brace_width_dim % ( { \box_wd:N \c__examzh_quanjiao_right_brace_box } -\cs_new:Npn \__examzh_fillin_paren_F: +\cs_new:Npn \__examzh_fillin_paren_breakable_F: { + \unskip + \hspace* { 0.5em plus .5em minus .5em } \bool_if:NTF \l__examzh_fillin_paren_banjiao_bool { ( \__examzh_fillin_breakable_hspace:NN \use:n \nobreak \kern-\c__examzh_banjiao_right_brace_width_dim ) \allowbreak @@ -1077,28 +1123,49 @@ { ( \__examzh_fillin_breakable_hspace:NN \use:n \nobreak \kern-\c__examzh_quanjiao_right_brace_width_dim )\allowbreak } + \ignorespaces + } +\cs_new:Npn \__examzh_fillin_paren_unbreakable_F: + { + \unskip + \hspace* { 0.5em plus .5em minus .5em } + \bool_if:NTF \l__examzh_fillin_paren_banjiao_bool + { + ( \hspace* { \l__examzh_fillin_F_width_dim } ) + } + { + ( \hspace* { \l__examzh_fillin_F_width_dim } ) + } + \ignorespaces } \cs_new:Npn \__examzh_fillin_blank_T: { + \unskip \hspace* { 0.5em plus .5em minus .5em } \group_begin: \box_use_drop:N \l_tmpa_box \group_end: - \hspace* { 0.5em plus .5em minus .5em } + \ignorespaces } \cs_new:Npn \__examzh_fillin_blank_breakline_T: { + \unskip \hspace* { 0.5em plus .5em minus .5em } \group_begin: \l_tmpa_tl \group_end: - \hspace* { 0.5em plus .5em minus .5em } + \ignorespaces } -\cs_new:Npn \__examzh_fillin_blank_F: +\cs_new:Npn \__examzh_fillin_blank_breakble_F: { % \hspace* { \l__examzh_fillin_F_width_dim } \__examzh_fillin_breakable_hspace:NN \use:n \allowbreak } +\cs_new:Npn \__examzh_fillin_blank_unbreakble_F: + { + \hspace* { \l__examzh_fillin_F_width_dim } + % \__examzh_fillin_breakable_hspace:NN \use:n \allowbreak + } \tikzset { fillin-circle/.style = @@ -1235,6 +1302,7 @@ \keys_define:nn { exam-zh / solution } { show-solution .bool_set:N = \l__examzh_solution_show_bool, + show-answer .bool_set:N = \l__examzh_solution_show_bool, show-qed .bool_set:N = \l__examzh_solution_show_qed_bool, qedsymbol .tl_set:N = \l__examzh_solution_qedsymbol_tl, label-content .tl_set:N = \l__examzh_solution_label_content_tl, diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh-symbols.sty b/macros/xetex/latex/exam-zh/tex/exam-zh-symbols.sty index 2b0490284d..37115aa5a8 100644 --- a/macros/xetex/latex/exam-zh/tex/exam-zh-symbols.sty +++ b/macros/xetex/latex/exam-zh/tex/exam-zh-symbols.sty @@ -1,14 +1,14 @@ % % Copyright (c) 2022 Kangwei Xia % Released under the LaTeX Project Public License v1.3c License. -% Repository: https://gitee.com/zepinglee/exam-zh +% Repository: https://gitee.com/xkwxdyy/exam-zh % \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\ProvidesExplPackage {exam-zh-symbols} {2022-08-15} {v0.1.18} +\ProvidesExplPackage {exam-zh-symbols} {2022-08-28} {v0.1.19} {exam-zh symbols module} \RequirePackage { tikz } diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh-textfigure.sty b/macros/xetex/latex/exam-zh/tex/exam-zh-textfigure.sty new file mode 100644 index 0000000000..77a98eb0ba --- /dev/null +++ b/macros/xetex/latex/exam-zh/tex/exam-zh-textfigure.sty @@ -0,0 +1,651 @@ +% +% Copyright (c) 2022 Kangwei Xia +% Released under the LaTeX Project Public License v1.3c License. +% Repository: https://gitee.com/xkwxdyy/exam-zh +% +\NeedsTeXFormat{LaTeX2e} + +\RequirePackage{expl3} + +\ProvidesExplPackage {exam-zh-textfigure} {2022-08-28} {v0.1.19} + {exam-zh text with figure module} + +\RequirePackage { wrapstuff } +\RequirePackage { tabularray } +\RequirePackage { varwidth } +\RequirePackage { graphicx } +\RequirePackage { filehook } + +\AtEndOfPackageFile* { exam-zh-choices } + { + \AddToHook { env / choices / before } + { \wrapstuffclear } + } + +%% multifigures 环境,排版多张图片 %% + +% \begin{multifigures} +% \item[题 9 图:勾股数] \includegraphics[width=3cm]{example-image.png} +% \item[题 11 图:圆锥曲线] \includegraphics[width=3cm]{example-image.png} +% \end{multifigures} + +% 图片相对于 label 的方位 +\str_new:N \l__examzh_multifigures_figure_position_str +% coffin type 的对齐方式 +\str_new:N \l__examzh_multifigures_coffin_align_str + + +\keys_define:nn { exam-zh / multifigures } + { + % 每行多少个(等价于有多少列) + columns .int_set:N = \l__examzh_multifigures_column_int, + % 图片相对于文字的位置(上下左右) + fig-pos .choices:nn = + { top, above, bottom, below, left, right } + { \str_set:Nx \l__examzh_multifigures_figure_position_str { \l_keys_choice_tl } }, + % 环境上方的额外距离 + top-sep .skip_set:N = \l__examzh_multifigures_top_sep_skip, + % 环境下方的额外距离 + bottom-sep .skip_set:N = \l__examzh_multifigures_bottom_sep_skip, + % 整体的偏移量 + xshift .dim_set:N = \l__examzh_multifigures_xshift_dim, + hshift .dim_set:N = \l__examzh_multifigures_xshift_dim, + yshift .dim_set:N = \l__examzh_multifigures_yshift_dim, + vshift .dim_set:N = \l__examzh_multifigures_yshift_dim, + % label 的偏移量 + label-xshift .dim_set:N = \l__examzh_multifigures_label_xshift_dim, + label-hshift .dim_set:N = \l__examzh_multifigures_label_xshift_dim, + label-yshift .dim_set:N = \l__examzh_multifigures_label_yshift_dim, + label-vshift .dim_set:N = \l__examzh_multifigures_label_yshift_dim, + % 对齐方式 + align .choices:nn = + { t, m, b } + { \str_set:Nx \l__examzh_multifigures_coffin_align_str { \l_keys_choice_tl } } + } +\keys_set:nn { exam-zh / multifigures } + { + columns = 3, + fig-pos = above, + label-xshift = 0pt, + label-yshift = 0pt, + align = b, + top-sep = 1ex plus .5ex minus .5ex, + bottom-sep = 0pt, + } + +% item 的 index 指标(即第几个 item) +\int_new:N \l__examzh_multifigures_item_index_int +% 将拼接后的 coffin 存到 seq 里 +\seq_new:N \l__examzh_multifigures_store_seq +% 上面的 seq 的 item 数 +\int_new:N \l__examzh_multifigures_store_seq_item_int +% 最终放在 tblr 里的内容 +\tl_new:N \l__examzh_multifigures_tblr_content_tl + +\NewDocumentEnvironment { multifigures } { O{ } +O{ } } + { + \group_begin: + \RenewDocumentCommand \item { O{ } } + { \__examzh_multifigures_item:n {##1} } + \int_set:Nn \l__examzh_multifigures_item_index_int {0} + \seq_clear:N \l__examzh_multifigures_store_seq + \tl_clear:N \l__examzh_multifigures_tblr_content_tl + \keys_set:nn { exam-zh / multifigures } {#1} + } + { + % 结束收集 + \unskip + \end{varwidth} + \hcoffin_set_end: + % 拼接 label 和 figure + \__examzh_multifigures_coffin_join: + % 输出 + \__examzh_multifigures_coffin_typeset:n {#2} + % \par \int_use:N \l__examzh_multifigures_item_index_int + \group_end: + } +% 拼接 label 和 figure +\cs_new:Npn \__examzh_multifigures_coffin_join: + { + \int_step_inline:nn { \l__examzh_multifigures_item_index_int } + { + \__examzh_multifigures_coffin_join_position_set:n {##1} + \seq_gput_right:Nn \l__examzh_multifigures_store_seq + { + \__examzh_multifigures_coffin_align_set:n {##1} + } + } + } +\cs_new:Npn \__examzh_multifigures_coffin_align_set:n #1 + { + \str_case:Vn \l__examzh_multifigures_coffin_align_str + { + {t} { \__examzh_multifigures_coffin_align_set_t:n {#1} } + {m} { \__examzh_multifigures_coffin_align_set_m:n {#1} } + {b} { \__examzh_multifigures_coffin_align_set_b:n {#1} } + } + } +\cs_new:Npn \__examzh_multifigures_coffin_align_set_t:n #1 + { + \coffin_typeset:cnnnn + { l__examzh_multifigures_figure_ \int_to_roman:n { #1 } _coffin } + { l } { t } % align = t + { \l__examzh_multifigures_xshift_dim } { \l__examzh_multifigures_yshift_dim + 1em } + } +\cs_new:Npn \__examzh_multifigures_coffin_align_set_m:n #1 + { + \coffin_typeset:cnnnn + { l__examzh_multifigures_figure_ \int_to_roman:n { #1 } _coffin } + { l } { vc } % align = m + { \l__examzh_multifigures_xshift_dim } { \l__examzh_multifigures_yshift_dim } + } +\cs_new:Npn \__examzh_multifigures_coffin_align_set_b:n #1 + { + \coffin_typeset:cnnnn + { l__examzh_multifigures_figure_ \int_to_roman:n { #1 } _coffin } + { l } { b } % align = b + { \l__examzh_multifigures_xshift_dim } { \l__examzh_multifigures_yshift_dim } + } +\cs_new:Npn \__examzh_multifigures_coffin_join_position_set:n #1 + { + \use:c { __examzh_multifigures_coffin_join_position_set_ \l__examzh_multifigures_figure_position_str :n } {#1} + } +\cs_new:Npn \__examzh_multifigures_coffin_join_position_set_top:n #1 + { + \coffin_join:cnncnnnn + { l__examzh_multifigures_figure_ \int_to_roman:n {#1} _ coffin } + { hc } { b } + { l__examzh_multifigures_label_ \int_to_roman:n {#1} _ coffin } + { hc } { t } + { \l__examzh_multifigures_label_xshift_dim } + { \l__examzh_multifigures_label_yshift_dim - 6pt } + } +\cs_set_eq:NN + \__examzh_multifigures_coffin_join_position_set_above:n + \__examzh_multifigures_coffin_join_position_set_top:n +\cs_new:Npn \__examzh_multifigures_coffin_join_position_set_bottom:n #1 + { + \coffin_join:cnncnnnn + { l__examzh_multifigures_figure_ \int_to_roman:n {#1} _ coffin } + { hc } { t } + { l__examzh_multifigures_label_ \int_to_roman:n {#1} _ coffin } + { hc } { b } + { \l__examzh_multifigures_label_xshift_dim } + { \l__examzh_multifigures_label_yshift_dim + 6pt } + } +\cs_set_eq:NN + \__examzh_multifigures_coffin_join_position_set_below:n + \__examzh_multifigures_coffin_join_position_set_bottom:n +\cs_new:Npn \__examzh_multifigures_coffin_join_position_set_left:n #1 + { + \coffin_join:cnncnnnn + { l__examzh_multifigures_figure_ \int_to_roman:n {#1} _ coffin } + { l } { vc } + { l__examzh_multifigures_label_ \int_to_roman:n {#1} _ coffin } + { r } { vc } + { \l__examzh_multifigures_label_xshift_dim - 6pt } + { \l__examzh_multifigures_label_yshift_dim } + } +\cs_new:Npn \__examzh_multifigures_coffin_join_position_set_right:n #1 + { + \coffin_join:cnncnnnn + { l__examzh_multifigures_figure_ \int_to_roman:n {#1} _ coffin } + { r } { vc } + { l__examzh_multifigures_label_ \int_to_roman:n {#1} _ coffin } + { l } { vc } + { \l__examzh_multifigures_label_xshift_dim + 2pt } + { \l__examzh_multifigures_label_yshift_dim } + } +\cs_new:Npn \__examzh_multifigures_coffin_typeset:n #1 + { + \__examzh_multifigures_coffin_typeset_count: + \seq_map_indexed_inline:Nn \l__examzh_multifigures_store_seq + % ##1: index + % ##2: content + { + \int_compare:nNnTF { \int_mod:nn {##1} { \l__examzh_multifigures_column_int } } = {0} + { + \tl_gput_right:Nn \l__examzh_multifigures_tblr_content_tl { ##2 \\ } + } + { + \tl_gput_right:Nn \l__examzh_multifigures_tblr_content_tl { ##2 & } + } + } + % 如果 seq 的 item 比 column 多且不整除 column 的话,要补 & + \int_compare:nNnT { \l__examzh_multifigures_store_seq_item_int } > { \l__examzh_multifigures_column_int } + { + \int_compare:nNnF { \l__examzh_multifigures_item_num_mod_column_left_int } = { 0 } + { + \tl_gput_right:Nx \l__examzh_multifigures_tblr_content_tl + { + \prg_replicate:nn { \l__examzh_multifigures_item_num_mod_column_left_int -1 } {&} + } + % \int_use:N \l__examzh_multifigures_item_num_mod_column_left_int + } + } + \par + \vspace*{ \l__examzh_multifigures_top_sep_skip } + \noindent \centering + % \SetTblrInner + % { + % rowsep = 4pt, + % % colsep = 0pt + % } + \begin{tblr} + [ expand = \l__examzh_multifigures_tblr_content_tl ] + { + width = \textwidth, + cells = {c}, + column{1} = {leftsep = 0pt}, + column{Z} = {rightsep = 0pt}, + rows = + { + abovesep = 0pt, + belowsep = 0pt, + }, + % vlines,hlines, + #1 + } + \l__examzh_multifigures_tblr_content_tl + \end{tblr} + \vspace*{ \l__examzh_multifigures_bottom_sep_skip } + \par + } +\int_new:N \l__examzh_multifigures_item_num_mod_column_left_int +\cs_new:Npn \__examzh_multifigures_coffin_typeset_count: + { + % 计算 seq 有多少项 + \int_set:Nn \l__examzh_multifigures_store_seq_item_int + { \seq_count:N \l__examzh_multifigures_store_seq } + % seq 项数小于 column 的话,column 设置为 seq 项数 + \int_compare:nNnTF { \l__examzh_multifigures_store_seq_item_int } < { \l__examzh_multifigures_column_int } + { \int_set_eq:NN \l__examzh_multifigures_column_int \l__examzh_multifigures_store_seq_item_int } + { + % 计算 \l__examzh_multifigures_store_seq_item_int mod \l__examzh_multifigures_column_int 的余数,用于补 & + \int_set:Nn \l__examzh_multifigures_item_num_mod_column_left_int { \int_mod:nn { \l__examzh_multifigures_store_seq_item_int } { \l__examzh_multifigures_column_int } } + } + } +\cs_new:Npn \__examzh_multifigures_item:n #1 + { + % 增加指标(g 是关键) + \int_gincr:N \l__examzh_multifigures_item_index_int + % 新建 coffin + \__examzh_multifigures_item_new_coffin: + % 储存 label(一直出不来的原因是因为没改成 gset) + \hcoffin_gset:cn { l__examzh_multifigures_label_ \int_to_roman:n { \l__examzh_multifigures_item_index_int } _coffin } {#1} + % 储存 figure + \int_compare:nNnF { \l__examzh_multifigures_item_index_int } = {1} + { + \unskip + \end{varwidth} + % 结束上一个 item 的收集 + \hcoffin_set_end: + } + % 收集 + \hcoffin_set:cw { l__examzh_multifigures_figure_ \int_to_roman:n { \l__examzh_multifigures_item_index_int } _coffin } + \begin{varwidth}{\hsize} + \ignorespaces + } + +% 新建 coffin +\cs_new:Npn \__examzh_multifigures_item_new_coffin: + { + % 放图片的 coffin + \coffin_if_exist:cF { l__examzh_multifigures_figure_ \int_to_roman:n { \l__examzh_multifigures_item_index_int } _coffin } + { \coffin_new:c { l__examzh_multifigures_figure_ \int_to_roman:n { \l__examzh_multifigures_item_index_int } _coffin } } + % 放 label 的 coffin + \coffin_if_exist:cF { l__examzh_multifigures_label_ \int_to_roman:n { \l__examzh_multifigures_item_index_int } _coffin } + { \coffin_new:c { l__examzh_multifigures_label_ \int_to_roman:n { \l__examzh_multifigures_item_index_int } _coffin } } + } + + + +%% \textfigure + + +\coffin_new:N \l__examzh_textfigure_text_coffin % 用于存文本 +\coffin_new:N \l__examzh_textfigure_figure_coffin % 用于存图片 + +\str_new:N \l__examzh_textfigure_current_figure_position_str % 用来存当前的 anchor值 + +\fp_new:N \l__examzh_textfigure_text_ratio_fp % 文本的比例 + +\dim_new:N \l__examzh_textfigure_text_width_dim % 文本的宽度 +\dim_new:N \l__examzh_textfigure_text_coffin_width_dim % 文本c offin 的宽度 +\dim_new:N \l__examzh_textfigure_figure_width_dim % 图片的 varwidth 环境的宽度 + +% 用于 top-center, top-right, bottom-center, bottom-right 的水平偏移量储存 +\dim_new:N \l__examzh_textfigure_figure_coffin_horizontal_transform_dim +\dim_new:N \l__examzh_textfigure_tmpa_dim % 临时变量 + +\skip_new:N \l__examzh_textfigure_tmpa_skip % 临时变量 + + +\keys_define:nn { exam-zh } + { + textfigure .meta:nn = { exam-zh / textfigure } {#1} + } + +\keys_define:nn { exam-zh / textfigure } + { + % fig-pos为图片位于文本的方位 + fig-pos .choices:nn = + { + left , right , top , bottom , + top-left , top-right , top-center , + top-flushright , bottom-flushright , + bottom-left , bottom-right , bottom-center , + right-top , right-bottom , right-center , + left-top , left-bottom , left-center + } + { + \str_set:NV \l__examzh_textfigure_current_figure_position_str \l_keys_choice_tl + }, + % figure-yshift:调整图片的垂直额外偏移量 + figure-yshift .dim_set:N = \l__examzh_textfigure_figure_yshift_dim, + figure-vshift .dim_set:N = \l__examzh_textfigure_figure_yshift_dim, + % figure-xshift:调整图片的水平额外偏移量 + figure-xshift .dim_set:N = \l__examzh_textfigure_figure_xshift_dim, + figure-hshift .dim_set:N = \l__examzh_textfigure_figure_xshift_dim, + % yshift:调整整体的垂直额外偏移量 + yshift .dim_set:N = \l__examzh_textfigure_yshift_dim, + vshift .dim_set:N = \l__examzh_textfigure_yshift_dim, + % xshift:调整整体的水平额外偏移量 + xshift .dim_set:N = \l__examzh_textfigure_xshift_dim, + hshift .dim_set:N = \l__examzh_textfigure_xshift_dim, + % text-width:手动设置文本的 varwidth 环境的宽度 + text-width .dim_set:N = \l__examzh_textfigure_text_width_dim, + % figure-width:手动设置 figure 的 varwidth 环境的宽度 + figure-width .dim_set:N = \l__examzh_textfigure_figure_width_dim, + % ratio / text-ratio:文本 coffin 占行宽的比例,范围0-1 + ratio .fp_set:N = \l__examzh_textfigure_text_ratio_fp, + text-ratio .fp_set:N = \l__examzh_textfigure_text_ratio_fp, + % 环境上方的额外距离 + top-sep .skip_set:N = \l__examzh_textfigure_top_sep_skip, + % 环境下方的额外距离 + bottom-sep .skip_set:N = \l__examzh_textfigure_bottom_sep_skip, + % 类似于 wrapstuff 的 top + top .int_set:N = \l__examzh_textfigure_top_int + } + +\keys_set:nn { exam-zh / textfigure } + { + fig-pos = right, + yshift = .5\baselineskip, + text-width = \columnwidth, + figure-width = \columnwidth, + text-ratio = 0.95, + top-sep = 0pt, + bottom-sep = 1.5ex plus .5ex minus 0.5ex, + top = 0 + } + + +% 【已解决】判断anchor是不是west或者east,是的话就自动调整调整一下text-ratio +% - 问题在于要知道key-val设置了什么anchor才能判断 +% - 但是这个key-val设置和手动设置ratio是同一接口 +% - 理想是: +% - 先用户设置anchor +% - 然后自动判断是否是west或者east,并自动调整ratio +% 【思考】其实也就是说anchor的时候要判断是否是east和west来设置ratio(关键) +% - 然后用户手动的话以手动的为准 +% 【解决关键】既然不可能中途处理,那只能在 key-val 设置的时候就要处理掉这个自动的ratio,所以重新设计了anchor键值代码 + +\NewDocumentCommand{ \textfigure }{ O{} +m +m } + { + \group_begin: + \keys_set:nn { exam-zh / textfigure } {#1} + \par + \vspace*{ \l__examzh_textfigure_top_sep_skip } + \noindent + \__examzh_textfigure_output:nn {#2} {#3} + \vspace*{ \l__examzh_textfigure_bottom_sep_skip } + \group_end: + } + + +% 最终的拼接命令 +\cs_new:Npn \__examzh_textfigure_output:nn #1#2 + { + \__examzh_textfigure_text_width_dim_set: + % issue:https://gitee.com/xkwxdyy/text-figure/issues/I4RVQX + % 关键点在于要离开垂直模式 + % https://ask.latexstudio.net/ask/question/7238.html + \mode_leave_vertical: + % 将内容存到 coffin 中 + \__examzh_textfigure_coffin_store:nn {#1}{#2} + % coffin 的拼接 + \__examzh_textfigure_coffin_join: + % coffin 的 typeset + \__examzh_textfigure_coffin_typeset: + } +\cs_new:Npn \__examzh_textfigure_text_width_dim_set: + { + % \str_case:VnT \l__examzh_textfigure_current_figure_position_str + % { + % {bottom-flushright} {} + % {bottom-left} {} + % {bottom-right} {} + % {bottom-center} {} + % } + % { \fp_set:Nn \l__examzh_textfigure_text_ratio_fp {1} } + % \fp_compare:nNnF { \l__examzh_textfigure_text_ratio_fp } = { 1 } + % { + % \str_case:VnT \l__examzh_textfigure_current_figure_position_str + % { + % {left} {} + % {right} {} + % {left-center} {} + % {right-center} {} + % {right-top} {} + % {right-bottom} {} + % {left-top} {} + % {left-bottom} {} + % } + % { \fp_set:Nn \l__examzh_textfigure_text_ratio_fp {0.7} } + % } + \dim_set_eq:NN \l__examzh_textfigure_tmpa_dim \l__examzh_textfigure_text_width_dim + \dim_set:Nn \l__examzh_textfigure_text_width_dim + { + \l__examzh_textfigure_tmpa_dim * \dim_ratio:nn { \fp_use:N \l__examzh_textfigure_text_ratio_fp pt } { 1 pt } + } + } +\cs_new:Npn \__examzh_textfigure_coffin_store:nn #1#2 + { + \hcoffin_set:Nn \l__examzh_textfigure_text_coffin + { + \begin{varwidth}{ \l__examzh_textfigure_text_width_dim } + \dim_set:Nn \parindent {2em} + \ignorespaces + #1 + \unskip + \end{varwidth} + } + \hcoffin_set:Nn \l__examzh_textfigure_figure_coffin + { + \begin{varwidth}{ \l__examzh_textfigure_figure_width_dim } + \centering + \ignorespaces + #2 + \unskip + \end{varwidth} + } + } +\cs_new:Npn \__examzh_textfigure_coffin_join: + { + \use:c { __examzh_textfigure_fig_pos_set_ \l__examzh_textfigure_current_figure_position_str :NN } + \l__examzh_textfigure_text_coffin + \l__examzh_textfigure_figure_coffin + } +\cs_new:Npn \__examzh_textfigure_coffin_typeset: + { + \coffin_typeset:Nnnnn \l__examzh_textfigure_text_coffin + { l } { t } + { \l__examzh_textfigure_xshift_dim } + { \l__examzh_textfigure_yshift_dim } + } + +% top表示位于文本正上方 +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_top:NN } #1#2 + { + \coffin_join:NnnNnnnn + #1 { t } { hc } + #2 { b } { hc } + { \l__examzh_textfigure_figure_xshift_dim } + { 1em + \l__examzh_textfigure_figure_yshift_dim } + } +% top-center表示位于文本上方,但是处于水平的中线处 +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_top-center:NN } #1#2 + { + \dim_set:Nn \l__examzh_textfigure_tmpa_dim + { \coffin_wd:N #1 } + \dim_set:Nn \l__examzh_textfigure_figure_coffin_horizontal_transform_dim + { + \linewidth * \dim_ratio:nn { 1 pt } { 2 pt } + - + \l__examzh_textfigure_tmpa_dim * \dim_ratio:nn { 1 pt } { 2 pt } + } + \coffin_join:NnnNnnnn + #1 { t } { hc } + #2 { b } { hc } + { \l__examzh_textfigure_figure_coffin_horizontal_transform_dim + \l__examzh_textfigure_figure_xshift_dim } + { 1em + \l__examzh_textfigure_figure_yshift_dim } + } +% bottom-center表示位于文本下方,但是处于水平的中线处 +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_bottom-center:NN } #1#2 + { + \dim_set:Nn \l__examzh_textfigure_tmpa_dim + { \coffin_wd:N #1 } + \dim_set:Nn \l__examzh_textfigure_figure_coffin_horizontal_transform_dim + { + \linewidth * \dim_ratio:nn { 1 pt } { 2 pt } + - + \l__examzh_textfigure_tmpa_dim * \dim_ratio:nn { 1 pt } { 2 pt } + } + \coffin_join:NnnNnnnn + #1 { b } { hc } + #2 { t } { hc } + { \l__examzh_textfigure_figure_coffin_horizontal_transform_dim + \l__examzh_textfigure_figure_xshift_dim } + { -1em + \l__examzh_textfigure_figure_yshift_dim } + } +% bottom 表示位于文本正下方 +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_bottom:NN } #1#2 + { + \coffin_join:NnnNnnnn + #1 { b } { hc } + #2 { t } { hc } + { \l__examzh_textfigure_figure_xshift_dim } + { -1em + \l__examzh_textfigure_figure_yshift_dim } + } +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_left:NN } #1#2 + { + \coffin_join:NnnNnnnn + #1 { vc } { l } + #2 { vc } { r } + { -1em + \l__examzh_textfigure_figure_xshift_dim } + { \l__examzh_textfigure_figure_yshift_dim } + } +\cs_set_eq:cc { __examzh_textfigure_fig_pos_set_left-center:NN } { __examzh_textfigure_fig_pos_set_left:NN } +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_left-top:NN } #1#2 + { + \dim_set:Nn \l__examzh_textfigure_tmpa_dim + { \baselineskip * \dim_ratio:nn { \int_use:N \l__examzh_textfigure_top_int pt } { 1pt } } + \coffin_join:NnnNnnnn + #1 { t } { l } + #2 { t } { r } + { -1em + \l__examzh_textfigure_figure_xshift_dim } + { - \l__examzh_textfigure_tmpa_dim + \l__examzh_textfigure_figure_yshift_dim } + } +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_left-bottom:NN } #1#2 + { + \coffin_join:NnnNnnnn + #1 { b } { l } + #2 { b } { r } + { -1em + \l__examzh_textfigure_figure_xshift_dim } + { 0pt + \l__examzh_textfigure_figure_yshift_dim } + } +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_right-top:NN } #1#2 + { + \dim_set:Nn \l__examzh_textfigure_tmpa_dim + { \baselineskip * \dim_ratio:nn { \int_use:N \l__examzh_textfigure_top_int pt } { 1pt } } + \coffin_join:NnnNnnnn + #1 { t } { r } + #2 { t } { l } + { 1em + \l__examzh_textfigure_figure_xshift_dim } + { - \l__examzh_textfigure_tmpa_dim + \l__examzh_textfigure_figure_yshift_dim } + } +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_right-center:NN } #1#2 + { + \coffin_join:NnnNnnnn + #1 { vc } { r } + #2 { vc } { l } + { 1em + \l__examzh_textfigure_figure_xshift_dim } + { 0pt + \l__examzh_textfigure_figure_yshift_dim } + } +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_right-bottom:NN } #1#2 + { + \coffin_join:NnnNnnnn + #1 { b } { r } + #2 { b } { l } + { 1em + \l__examzh_textfigure_figure_xshift_dim } + { 0pt + \l__examzh_textfigure_figure_yshift_dim } + } +\cs_set_eq:cc { __examzh_textfigure_fig_pos_set_right:NN } { __examzh_textfigure_fig_pos_set_right-center:NN } +% top-flushright:文本上方,水平方向是在行尾 +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_top-flushright:NN } #1#2 + { + \dim_set:Nn \l__examzh_textfigure_tmpa_dim + { \coffin_wd:N #1 } + \dim_set:Nn \l__examzh_textfigure_figure_coffin_horizontal_transform_dim + { \linewidth - \l__examzh_textfigure_tmpa_dim } + \coffin_join:NnnNnnnn + #1 { t } { r } + #2 { b } { r } + { \l__examzh_textfigure_figure_coffin_horizontal_transform_dim + \l__examzh_textfigure_figure_xshift_dim } + { 1em + \l__examzh_textfigure_figure_yshift_dim } + } +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_top-right:NN } #1#2 + { + \coffin_join:NnnNnnnn + #1 { t } { r } + #2 { b } { r } + { \l__examzh_textfigure_figure_xshift_dim } + { 1em + \l__examzh_textfigure_figure_yshift_dim } + } +% bottom-flushright:文本下方,水平方向在行尾 +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_bottom-flushright:NN } #1#2 + { + \dim_set:Nn \l__examzh_textfigure_tmpa_dim + { \coffin_wd:N #1 } + \dim_set:Nn \l__examzh_textfigure_figure_coffin_horizontal_transform_dim + { \linewidth - \l__examzh_textfigure_tmpa_dim } + \coffin_join:NnnNnnnn + #1 { b } { r } + #2 { t } { r } + { \l__examzh_textfigure_figure_coffin_horizontal_transform_dim + \l__examzh_textfigure_figure_xshift_dim } + { -1em + \l__examzh_textfigure_figure_yshift_dim } + } +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_bottom-right:NN } #1#2 + { + \coffin_join:NnnNnnnn + #1 { b } { r } + #2 { t } { r } + { \l__examzh_textfigure_figure_xshift_dim } + { -1em + \l__examzh_textfigure_figure_yshift_dim } + } +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_top-left:NN } #1#2 + { + \coffin_join:NnnNnnnn + #1 { t } { l } + #2 { b } { l } + { 0pt + \l__examzh_textfigure_figure_xshift_dim } + { 1em + \l__examzh_textfigure_figure_yshift_dim } + } +\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_bottom-left:NN } #1#2 + { + \coffin_join:NnnNnnnn + #1 { b } { l } + #2 { t } { l } + { 0pt + \l__examzh_textfigure_figure_xshift_dim } + { -1em + \l__examzh_textfigure_figure_yshift_dim } + }
\ No newline at end of file diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh.cls b/macros/xetex/latex/exam-zh/tex/exam-zh.cls index 817ee767e5..3f98de7858 100644 --- a/macros/xetex/latex/exam-zh/tex/exam-zh.cls +++ b/macros/xetex/latex/exam-zh/tex/exam-zh.cls @@ -1,12 +1,12 @@ % % Copyright (c) 2022 Zeping Lee % Released under the LaTeX Project Public License v1.3c License. -% Repository: https://gitee.com/zepinglee/exam-zh +% Repository: https://gitee.com/xkwxdyy/exam-zh % \NeedsTeXFormat{LaTeX2e}[2017/04/15] \RequirePackage{expl3} -\ProvidesExplClass {exam-zh} {2022-08-15} {v0.1.18} {LaTeX template for Chinese exam} +\ProvidesExplClass {exam-zh} {2022-08-28} {v0.1.19} {LaTeX template for Chinese exam} % 检查 LaTeX2e kernel 版本 \msg_new:nnn { exam-zh } { latex-too-old } @@ -86,6 +86,7 @@ \RequirePackage { exam-zh-choices } \RequirePackage { exam-zh-symbols } \RequirePackage { exam-zh-chinese-english } +\RequirePackage { exam-zh-textfigure } \AtEndPreamble { @@ -182,8 +183,9 @@ \NewDocumentCommand { \ExamPrintAnswer } { } { - \clist_use:Nn \g__examzh_print_answer_cmd_set_clist {} - \clist_if_empty:NF \g__examzh_print_answer_keys_set_clist + \clist_if_exist:NT \g__examzh_print_answer_cmd_set_clist + { \clist_use:Nn \g__examzh_print_answer_cmd_set_clist {} } + \clist_if_exist:NT \g__examzh_print_answer_keys_set_clist { \keys_set:nx { exam-zh } { \g__examzh_print_answer_keys_set_clist } @@ -499,6 +501,11 @@ \dim_set:Nn \lineskiplimit { .5em } \skip_set:Nn \lineskip { .5em } +% 增加对 minipage 的处理 +% https://tex.stackexchange.com/a/358080/246645 +\dim_set:Nn \normallineskiplimit { .5em } +\skip_set:Nn \normallineskip { .5em } + % 设置 enumitem 列表格式 @@ -534,9 +541,14 @@ \setlist[enumerate, 2] { - left = 2em, - labelsep = 0pt, - label = { ( \arabic * ) } + % labelindent = *, + leftmargin = 0pt, + widest = 0, + itemindent = 4em, + labelsep = 0pt, + % labelwidth = 2em, + listparindent = \parindent, + label = {( \arabic * )}, } % 多种方法: method环境 @@ -1193,7 +1205,7 @@ } \keys_set:nn { exam-zh / page } { - show-columnline = true, + show-columnline = false, columnline-width = 0.4pt } diff --git a/macros/xetex/latex/xgreek/README b/macros/xetex/latex/xgreek/README index 762a9207ae..d715f36f29 100644 --- a/macros/xetex/latex/xgreek/README +++ b/macros/xetex/latex/xgreek/README @@ -1,29 +1,39 @@ -Version 3.0.1 of package xgreek +Version 3.1.0 + +Introduces the option "listings" that loads the listings package, +adjusts the catcodes of the Greek letters and allows one to properly +use Greek letters in code listings (remember: all modern programming +languages are UTF-8 aware!). It should be obvious, but here is how +one can load the package with this oprion enabled: + +\usepackage[listings]{xgreek} + +Version 3.0.1 This version provides a fix to a typo found by a user. -Version 3.0 of package xgreek +Version 3.0 Include support for LuaLaTeX. Now one can use the package with either XeLaTeX or LuaLaTeX. -Version 2.7 of package xgreek +Version 2.7 The package option "stigma" did not set the proper character. -Also, all polytonic names use now characters from the +Also, all polytonic names consist now of characters from the Extended Greek Unicode block. -Version 2.61 of package xgreek +Version 2.61 In the previous version the uppercase of 'GREEK SMALL LETTER RHO WITH DASIA' (U+1FE5) was set to be 'GREEK CAPITAL LETTER RHO WITH DASIA' (U+1FEC) while the correct is -'GREEK CAPITAL LETTER RHO' (U+03A1). This version fixes the problem. Thanks to +'GREEK CAPITAL LETTER RHO' (U+03A1). This version fixes this problem. Thanks to Claudio Beccari and Günter Milde for finding this bug. -Version 2.6 of package xgreek +Version 2.6 In this version the definition of \anwtonos and \katwtonos have been changed and now the commands expand to the correspong symbol and not @@ -31,7 +41,7 @@ to some \char"03XX\relax sequence. It seems the previous definitions did not work with some packages. -Version 2.5 of package xgreek +Version 2.5 By default the package enables the indentation even for first paragraph after any header. This is the default in Greek typography. However, some @@ -42,29 +52,29 @@ chapter headers to get printed without the NUMERAL SIGN. This feature can be turned on with the new option nonumeralsign. Fianlly, command \anoteleia can be used to get an ANO TELEIA character. -Version 2.4 of package xgreek +Version 2.4 Two erroneous entries in \@ncientn@mes have been deleted. -Version 2.3 of package xgreek +Version 2.3 In this version the \stigma command expands to the letters sigma tau. If one wants this command to expand to the stigma symbol, she has to use the stigma package option. -Version 2.2 of package xgreek +Version 2.2 Removed the first entry of \refname in \@ncientn@mes. -Version 2.1 of package xgreek +Version 2.1 I have introduced some new \lccode-\uccode pairs that reflect current changes in Unicode 5.2 while I have corrected the values for an existing pair. -Version 2.0 of package xgreek +Version 2.0 Package xgreek has been designed so to allow people to typeset Greek language documents using XeLaTeX. And it is released in @@ -88,4 +98,4 @@ greek loadhyph-el-polyton.tex Apostolos Syropoulos Xanthi, Greece -2018/02/16 +2022/08/28 diff --git a/macros/xetex/latex/xgreek/xgreek.dtx b/macros/xetex/latex/xgreek/xgreek.dtx index 14a9a59496..864345aa82 100644 --- a/macros/xetex/latex/xgreek/xgreek.dtx +++ b/macros/xetex/latex/xgreek/xgreek.dtx @@ -16,7 +16,7 @@ %% %\iffalse % -% (c) Copyright 2007-2018 Apostolos Syropoulos +% (c) Copyright 2007-2022 Apostolos Syropoulos % This program can be redistributed and/or modified under the % terms of the LaTeX Project Public License Distributed from % http://www.latex-project.org/lppl.txt; either @@ -29,12 +29,12 @@ % Apostolos Syropoulos (asyropoulos@yahoo.com) % %\fi -% \CheckSum{1913} -% \iffalse This is a Metacomment +% \CheckSum{1929} +% \iffalse This is a Metacommentxel % %<xgreek, >\ProvidesFile{xgreek.sty} % -%<xgreek, > [2018/02/16 v3.0.1 Package `xgreek.sty'] +%<xgreek, > [2022/08/28 v3.1.0 Package `xgreek.sty'] % % \begin{macrocode} %<*driver> @@ -57,7 +57,7 @@ %\author{Apostolos Syropoulos\\ % Xanthi, Greece\\ % \texttt{asyropoulos@yahoo.com}} -% \date{2009/11/23\\ Last Updated 2018/02/16} +% \date{2009/11/23\\ Last Updated 2022/08/22} %\maketitle % \begin{abstract} % The \textsf{xgreek} package provides rudimentary support for Greek language @@ -87,7 +87,7 @@ % I first need to set up the correct |\uccode|s and |\lccode|s. % \begin{macrocode} %<*xgreek> -\message{Package `xgreek' version 3.0.1 by Apostolos Syropoulos} +\message{Package 'xgreek' version 3.1.0 by Apostolos Syropoulos} \global\lccode"0370="0371 \global\uccode"0370="0370 \global\lccode"0371="0371 \global\uccode"0371="0370 \global\lccode"0372="0373 \global\uccode"0372="0372 @@ -576,12 +576,57 @@ \let\numer@lsign\relax } % \end{macrocode} -% -% By default the |monogreek| option is activated. +% Package \textsf{listings} does not work properly with UTF-8 encoded files. So this +% option should be used whenever one wants to use this package and see Greek text come out +% correctly. +% \begin{macrocode} +\newif\if@mylistings +\@mylistingsfalse +\DeclareOption{listings}{% + \@mylistingstrue +} +% \end{macrocode} +% By default the |monogreek| option is activated. % \begin{macrocode} \ExecuteOptions{monogreek} \ProcessOptions % \end{macrocode} +% If the user has enabled the |listings| option, then it loads the package \textsf{listings} +% and makes a few changes to it. In particular, it redefines the command |\lst@DefEC| and the new +% comamnd makes all characters in the range 128--255 plus the Greek letters to be treated as letters. +% \begin{macrocode} +\if@mylistings +\RequirePackage{listings} +\lstset{inputencoding=utf8} +\lst@InputCatcodes +\gdef\lst@DefEC{% + \lst@CCECUse \lst@ProcessLetter + ^^80^^81^^82^^83^^84^^85^^86^^87^^88^^89^^8a^^8b^^8c^^8d^^8e^^8f% + ^^90^^91^^92^^93^^94^^95^^96^^97^^98^^99^^9a^^9b^^9c^^9d^^9e^^9f% + ^^a0^^a1^^a2^^a3^^a4^^a5^^a6^^a7^^a8^^a9^^aa^^ab^^ac^^ad^^ae^^af% + ^^b0^^b1^^b2^^b3^^b4^^b5^^b6^^b7^^b8^^b9^^ba^^bb^^bc^^bd^^be^^bf% + ^^c0^^c1^^c2^^c3^^c4^^c5^^c6^^c7^^c8^^c9^^ca^^cb^^cc^^cd^^ce^^cf% + ^^d0^^d1^^d2^^d3^^d4^^d5^^d6^^d7^^d8^^d9^^da^^db^^dc^^dd^^de^^df% + ^^e0^^e1^^e2^^e3^^e4^^e5^^e6^^e7^^e8^^e9^^ea^^eb^^ec^^ed^^ee^^ef% + ^^f0^^f1^^f2^^f3^^f4^^f5^^f6^^f7^^f8^^f9^^fa^^fb^^fc^^fd^^fe^^ff% + ^^^^0396^^^^0388^^^^0389^^^^038a^^^^038c% <--- Begin of Greek Letters + ^^^^038e^^^^038f^^^^0390^^^^0391^^^^0392% + ^^^^0393^^^^0394^^^^0395^^^^0396^^^^0397% + ^^^^0398^^^^0399^^^^039a^^^^039b^^^^039c% + ^^^^039d^^^^039e^^^^039f^^^^03a0^^^^03a1% + ^^^^03a3^^^^03a4^^^^03a5^^^^03a6^^^^03a7% + ^^^^03a8^^^^03a9^^^^03aa^^^^03ab^^^^03ac% + ^^^^03ad^^^^03ae^^^^03af^^^^03b0^^^^03b1% + ^^^^03b2^^^^03b3^^^^03b4^^^^03b5^^^^03b6% + ^^^^03b7^^^^03b8^^^^03b9^^^^03ba^^^^03bb% + ^^^^03bc^^^^03bd^^^^03be^^^^03bf^^^^03c0% + ^^^^03c1^^^^03c2^^^^03c3^^^^03c4^^^^03c5% + ^^^^03c6^^^^03c7^^^^03c8^^^^03c9^^^^03ca% + ^^^^03cb^^^^03cc^^^^03cd^^^^03ce% <--- End of Greek Letters + ^^00}% +\lst@RestoreCatcodes +\fi +% \end{macrocode} % Now I am going to define the macros that typeset alphabetic Greek numerals. The code % is borrowed from the greek option for the babel package. % \begin{macro}{\gr@ill@value} @@ -620,8 +665,8 @@ % \end{macro} % % \begin{macro}{\@greeknumeral} -% This command is used to typeset Greek numerals. The command uses -% |\numer@lsign| to typeset the NUMERAL SIGN. Obviously, when the +% This command is used to get Greek numerals. The command uses +% |\numer@lsign| to get the NUMERAL SIGN. Obviously, when the % user has specified the \texttt{no\-numeral\-sign} option, then numeral % comes out without the trailing NUMERAL SIGN. However, when a user % wants to typeset a Greek numeral, the numeral must come out correctly, @@ -806,11 +851,13 @@ \ifnum\@attic@num<\@ne% \space% \PackageWarning{xgreek}{% - Illegal value (\the\@attic@num) for acrophonic Attic numeral}% + Illegal value (\the\@attic@num) for acrophonic + Attic numeral}% \else\ifnum\@attic@num>249999% \space% \PackageWarning{xgreek}{% - Value too large (\the\@attic@num) for acrophonic Attic numeral}% + Value too large (\the\@attic@num) for acrophonic + Attic numeral}% \else % \end{macrocode} % Having done all the necessary checks, it is possible to proceed with the actual @@ -939,7 +986,8 @@ \ifx\directlua\undefined% \def\setlanguage#1{% \expandafter\ifx\csname l@#1\endcsname\relax% - \typeout{^^J Error: No hyphenation pattern for language #1 loaded,}% + \typeout{^^J Error: No hyphenation pattern for}% + \typeout{ language #1 are loaded,}% \typeout{ default hyphenation patterns are used.^^J}% \language=0% \else\language=\csname l@#1\endcsname\fi} diff --git a/macros/xetex/latex/xgreek/xgreek.ins b/macros/xetex/latex/xgreek/xgreek.ins index 61032e4b68..b744ebff6c 100644 --- a/macros/xetex/latex/xgreek/xgreek.ins +++ b/macros/xetex/latex/xgreek/xgreek.ins @@ -1,9 +1,9 @@ -%% Copyright 2007—2018 Apostolos Syropoulos +%% Copyright 2007—2022 Apostolos Syropoulos %% %% This file is part of the `xgreek' package. %% You are not allowed to modify its contents. %% -\def\filedate{2017/02/16} +\def\filedate{2022/08/28} \def\batchfile{xgreek.ins} \input docstrip.tex @@ -24,7 +24,7 @@ \preamble - (c) Copyright 2007—2018 Apostolos Syropoulos + (c) Copyright 2007—2022 Apostolos Syropoulos This program can be redistributed and/or modified under the terms of the LaTeX Project Public License Distributed from http://www.latex-project.org/lppl.txt; either diff --git a/macros/xetex/latex/xgreek/xgreek.pdf b/macros/xetex/latex/xgreek/xgreek.pdf Binary files differindex b13ca29503..734a291e46 100644 --- a/macros/xetex/latex/xgreek/xgreek.pdf +++ b/macros/xetex/latex/xgreek/xgreek.pdf |