summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-04-21 03:01:10 +0000
committerNorbert Preining <norbert@preining.info>2021-04-21 03:01:10 +0000
commit20788e2817af7ef0b25395c161b06e7a1446b8b1 (patch)
treef559ca4cfaa8f1fa63d1f8a44f16805204001acd /macros
parentd65c208b161ffee9ce5343fdfdb17d00523cecae (diff)
CTAN sync 202104210301
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-philosophy/README2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-philosophy/biblatex-philosophy.dtx288
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-philosophy/biblatex-philosophy.pdfbin500403 -> 539759 bytes
-rw-r--r--macros/latex/contrib/easybook/doc/chapter1.tex2
-rw-r--r--macros/latex/contrib/easybook/doc/easybook-demo.pdfbin268475 -> 268481 bytes
-rw-r--r--macros/latex/contrib/easybook/doc/easybook-demo.tex3
-rw-r--r--macros/latex/contrib/easybook/doc/easybook.pdfbin459430 -> 462196 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx232
-rw-r--r--macros/latex/contrib/principia/README8
-rw-r--r--macros/latex/contrib/principia/principia.pdfbin381284 -> 279322 bytes
-rw-r--r--macros/latex/contrib/principia/principia.sty209
-rw-r--r--macros/latex/contrib/principia/principia.tex197
-rw-r--r--macros/luatex/generic/luatexko/ChangeLog8
-rw-r--r--macros/luatex/generic/luatexko/README2
-rw-r--r--macros/luatex/generic/luatexko/luatexko-doc.pdfbin328095 -> 326736 bytes
-rw-r--r--macros/luatex/generic/luatexko/luatexko-doc.tex52
-rw-r--r--macros/luatex/generic/luatexko/luatexko-normalize.lua4
-rw-r--r--macros/luatex/generic/luatexko/luatexko-uhc2utf8.lua4
-rw-r--r--macros/luatex/generic/luatexko/luatexko.lua651
-rw-r--r--macros/luatex/generic/luatexko/luatexko.sty55
-rw-r--r--macros/xetex/generic/xetexko/ChangeLog8
-rw-r--r--macros/xetex/generic/xetexko/README2
-rw-r--r--macros/xetex/generic/xetexko/xetexko-doc.pdfbin251319 -> 250218 bytes
-rw-r--r--macros/xetex/generic/xetexko/xetexko-doc.tex23
-rw-r--r--macros/xetex/generic/xetexko/xetexko.sty427
25 files changed, 1188 insertions, 989 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-philosophy/README b/macros/latex/contrib/biblatex-contrib/biblatex-philosophy/README
index 77ab9f6e70..c40267da08 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-philosophy/README
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-philosophy/README
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------
The 'biblatex-philosophy' styles for biblatex
Author: Ivan Valbusa
- ivan dot valbusa at univr dot it
+ ivan dot valbusa at gmail dot com
This work has the LPPL maintenance status "author-maintained".
This work may be distributed and/or modified under the
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-philosophy/biblatex-philosophy.dtx b/macros/latex/contrib/biblatex-contrib/biblatex-philosophy/biblatex-philosophy.dtx
index 47b8f33a2d..7b5470b99e 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-philosophy/biblatex-philosophy.dtx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-philosophy/biblatex-philosophy.dtx
@@ -5,7 +5,7 @@
\preamble
The 'biblatex-philosophy' package
-Copyright (C) 2009-2020 Ivan Valbusa
+Copyright (C) 2009-2021 Ivan Valbusa
<ivan dot valbusa at gmail dot com>
All rights reserved
@@ -84,7 +84,7 @@ This work has the LPPL maintenance status "author-maintained".
%<spanish-lbx>\ProvidesFile{spanish-philosophy.lbx}
%<french-lbx>\ProvidesFile{french-philosophy.lbx}
%<*standard-bbx|classic-bbx|modern-bbx|verbose-bbx|classic-cbx|modern-cbx|verbose-cbx|italian-lbx|english-lbx|spanish-lbx|french-lbx>
-[2020/09/30 v1.9.8c A set of styles for biblatex]
+[2021/04/20 v1.9.8d A set of styles for biblatex]
%</standard-bbx|classic-bbx|modern-bbx|verbose-bbx|classic-cbx|modern-cbx|verbose-cbx|italian-lbx|english-lbx|spanish-lbx|french-lbx>
%<*driver>
\documentclass[12pt]{ltxdoc}
@@ -122,6 +122,7 @@ This work has the LPPL maintenance status "author-maintained".
\usepackage{biolinum}
\usepackage[cochineal,bigdelims,cmintegrals,vvarbb]{newtxmath}
\usepackage{microtype}
+\usepackage{manfnt}
%--------------------------------------------------------
% LAYOUT
%--------------------------------------------------------
@@ -145,14 +146,15 @@ This work has the LPPL maintenance status "author-maintained".
\usepackage{csquotes}
\usepackage[style=philosophy-modern,annotation=true]{biblatex}
\setlength{\bibhang}{60pt}
-\addbibresource{biblatex-philosophy.bib}
\addbibresource{biblatex-examples.bib}
+\addbibresource{biblatex-philosophy.bib}
\DeclareBibliographyCategory{biblatex}
+\DeclareBibliographyCategory{web}
+\addtocategory{web}{ctan,guit:sito}
\addtocategory{biblatex}{set,stdmodel,matuz:doody,vizedom:related,britannica,gaonkar,jaffe,westfahl:frontier,cms,ctan,jcg,yoon,worman,wilde,westfahl:space,weinberg,wassenberg,vazques-de-parga,springer,spiegelberg,sorace,sigfridsson,shore,sarfraz,salam,reese,pines,piccato,padhye,nussbaum,nietzsche:ksa,nietzsche:ksa1,nietzsche:historie,moraux,moore,moore:related,massa,maron,markey,malinowski,loh,laufenberg,kullback,kullback:reprint,kullback:related,kowalik,knuth:ct,knuth:ct:a,knuth:ct:b,knuth:ct:c,knuth:ct:d,knuth:ct:e,knuth:ct:related,kastenholz,kant:kpv,kant:ku,itzhaki,hyman,murray,iliad,herrmann,hammond,companion,gonzalez,glashow,gillies,gerhardt,vangennep,vangennep:trans,vangennep:related,geer,gaonkar:in,doody,cotton,coleridge,cicero,chiu,brandt,bertram,baez/article,baez/online,averroes/bland,averroes/hannes,averroes/hercz,augustine,aristotle:anima,aristotle:physics,aristotle:poetics,aristotle:rhetoric,angenendt,almendro,aksin}
%--------------------------------------------------------
% COMMANDS AND ENVIRONMENTS
%--------------------------------------------------------
-\newcommand*{\OR}{${}\mid{}$}
\newcommand{\argstyle}{\itshape}
\DeclareRobustCommand*{\ar}[1]{\texttt{\char`\{}%
\textrm{\argstyle#1}\texttt{\char`\}}}
@@ -163,6 +165,15 @@ This work has the LPPL maintenance status "author-maintained".
\DeclareRobustCommand*{\arm}[1]{\ar{\meta{\argstyle#1}}}
\DeclareRobustCommand*{\oarm}[1]{\oar{\meta{\argstyle#1}}}
\newcommand{\emphasize}[1]{\textcolor{teal}{#1}}
+\newcommand*{\OR}{${}\mid{}$}
+\makeatletter
+\newlength\CLett
+\newcommand*\alert{
+ \par\noindent
+ \setbox\z@\hbox{\textdbend}\CLett=\wd\z@%
+ \raisebox{-1.05\baselineskip}[0pt][0pt]{%
+ \llap{\box\z@\kern6pt}}}
+\makeatother
% environments
\newenvironment{ttquote}
{\begin{mdframed}
@@ -177,7 +188,7 @@ This work has the LPPL maintenance status "author-maintained".
{\end{mdframed}}
\newenvironment{bibexamplelist}[1][]
{\begin{NoHyper}\begin{mdframed}[frametitlefont={\bfseries},#1,backgroundcolor=philA!10,linecolor=white]
- \list{}{\setlength{\itemindent}{-.5cm}\setlength{\leftmargin}{.5cm}\setlength{\itemsep}{0pt}}}
+ \list{}{\setlength{\parsep}{0pt}\setlength{\itemindent}{-.5cm}\setlength{\leftmargin}{.5cm}\setlength{\itemsep}{0pt}}}
{\endlist\end{mdframed}\end{NoHyper}
}
\makeatletter
@@ -186,17 +197,13 @@ This work has the LPPL maintenance status "author-maintained".
\ifblank{#1}
{\ltd@option{}{#2}{#3}{}}
{\ltd@option{}{#2}{#3}{\ltd@textverb{#1}}}}%
-\patchcmd{\optionlist}{\marglistwidth}{0pt}{}{}
-\patchcmd{\optionlist}{\hss}{\phantom{\rule{1pt}{20pt}}\hss}{}{}
-\patchcmd{\ltd@option@i}{\linewidth}{\linewidth-\marglistwidth}{}{}
-
\patchcmd{\fieldlist}{field }{\ \ field }{}{}
\patchcmd{\fieldlist}{\marglistwidth}{0pt}{}{}
\patchcmd{\fieldlist}{\marglistsep}{0pt}{}{}
-
\pretocmd{\valuelist}{\let\optionlistfont\valuelistfont}{}{}
\patchcmd{\ltxsyntax}{\marglistwidth}{0pt}{}{}
\patchcmd{\ltd@option@i}{=}{\ = }{}{}
+\patchcmd{\ltd@option@ii}{=}{\ = }{}{}
\expandafter\patchcmd\csname\string\valuelist\endcsname{{\leftmargin}{\labelsep}}{{\leftmargin}{3\labelsep}}{}{}
% New color for items
\newcommand*{\valuelistfont}{%
@@ -246,7 +253,7 @@ This work has the LPPL maintenance status "author-maintained".
%</driver>
% \fi
%
-% \CheckSum{4353}
+% \CheckSum{4370}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -264,6 +271,7 @@ This work has the LPPL maintenance status "author-maintained".
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
+% \changes{v1.9.8d}{2021/04/20}{Changed \texttt{crossrefdata} macro. Updated \file{italian-philosophy.lbx}.}
% \changes{v1.9.8c}{2020/09/30}{Maintenance release. Corrected a bug in the related entries. Added \cmd{mkrelatedparens} and \cmd{mkrelatedbrackets}.}
% \changes{v1.9.8b}{2020/05/19}{Maintenance release. Corrected a bug in \bibtype{incollection} and \bibtype{inproceeding} without editor.}
% \changes{v1.9.8a}{2018/03/03}{Maintenance release. Corrected missing commas in some \texttt{.lbx} files.}
@@ -348,8 +356,18 @@ This work has the LPPL maintenance status "author-maintained".
%};
% \end{tikzpicture}
% \clearpage\thispagestyle{empty}
+% \null\vspace{1cm}
+%
+%\hfill\begin{minipage}{.5\textwidth}
+% \raggedleft\footnotesize
+% The serif typeface is Cochineal, created by Michael Sharpe
+% on the basis of Sebastian Kosch's Crimson.
+% The \texttt{typewriter} font is Inconsolata,
+% designed by Raph Levien and the \textsf{sans serif} text
+% is typeset in Linux Biolinum, created by Philipp H.~Pol.
+%\end{minipage}
%
-% \null\vfill
+% \vfill
%
% ^^A ----------------------------------------------------------------
% ^^A
@@ -409,7 +427,8 @@ This work has the LPPL maintenance status "author-maintained".
% ^^A
% ^^A ----------------------------------------------------------------
%
-% The firs step toward the creation of the \sty{philosophy-modern} style was the request of Lorenzo Pantieri in the \GuIT{} Forum at \url{http://www.guit.sssup.it/phpbb/viewtopic.php?t=6472} (See the discussion on \url{http://www.guit.sssup.it/phpbb/viewtopic.php?t=6717.}) Now this is the bibliography style of \citetitle{pantieri:artelatex}, the most popular Italian guide to \hologo{LaTeX} \parencite{pantieri:artelatex}. %\nocite{ctan,guit:sito}
+% The firs step toward the creation of the \sty{philosophy-modern} style was the request of Lorenzo Pantieri in the \GuIT{} Forum at \url{http://www.guit.sssup.it/phpbb/viewtopic.php?t=6472} (See the discussion on \url{http://www.guit.sssup.it/phpbb/viewtopic.php?t=6717.}) Now this is the bibliography style of \citetitle{pantieri:artelatex}, the most popular Italian guide to \hologo{LaTeX} \parencite{pantieri:artelatex}.
+%\nocite{ctan,guit:sito}
%
% ^^A ----------------------------------------------------------------
% ^^A
@@ -485,10 +504,9 @@ This work has the LPPL maintenance status "author-maintained".
% \setlength{\labelwidth}{2cm}
% \setlength{\leftmargin}{2cm}
% \setlength{\itemsep}{0em}
+% \setlength{\parsep}{0pt}
% }
% \item \hskip-2cm Knuth, Donald E.
-% \item[1984/1986]
-% \emph{Computers \& Typesetting}, 5 vols., Addison-Wesley.
% \item[1984]
% \emph{Computers \& Typesetting}, vol. A: \emph{The \TeX book}, Addison-Wesley.
% \item[1986a]
@@ -497,6 +515,7 @@ This work has the LPPL maintenance status "author-maintained".
% \emph{Computers \& Typesetting}, vol. C: \emph{The \hologo{METAFONT}book}, Addison-Wesley.
% \item[1986c]
% \emph{Computers \& Typesetting}, vol. D: \emph{\hologo{METAFONT}: The Program}, Addison-Wesley.
+% \vspace*{1ex}
%\item \hskip-2cm Nietzsche, Friedrich
% \item[1988a] \emph{Sämtliche Werke. Kritische Studienausgabe}, ed. by Giorgio Colli and Mazzino Montinari,
% 2nd ed., 15 vols., Deutscher Taschenbuch-Verlag and Walter de Gruyter, München,
@@ -510,6 +529,7 @@ This work has the LPPL maintenance status "author-maintained".
% Tragödie. Unzeitgemäße Betrachtungen I-IV. Nachgelassene Schriften 1870-1973}, ed. by
% Giorgio Colli and Mazzino Montinari, Deutscher Taschenbuch-Verlag and Walter de
% Gruyter, München, Berlin, and New York, p. 243-334.
+% \vspace*{1ex}
%\item \hskip-2cm Van Gennep, Arnold
%\item[1909a] \emph{Les rites de passage}, Nourry, Paris.
%\item[1909b] \emph{Les rites de passage}, Nourry, Paris; trans. by Monika B. Vizedom and
@@ -530,11 +550,11 @@ This work has the LPPL maintenance status "author-maintained".
%\smallskip
%
% \begin{bibexample}[frametitle=Italian \sty{philosophy-verbose} citation scheme]
-% \textsuperscript{1} \fullcite{Valbusa:2007}, p. 43.\\
+% \textsuperscript{1} \fullcite{hyman}, p. 43.\\
% \textsuperscript{2} {Ivi}, p. 26. \\
% \textsuperscript{3} {Ibidem}. \\
% \textsuperscript{4} \fullcite{heidegger:sz}.\\
-% \textsuperscript{5} Valbusa, ``Psicologia e sistema'' cit., p. 35.
+% \textsuperscript{5} Hyman, «Aristotle’s Theory of the Intellect» cit, p. 179.
% \end{bibexample}
%\smallskip
%
@@ -645,36 +665,40 @@ This work has the LPPL maintenance status "author-maintained".
% ^^A ----------------------------------------------------------------
%
% The \sty{philosophy} styles allow you to manage
-% entries referring to other entries via the \bibfield{crossref} field. This is very useful when you have to cite two or more \bibtype{incollection} of the same \bibtype{collection} \parencite[see][]{corrocher:2009,federspil:2009}. In this way the \bibtype{collection} is printed in the bibliography and it is cross-referenced inside the \bibtype{incollection}, using the corresponding author-year label (the mechanism is the same for \bibtype{inbook} items).
+% entries referring to other entries via the \bibfield{crossref} field. This is very useful when you have to cite two or more \bibtype{incollection} of the same \bibtype{collection} \parencite[see][]{westfahl:flying,westfahl:frontier}. In this way the \bibtype{collection} is printed in the bibliography and it is cross-referenced inside the \bibtype{incollection}, using the corresponding author-year label (the mechanism is the same for \bibtype{inbook} items).
%\begin{bibexamplelist}
-%\item Corrocher, Roberto (2009) “Riflessioni sull’uomo di fronte a nuove sfide”, in Giaretta et al. (2009), p. 27-42.
-%\item Federspil, Giovanni and Roberto Vettor (2009), “Medicina: un unico metodo e una sola argomentazione?”, in Giaretta et al. (2009), p. 43-74.
-%\item Giaretta, Pierdaniele, Antonio Moretto, Gian Franco Gensini, and Marco Trabucchi (2009) (eds.), \emph{Filosofia delle medicina. Metodo, modelli, cura ed errori}, 2 vols., il Mulino, Bologna.
+%\item Westfahl, Gary (2000b), «The True Frontier. Confronting and
+% Avoiding the Realities of Space in American Science Fiction Films»,
+% in Westfahl (2000a), p. 55-65.
+%\item Chatelain, Daniele e George Slusser (2000), «Flying to the Moon
+% in French and American Science Fiction», in Westfahl (2000a), p. 25-33.
+% \item Westfahl, Gary (a cura di) (2000a), \textit{Space and Beyond. The Frontier
+% Theme in Science Fiction}, Greenwood, Westport, Conn. e London.
%\end{bibexamplelist}
%\begin{latexcode}\begin{verbatim}
-%@collection{Filmed:2009,
-% title = {Filosofia delle medicina},
-% booktitle = {Filosofia delle medicina},
-% subtitle = {Metodo, modelli, cura ed errori},
-% editor = {Pierdaniele Giaretta and Antonio Moretto
-% and Gian Franco Gensini
-% and Marco Trabucchi},
-% volumes = {2},
-% publisher = {il Mulino},
-% location = {Bologna},
-% date = {2009}}
-%
-%@incollection{corrocher:2009,
-% author = {Roberto Corrocher},
-% title = {Riflessioni sull'uomo di fronte a nuove sfide},
-% pages = {27-42},
-% crossref = {Filmed:2009}}
-%
-%@incollection{federspil:2009,
-% author = {Giovanni Federspil and Roberto Vettor},
-% title = {Medicina: un unico metodo e una sola argomentazione?},
-% pages = {43-74},
-% crossref = {Filmed:2009}}
+%@collection{westfahl:frontier,
+% editor = {Westfahl, Gary},
+% title = {Space and Beyond},
+% date = {2000},
+% subtitle = {The Frontier Theme in Science Fiction},
+% publisher = {Greenwood},
+% location = {Westport, Conn. and London},
+% booktitle = {Space and Beyond},
+% booksubtitle = {The Frontier Theme in Science Fiction}}
+%
+%@incollection{westfahl:flying,
+% author = {Daniele Chatelain and George Slusser},
+% title = {Flying to the Moon in French and American Science Fiction},
+% pages = {25-33},
+% crossref = {westfahl:frontier}}
+%
+%@incollection{westfahl:space,
+% author = {Westfahl, Gary},
+% title = {The True Frontier},
+% subtitle = {Confronting and Avoiding the Realities of Space in {American}
+% Science Fiction Films},
+% pages = {55-65},
+% crossref = {westfahl:frontier}}
%\end{verbatim}\end{latexcode}
% When you have to cite \emph{only one} \bibtype{incollection} of a single \bibtype{collection} you have three choices.
% \smallskip
@@ -700,20 +724,23 @@ This work has the LPPL maintenance status "author-maintained".
% location = {Milano},
% date = {2007}}
%\end{verbatim}\end{latexcode}
-% 2. Put the \bibtype{collection} data in the fields of the \bibtype{incollection} entry \parencite[see][]{Valbusa:2007}. In this case the \bibtype{incollection} is self-contained:
+% 2. Put the \bibtype{collection} data in the fields of the \bibtype{incollection} entry \parencite[see][]{hyman}. In this case the \bibtype{incollection} is self-contained:
% \begin{bibexamplelist}
-%\item \fullcite{Valbusa:2007}.
+%\item \fullcite{hyman}.
% \end{bibexamplelist}
%\begin{latexcode}\begin{verbatim}
-%@incollection{Valbusa:2007,
-% author = {Ivan Valbusa},
-% title = {Psicologia e sistema in Alsted e in Wolff},
-% booktitle = {Christian Wolff tra psicologia empirica e
-% psicologia razionale},
-% publisher = {Georg Olms Verlag},
-% editor = {Ferdinando Luigi Marcolungo},
-% location = {Hildesheim and Zürich and London},
-% date = {2007}}
+%@incollection{hyman,
+% author = {Arthur Hyman},
+% editor = {O'Meara, Dominic J.},
+% title = {Aristotle's Theory of the Intellect and its Interpretation by
+% {Averroes}},
+% date = {1981},
+% booktitle = {Studies in {Aristotle}},
+% series = {Studies in Philosophy and the History of Philosophy},
+% number = {9},
+% publisher = {The Catholic University of America Press},
+% location = {Washington, D.C.},
+% pages = {161-191}}
%\end{verbatim}\end{latexcode}
% 3. Put the \bibtype{collection} data in the fields of the \bibtype{incollection} entry and put the \bibtype{collection} label in the \bibfield{xref} field of the \bibtype{incollection} \parencite[see][]{kant:kpv:xref,kant:ku:xref}\label{kant}:
% \begin{bibexamplelist}
@@ -758,9 +785,11 @@ This work has the LPPL maintenance status "author-maintained".
% ^^A
% ^^A ----------------------------------------------------------------
%
-% The treatment of classical works (a fuzzy concept) and other writings with uncertain or omitted date is not particularly difficult if you use the \sty{verbose} style, but with the \sty{classic} and \sty{modern} styles some difficulties inevitably impose clear choices. Anyway remember that every citation label is \emph{merely} a label and it does not affect in any way the object or the subject it refers to. The label ``Plato 1978'' simply means ``the entry in the bibliography which is alphabetized under the name `Plato' and the year `1978'{}''. All the information about the \emph{object} (in this case a book or a collection of writings) will be retrieved in the bibliography entry.
+% The treatment of classical works (a fuzzy concept) and other writings with uncertain or omitted date is not particularly difficult if you use the \sty{verbose} style, but with the \sty{classic} and \sty{modern} styles some difficulties inevitably impose clear choices.
%
-% So if a critical edition (or similar) exists you should cite it directly, such as \textcite{heidegger:sz}. If you do not like this ``anachronistic'' label you may use the \bibfield{shorthand} field, such as \cite{kant:kpv:xref}. Note that a ``shorthand intro'' is automatically printed when the entry is cited for the first time (see p. \pageref{kant}) and omitted afterwards. To turn off this feature load the option \opt{shorthandintro=false}. Of course in this case you will need a list of shorthands. If you do not like these solutions you can use the \bibfield{entrysubtype} or the \cmd{sdcite} command in order to get an author-title citation, such as \cite{aristotle:ethics} (see sections \ref{sec:newfields} and \ref{sec:commands:citations}).
+% If a critical edition (or similar) exists you should cite it directly, such as \textcite{heidegger:sz}. If you do not like this ``anachronistic'' label you may use the \bibfield{shorthand} field, such as \cite{kant:kpv:xref}. Note that a ``shorthand intro'' is automatically printed when the entry is cited for the first time (see p. \pageref{kant}) and omitted afterwards. To turn off this feature load the option \opt{shorthandintro=false}. Of course in this case you will need a list of shorthands. If you do not like these solutions you can use the \bibfield{entrysubtype} or the \cmd{sdcite} command in order to get an author-title citation, such as \cite{aristotle:ethics} (see sections \ref{sec:newfields} and \ref{sec:commands:citations}).
+%
+%\alert Anyway remember that every citation label is \emph{merely} a label and it does not affect in any way the object or the subject it refers to. The label ``Plato 1978'' simply means ``the entry in the bibliography which is alphabetized under the name `Plato' and the year `1978'{}''. All the information about the \emph{object} (in this case a book or a collection of writings) will be retrieved in the bibliography entry.
%
% ^^A ----------------------------------------------------------------
% ^^A
@@ -811,13 +840,13 @@ This work has the LPPL maintenance status "author-maintained".
%\end{bibexamplelist}
%\begin{latexcode}\begin{verbatim}
%@book{heidegger:sz,
-% author = {Martin Heidegger},
-% title = {Sein und Zeit},
-% edition = {18},
+% author = {Martin Heidegger},
+% title = {Sein und Zeit},
+% edition = {18},
% publisher = {Max Niemeyer Verlag},
-% location = {Tübingen},
-% date = {2001},
-% library = {Originally published in 1927 in the \emph{Jahrbuch
+% location = {Tübingen},
+% date = {2001},
+% library = {Originally published in 1927 in the \emph{Jahrbuch
% für Philosophie und phänomenologische Forschung (vol. VIII)},
% directed by H. Husserl}}
%\end{verbatim}\end{latexcode}
@@ -837,11 +866,11 @@ This work has the LPPL maintenance status "author-maintained".
%\end{bibexamplelist}
%\begin{latexcode}\begin{verbatim}
%@online{lehman:biblatex,
-% author = {Philipp Lehman},
-% title = {The \texttt{biblatex} Package},
-% subtitle = {Programmable Bibliographies and Citations},
-% version = {3.7},
-% date = {2016-11-16},
+% author = {Philipp Lehman},
+% title = {The \texttt{biblatex} Package},
+% subtitle = {Programmable Bibliographies and Citations},
+% version = {3.7},
+% date = {2016-11-16},
% annotation = {This package provides advanced bibliographic facilities
% for use with \LaTeX. The package is a complete reimplementation
% of the bibliographic facilities provided by \LaTeX. The
@@ -874,7 +903,7 @@ This work has the LPPL maintenance status "author-maintained".
%\begin{bibexample}
%\begin{minipage}{.9\textwidth}
% \begin{NoHyper}
-% Medicine is an art\footnote{\emphasize{\cite[12-13]{corrocher:2009}.}} but it is also a science.\footnote{\emphasize{\textcite[12-13]{corrocher:2009}.}}
+% Medicine is an art\footnote{\emphasize{Garlik 1978, p. 13.}} but it is also a science.\footnote{\emphasize{Garlik (1978, p. 13)}}
%\end{NoHyper}
%\end{minipage}
%\end{bibexample}
@@ -883,11 +912,12 @@ This work has the LPPL maintenance status "author-maintained".
%
% The same as \cmd{cite}, but omits the author's (editor's) name (defined only for the \sty{verbose} style). Here is an example:
%\begin{bibexample}
-% This topic is discussed in P. Rossi, \emph{History of Types}, La TeXnica, Verona 2007 and in the recent \emph{Types of History}, Typographica, Milano 2008.
+% The topic is discussed in P. Rossi, \emph{History of Types}, La TeXnica, Verona 2007 and in the recent \emph{Types of History}, Typographica, Milano 2008.
%\end{bibexample}
%\begin{latexcode}
%\begin{verbatim}
-% This topic is discussed in \cite{Rossi:2007} and in the recent \ccite{Rossi:2008}.
+% The topic is discussed in \cite{Rossi:2007} and in the recent
+% \ccite{Rossi:2008}.
%\end{verbatim}
%\end{latexcode}
%\end{ltxsyntax}
@@ -904,7 +934,7 @@ This work has the LPPL maintenance status "author-maintained".
% ^^A
% ^^A ----------------------------------------------------------------
%
-%\begin{optionlist}
+%\begin{optionlist*}
%\optitem[semicolon]{relatedformat}{\opt{semicolon}\OR\opt{parens}\OR\opt{brackets}}
%\begin{valuelist}
%\item[semicolon]
@@ -1026,7 +1056,8 @@ This work has the LPPL maintenance status "author-maintained".
% It requires \sty{babel} or \sty{polyglossia}.
% If \opt{true} it doubles the last consonant of the abbreviations such as ``p.'', ``vol.'', ``col.'', etc., when used in the plural form. For example you will have ``p.'' for ``page'' and ``pp.'' for ``pages''. This habit is very common in Italian writings even if it remains useless.
%\begin{bibexample}
-% Corrocher, Roberto (2009), ``Riflessioni sull’uomo di fronte a nuove sfide'', in Giaretta et al. (2009), \emphasize{pp.} 27-42.
+% Chatelain, Daniele e George Slusser (2000), «Flying to the Moon
+% in French and American Science Fiction», in Westfahl (2000a), \emphasize{pp.} 25-33.
%\end{bibexample}
%^^A A similar setting is adopted for the default English and Spanish localization modules which, for example, use ``cols.'' for ``columns'' and ``pp'' for ``pages''.
%
@@ -1040,7 +1071,7 @@ This work has the LPPL maintenance status "author-maintained".
%\cmd{printbibliography}[annotation=true]
%\end{ttquote}
%
-% \end{optionlist}
+% \end{optionlist*}
%
% ^^A ----------------------------------------------------------------
% ^^A
@@ -1049,7 +1080,7 @@ This work has the LPPL maintenance status "author-maintained".
% ^^A
% ^^A ----------------------------------------------------------------
%
-% \begin{optionlist}
+% \begin{optionlist*}
%
%\boolitem[false]{latinemph}
% Prints the \emph{latinitas} ``et al.'' (\emph{et alii}) in italic shape.
@@ -1060,7 +1091,7 @@ This work has the LPPL maintenance status "author-maintained".
%
%\boolitem[true]{nodate} Prints the \texttt{nodate} string (localized) when \bibfield{year} or \bibfield{date} is missing. Yo can set this option globally in the package options or in the optional argument of \cmd{printbibliography}.
%
-% \end{optionlist}
+% \end{optionlist*}
%
% ^^A ----------------------------------------------------------------
% ^^A
@@ -1068,7 +1099,7 @@ This work has the LPPL maintenance status "author-maintained".
% ^^A
% ^^A ----------------------------------------------------------------
%
-% \begin{optionlist}
+% \begin{optionlist*}
%
%\boolitem[false]{yearleft}
%
@@ -1082,7 +1113,7 @@ This work has the LPPL maintenance status "author-maintained".
%\cmd{printbibliography}[restoreclassic,type=online]
%\end{ttquote}
%
-% \end{optionlist}
+% \end{optionlist*}
%
% ^^A ----------------------------------------------------------------
% ^^A
@@ -1090,7 +1121,7 @@ This work has the LPPL maintenance status "author-maintained".
% ^^A
% ^^A ----------------------------------------------------------------
%
-% \begin{optionlist}
+% \begin{optionlist*}
%
%\boolitem[false]{latinemph}
% Prints the \emph{latinitates} ``{ivi}'', ``{ibidem}'' and ``et al.'' in italic shape.
@@ -1100,7 +1131,7 @@ This work has the LPPL maintenance status "author-maintained".
% \begin{bibexample}
%``Descartes, \emph{Discours de la méthode}\emphasize{,} cit.''.
% \end{bibexample}
-%\end{optionlist}
+%\end{optionlist*}
%
%
%
@@ -1336,7 +1367,7 @@ This work has the LPPL maintenance status "author-maintained".
% ^^A
% ^^A ----------------------------------------------------------------
%
-%\begin{optionlist}
+%\begin{optionlist*}
%\optitem[trans]{origfields}{\opt{trans}\OR\opt{none}\OR\opt{edorig}}
%\begin{valuelist}
%\item[true] Prints the \bibfield{orig-} fields.
@@ -1364,7 +1395,7 @@ This work has the LPPL maintenance status "author-maintained".
%Same as \opt{scauthors=cite}.
%\boolitem[false]{scauthors}
%Same as \opt{scauthors=bibcite}.
-%\end{optionlist}
+%\end{optionlist*}
%
% \section{Known issues}
%
@@ -1379,7 +1410,7 @@ This work has the LPPL maintenance status "author-maintained".
%\printbibheading[heading=bibintoc,title=Examples]
%\printshorthands[heading=subbibliography,title=Shorthands]
%\printbibliography[heading=subbibliography,title=A Web List,
-% keyword=web,restoreclassic,prenote=weblist,annotation=false]
+% category=web,restoreclassic,prenote=weblist,annotation=false]
%\printbibliography[heading=subbibliography,title=Philosophy
% examples,prenote=philosophy-examples,keyword=esempio]
%
@@ -2318,10 +2349,8 @@ This work has the LPPL maintenance status "author-maintained".
\usebibmacro{finentry}}
\newbibmacro*{crossrefdata}{%
- \iffieldundef{maintitle}
- {\printfield{volume}%
- \printfield{part}}
- {}%
+ \printfield{volume}%
+ \printfield{part}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit\newblock
@@ -4947,7 +4976,16 @@ This work has the LPPL maintenance status "author-maintained".
columns = {{colonne}{\iftoggle{bbx:classical}{coll\adddot}{col\adddot}}},
lines = {{righe}{\iftoggle{bbx:classical}{rr\adddot}{r\adddot}}},
verses = {{versi}{\iftoggle{bbx:classical}{vv\adddot}{v\adddot}}},
+ % section = {{}{\S}},% FIXME: missing
+ % sections = {{}{\S\S}},% FIXME: missing
paragraphs = {{paragrafi}{\iftoggle{bbx:classical}{parr\adddot}{par\adddot}}},
+ pagetotals = {{pagine}{\iftoggle{bbx:classical}{pp\adddot}{p\adddot}}},
+ columntotals = {{colonne}{\iftoggle{bbx:classical}{coll\adddot}{col\adddot}}},
+ linetotals = {{righe}{\iftoggle{bbx:classical}{rr\adddot}{r\adddot}}},
+ versetotals = {{versi}{\iftoggle{bbx:classical}{vv\adddot}{v\adddot}}},
+ % sectiontotal = {{}{}},% FIXME: missing
+ % sectiontotals = {{}{}},% FIXME: missing
+ paragraphtotals = {{paragrafi}{\iftoggle{bbx:classical}{parr\adddot}{par\adddot}}},
byreviser = {{revisione di}{rev\adddotspace di}},
translationof = {{traduzione di}{trad\adddotspace di}},
translationas = {{traduzione italiana}{trad\adddotspace it\adddot}},
@@ -5726,19 +5764,6 @@ This work has the LPPL maintenance status "author-maintained".
timestamp = {2012.04.25}
}
-@incollection{Valbusa:2007,
- author = {Ivan Valbusa},
- title = {Psicologia e sistema in Alsted e in Wolff},
- booktitle = {Christian Wolff tra psicologia empirica
- e psicologia razionale},
- publisher = {Georg Olms Verlag},
- editor = {Ferdinando Luigi Marcolungo},
- date = {2007},
- langid = {italian},
- keywords = {esempio},
- location = {Hildesheim and Zürich and London}
-}
-
@online{wassenhoven:dw,
annotation = {\texttt{biblatex-dw} is a small collection
of styles for the \texttt{biblatex} package.
@@ -5769,61 +5794,6 @@ This work has the LPPL maintenance status "author-maintained".
title = {Vite matematiche}
}
-@collection{Filmed:2009,
- annotation = {A collection with four editors. The list
- is automatically truncated in the citations},
- booktitle = {Filosofia delle medicina},
- date = {2009},
- editor = {Pierdaniele Giaretta and Antonio Moretto
- and Gian Franco Gensini and Marco Trabucchi},
- langid = {italian},
- keywords = {esempio},
- location = {Bologna},
- publisher = {il Mulino},
- subtitle = {Metodo, modelli, cura ed errori},
- title = {Filosofia delle medicina},
- volumes = {2}
-}
-
-@incollection{corrocher:2009,
- author = {Roberto Corrocher},
- title = {Riflessioni sull'uomo di fronte a nuove sfide},
- pages = {27-42},
- annotation = {An \texttt{@incollection} entry.
- The \texttt{@collection} is automatically
- printed in the bibliography because
- another \texttt{@incollection} has been cited.},
- crossref = {Filmed:2009},
- langid = {italian},
- keywords = {esempio},
- read = {0}
-}
-
-@incollection{federspil:2009,
- author = {Giovanni Federspil and Roberto Vettor},
- title = {Medicina: un unico metodo e una sola argomentazione?},
- pages = {43-74},
- annotation = {An \texttt{@incollection} entry. The \texttt{@collection}
- is automatically printed in the bibliography because
- another \texttt{@incollection} has been cited.},
- crossref = {Filmed:2009},
- langid = {italian},
- keywords = {esempio}
-}
-
-@online{ctan,
- annotation = {The official website of the Comprehensive \TeX\ Archive Network},
- bdsk-url-1 = {http://www.ctan.org},
- date = {2006},
- langid = {american},
- keywords = {web},
- label = {CTAN},
- subtitle = {The Comprehensive \TeX\ Archive Network},
- title = {CTAN},
- url = {http://www.ctan.org},
- urldate = {2006-10-01}
-}
-
@online{guit:sito,
annotation = {The official website of the Italian \TeX\ Group},
bdsk-url-1 = {http://www.guitex.org},
@@ -5834,6 +5804,12 @@ This work has the LPPL maintenance status "author-maintained".
url = {http://www.guitex.org},
urldate = {2012-01-15}
}
+@incollection{westfahl:flying,
+ author = {Daniele Chatelain and George Slusser},
+ title = {Flying to the Moon in French and American Science Fiction},
+ pages = {25-33},
+ crossref = {westfahl:frontier},
+}
%</bib>
% \fi
-% \Finale
+% \Finale \ No newline at end of file
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-philosophy/biblatex-philosophy.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-philosophy/biblatex-philosophy.pdf
index 8f439b6907..6e7969f276 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-philosophy/biblatex-philosophy.pdf
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-philosophy/biblatex-philosophy.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/doc/chapter1.tex b/macros/latex/contrib/easybook/doc/chapter1.tex
index cca66cef33..58d20eb0e8 100644
--- a/macros/latex/contrib/easybook/doc/chapter1.tex
+++ b/macros/latex/contrib/easybook/doc/chapter1.tex
@@ -61,7 +61,7 @@
\zhlipsum*[59][name = aspirin]
\end{ebparbox}
-\begin{exercise}+[LightBlue][1.](习题)[after skip = 3ex][\zhlipsum*[20][name = zhufu]]
+\begin{exercise}+[LightBlue][1.](习题)[after skip = 3.25ex][\zhlipsum*[20][name = zhufu]]
\index{x@习题环境}
\item \zhlipsum*[20][name = zhufu]
\begin{tasks}
diff --git a/macros/latex/contrib/easybook/doc/easybook-demo.pdf b/macros/latex/contrib/easybook/doc/easybook-demo.pdf
index 280972b9ae..eca98d1e78 100644
--- a/macros/latex/contrib/easybook/doc/easybook-demo.pdf
+++ b/macros/latex/contrib/easybook/doc/easybook-demo.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/doc/easybook-demo.tex b/macros/latex/contrib/easybook/doc/easybook-demo.tex
index 6e41e8f790..2d618acbf0 100644
--- a/macros/latex/contrib/easybook/doc/easybook-demo.tex
+++ b/macros/latex/contrib/easybook/doc/easybook-demo.tex
@@ -72,6 +72,7 @@
{
hang = false,
line-align = true,
+ numsep-all = \ccwd,
part =
{
format = \addvspace{1pc}\sffamily\large,
@@ -105,7 +106,7 @@
\url{https://latexstudio.net} \\
\url{https://gitee.com/texl3/easybook}\thanks{Gitee为项目的主要发布地址。}
}
-\date{2021/04/19\hskip\ccwd\relax v1.24o}
+\date{2021/04/20\hskip\ccwd\relax v1.24p}
\frontmatter[roman]
\maketitle
diff --git a/macros/latex/contrib/easybook/doc/easybook.pdf b/macros/latex/contrib/easybook/doc/easybook.pdf
index 1b53ae5a8a..efb9d7f7bd 100644
--- a/macros/latex/contrib/easybook/doc/easybook.pdf
+++ b/macros/latex/contrib/easybook/doc/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index 0f21f5784b..6a5c1f3770 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -55,7 +55,7 @@ The latest version of this license is in
%
% \title{\sffamily easybook 书籍文档类}
% \author{瞿毅}
-% \date{2021/04/19\hskip\ccwd\relax v1.24o\thanks{\url{https://gitee.com/texl3/easybook}}}
+% \date{2021/04/20\hskip\ccwd\relax v1.24p\thanks{\url{https://gitee.com/texl3/easybook}}}
% \maketitle
% \begin{abstract}
% \cls{easybook} 是基于 \cls{ctexbook} 书籍文档类创建以极简为风格的模板,可以看作对 \cls{ctexbook} 的进一步包装。虽然\CTeX 文档类提供了较好的中文支持,但想实现个性化功能一般需要在其基础上载入更多宏包来定制。\cls{easybook} 考虑了一些细节并载入一些常用宏包实现一般的排版需求,它适用于排版中英文书籍或笔记,甚至可稍加调整成为学位论文模板。
@@ -141,6 +141,14 @@ The latest version of this license is in
% 设置页面大小,交给 \pkg{geometry} 宏包处理,可使用它支持的所有规格。建议选项 \opt{b5paper} 和 \opt{zihao = 5},选项 \opt{a4paper} 和 \opt{zihao = -4} 配合。
% \end{function}
%
+% \begin{function}[rEXP,added = 2021-01-08,updated = 2021-04-20]{config}
+% \begin{syntax}
+% config = <配置文件名>
+% \end{syntax}
+% \opt{config}为载入用户配置选项,配置文件名不需加括号但需带有后缀名如 \opt{tex}、\opt{def} 和 \opt{cfg}。
+% \changes{v1.10}{2021/01/08}{加入载入用户配置选项。}
+% \end{function}
+%
% \subsection{article 模式}
% \begin{function}[rEXP,added = 2021-03-16]{class}
% \begin{syntax}
@@ -174,7 +182,7 @@ The latest version of this license is in
% \end{syntax}
% \opt{multoc} 与 \opt{style/multoc} 选项具有相同的效果,但是具有优先性且可单独设置不同目录是否双栏排版。已经预置了中英文的目录标题,可以使用 \opt{title} 选项更改目录标题的名称。\opt{book} 选项使目录标题按照 \opt{chapter} 级别输出,\opt{article} 选项使目录标题按照 \opt{article} 级别输出,默认为 \opt{chapter} 级别。
% \changes{v1.23}{2021/03/15}{为几个目录增加键值列表的选项,可设置标题输出级别以及是否加入主目录。}
-% \changes{v1.24o}{2021/04/04}{目录命令的可选参数增加标题键值。}
+% \changes{v1.24p}{2021/04/04}{目录命令的可选参数增加标题键值。}
% \end{function}
%
% \section{接口选项}
@@ -197,14 +205,6 @@ The latest version of this license is in
% \end{center}
% \end{function}
%
-% \begin{function}[EXP,added = 2021-01-08]{config}
-% \begin{syntax}
-% config = <配置文件名>
-% \end{syntax}
-% \opt{config}为载入用户配置选项,配置文件名不需加括号但需带有后缀名如 \opt{tex}、\opt{def} 和 \opt{cfg}。
-% \changes{v1.10}{2021/01/08}{加入载入用户配置选项。}
-% \end{function}
-%
% \subsection{风格}
% \label{subsec:style}
% \begin{function}[EXP,added = 2021-01-05,updated = 2021-04-11]{color,color-all,multoc,withpart,footwith,notomath,rulewidth,uppercase,figure-sep,table-sep,listing-sep,equation-sep,number-sep}
@@ -265,7 +265,7 @@ The latest version of this license is in
% \ding{229} 以上选项路径为 \opt{link/...} \\
% \opt{link} 将超链接选项(包括以上选项)交给 \pkg{hyperref} 处理,除了一些关于 pdf 书签的选项可能会失效,其它由键值选项命令 \tn{hypersetup} 支持的多数选项可用。
% \changes{v1.10}{2021/01/08}{修复了 \opt{linktopage} 选项关闭时目录中标题编号无超链接的问题。}
-% \changes{v1.24o}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。}
+% \changes{v1.24p}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。}
% \end{function}
%
% \begin{optdesc}
@@ -344,7 +344,7 @@ The latest version of this license is in
% \ding{229} 以上选项路径为 \opt{bibset/...}
% \changes{v1.21}{2021/01/11}{增加 \opt{bibset} 选项,可以使用 \hologo{BibTeX} 或 \hologo{biber} 编译参考文献。}
% \changes{v1.23}{2021/02/23}{使用 \opt{bibset} 选项时可设置标注风格。}
-% \changes{v1.24o}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。}
+% \changes{v1.24p}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。}
% \end{function}
%
% \begin{optdesc}
@@ -444,12 +444,11 @@ The latest version of this license is in
%
% \subsection{页面尺寸}
% \label{subsec:page margins}
-% \begin{function}[EXP,added = 2021-01-13,updated = 2021-03-21]{footnotemargin,footparskip,footparindent,list-labelsep,left,top,hmargin,textwidth,includehead}
+% \begin{function}[EXP,added = 2021-01-13,updated = 2021-03-21]{footnotemargin,footparskip,footparindent,left,top,hmargin,textwidth,includehead}
% \begin{syntax}
% footnotemargin = <脚注首行缩进|(0.5\tn{ccwd})>
% footparskip = <脚注段落间距|(0ex)>
% footparindent = <脚注分段缩进|(2\tn{ccwd})>
-% list-labelsep = <索引目录编号与标题的间距|(\tn{ccwd})>
% left = <页面左边距>
% top = <页面上边距>
% hmargin = \marg{左边距,右边距}
@@ -467,8 +466,7 @@ The latest version of this license is in
% top = 2.5cm,
% bottom = 2.5cm,
% left = 3.2cm,
-% right = 3.2cm,
-% list-labelsep = \hspace{0.5\ccwd}
+% right = 3.2cm
% }
% \end{ctexexam}
%
@@ -492,7 +490,7 @@ The latest version of this license is in
% \changes{v1.21}{2021/01/13}{增加配置页眉页脚的选项。}
% \changes{v1.23}{2021/03/08}{优化页眉页脚设置,增加 \opt{chap-mark} 和 \opt{sec-mark} 标志选项。}
% \changes{v1.23}{2021/03/14}{可以手动绘制页眉、页脚和脚注的横线。}
-% \changes{v1.24o}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 \opt{article} 模式生效。}
+% \changes{v1.24p}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 \opt{article} 模式生效。}
% \end{function}
%
% \begin{function}[added = 2021-01-13,updated = 2021-03-14]{\easyhead,\easyfoot}
@@ -519,24 +517,29 @@ The latest version of this license is in
%
% \subsection{目录样式}
% \label{subsec:catalog style}
-% \begin{function}[EXP,added = 2021-01-13,updated = 2021-01-15]{format,indent,rule}
+% \begin{function}[EXP,added = 2021-01-13,updated = 2021-04-20]{format,indent,rule,numsep}
% \begin{syntax}
% format = <目录标题格式>
% indent = <目录标题左边缩进>
% rule = <目录引导线样式>
+% numsep = <编号后间距|(\tn{ccwd})>
% \end{syntax}
% \ding{229} 以上选项路径为 \opt{tocset/(level)/...} \\
% \opt{tocset} 将目录样式交给 \pkg{titletoc} 处理,\opt{level} 代表 \opt{part}、\opt{chapter}、\opt{section}、\opt{subsection} 和 \opt{lists} 五种级别的目录样式设置,其中 \opt{lists} 为图片、表格和代码目录样式的级别。
%
-% \opt{format} 是目录中标题的格式,可以设置字体和加入垂直间距等,垂直间距最好使用无间距重合的 \tn{addvspace} 命令。\opt{indent} 是目录中标题在页面左侧的缩进距离,应该有长度单位。\opt{rule} 选项中一般应当使用 \tn{tocrule} 命令,将会在接下来介绍。
+% \opt{format} 是目录中标题的格式,可以设置字体和加入垂直间距等,垂直间距最好使用无间距重合的 \tn{addvspace} 命令。\opt{indent} 是目录中标题在页面左侧的缩进距离,应该有长度单位。\opt{rule} 选项中一般应当使用 \tn{tocrule} 命令,将会在接下来介绍。\opt{numsep} 是有编号的标题在目录中编号与标题的间距。
% \changes{v1.21}{2021/01/13}{增加配置目录样式的选项。}
+% \changes{v1.24p}{2021/04/20}{增加目录中编号与标题的间距选项 \opt{numsep}。}
% \end{function}
%
-% \begin{function}[added = 2021-01-13,updated = 2021-04-06]{\tocrule}
+% \begin{function}[added = 2021-01-13,updated = 2021-04-20]{\tocrule,\EbNumberline}
% \begin{syntax}
% \tn{tocrule}*\oarg{引导点间距|(0.7pc)}\parg{引导点大小|(1.2)}\marg{引导点}\oarg{页码格式}
+% \tn{EbNumberline}\marg{编号类型}
% \end{syntax}
% \tn{tocrule} 命令生成目录引导线,需要在 \opt{rule} 选项中使用。带有星号的命令会使当前级别的目录引导线右边与页码连接而不是对齐。引导点间距需带有长度单位,引导点大小不带单位,为引导点符号正常大小的倍数,引导点一般为英文句号或 \tn{cdot} 中心点符号。页码格式的内容位于页码前面,可以设置页码字体、距离。
+%
+% \tn{EbNumberline} 命令类似\CTeX 的 \tn{CTEXnumberline} 命令,用于 \opt{tocline} 选项中设置目录标签的编号。区别是它需要在 \opt{tocset/hang = false} 时使用,否则目录中无法显示标题编号,使用它的时候 \opt{numsep} 选项仍然有效。\meta{编号类型} 为 \opt{chapter} 和 \opt{section} 等,也可用参数\#1代替当前级别类型,标题名用参数\#2代替一般不变。
% \end{function}
%
% \begin{ctexexam}
@@ -551,7 +554,7 @@ The latest version of this license is in
% }
% \end{ctexexam}
%
-% \begin{function}[EXP,added = 2021-01-13,updated = 2021-04-19]{lists/lolskip,lists/belowoffset,tocset/tocline-fig,tocset/tocline-tab,tocset/tocline-lst,tocset/belowoffset,tocset/line-align,tocset/hang}
+% \begin{function}[EXP,added = 2021-01-13,updated = 2021-04-19]{lists/lolskip,lists/belowoffset,tocset/tocline-fig,tocset/tocline-tab,tocset/tocline-lst,tocset/belowoffset,tocset/line-align,tocset/hang,tocset/numsep-all,tocset/indent-all}
% \begin{syntax}
% lolskip = <(0.8pc)>
% belowoffset = <(0pc)>
@@ -561,22 +564,31 @@ The latest version of this license is in
% belowoffset = <(-1pc)>
% line-align = <(true)|false>
% hang = <true|(false)>
+% numsep-all = <编号后间距|(\tn{ccwd})>
+% indent-all = <目录标题左边缩进>
% \end{syntax}
-% \opt{lolskip} 是代码目录中章之间的代码标题的距离,与\CTeX 的表格目录和图片目录中章之间的标题距离选项 \opt{lotskip} 和 \opt{lofskip} 类似,它们的值均默认0.8 pc,在 \opt{article} 模式中此选项失效。目录标签整体使用 \opt{tocline} 设置,也可使用小节 \ref{subsec:page margins} 的 \opt{list-labelsep} 选项只设置编号与标题的间距。在图表标签的参数中\#1代表编号,代码标签中则是 \tn{thelstlisting} 代表编号,标签中还可包含标签名称,默认标签名称与图、表和代码环境的标题名称一致。下面举个设置标签的例子
-% \changes{v1.24o}{2021/04/05}{可以设置图、表和代码目录的标签。}
-% \changes{v1.24o}{2021/04/06}{增加目录引导线右边对齐方式。}
-% \changes{v1.24o}{2021/04/19}{给目录增加 \opt{hang} 样式选项。}
+% \ding{229} 以上选项路径为 \opt{tocset/lists/...} 或 \opt{tocset/...}
+% \changes{v1.24p}{2021/04/05}{可以设置图、表和代码目录的标签。}
+% \changes{v1.24p}{2021/04/06}{增加目录引导线右边对齐方式。}
+% \changes{v1.24p}{2021/04/19}{给目录增加 \opt{hang} 样式选项。}
% \end{function}
%
-% \begin{ctexexam}
+% \begin{optdesc}
+% \item[lolskip] \opt{lolskip} 是代码目录中章之间的代码标题的距离,与\CTeX 的表格目录和图片目录中章之间的标题距离选项 \opt{lotskip} 和 \opt{lofskip} 类似,它们的值均默认0.8 pc,在 \opt{article} 模式中此选项失效。
+% \item[belowoffset] \opt{belowoffset} 选项为主目录标题 \tn{contentsname} 后的间距补偿,一般为负值,用于抵消 \opt{format} 中设置的垂直间距。\opt{lists} 中的 \opt{belowoffset} 与之意义类似,但是一般为正值,可以在 \opt{article} 模式中使用。建议 \opt{lists/lolskip(0.8pc) + lists/format/addvspace(0.2pc) + lists/belowoffset(0pc) = belowoffset(-1pc)}。
+% \item[tocline] 目录标签整体使用 \opt{tocline} 设置,在图表标签的参数中\#1代表编号,代码标签中则是 \tn{thelstlisting} 代表编号,标签中还可包含标签名称,默认标签名称与图、表和代码环境的标题名称一致。下面举个设置标签的例子
+% \begin{ctexexam}
% \tocset
% {
% tocline-fig = 图#1\hspace{\ccwd}
% tocline-lst = 代码\thelstlisting\hspace{\ccwd}
% }
-% \end{ctexexam}
-%
-% \opt{belowoffset} 选项为主目录标题 \tn{contentsname} 后的间距补偿,一般为负值,用于抵消 \opt{format} 中设置的垂直间距。\opt{lists} 中的 \opt{belowoffset} 与之意义类似,但是一般为正值,可以在 \opt{article} 模式中使用。建议 \opt{lists/lolskip(0.8pc) + lists/format/addvspace(0.2pc) + lists/belowoffset(0pc) = belowoffset(-1pc)}。\opt{line-align} 选项可以使目录引导线右边对齐并与页码保持一定间隙,否则会与页码连接。\opt{hang} 选项使目录标题为悬挂缩进形式,缩进距离为编号及其与标题间距的长度,但此时目录编号会失去超链接。
+% \end{ctexexam}
+% \item[line-align] \opt{line-align} 选项可以使目录引导线右边对齐并与页码保持一定间隙,否则会与页码连接。
+% \item[hang] \opt{hang} 选项使目录标题为悬挂缩进形式,缩进距离为编号及其与标题间距的长度,但此时目录编号会失去超链接。
+% \item[numsep-all] 统一设置所有有编号的标题在目录中编号与标题的间距。
+% \item[indent-all] 统一设置所有级别的目录标题左边缩进。
+% \end{optdesc}
%
% \section{常用环境}
%
@@ -598,7 +610,7 @@ The latest version of this license is in
% \tn{end}\marg{环境名}
% \end{syntax}
% \pkg{enumitem} 宏包为系统预置的列表环境 \env{enumerate}、\env{itemize}和 \env{description} 提供了更灵活的标签以及间距的控制,可使用 \tn{setlist} 命令设置原有的三种列表格式,也可以直接使用可选参数的键值列表,具体选项见 \pkg{enumitem} 宏包文档。已为三种列表预置了三个级别的格式可相互嵌套,默认标签与 \cls{book} 文档类相同,若自定义标签可例如
-% \changes{v1.24o}{2021/04/08}{重新优化列表环境的配置。}
+% \changes{v1.24p}{2021/04/08}{重新优化列表环境的配置。}
% \end{function}
%
% \begin{ctexexam}
@@ -658,9 +670,9 @@ The latest version of this license is in
% \ \tn{item} <习题内容>
% \tn{end}\marg{exercise}
% \end{syntax}
-% 习题环境 \env{exercise} 的标题紧接上一节编号并加入目录与页眉,当使用星号参数时不进行编号,使用+号参数启用 \pkg{tcolorbox} 支持生成标题。\oarg{颜色名} 选项在使用+号参数时有效,其中颜色为自定义或 \pkg{xcolor} 包含的颜色名称。题目编号格式与小节 \ref{subsec:sort list} 排序列表相同,标题名默认为习题。
+% 习题环境 \env{exercise} 的标题紧接上一节编号并加入目录与页眉,当使用星号参数时不进行编号,使用+号参数启用 \pkg{tcolorbox} 支持生成标题。\meta{颜色名} 选项在使用+号参数时有效,其中颜色为自定义或 \pkg{xcolor} 包含的颜色名称。题目编号格式与小节 \ref{subsec:sort list} 排序列表相同,标题名默认为习题。
%
-% 配置选项在是否使用+号参数时用法不同,使用+号参数时为 \pkg{tcolorbox} 的盒子选项,例如 \opt{boxrule} 和 \opt{fontupper}。不使用+号参数时相当于设置 \tn{ctexset}\marg{section = {\#1}} 键值选项列表,例如 \opt{format} 和 \opt{beforeskip}。\oarg{序言} 选项用于在习题环境开始前插入一段内容,可以是文本或者代码。注意,环境具有相同定界符的可选参数只能\textbf{从右往左}省略,省略的参数使用默认值。
+% 配置选项在是否使用+号参数时用法不同,使用+号参数时为 \pkg{tcolorbox} 的盒子选项,例如 \opt{boxrule} 和 \opt{fontupper}。不使用+号参数时相当于设置 \tn{ctexset}\marg{section = {\#1}} 键值选项列表,例如 \opt{format} 和 \opt{beforeskip}。\meta{序言} 选项用于在习题环境开始前插入一段内容,可以是文本或者代码。注意,环境具有相同定界符的可选参数只能\textbf{从右往左}省略,省略的参数使用默认值。
% \changes{v1.23}{2021/02/08}{增加准确的习题盒子标题目录锚点。}
% \end{function}
%
@@ -699,7 +711,7 @@ The latest version of this license is in
% \ <盒子内容>
% \tn{end}\marg{easybox}
% \end{syntax}
-% 环境 \env{easybox} 创建一个带有三个可选参数的扁平盒子。使用星号参数时给盒子添加边框,\oarg{颜色名} 选项设置背景颜色,\parg{段落标题} 选项可以设置标题,默认无标题。
+% 环境 \env{easybox} 创建一个带有三个可选参数的扁平盒子。使用星号参数时给盒子添加边框,\meta{颜色名} 选项设置背景颜色,\meta{段落标题} 选项可以设置标题,默认无标题。
% \end{function}
%
% \begin{ctexexam}
@@ -716,8 +728,8 @@ The latest version of this license is in
% \ <盒子内容>
% \tn{end}\marg{ebparbox}
% \end{syntax}
-% 环境 \env{ebparbox} 与 \env{easybox} 类似,同样带有三个可选参数。当使用星号参数时盒子左边带有一条竖线,\oarg{颜色名} 选项可以自定义竖线颜色,使用不带有星号的环境则盒子带有竖线颜色的浅色背景。\parg{段落标题} 选项可以设置标题,默认无标题。
-% \changes{v1.24o}{2021/04/19}{优化盒子环境的选项,增加可带有标题的扁平盒子 \env{ebparbox}。}
+% 环境 \env{ebparbox} 与 \env{easybox} 类似,同样带有三个可选参数。当使用星号参数时盒子左边带有一条竖线,\meta{颜色名} 选项可以自定义竖线颜色,使用不带有星号的环境则盒子带有竖线颜色的浅色背景。\meta{段落标题} 选项可以设置标题,默认无标题。
+% \changes{v1.24p}{2021/04/19}{优化盒子环境的选项,增加可带有标题的扁平盒子 \env{ebparbox}。}
% \end{function}
%
% \subsubsection{行内盒子}
@@ -766,7 +778,7 @@ The latest version of this license is in
% \tn{ch}\oarg{键值列表}\marg{输入}
% \tn{chemfig}\oarg{键值列表}\marg{分子代码}
% \end{syntax}
-% 除了以普通公式的方式,化学式还可用 \pkg{chemformula} 实现,无机化学式使用 \tn{ch} 命令书写。有机化学式推荐在导言区载入 \pkg{chemfig} 宏包,使用\tn{chemfig} 命令完成。
+% 除了以普通公式的方式,化学式还可用 \pkg{chemformula} 实现,无机化学式使用 \tn{ch} 命令书写。有机化学式推荐在导言区载入 \pkg{chemfig} 宏包,使用 \tn{chemfig} 命令完成。
% \end{function}
%
% \subsection{引用}
@@ -776,7 +788,7 @@ The latest version of this license is in
% \tn{labelformat}\marg{计数器}\marg{标签引用格式}
% \end{syntax}
% 使用 \tn{ref} 命令进行引用将会自动检测环境并添加相应的前缀,\tn{labelformat} 可以设置标签引用格式,第二个参数中\#1代表 \tn{the}\meta{计数器},可以设置引用序号的前缀和后缀。
-% \changes{v1.24o}{2021/04/11}{取消载入 \pkg{cleveref} 宏包来交叉引用。}
+% \changes{v1.24p}{2021/04/11}{取消载入 \pkg{cleveref} 宏包来交叉引用。}
% \end{function}
%
% \subsubsection{索引}
@@ -886,7 +898,7 @@ The latest version of this license is in
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplClass{easybook}{2021/04/19}{1.24o}{beta}
+\ProvidesExplClass{easybook}{2021/04/20}{1.24p}{beta}
\cs_generate_variant:Nn \__ctex_define:nn {nx}
\cs_generate_variant:Nn \int_to_arabic:n {v}
@@ -909,6 +921,7 @@ The latest version of this license is in
\bool_set_true:N \l__eb_zhtitle_bool
\bool_set_true:N \l__eb_page_twoside_bool
\bool_set_true:N \l__eb_class_book_bool
+\tl_new:N \g__eb_config_tl
\clist_new:N \g__eb_options_clist
\keys_define:nn {easybook}
@@ -960,6 +973,7 @@ The latest version of this license is in
},
class .initial:n = book,
+ config .tl_set:N = \g__eb_config_tl,
unknown .code:n =
{\clist_gput_right:No \g__eb_options_clist{\CurrentOption}}
}
@@ -988,7 +1002,6 @@ The latest version of this license is in
\bool_new:N \l__eb_uppercase_bool
\bool_new:N \l__eb_chap_withpart_bool
\tl_new:N \l__eb_foot_numberwith_tl
-\tl_new:N \g__eb_config_tl
\seq_const_from_clist:Nn \c__eb_options_path_seq
{
@@ -1003,7 +1016,6 @@ The latest version of this license is in
}
\ctex_define:n
{
- config .tl_set:N = \g__eb_config_tl,
lstlistlistingname .tl_set:N = \lstlistlistingname,
lstlistingname .tl_set:N = \lstlistingname
}
@@ -1057,8 +1069,13 @@ The latest version of this license is in
}
\ctex_at_end_preamble:n
{
- \bool_if:NT \l__eb_notomath_bool{\RequirePackage{newtxmath,bm}}
- \tl_if_empty:NF \g__eb_config_tl{\file_input:n {\g__eb_config_tl}}
+ \bool_if:NT \l__eb_notomath_bool
+ {\RequirePackage{newtxmath,bm}}
+ }
+\ctex_at_end:n
+ {
+ \tl_if_empty:NF \g__eb_config_tl
+ {\file_input:n {\g__eb_config_tl}}
}
\cs_new_protected:Npn \__eb_package_later_bool:nn #1#2
@@ -1194,8 +1211,6 @@ The latest version of this license is in
footparskip .initial:n = 0ex,
footparindent .tl_set:N = \hangfootparindent,
footparindent .initial:n = 2\ccwd,
- list-labelsep .dim_set:N = \eb@list@labelsep,
- list-labelsep .initial:n = \ccwd,
unknown .code:n =
{
\clist_gput_right:Nx \g__eb_geometry_clist
@@ -1362,11 +1377,21 @@ The latest version of this license is in
\ctex_define:n {tocset/#1 .meta:nn = {ctex/tocset/#1}{##1}}
\__ctex_define:nn {tocset}
{
- #1/format .tl_set:c = l__toc_#1_format_tl,
- #1/indent .tl_set:c = l__toc_#1_indent_tl,
- #1/rule .tl_set:c = l__toc_#1_rule_tl
+ #1/format .tl_set:c = l__eb_toc_#1_format_tl,
+ #1/indent .tl_set:c = l__eb_toc_#1_indent_tl,
+ #1/rule .tl_set:c = l__eb_toc_#1_rule_tl,
+ #1/numsep .tl_set:c = eb@toc@#1@numsep
}
}
+
+\cs_new:Npn \EbNumberline#1
+ {
+ \CTEXifname
+ {
+ \use:c {CTEXthe#1}
+ \hspace{\use:c {eb@toc@#1@numsep}}
+ }{}
+ }
\__ctex_define:nn {tocset}
{
lists/lolskip .skip_set:N = \l__eb_toc_lolskip_skip,
@@ -1375,46 +1400,105 @@ The latest version of this license is in
lists/belowoffset .initial:n = 0pc,
tocline-fig .cs_set:Np = \eb@labelname@lof#1,
tocline-fig .initial:n =
- {\figurename\space#1\hspace{\eb@list@labelsep}},
+ {
+ \figurename\space#1
+ \ifodd\eb@titletoc@hang@fix
+ \else
+ \hspace{\eb@toc@lists@numsep}
+ \fi
+ },
tocline-tab .cs_set:Np = \eb@labelname@lot#1,
tocline-tab .initial:n =
- {\tablename\space#1\hspace{\eb@list@labelsep}},
+ {
+ \tablename\space#1
+ \ifodd\eb@titletoc@hang@fix
+ \else
+ \hspace{\eb@toc@lists@numsep}
+ \fi
+ },
tocline-lst .tl_set:N = \eb@labelname@lol,
tocline-lst .initial:n =
{
\lstlistingname\space
- \thelstlisting\hspace{\eb@list@labelsep}
+ \thelstlisting
+ \ifodd\eb@titletoc@hang@fix
+ \else
+ \hspace{\eb@toc@lists@numsep}
+ \fi
},
belowoffset .dim_set:N = \l__eb_toc_offset_dim,
belowoffset .initial:n = -1pc,
line-align .bool_set:N = \l__eb_toc_line_align_bool,
line-align .default:n = true,
line-align .initial:n = true,
- hang .bool_set:N = \eb@titletoc@hang@fix,
+
+ hang .choice:,
+ hang/true .code:n =
+ {
+ \bool_set_true:N \eb@titletoc@hang@fix
+ \ctex_set:n
+ {
+ chapter/tocline = \CTEXnumberline{##1}##2,
+ section/tocline = \CTEXnumberline{##1}##2,
+ subsection/tocline = \CTEXnumberline{##1}##2
+ }
+ },
+ hang/false .code:n =
+ {
+ \bool_set_false:N \eb@titletoc@hang@fix
+ \ctex_set:n
+ {
+ chapter/tocline = \EbNumberline{##1}##2,
+ section/tocline = \EbNumberline{##1}##2,
+ subsection/tocline = \EbNumberline{##1}##2
+ }
+ },
hang .default:n = true,
- hang .initial:n = false
+ hang .initial:n = false,
+
+ numsep-all .meta:n =
+ {
+ part/numsep = {#1},
+ chapter/numsep = {#1},
+ section/numsep = {#1},
+ subsection/numsep = {#1},
+ lists/numsep = {#1}
+ },
+ indent-all .meta:n =
+ {
+ part/indent = {#1},
+ chapter/indent = {#1},
+ section/indent = {#1},
+ subsection/indent = {#1},
+ lists/indent = {#1}
+ }
}
\ctex_set:nn {tocset}
{
part/format = \addvspace{1pc}\sffamily\large,
part/indent = 0\ccwd,
part/rule = \tocrule{}[\bfseries],
+ part/numsep = \ccwd,
chapter/format = \addvspace{1pc}\sffamily\large,
chapter/indent = 0\ccwd,
chapter/rule = \tocrule{$\cdot$}[\bfseries],
+ chapter/numsep = \ccwd,
section/format = \addvspace{0.35pc},
section/indent = 1.5\ccwd,
section/rule = \tocrule{$\cdot$},
+ section/numsep = \ccwd,
subsection/format = \addvspace{0.35pc},
subsection/indent = 3.8\ccwd,
subsection/rule = \tocrule{$\cdot$},
+ subsection/numsep = \ccwd,
lists/format = \addvspace{0.2pc},
lists/indent = 0\ccwd,
- lists/rule = \tocrule{$\cdot$}
+ lists/rule = \tocrule{$\cdot$},
+ lists/numsep = \ccwd
}
\NewDocumentCommand{\tocrule}{sO{0.7pc}D(){1.2}mO{}}
@@ -1431,14 +1515,19 @@ The latest version of this license is in
\cs_new_protected:Npn \__eb_titlecontents_set:nn #1#2
{
\titlecontents{#1}
- [\use:c {l__toc_#2_indent_tl}]
- {\use:c {l__toc_#2_format_tl}}
+ [\use:c {l__eb_toc_#2_indent_tl}]
+ {\use:c {l__eb_toc_#2_format_tl}}
{
\ifodd\eb@titletoc@hang@fix
- \contentspush{\color{ctex@link}\thecontentslabel}
+ \contentspush
+ {
+ \color{ctex@link}
+ \thecontentslabel
+ \hspace{\use:c {eb@toc@#2@numsep}}
+ }
\fi
}{}
- {\use:c {l__toc_#2_rule_tl}}
+ {\use:c {l__eb_toc_#2_rule_tl}}
}
\contentsuse{lstlisting}{lol}
\clist_map_inline:nn
@@ -1458,14 +1547,6 @@ The latest version of this license is in
figure = \eb@labelname@lof,
table = \eb@labelname@lot
}
-\cs_new:Npn \eb@numberline#1#2
- {
- \CTEXifname
- {
- \protect\numberline{\use:c {CTEXthe#1}}
- \hspace{#2}
- }{}
- }
\ctex_at_end_preamble:n
{
\cs_gset:Npn \caption@@@addcontentsline#1#2#3#4
@@ -1491,14 +1572,6 @@ The latest version of this license is in
{\eb@labelname@lol}\lst@@caption
}
}
- \ifodd\eb@titletoc@hang@fix
- \ctex_set:n
- {
- chapter/tocline = \eb@numberline{#1}{\ccwd}#2,
- section/tocline = \eb@numberline{#1}{\ccwd}#2,
- subsection/tocline = \eb@numberline{#1}{\ccwd}#2
- }
- \fi
}
\__eb_appto_cmd:Nn \@chapter
@@ -2071,7 +2144,7 @@ The latest version of this license is in
{
blank,on~line,center,
fontupper = \Large\sffamily,
- before~skip = 3.5ex,after~skip = 2.25ex
+ before~skip = 3.75ex,after~skip = 2.5ex
},
breakable,
boxsep = 0pt,
@@ -2560,7 +2633,7 @@ The latest version of this license is in
format = \color{ctex@frame}\sffamily\Huge,
aftername =
{\bool_if:NTF \l__eb_newline_bool{\par\nobreak}{\hspace{\ccwd}}},
- tocline = \CTEXifname{\CTEXthepart\hspace{\ccwd}}{}#2
+ tocline = \CTEXifname{\CTEXthepart\hspace{\eb@toc@part@numsep}}{}#2
},
chapter =
{
@@ -2580,8 +2653,7 @@ The latest version of this license is in
beforeskip = -1.5ex,
afterskip = 3ex,
lotskip = 0.8pc,
- lofskip = 0.8pc,
- tocline = \CTEXifname{\CTEXthechapter\hspace{\ccwd}}{}#2
+ lofskip = 0.8pc
},
section =
{
@@ -2589,8 +2661,7 @@ The latest version of this license is in
format = \color{ctex@frame}\sffamily\Large,
aftername = \hspace{0.5\ccwd},
beforeskip = 1.5ex plus .2ex minus .1ex,
- afterskip = 1.5ex plus .2ex minus .1ex,
- tocline = \CTEXifname{\CTEXthesection\hspace{\ccwd}}{}#2
+ afterskip = 1.5ex plus .2ex minus .1ex
},
subsection =
{
@@ -2598,8 +2669,7 @@ The latest version of this license is in
format = \color{ctex@frame}\sffamily\large,
aftername = \hspace{0.5\ccwd},
beforeskip = 1.3ex plus .2ex minus .1ex,
- afterskip = 1.3ex plus .2ex minus .1ex,
- tocline = \CTEXifname{\CTEXthesubsection\hspace{\ccwd}}{}#2
+ afterskip = 1.3ex plus .2ex minus .1ex
},
subsubsection =
{
diff --git a/macros/latex/contrib/principia/README b/macros/latex/contrib/principia/README
index 05b3abc81d..83b78ebc29 100644
--- a/macros/latex/contrib/principia/README
+++ b/macros/latex/contrib/principia/README
@@ -2,11 +2,11 @@ principia.sty - a LaTeX2e package for typesetting the "Peanese" notation of Whit
The file principia.sty is the original work of Landon D. C. Elkind (Copyright (c) 2021). It is released under the LaTeX Project Public License 1.3c.
-This is principia package Version 1.2 (23/02/2021). Like Versions 1.0-1.1, this version covers typesetting the notations through Volume I of "Principia Mathematica". Version 1.2 has some minor updates. See the file principia.pdf for information on these changes and for further information on how to typeset Peanese symbols in LaTeX with the principia package.
+This is principia package Version 1.3 (2021/04/19). This version covers typesetting the notations through Sections A and B in Volume I of "Principia Mathematica". See the file principia.pdf for information on these changes and for further information on how to typeset Peanese symbols in LaTeX with the principia package.
-Updates to include all notations throughout Volumes II and III are planned. Further information and updates can be found at https://logicalatomist.github.io/principia/
+Changes between version updates can be found at https://logicalatomist.github.io/principia/
Comments and suggestions are welcomed by the package maintainer, signed below.
-Landon D. C. Elkind
-University of Alberta \ No newline at end of file
+Landon D. C. Elkind
+University of Alberta
diff --git a/macros/latex/contrib/principia/principia.pdf b/macros/latex/contrib/principia/principia.pdf
index 7a86501043..b0c8da5020 100644
--- a/macros/latex/contrib/principia/principia.pdf
+++ b/macros/latex/contrib/principia/principia.pdf
Binary files differ
diff --git a/macros/latex/contrib/principia/principia.sty b/macros/latex/contrib/principia/principia.sty
index 14a99d9fa3..421a0b65ab 100644
--- a/macros/latex/contrib/principia/principia.sty
+++ b/macros/latex/contrib/principia/principia.sty
@@ -1,18 +1,24 @@
%Package Identification
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{principia}[2020/10/25 principia package version 1.1] %This is the principia package is for representing notations in Whitehead and Russell's ``Principia Mathematica" close to their appearance in the original.
+\ProvidesPackage{principia}[2021/04/19 principia package version 1.3] %This is the principia package is for representing notations in Whitehead and Russell's ``Principia Mathematica" close to their appearance in the original.
%Version 1.0 (superseded by Version 1.1): Covers typesetting of notation through Volume I. 2020/10/24
-%Version 1.1 (updates): fixed the spacing of scope dots around parentheses; fixed spacing of theorem sign; fixed spacing around primitive proposition and definition signs. 2020/10/25
+%Version 1.1 (superseded by Version 1.2) minor updates: fixed the spacing of scope dots around parentheses; fixed spacing of theorem sign; fixed spacing around primitive proposition and definition signs. 2020/10/25
%Licensed under LaTeX Project Public License 1.3c.
-%Copyright Landon D. C. Elkind, 2020. (https://landondcelkind.com/contact/).
+%Version 1.2 (superseded by Version 1.3) (minor updates): boldfaced (`thickened') the truth-functional connectives, existential quantifier, set and relation symbols; added numerous commands for typesetting brackets and substitutions into theorems. 2021/02/25
+%Version 1.3 (minor update): removes package dependency on marvosym; updates Section A notation; removes other notations (corrected extension pending). 2021/04/19
+%Licensed under LaTeX Project Public License 1.3c.
+%Copyright Landon D. C. Elkind, 2021 (https://landondcelkind.com/contact/).
%Principia package requirements
\RequirePackage{amssymb} %This loads the relation domain and converse domain limitation symbols.
\RequirePackage{amsmath} %This loads the circumflex, substitution into theorems, \text{}, \mathbf{}, \boldsymbol{}, \overleftarrow{}, \overrightarrow{}, etc.
\RequirePackage{graphicx} %This loads commands that flip iota for definite descriptions, Lambda for the universal class, and so on. The (superseded) graphics package should also work here, but is not recommended.
-\RequirePackage{marvosym} %This loads the male and female symbol.
\RequirePackage{pifont} %This loads the symbols such as the eight-pointed asterisk.
+%The \Female and \Male symbols are imported directly from Marvosym.
+%Volume I
+%Mathematical logic
+%The theory of deduction
%Meta-logical symbols
\newcommand{\pmfd}{\begin{center} \rule{5cm}{.5pt} \end{center}} %Dividing line between introductory remarks in a starred number and the formal deductions.
\newcommand{\pmdem}{\textit{Dem}.} %This notation begins a proof.
@@ -54,22 +60,26 @@
%Logical connectives
\newcommand{\pmnot}{\mathord{\ooalign{$\boldsymbol{\sim}\mkern.5mu$\hidewidth\cr$\boldsymbol{\sim}$\cr\hidewidth$\mkern.5mu\boldsymbol{\sim}$}}}
-\newcommand{\pmimp}{\mathbin{\ooalign{$\boldsymbol{\supset}\mkern.5mu$\hidewidth\cr$\boldsymbol{\supset}$\cr\hidewidth$\mkern.5mu\boldsymbol{\supset}$}}}
-\newcommand{\pmiff}{\mathbin{\ooalign{$\boldsymbol{\equiv}\mkern.5mu$\hidewidth\cr$\boldsymbol{\equiv}$\cr\hidewidth$\mkern.5mu\boldsymbol{\equiv}$}}}
\newcommand{\pmor}{\mathbin{\ooalign{$\boldsymbol{\vee}\mkern.5mu$\hidewidth\cr$\boldsymbol{\vee}$\cr\hidewidth$\mkern.5mu\boldsymbol{\vee}$}}}
-\newcommand{\pmprod}{\mathbin{\ooalign{$\boldsymbol{\wedge}\mkern.5mu$\hidewidth\cr$\boldsymbol{\wedge}$\cr\hidewidth$\mkern.5mu\boldsymbol{\wedge}$}}}
-\newcommand{\pmall}[1]{(#1)}
-\newcommand{\pmsome}[1]{(\text{\raisebox{.5em}{\rotatebox{180}{\textbf{E}}}}#1)}
-\newcommand{\pmSome}{\text{\raisebox{.5em}{\rotatebox{180}{\textbf{E}}}}}
-\newcommand{\pmand}{\mathrel{\hbox{\rule{.3ex}{.3ex}}}}
+\newcommand{\pmimp}{\mathbin{\ooalign{$\boldsymbol{\supset}\mkern.5mu$\hidewidth\cr$\boldsymbol{\supset}$\cr\hidewidth$\mkern.5mu\boldsymbol{\supset}$}}} %1.01
+\newcommand{\pmand}{\mathrel{\hbox{\rule{.3ex}{.3ex}}}} %3.01
\newcommand{\pmandd}{\overset{\pmand}{\pmand}}
\newcommand{\pmanddd}{\pmandd\hspace{.1em}\pmand}
\newcommand{\pmandddd}{\pmandd\hspace{.1em}\pmandd}
\newcommand{\pmanddddd}{\pmandd\hspace{.1em}\pmandd\hspace{.1em}\pmand}
\newcommand{\pmandddddd}{\pmandd\hspace{.1em}\pmandd\hspace{.1em}\pmandd}
+\newcommand{\pmprod}{\mathbin{\ooalign{$\boldsymbol{\wedge}\mkern.5mu$\hidewidth\cr$\boldsymbol{\wedge}$\cr\hidewidth$\mkern.5mu\boldsymbol{\wedge}$}}} %Not in Principia, but added here as a dual of its symbol for disjunction.
+\newcommand{\pmiff}{\mathbin{\ooalign{$\boldsymbol{\equiv}\mkern.5mu$\hidewidth\cr$\boldsymbol{\equiv}$\cr\hidewidth$\mkern.5mu\boldsymbol{\equiv}$}}} %4.01
+
+%The theory of apparent variables
+\newcommand{\pmall}[1]{(#1)}
+\newcommand{\pmsome}[1]{(\text{\raisebox{.5em}{\rotatebox{180}{\textbf{E}}}}#1)} %10.01
+\newcommand{\pmSome}{\text{\raisebox{.5em}{\rotatebox{180}{\textbf{E}}}}}
%Additional defined logic signs
\newcommand{\pmhat}[1]{\mathbf{\hat{\text{$#1$}}}}
+\newcommand{\pmbreve}[1]{\mathbf{\breve{\text{$#1$}}}}
+\newcommand{\pmcirc}[1]{\mathbf{\dot{\text{$#1$}}}}
\newcommand{\pmpf}[2]{#1#2} %for propositional functions of one variable
\newcommand{\pmpff}[3]{#1(#2, #3)} %for propositional functions of two variables
\newcommand{\pmpfff}[4]{#1(#2, #3, #4)} %for propositional functions of three variables
@@ -77,179 +87,8 @@
\newcommand{\pmpred}[2]{#1\pmshr#2} %for predicates (``predicative functions'') of one variable
\newcommand{\pmpredd}[3]{#1\pmshr(#2, #3)} %for predicates (``predicative functions'') of two variables
\newcommand{\pmpreddd}[4]{#1\pmshr(#2, #3, #4)} %for predicates (``predicative functions'') of three variables
-\newcommand{\pmnid}{\mathrel{\ooalign{$=$\cr\hidewidth\footnotesize\rotatebox[origin=c]{210}{\textbf{/}}\hidewidth\cr}}} %*13.01
+\newcommand{\pmnid}{\mathrel{\ooalign{$=$\cr\hidewidth\footnotesize\rotatebox[origin=c]{210}{\textbf{/}}\hidewidth\cr}}} %*13.02
\newcommand{\pmiota}{\ooalign{\rotatebox[origin=c]{180}{$\mathbf{\iota}$}\cr\hidewidth\raisebox{.0125em}{\rotatebox[origin=c]{180}{$\mathbf{\iota}$}}\cr\hidewidth\raisebox{.025em}{\rotatebox[origin=c]{180}{$\mathbf{\iota}$}}\cr\hidewidth\raisebox{.0375em}{\rotatebox[origin=c]{180}{$\mathbf{\iota}$}}\cr\hidewidth\raisebox{.05em}{\rotatebox[origin=c]{180}{$\mathbf{\iota}$}}}} %the rotated Greek iota used in definite descriptions
\newcommand{\pmdsc}[1]{(\pmiota#1)} %*14.01
-\newcommand{\pmDsc}{\pmiota} %*14.01
-\newcommand{\pmexists}{\textbf{E}\hspace{.1em}\pmshr} %*14.02
-
-%Class signs
-\newcommand{\pmcuni}{\text{\rotatebox[origin=c]{180}{$\Lambda$}}}
-\newcommand{\pmcnull}{\Lambda}
-\newcommand{\pmcls}[2]{\pmhat{#1}(#2)}
-\newcommand{\pmCls}{\text{Cls}}
-\newcommand{\pmClsn}[1]{\text{Cls}^{#1}}
-\newcommand{\pmcexists}{\text{\raisebox{.5em}{\rotatebox{180}{\textbf{E}}}}\hspace{-.1em}\mathop{\pmshr}}
-\newcommand{\pmccmp}[1]{\boldsymbol{-}#1}
-\newcommand{\pmcmin}[2]{#1\boldsymbol{-}#2}
-\newcommand{\pmcin}{\mathop{\boldsymbol{\epsilon}}}
-\newcommand{\pmccup}{\mathop{\ooalign{\scalebox{1.3}[1.75]{$\put(3, 2.5){\oval(4,4)[b]}\phantom{\circ}$}\cr\hidewidth\hspace{.1em}\scalebox{1.3}[1.75]{$\put(3, 2.5){\oval(4,4)[b]}\phantom{\circ}$}\cr\hidewidth\hspace{.2em}\scalebox{1.3}[1.75]{$\put(3, 2.5){\oval(4,4)[b]}\phantom{\circ}$}\cr\hidewidth\hspace{.3em}\scalebox{1.3}[1.75]{$\put(3, 2.5){\oval(4,4)[b]}\phantom{\circ}$}\cr\hidewidth\hspace{.4em}\scalebox{1.3}[1.75]{$\put(3, 2.5){\oval(4,4)[b]}\phantom{\circ}$}\cr\hidewidth\hspace{.5em}\scalebox{1.3}[1.75]{$\put(3, 2.5){\oval(4,4)[b]}\phantom{\circ}$}\cr\hidewidth\hspace{.6em}\scalebox{1.3}[1.75]{$\put(3, 2.5){\oval(4,4)[b]}\phantom{\circ}$}}}}
-\newcommand{\pmccap}{\mathop{\ooalign{\scalebox{1.3}[1.75]{$\put(3, 2){\oval(4,1)[t]}\phantom{\circ}$}\cr\hidewidth\hspace{.1em}\scalebox{1.3}[1.75]{$\put(3, 2){\oval(4,1)[t]}\phantom{\circ}$}\cr\hidewidth\hspace{.2em}\scalebox{1.3}[1.75]{$\put(3, 2){\oval(4,1)[t]}\phantom{\circ}$}\cr\hidewidth\hspace{.3em}\scalebox{1.3}[1.75]{$\put(3, 2){\oval(4,1)[t]}\phantom{\circ}$}\cr\hidewidth\hspace{.4em}\scalebox{1.3}[1.75]{$\put(3, 2){\oval(4,1)[t]}\phantom{\circ}$}\cr\hidewidth\hspace{.5em}\scalebox{1.3}[1.75]{$\put(3, 2){\oval(4,1)[t]}\phantom{\circ}$}\cr\hidewidth\hspace{.6em}\scalebox{1.3}[1.75]{$\put(3, 2){\oval(4,1)[t]}\phantom{\circ}$}}}}
-\newcommand{\pmcinc}{\mathop{\ooalign{$\boldsymbol{\subset}$\cr\hidewidth$\hspace{.1em}\boldsymbol{\subset}$\cr\hidewidth$\hspace{.15em}\boldsymbol{\subset}$\cr\hidewidth$\hspace{.2em}\boldsymbol{\subset}$}}}
-
-%Relation signs
-\newcommand{\pmruni}{\dot{\text{\rotatebox[origin=c]{180}{$\Lambda$}}}}
-\newcommand{\pmrnull}{\dot{\Lambda}}
-\newcommand{\pmdscf}[2]{#1\textbf{`}#2}
-\newcommand{\pmdscff}[2]{#1\textbf{`}\textbf{`}#2}
-\newcommand{\pmdscfff}[2]{#1\textbf{`}\textbf{`}\textbf{`}#2}
-\newcommand{\pmdscfr}[2]{#1_{\pmcin}\textbf{`}#2}
-\newcommand{\pmdscfR}[1]{#1_{\pmcin}}
-\newcommand{\pmdscfe}[2]{\mathop{\text{E}}\mathop{\pmshr\pmshr}\pmdscff{#1}{#2}}
-\newcommand{\pmdm}[1]{\text{D}\textbf{`}#1}
-\newcommand{\pmDm}{\text{D}}
-\newcommand{\pmcdm}[1]{\text{\rotatebox[origin=c]{180}{D}}\textbf{`}#1}
-\newcommand{\pmCdm}{\text{\rotatebox[origin=c]{180}{D}}}
-\newcommand{\pmcmp}[1]{C\textbf{`}#1}
-\newcommand{\pmCmp}{C}
-\newcommand{\pmfld}[1]{F\textbf{`}#1}
-\newcommand{\pmFld}{F}
-\newcommand{\pmrel}[3]{\pmhat{#1}\pmhat{#2}#3}
-\newcommand{\pmrele}[5]{#1\{\pmhat{#2}\pmhat{#3}#4(#2, #3)\}#5}
-\newcommand{\pmrelep}[3]{#1\{#2\}#3}
-\newcommand{\pmrcmp}[1]{\ooalign{$\hidewidth\raisebox{.25em}{$\cdot$}\hidewidth$\cr$\mathbf{\pmccmp}$}#1}
-\newcommand{\pmrmin}[2]{#1\mathrel{\ooalign{$\hidewidth\raisebox{.25em}{$\cdot$}\hidewidth$\cr$\mathbf{\pmccmp}$}}#2}
-\newcommand{\pmrexists}{\dot{\mathop{\text{\raisebox{.5em}{\rotatebox{180}{E}}}}}\mathop{\pmshr}}
-\newcommand{\pmcrel}[1]{\breve{#1}}
-\newcommand{\pmCnv}{\text{Cnv}}
-\newcommand{\pmcnv}[1]{\breve{#1}}
-\newcommand{\pmcnvr}[1]{\text{Cnv}\textbf{`}#1}
-\newcommand{\pmrcup}{\mathrel{\ooalign{$\hidewidth\cdot\hidewidth$\cr$\mathbf{\pmccup}$}}}
-\newcommand{\pmrcap}{\mathrel{\ooalign{$\hidewidth\raisebox{.3em}{$\cdot$}\hidewidth$\cr$\mathbf{\pmccap}$}}}
-\newcommand{\pmrinc}{\mathrel{\ooalign{$\hidewidth\cdot\hidewidth$\cr$\mathbf{\pmcinc}$}}}
-\newcommand{\pmrrf}[2]{\overset{\boldsymbol{\rightarrow}}{#1\textbf{`}}#2}
-\newcommand{\pmRrf}[1]{\overset{\boldsymbol{\rightarrow}}{#1}}
-\newcommand{\pmrrl}[2]{\overset{\boldsymbol{\leftarrow}}{#1\textbf{`}}#2}
-\newcommand{\pmRrl}[1]{\overset{\boldsymbol{\leftarrow}}{#1}}
-\newcommand{\pmsg}[1]{\text{sg}\textbf{`}#1}
-\newcommand{\pmgs}[1]{\text{gs}\textbf{`}#1}
-\newcommand{\pmSg}{\text{sg}}
-\newcommand{\pmGs}{\text{gs}}
-\newcommand{\pmRprd}{\mathop{|}}
-\newcommand{\pmrprd}[2]{{#1}\mathop{|}{#2}}
-\newcommand{\pmrprdn}[2]{#1^{#2}}
-\newcommand{\pmrld}[2]{#1 \boldsymbol{\upharpoonleft} #2}
-\newcommand{\pmrlcd}[2]{#1 \boldsymbol{\upharpoonright} #2}
-\newcommand{\pmrlf}[3]{#1 \boldsymbol{\upharpoonleft} #2 \boldsymbol{\upharpoonright} #3}
-\newcommand{\pmrl}[2]{#1 \boldsymbol{\uparrow} #2}
-\newcommand{\pmrlF}[2]{#1 \mathbin{\ooalign{$\upharpoonright$\cr\hidewidth\rotatebox[origin=c]{180}{\text{$\upharpoonleft$}}\hidewidth\cr}} #2}
-\newcommand{\pmop}{\mathop{\text{\Female}}}
-\newcommand{\pmopc}[2]{#1 \mathop{\underset{\textbf{''}}{\text{\Female}}} #2}
-
-%Products and sums of classes of classes or relations
-\newcommand{\pmccsum}[1]{p\textbf{`}#1}
-\newcommand{\pmccprd}[1]{s\textbf{`}#1}
-\newcommand{\pmcrsum}[1]{\dot{p}\textbf{`}#1}
-\newcommand{\pmcrprd}[1]{\dot{s}\textbf{`}#1}
-\newcommand{\pmRprdd}{\mathop{||}}
-\newcommand{\pmrprdd}[2]{{#1}\mathop{||}{#2}}
-
-%Identity and Diversity
-\newcommand{\pmrid}{I}
-\newcommand{\pmrdiv}{J}
-\newcommand{\pmcunit}[1]{\iota\textbf{`}#1}
-\newcommand{\pmcUnit}{\iota}
-\newcommand{\pmcunits}[1]{\breve{\iota}\textbf{`}#1}
-
-%Cardinal numbers
-\newcommand{\pmcn}[1]{#1}
-
-%Ordinal numbers
-\newcommand{\pmrn}[1]{#1_r}
-\newcommand{\pmdn}[1]{\dot{#1}}
-\newcommand{\pmoc}[2]{#1 \boldsymbol{\downarrow} #2}
-
-%Subclasses and subrelations
-\newcommand{\pmscl}[1]{\text{Cl}\textbf{`}#1}
-\newcommand{\pmsCl}{\text{Cl}}
-\newcommand{\pmscle}[1]{\text{Cl ex}\textbf{`}#1}
-\newcommand{\pmsCle}{\text{Cl ex}}
-\newcommand{\pmscls}[1]{\text{Cls}\textbf{`}#1}
-\newcommand{\pmsrl}[1]{\text{Rl}\textbf{`}#1}
-\newcommand{\pmsRl}{\text{Rl}}
-\newcommand{\pmsrle}[1]{\text{Rl ex}\textbf{`}#1}
-\newcommand{\pmsRle}{\text{Rl ex}}
-\newcommand{\pmsrel}[1]{\text{Rel}\textbf{`}#1}
-\newcommand{\pmRel}{\text{Rel}}
-\newcommand{\pmReln}[1]{\text{Rel}^{#1}}
-\newcommand{\pmrin}{\mathop{\boldsymbol{\epsilon}}}
-
-%Relative type symbols
-\newcommand{\pmrt}[1]{t\textbf{`}#1}
-\newcommand{\pmrti}[2]{t^{#1}\textbf{`}#2}
-\newcommand{\pmrtc}[2]{t_{#1}\textbf{`}#2}
-\newcommand{\pmrtri}[2]{t^{#1}\textbf{`}#2}
-\newcommand{\pmrtrc}[2]{t_{#1}\textbf{`}#2}
-\newcommand{\pmrtrci}[3]{t_{#1}^{\text{ }#2}\textbf{`}#3}
-\newcommand{\pmrtric}[3]{^{#1}t_{#2}\textbf{`}#3}
-\newcommand{\pmrtdi}[2]{#1_{#2}}
-\newcommand{\pmrtdc}[2]{#1(#2)}
-\newcommand{\pmrtdri}[2]{#1_{#2}}
-\newcommand{\pmrtdrc}[2]{#1(#2)}
-
-%Similarity relation signs
-\newcommand{\pmrdc}[2]{#1\boldsymbol{\to}#2}
-\newcommand{\pmsm}{\mathrel{\text{sm}}}
-\newcommand{\pmsmbar}{\mathrel{\overline{\text{sm}}}}
-\newcommand{\pmsmarr}{\overrightarrow{{\pmsm}}}
-\newcommand{\pmonemany}{1\boldsymbol{\to}\pmCls}
-\newcommand{\pmmanyone}{\pmCls\boldsymbol{\to}1}
-\newcommand{\pmoneone}{1\boldsymbol{\to}1}
-
-%Selections
-\newcommand{\pmselp}[1]{P_{\small\Delta}\mathbf{`}#1}
-\newcommand{\pmSelp}{P_{\Delta}}
-\newcommand{\pmsele}[1]{\pmcin_{\small\Delta}\mathbf{`}#1}
-\newcommand{\pmSele}{\pmcin_{\Delta}}
-\newcommand{\pmself}[1]{F_{\small\Delta}\mathbf{`}#1}
-\newcommand{\pmSelf}{F_{\Delta}}
-\newcommand{\pmex}[1]{\text{Cls} \mathop{\text{excl}}\mathbf{`}#1}
-\newcommand{\pmexc}{\text{Cls}^2 \mathop{\text{excl}}}
-\newcommand{\pmexcc}[1]{\text{Cl} \mathop{\text{excl}}\textbf{`}#1}
-\newcommand{\pmexcn}{\text{Cls} \mathop{\text{ex}^2} \mathop{\text{excl}}}
-\newcommand{\pmselc}[2]{#1 \mathrel{\rotatebox[origin=c]{270}{$\boldsymbol{\mapsto}$}} #2}
-\newcommand{\pmmultr}{\mathop{\text{Rel}} \mathop{\text{Mult}}}
-\newcommand{\pmmultc}{\mathop{\text{Cls}^2} \mathop{\text{Mult}}}
-\newcommand{\pmmultax}{\mathop{\text{Mult}} \mathop{\text{ax}}}
-
-%Inductive relations
-\newcommand{\pmanc}[1]{#1_\pmast}
-\newcommand{\pmancc}[1]{\pmcnv{#1}_\pmast}
-\newcommand{\pmrst}[1]{#1_\text{st}}
-\newcommand{\pmrts}[1]{#1_\text{ts}}
-\newcommand{\pmpot}[1]{\text{Pot}\mathbf{`}#1}
-\newcommand{\pmpotid}[1]{\text{Potid}\mathbf{`}#1}
-\newcommand{\pmpo}[1]{#1_\text{po}}
-\newcommand{\pmB}{B}
-\newcommand{\pmmin}[1]{\text{min}_{#1}}
-\newcommand{\pmmax}[1]{\text{max}_{#1}}
-\newcommand{\pmMin}{\text{min}}
-\newcommand{\pmMax}{\text{max}}
-\newcommand{\pmgen}[1]{\text{gen}\mathbf{`}#1}
-\newcommand{\pmGen}{\text{gen}}
-\newcommand{\pmefr}[2]{#1\pmast#2}
-\newcommand{\pmipr}[2]{I_{#1}\textbf{`}#2}
-\newcommand{\pmjpr}[2]{J_{#1}\textbf{`}#2}
-\newcommand{\pmfr}[2]{\overset{\boldsymbol{\leftrightarrow}}{#1}\textbf{`}#2}
-
-%Cardinality
-\newcommand{\pmnc}[1]{\text{Nc}\textbf{`}#1}
-\newcommand{\pmNc}{\text{Nc}}
-\newcommand{\pmNC}{\text{NC}}
-\newcommand{\pmnoc}[1]{\text{N}_0\text{c}\textbf{`}#1}
-\newcommand{\pmNoc}{\text{N}_0\text{c}}
-\newcommand{\pmnocind}[1]{\text{N}_0\text{Cinduct}\textbf{`}#1}
-\newcommand{\pmNocind}{\text{N}_0\text{Cinduct}}
-
-\newcommand{\pmclsrefl}{\text{Cls} \mathop{\text{refl}}}
-\newcommand{\pmncrefl}{\text{NC} \mathop{\text{refl}}} \ No newline at end of file
+\newcommand{\pmDsc}{\pmiota}
+\newcommand{\pmexists}{\textbf{E}\hspace{.1em}\pmshr} %*14.02 \ No newline at end of file
diff --git a/macros/latex/contrib/principia/principia.tex b/macros/latex/contrib/principia/principia.tex
index 76618c0b0b..86d5ce3a22 100644
--- a/macros/latex/contrib/principia/principia.tex
+++ b/macros/latex/contrib/principia/principia.tex
@@ -1,11 +1,13 @@
\documentclass[12pt]{article}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{principia}[2020/10/25 principia package version 1.1] %This package supports typesetting the Peanese notation in Volume I of Whitehead and Russell’s 1910 ``Principia Mathematica".
+\ProvidesPackage{principia}[2021/04/19 principia package version 1.3] %This is the principia package is for representing notations in Whitehead and Russell's ``Principia Mathematica" close to their appearance in the original.
%Version 1.0 (superseded by Version 1.1): Covers typesetting of notation through Volume I. 2020/10/24
-%Version 1.1 (updates): fixed the spacing of scope dots around parentheses; fixed spacing of theorem sign; fixed spacing around primitive proposition and definition signs. 2020/10/25
-%Version 1.2 (updates): boldfaced (`thickened') the truth-functional connectives, existential quantifier, set and relation symbols; added numerous commands for typesetting brackets and substitutions into theorems. 2021/02/23
+%Version 1.1 (superseded by Version 1.2) minor updates: fixed the spacing of scope dots around parentheses; fixed spacing of theorem sign; fixed spacing around primitive proposition and definition signs. 2020/10/25
%Licensed under LaTeX Project Public License 1.3c.
-%Copyright Landon D. C. Elkind, 2020. (https://landondcelkind.com/contact/).
+%Version 1.2 (superseded by Version 1.3) (minor updates): boldfaced (`thickened') the truth-functional connectives, existential quantifier, set and relation symbols; added numerous commands for typesetting brackets and substitutions into theorems. 2021/02/25
+%Version 1.3 (minor update): removes package dependency on marvosym; updates Section A and Section B notations. 2021/04/19
+%Licensed under LaTeX Project Public License 1.3c.
+%Copyright Landon D. C. Elkind, 2021. (https://landondcelkind.com/contact/).
\usepackage{fullpage}
\usepackage[T1]{fontenc}
@@ -13,14 +15,89 @@
\usepackage{setspace}
%Principia package requirements
-\usepackage{principia} %The package itself, and its dependencies:
\usepackage{amssymb} %This loads the relation domain and converse domain limitation symbols.
\usepackage{amsmath} %This loads the circumflex, substitution into theorems, \text{}, \mathbf{}, \boldsymbol{}, \overleftarrow{}, \overrightarrow{}, etc.
\usepackage{pifont} %This loads the eight-pointed asterisk.
-\usepackage{marvosym} %This loads the male and female symbol.
\usepackage{graphicx} %This loads commands that flip iota for definite descriptions, Lambda for the universal class, and so on. The (superseded) graphics package should also work here, but is not recommended.
-\title{\texttt{principia.sty }\\ A \LaTeXe \space Package for Typesetting Whitehead and Russell's \textit{Principia Mathematica} (Version 1.2)}
+%Volume I
+%Mathematical logic
+%The theory of deduction
+%Meta-logical symbols
+\newcommand{\pmfd}{\begin{center} \rule{5cm}{.5pt} \end{center}} %Dividing line between introductory remarks in a starred number and the formal deductions.
+\newcommand{\pmdem}{\textit{Dem}.} %This notation begins a proof.
+\newcommand{\pmdemi}{\indent \pmdem} %This idents the notation that begins a proof.
+\newcommand{\pmhp}{\text{Hp}} %This typesets Hp (short for antecedent), which occurs at the beginning of a proof.
+\newcommand{\pmprop}{\text{Prop}} %This occurs at the end of a proof.
+\newcommand{\pmithm}{\pmimp\;\pmthm} %This occurs when a meta-theoretic implication is asserted.
+\newcommand{\pmbr}[1]{\bigg \lbrack \normalsize #1 \bigg \rbrack} %These are larger brackets for substitution.
+\newcommand{\pmsub}[2]{\bigg \lbrack \small \begin{array}{c} #1 \\ \hline #2 \end{array} \bigg \rbrack} %This is the substitution command.
+\newcommand{\pmsubb}[4]{\bigg \lbrack \small \begin{array}{c c} #1, & #3 \\ \hline #2, & #4 \end{array} \bigg \rbrack} %This is the substitution command.
+\newcommand{\pmsubbb}[6]{\bigg \lbrack \small \begin{array}{c c c} #1, & #3, & #5 \\ \hline #2, & #4, & #6 \end{array} \bigg \rbrack} %This is the substitution command.
+\newcommand{\pmsubbbb}[8]{\bigg \lbrack \small \begin{array}{c c c c} #1, & #3, & #5, & #7 \\ \hline #2, & #4, & #6, & #8 \end{array} \bigg \rbrack} %This is the substitution command.
+\newcommand{\pmSub}[3]{\bigg \lbrack \normalsize #1 \text{ } \small \begin{array}{c} #2 \\ \hline #3 \end{array} \bigg \rbrack} %This is the substitution command.
+\newcommand{\pmSubb}[5]{\bigg \lbrack \normalsize #1 \text{ } \small \begin{array}{c c} #2, & #4 \\ \hline #3, & #5 \end{array} \bigg \rbrack} %This is the substitution command.
+\newcommand{\pmSubbb}[7]{\bigg \lbrack \normalsize #1 \text{ } \small \begin{array}{c c c} #2, & #4, & #6 \\ \hline #3, & #5, & #7 \end{array} \bigg \rbrack} %This is the substitution command.
+\newcommand{\pmSubbbb}[9]{\bigg \lbrack \normalsize #1 \text{ } \small \begin{array}{c c c c} #1, & #3, & #5, & #7 \\ \hline #2, & #4, & #6, & #8 \end{array} \bigg \rbrack} %This is the substitution command.
+\newcommand{\pmsUb}[2]{\small \begin{array}{c} #1 \\ \hline #2 \end{array}} %This is the substitution command.
+\newcommand{\pmsUbb}[4]{\small \begin{array}{c c} #1, & #3 \\ \hline #2, & #4 \end{array}} %This is the substitution command.
+\newcommand{\pmsUbbb}[6]{\small \begin{array}{c c c} #1, & #3, & #5 \\ \hline #2, & #4, & #6 \end{array}} %This is the substitution command.
+\newcommand{\pmsUbbbb}[8]{\small \begin{array}{c c c c} #1, & #3, & #5, & #7 \\ \hline #2, & #4, & #6, & #8 \end{array}} %This is the substitution command.
+\newcommand{\pmSUb}[3]{\normalsize #1 \text{ } \small \begin{array}{c} #2 \\ \hline #3 \end{array}} %This is the substitution command.
+\newcommand{\pmSUbb}[5]{\normalsize #1 \text{ } \small \begin{array}{c c} #2, & #4 \\ \hline #3, & #5 \end{array}} %This is the substitution command.
+\newcommand{\pmSUbbb}[7]{\normalsize #1 \text{ } \small \begin{array}{c c c} #2, & #4, & #6 \\ \hline #3, & #5, & #7 \end{array}} %This is the substitution command.
+\newcommand{\pmSUbbbb}[9]{\normalsize #1 \text{ } \small \begin{array}{c c c c} #1, & #3, & #5, & #7 \\ \hline #2, & #4, & #6, & #8 \end{array}} %This is the substitution command.
+\newcommand{\pmthm}{\mathpunct{\text{\scalebox{.5}[1]{$\boldsymbol\vdash$}}}} %This is the theorem sign.
+\newcommand{\pmast}{\text{\resizebox{!}{.75\height}{\ding{107}}}} %This is the sign introducing a theorem number.
+\newcommand{\pmcdot}{\text{\raisebox{.05cm}{$\boldsymbol\cdot$}}} %This is a sign introducing a theorem sub-number.
+\newcommand{\pmiddf}{\mathbin{=}}
+\newcommand{\pmdf}{\quad \text{Df}}
+\newcommand{\pmpp}{\quad \text{Pp}}
+
+%Square dots for scope, defined for up to six dots
+\newcommand{\pmdot}{\mathrel{\hbox{\rule{.3ex}{.3ex}}}}
+\newcommand{\pmdott}{\mathrel{\overset{\pmdot}{\pmdot}}}
+\newcommand{\pmdottt}{\pmdott\hspace{.1em}\pmdot}
+\newcommand{\pmdotttt}{\pmdott\hspace{.1em}\pmdott}
+\newcommand{\pmdottttt}{\pmdott\hspace{.1em}\pmdott\hspace{.1em}\pmdot}
+\newcommand{\pmdotttttt}{\pmdott\hspace{.1em}\pmdott\hspace{.1em}\pmdott}
+
+%Logical connectives
+\newcommand{\pmnot}{\mathord{\ooalign{$\boldsymbol{\sim}\mkern.5mu$\hidewidth\cr$\boldsymbol{\sim}$\cr\hidewidth$\mkern.5mu\boldsymbol{\sim}$}}}
+\newcommand{\pmor}{\mathbin{\ooalign{$\boldsymbol{\vee}\mkern.5mu$\hidewidth\cr$\boldsymbol{\vee}$\cr\hidewidth$\mkern.5mu\boldsymbol{\vee}$}}}
+\newcommand{\pmimp}{\mathbin{\ooalign{$\boldsymbol{\supset}\mkern.5mu$\hidewidth\cr$\boldsymbol{\supset}$\cr\hidewidth$\mkern.5mu\boldsymbol{\supset}$}}} %1.01
+\newcommand{\pmand}{\mathrel{\hbox{\rule{.3ex}{.3ex}}}} %3.01
+\newcommand{\pmandd}{\overset{\pmand}{\pmand}}
+\newcommand{\pmanddd}{\pmandd\hspace{.1em}\pmand}
+\newcommand{\pmandddd}{\pmandd\hspace{.1em}\pmandd}
+\newcommand{\pmanddddd}{\pmandd\hspace{.1em}\pmandd\hspace{.1em}\pmand}
+\newcommand{\pmandddddd}{\pmandd\hspace{.1em}\pmandd\hspace{.1em}\pmandd}
+\newcommand{\pmprod}{\mathbin{\ooalign{$\boldsymbol{\wedge}\mkern.5mu$\hidewidth\cr$\boldsymbol{\wedge}$\cr\hidewidth$\mkern.5mu\boldsymbol{\wedge}$}}} %Not in Principia, but added here as a dual of its symbol for disjunction.
+\newcommand{\pmiff}{\mathbin{\ooalign{$\boldsymbol{\equiv}\mkern.5mu$\hidewidth\cr$\boldsymbol{\equiv}$\cr\hidewidth$\mkern.5mu\boldsymbol{\equiv}$}}} %4.01
+
+%The theory of apparent variables
+\newcommand{\pmall}[1]{(#1)}
+\newcommand{\pmsome}[1]{(\text{\raisebox{.5em}{\rotatebox{180}{\textbf{E}}}}#1)} %10.01
+\newcommand{\pmSome}{\text{\raisebox{.5em}{\rotatebox{180}{\textbf{E}}}}}
+
+%Additional defined logic signs
+\newcommand{\pmhat}[1]{\mathbf{\hat{\text{$#1$}}}}
+\newcommand{\pmbreve}[1]{\mathbf{\breve{\text{$#1$}}}}
+\newcommand{\pmcirc}[1]{\mathbf{\dot{\text{$#1$}}}}
+\newcommand{\pmpf}[2]{#1#2} %for propositional functions of one variable
+\newcommand{\pmpff}[3]{#1(#2, #3)} %for propositional functions of two variables
+\newcommand{\pmpfff}[4]{#1(#2, #3, #4)} %for propositional functions of three variables
+\newcommand{\pmshr}{\textbf{!}} %*12.1 and *12.11, used for predicative propositional functions
+\newcommand{\pmpred}[2]{#1\pmshr#2} %for predicates (``predicative functions'') of one variable
+\newcommand{\pmpredd}[3]{#1\pmshr(#2, #3)} %for predicates (``predicative functions'') of two variables
+\newcommand{\pmpreddd}[4]{#1\pmshr(#2, #3, #4)} %for predicates (``predicative functions'') of three variables
+\newcommand{\pmnid}{\mathrel{\ooalign{$=$\cr\hidewidth\footnotesize\rotatebox[origin=c]{210}{\textbf{/}}\hidewidth\cr}}} %*13.02
+\newcommand{\pmiota}{\ooalign{\rotatebox[origin=c]{180}{$\mathbf{\iota}$}\cr\hidewidth\raisebox{.0125em}{\rotatebox[origin=c]{180}{$\mathbf{\iota}$}}\cr\hidewidth\raisebox{.025em}{\rotatebox[origin=c]{180}{$\mathbf{\iota}$}}\cr\hidewidth\raisebox{.0375em}{\rotatebox[origin=c]{180}{$\mathbf{\iota}$}}\cr\hidewidth\raisebox{.05em}{\rotatebox[origin=c]{180}{$\mathbf{\iota}$}}}} %the rotated Greek iota used in definite descriptions
+\newcommand{\pmdsc}[1]{(\pmiota#1)} %*14.01
+\newcommand{\pmDsc}{\pmiota}
+\newcommand{\pmexists}{\textbf{E}\hspace{.1em}\pmshr} %*14.02
+
+\title{\texttt{principia.sty}\\ A \LaTeXe \space Package for Typesetting Whitehead and Russell's \textit{Principia Mathematica} (Version 1.3)}
\author{Landon D. C. Elkind \texttt{elkind@ualberta.ca}}
\date{\today}
@@ -33,9 +110,11 @@ The \texttt{principia} package is designed for typesetting the Peanese notation
In \textit{Principia Mathematica} some symbols occur with an argument and sometimes that same symbol occurs without an argument. For example, `$\pmsome{x}$' occurs in some formulas, but sometimes `$\pmSome$' occurs in the text when they talk about the symbol itself. \texttt{principia} is designed to accommodate these different occurrences of symbols. When a symbol is to occur without an argument, capitalize the first letter following the `\texttt{$\backslash$pm}' part of the command. E.g. \verb|\pmsome{x}| produces $\pmsome{x}$ and \verb|\pmSome| produces `$\pmSome$'. Note the former command requires an argument and the latter command does not. Not all commands in the \texttt{principia} package admit of such dual use because some symbols in \textit{Principia Mathematica} never occur without an argument or do not take an argument in the usual sense. For example, the propositional connectives do not take an `argument' in the way singular or plural descriptions do.
-Version 1.2 (and 1.0-1.1) of \texttt{principia} is adequate to typeset all notations throughout Volume I of \textit{Principia} and includes some fixes to spacing, etc. See the package documentation for details. Updates to include all notations throughout Volumes II and III are planned.
+Version 1.3 of \texttt{principia} is adequate to typeset all notations throughout Sections A and B of \textit{Principia}'s Volume I and includes some minor fixes. See the package documentation for details.
+
+\texttt{principia}'s dependencies are \texttt{amsmath}, \texttt{amssymb}, \texttt{pifont}, and \texttt{graphicx}. Make sure to load these package by typing \texttt{$\backslash$usepackage\{graphicx\}}, etc., into the document preamble.
-\texttt{principia}'s dependencies are \texttt{amsmath}, \texttt{amssymb}, \texttt{pifont}, \texttt{marvosym}, and \texttt{graphicx}. Make sure to load these package by typing \texttt{$\backslash$usepackage\{graphicx\}}, etc., into the document preamble. To load \texttt{principia}, type \texttt{$\backslash$usepackage\{principia\}} in the document's preamble.
+To load \texttt{principia}, type \texttt{$\backslash$usepackage\{principia\}} in the document's preamble.
\noindent \begin{tabular}{@{}p{3cm} | p{5cm} | p{8.25cm}}
\textbf{Symbol} & \textbf{\LaTeX command} & \textbf{Notes} \\ \hline
@@ -70,105 +149,7 @@ Version 1.2 (and 1.0-1.1) of \texttt{principia} is adequate to typeset all notat
\noindent \begin{tabular}{@{}p{3cm} | p{5cm} | p{8.25cm}}
$=$, $\pmnid$ & \verb|=|, \verb|\pmnid| & Identity and its negation. \\
$\pmdsc{x}$ & \verb|\pmdsc{x}| & Definite description. \\
- $\pmexists$ & \verb|\pmexists| & Existence. \\
- $\pmcls{z}{\psi z}$ & \verb|\pmcls{z}{\psi z}| & The class of $z$s satisfying $\psi$. \\
- $\pmcin$ & \verb|\pmcin| & The class membership symbol. \\
- $\pmClsn{n}$, $\pmCls$ & \verb|\pmClsn{n}|, \verb|\pmCls| & The class of classes of individuals. \\
- $\pmscl{\alpha}$, $\pmsCl$ & \verb|\pmscl{\alpha}|, \verb|\pmsCl| & The subclasses of a class $\alpha$. \\
- $\pmsrl{R}$, $\pmsRl$ & \verb|\pmsrl{R}|, \verb|\pmsRl| & The sub-relations of a relation $R$. \\
- $\pmcuni$ & \verb|\pmcuni| & The universal class. \\
- $\pmcnull$ & \verb|\pmcnull| & The null class. \\
- $\pmcexists$ & \verb|\pmcexists| & The existence of a class. \\
- $\pmccmp{\alpha}$ & \verb|\pmccmp{\alpha}| & This command requires one argument. \\
- $\pmcmin{\alpha}{\beta}$ & \verb|\pmcmin{\alpha}{\beta}| & This command requires two arguments. \\
- $\pmccup$ & \verb|\pmccup| & Class union. \\
- $\pmccap$ & \verb|\pmccap| & Class intersection. \\
- $\pmcinc$ & \verb|\pmcinc| & Class inclusion. \\
- $\pmrel{x}{y}{\phi(x,y)}$ & \verb|\pmrel{x}{y}{\phi(x,y)}| & The relation in extension given by $\phi$. \\
- $\pmrele{a}{x}{y}{R}{b}$ & \verb|\pmrele{a}{x}{y}{R}{b}| & This command requires five arguments. \\
- $\pmrelep{a}{R}{b}$ & \verb|\pmrelep{a}{R}{b}| & This command requires three arguments. \\
- $\pmrin$ & \verb|\pmrin| & The relation membership symbol. \\
- $\pmReln{n}$, $\pmRel$ & \verb|\pmReln{n}|, \verb|\pmRel| & The class of relations ($n$-many `of relations'). \\
- $\pmruni$ & \verb|\pmruni| & The universal relation. \\
- $\pmrnull$ & \verb|\pmrnull| & The null relation. \\
- $\pmrexists$ & \verb|\pmrexists| & This symbol prefixes relations. \\
- $\pmrcmp{R}$ & \verb|\pmrcmp{\alpha}| & This command requires one argument. \\
- $\pmrmin{R}{S}$ & \verb|\pmcmin{R}{S}| & This command requires two arguments. \\
- $\pmrcup$ & \verb|\pmrcup| & Relation union. \\
- $\pmrcap$ & \verb|\pmrcap| & Relation intersection. \\
- $\pmrinc$ & \verb|\pmrinc| & Relation inclusion. \\
- $\pmcrel{R}$ & \verb|\pmcrel{R}| & The converse of a relation. \\
- $\pmCnv$ & \verb|\pmCnv| & The command for `Cnv'. \\
- $\pmdscf{R}{x}$ & \verb|\pmdscf{R}{x}| & A singular descriptive function. \\
- $\pmdscff{R}{\beta}$ & \verb|\pmdscff{R}{\beta}| & A plural descriptive function. \\
- $\pmdscfff{R}{\kappa}$ & \verb|\pmdscfff{R}{\kappa}| & A plural descriptive function. \\
- $\pmdscfe{R}{\beta}$ & \verb|\pmdscfe{R}{\beta}| & The existence of a plural descriptive function.
-\end{tabular}
-
-\noindent \begin{tabular}{@{}p{3cm} | p{5cm} | p{8.25cm}}
- $\pmdscfr{R}{x}$, `$\pmdscfR{R}$'& \verb|\pmdscfr{R}{x}|, \verb|\pmdscfR{R}| & The relation of $\pmdscfr{R}{\beta}$ to $\beta$. \\
- $\pmdm{R}$, $\pmDm$ & \verb|\pmdm{R}|, \verb|\pmDm| & The domain of a relation $R$. \\
- $\pmcdm{R}$, $\pmCdm$ & \verb|\pmcdm{R}|, \verb|\pmCdm| & The converse domain of a relation $R$. \\
- $\pmcmp{R}$, $\pmCmp$ & \verb|\pmcmp{R}|, \verb|\pmCmp| & The campus of a relation $R$. \\
- $\pmfld{R}$, $\pmFld$ & \verb|\pmfld{R}|, \verb|\pmFld| & The field of a relation $R$. \\
- $\pmrrf{R}{x}$, $\pmRrf{R}$ & \verb|\pmrrf{R}{x}|, \verb|\pmRrf{R}| & The referents of a given relation. \\
- $\pmrrl{R}{x}$, $\pmRrl{R}$ & \verb|\pmrrl{R}{x}|, \verb|\pmRrl{R}| & The relata of a given relation. \\
- $\pmsg{R}$, $\pmSg$ & \verb|\pmsg{R}|, \verb|\pmSg| & \\
- $\pmgs{R}$, $\pmGs$ & \verb|\pmgs{R}|, \verb|\pmGs| & \\
- $\pmrprd{R}{S}$, $\pmRprd$ & \verb|\pmrprd{R}{S}|, \verb|\pmrprd| & The relative product of $R$ and $S$. \\
- $\pmrprdn{R}{n}$ & \verb|\pmrprdn{R}{n}| & The $n$th relative product of $R$. \\
- $\pmrprdd{R}{S}$, $\pmRprdd$ & \verb|\pmrprdd{R}{S}|, \verb|\pmrprdd| & The double relative product of $R$ and $S$. \\
- $\pmrlcd{\alpha}{R}$ & \verb|\pmrld{\alpha}{R}| & The limitation of $R$'s domain to $\alpha$. \\
- $\pmrlcd{R}{\beta}$ & \verb|\pmrld{R}{\beta}| & The limitation of $R$'s converse domain to $\beta$. \\
- $\pmrlf{\alpha}{R}{\beta}$ & \verb|\pmrlf{\alpha}{R}{\beta}| & The limitation of $R$'s field to $\alpha$ and $\beta$, resp. \\
- $\pmrlF{P}{\alpha}$ & \verb|\pmrlF{\alpha}{R}{\beta}| & The limitation of $P$'s field to $\alpha$. \\
- $\pmrl{\alpha}{\beta}$ & \verb|\pmrl{\alpha}{\beta}| & The relation made of all $x$s in $\alpha$ and $y$s in $\beta$. \\
- $\pmop$ & \verb|\pmop| & The operation symbol. \\
- $\pmopc{\alpha}{y}$ & \verb|\pmopc{\alpha}{y}| & The relation of $x$s in $\alpha$ taken to $y$ by $\pmop$. \\
- $\pmccsum{\alpha}$ & \verb|\pmccsum{\alpha}| & The sum of a class of classes. \\
- $\pmccprd{\alpha}$ & \verb|\pmccprd{\alpha}| & The product of a class of classes. \\
- $\pmcrsum{\alpha}$ & \verb|\pmcrsum{\alpha}| & The sum of a class of relations. \\
- $\pmcrprd{\alpha}$ & \verb|\pmcrprd{\alpha}| & The product of a class of relations. \\
- $\pmrid$, $\pmrdiv$ & \verb|\pmrid|, \verb|\pmrdiv| & The relations of identity and diversity. \\
- $\pmcunit{x}$, $\pmcUnit$ & \verb|\pmcunit{x}|, \verb|\pmcUnit| & The unit class. \\
- $\pmcunits{\alpha}$ & \verb|\pmcunits{\alpha}| & The sum of unit classes of $\alpha$'s elements. \\
- $\pmrn{n}$ & \verb|\pmrn{n}| & The ordinal number $n$. \\
- $\pmdn{n}$ & \verb|\pmdn{n}| & The class of relations equal to an $n$-tuple. \\
- $\pmoc{x}{y}$ & \verb|\pmoc{x}{y}| & The ordinal number restricted to $R=(x,y)$. \\
- $\pmrt{x}$, $\pmrti{n}{x}$ & \verb|\pmrt{x}|, \verb|\pmrti{n}{x}| & The relative type of $x$ ($n$-many `type of's). \\
- $\pmrtc{n}{\alpha}$ & \verb|\pmrtc{n}{\alpha}| & The relative type of $\alpha$ ($n$-many `type of's). \\
- $\pmrtri{n}{R}$, $\pmrtrc{n}{R}$ & \verb|\pmrtri{n}{R}|, \verb|\pmrtrc{n}{R}| & The relative type of (with $n$-many `type of's) $R$ from individuals to individuals, or from classes to classes. `$nm$' can replace `$n$'.
-\end{tabular}
-
-\noindent \begin{tabular}{@{}p{3cm} | p{5cm} | p{8.25cm}}
- $\pmrtric{n}{m}{R}$, $\pmrtrci{n}{m}{R}$ & \verb|\pmrtric{n}{R}|, \verb|\pmrtrci{n}{R}| & The relative type of $R$ from individuals to classes, or from classes to individuals. \\
- $\pmrtdi{\alpha}{x}$, $\pmrtdri{R}{(x,y)}$ & \verb|\pmrtdi{\alpha}{x}|, \verb|\pmrtdri{R}{(x,y)}| & The result of determining that the members of $\alpha$ ($R$) belong to the relative type of $x$ (in the domain, and of $y$ in the converse domain). \\
- $\pmrtdc{\alpha}{x}$, $\pmrtdrc{R}{x,y}$ & \verb|\pmrtdc{\alpha}{x}|, \verb|\pmrtdrc{R}{x,y}| & The result of determining that the members of $\alpha$ ($R$) belong to the relative type of $\pmrt{x}$ (in the domain, and of $\pmrt{y}$ in the converse domain). \\
- $\pmrdc{\alpha}{\beta}$ & \verb|\pmrdc{\alpha}{\beta}| & The class of relations $R$ with domain contained in $\alpha$ and converse domain in $\beta$. \\
- $\pmoneone$, $\pmonemany$, $\pmmanyone$ & \verb|\pmoneone|, \verb|\pmonemany|, \verb|\pmmanyone| & The class of one-one, or one-many, or many-one, relations. Note \verb|\pmrdc| can be used here. \\
- $\pmsm$, $\pmsmbar$ & \verb|\pmsm|, \verb|\pmsmbar| & The similarity relation. \\
- $\pmselp{\kappa}$, $\pmSelp$ & \verb|\pmselp{\kappa}|, \verb|\pmSelp| & The $P$-selections from $\kappa$ \\
- $\pmsele{\kappa}$, $\pmSele$ & \verb|\pmsele{\kappa}|, \verb|\pmSele| & The $\pmcin$-selections from $\kappa$ \\
- $\pmself{\kappa}$, $\pmSelf$ & \verb|\pmself{\kappa}|, \verb|\pmSelf| & The $F$-selections from $\kappa$ \\
- $\pmexc$ & \verb|\pmexc| & The class of pairwise-disjoint classes. \\
- $\pmexcn$ & \verb|\pmexcn| & The class of pairwise-disjoint non-null classes. \\
- $\pmexcc{\gamma}$ & \verb|\pmexcc{\gamma}| & A class of mutually exclusive classes in $\gamma$. \\
- $\pmselc{P}{y}$ & \verb|\pmselc{P}{y}| & The class of couples $(y, \pmdscf{P}{y})$. \\
- $\pmmultc$ & \verb|\pmmultc| & The class of multipliable classes. \\
- $\pmmultr$ & \verb|\pmmultr| & The class of multipliable relations. \\
- $\pmmultax$ & \verb|\pmmultax| & The multiplicative axiom. \\
- $\pmanc{R}$, $\pmancc{R}$ & \verb|\pmanc{R}|, \verb|\pmancc{R}| & The ancestral and its converse. \\
- $\pmrst{R}$, $\pmrts{R}$ & \verb|\pmrst{R}|, \verb|\pmrts{R}| & The powers of the ancestral and its converse. \\
- $\pmmin{P}$, $\pmmax{P}$ & \verb|\pmmin{P}|, \verb|\pmmax{P}| & The minimum and maximum under $P$. \\
- $\pmpot{R}$, $\pmpotid{R}$ & \verb|\pmpot{R}|, \verb|\pmpotid{R}| & The products (strict and not) of an ancestral. \\
- $\pmpo{R}$ & \verb|\pmpo{R}| & The product of a class of ancestrals $R$. \\
- $\pmB$ & \verb|\pmB| & The relation of beginning under $P$. \\
- $\pmgen{P}$ & \verb|\pmgen{P}| & The generation of $P$. \\
- $\pmefr{P}{Q}$ & \verb|\pmefr{P}{Q}| & The equi-factor relation. \\
- $\pmipr{R}{x}$ & \verb|\pmipr{R}{x}| & The non-distinct posterity of $x$ under $R$. \\
- $\pmjpr{R}{x}$ & \verb|\pmjpr{R}{x}| & The distinct posterity of $x$ under $R$. \\
- $\pmfr{R}{x}$ & \verb|\pmfr{R}{x}| & The ancestry and posterity of $x$ under $R$. \\
- $\pmnc{\kappa}$, $\pmNc$ & \verb|\pmnc{\kappa}|, \verb|\pmNc| & The cardinal number of $\kappa$.
+ $\pmexists$ & \verb|\pmexists| & Existence.
\end{tabular}
\end{document} \ No newline at end of file
diff --git a/macros/luatex/generic/luatexko/ChangeLog b/macros/luatex/generic/luatexko/ChangeLog
index e0dc310e65..87afc21887 100644
--- a/macros/luatex/generic/luatexko/ChangeLog
+++ b/macros/luatex/generic/luatexko/ChangeLog
@@ -1,3 +1,11 @@
+2021-04-20 Dohyun Kim <nomos at ktug org>
+
+ Version 3.1
+
+ * luatexko.lua: insert 1/4 quad after vertical colons;
+ cleverer behavior when protrusion option is given;
+ process_fonts() is now called by hyphenate callback
+
2021-03-01 Dohyun Kim <nomos at ktug org>
Version 3.0
diff --git a/macros/luatex/generic/luatexko/README b/macros/luatex/generic/luatexko/README
index 204f8183bb..1b9329ffca 100644
--- a/macros/luatex/generic/luatexko/README
+++ b/macros/luatex/generic/luatexko/README
@@ -1,4 +1,4 @@
-LuaTeX-ko Package version 3.0 (2021/03/01)
+LuaTeX-ko Package version 3.1 (2021/04/20)
===========================================
This is a Lua(La)TeX macro package that supports typesetting Korean
diff --git a/macros/luatex/generic/luatexko/luatexko-doc.pdf b/macros/luatex/generic/luatexko/luatexko-doc.pdf
index a8b7ae9d40..dc87222ab2 100644
--- a/macros/luatex/generic/luatexko/luatexko-doc.pdf
+++ b/macros/luatex/generic/luatexko/luatexko-doc.pdf
Binary files differ
diff --git a/macros/luatex/generic/luatexko/luatexko-doc.tex b/macros/luatex/generic/luatexko/luatexko-doc.tex
index ea7d4fc938..d23b010e8f 100644
--- a/macros/luatex/generic/luatexko/luatexko-doc.tex
+++ b/macros/luatex/generic/luatexko/luatexko-doc.tex
@@ -14,22 +14,31 @@
\usepackage{luacolor}
\usepackage[hangul]{luatexko}
\directlua{
- local gidoffset = 0x120000
- local notoserifcjkkr_hb = {
- [171] = { 0.5, 0 }, % «
- [187] = { 0, 0.5 }, % »
- [62253+gidoffset] = { 0.5, 0 }, % (
- [62254+gidoffset] = { 0, 0.5 }, % )
- [62255+gidoffset] = { 0, 1 }, % ,
- [62257+gidoffset] = { 0, 1 }, % .
- [62259+gidoffset] = { 0, 0.5 }, % :
- [62260+gidoffset] = { 0, 0.5 }, % ;
- [62270+gidoffset] = { 1, 0 }, % ‘
- [62271+gidoffset] = { 0, 1 }, % ’
- [62273+gidoffset] = { 0.5, 0 }, % “
- [62274+gidoffset] = { 0, 0.5 }, % ”
+ fonts.protrusions.setups.notoserifcjk = {
+ [0x28] = { 0.5, 0 }, % (
+ [0x29] = { 0, 0.5 }, % )
+ [0x2C] = { 0, 1 }, % ,
+ [0x2E] = { 0, 1 }, % .
+ [0x3A] = { 0, 0.5 }, % :
+ [0x3B] = { 0, 0.5 }, % ;
+ [0xAB] = { 0.5, 0 }, % «
+ [0xBB] = { 0, 0.5 }, % »
+ [0x2018] = { 1, 0 }, % ‘
+ [0x2019] = { 0, 1 }, % ’
+ [0x201C] = { 0.5, 0 }, % “
+ [0x201D] = { 0, 0.5 }, % ”
+ }
+ fonts.protrusions.setups.notosanscjk = {
+ % compresspunctuations 가 이미 반각을 강제했으므로 여기선 0.5만 준다.
+ % +halt, +vhal 따위의 옵션이 주어진 때에도 마찬가지
+ [0x3001] = { 0, .5 },
+ [0x3002] = { 0, .5 },
+ [0xFF0C] = { 0, .5 },
+ [0xFF0E] = { 0, .5 },
+ [0xFE10] = { 0, .5 },
+ [0xFE11] = { 0, .5 },
+ [0xFE12] = { 0, .5 },
}
- fonts.protrusions.setups.notoserifcjk = notoserifcjkkr_hb
}
\defaultfontfeatures+{Renderer=HarfBuzz}
\setmainfont{Latin Modern Roman}[Expansion] % for hb tlig
@@ -87,6 +96,7 @@
InterCharStretch=1pt,
CharRaise=1pt,
CharacterWidth=Full,
+ Protrusion=notosanscjk,
]
\newhangulfontface\rubyfont{Noto Serif CJK KR Medium}[
Script=Hangul,
@@ -124,7 +134,7 @@
\author{Dohyun Kim \normalsize |<nomos at ktug org>| \and
Soojin Nam \normalsize |<jsunam at gmail com>| \and
\normalsize <\url{http://github.com/dohyunkim/luatexko}>}
-\date{Version 3.0\quad 2021/03/01}
+\date{Version 3.1\quad 2021/04/20}
\maketitle
\begin{quote}
@@ -455,6 +465,7 @@ v2.0부터는 고문헌 조판에서 한글^^b7한자와 영문자가 붙어 나
참조.
\begin{figure}
+ \fboxsep=5pt
\framebox[\linewidth]{
\begin{vertical}{20em}
\linespread{1.5}\sffamily \verticalhangulfont
@@ -465,17 +476,21 @@ v2.0부터는 고문헌 조판에서 한글^^b7한자와 영문자가 붙어 나
\end{figure}
\begin{figure}
+ \fboxsep=5pt
\framebox[\linewidth]{
- \begin{vertical}{19em}
+ \begin{vertical}{17em}
\linespread{1.5}\sffamily \verticalhangulfont
\parindent0pt \everypar{\hangindent1em \hangafter1 }
\analectstext
\end{vertical}
}
- \caption{세로쓰기의 다른 예. 박스 높이 |19em|을 지시했다.
+ \caption{세로쓰기의 다른 예. 박스 높이 |17em|을 지시했다.
글꼴에 |CompressPunctuations|와 더불어
|InterCharStretch=1pt|를 옵션으로 주었다. 공백이 없는 문서는 자간늘이기 값을
넉넉하게 주는 것이 좋다.
+ |Protrusion| 옵션으로 구두점들이 행 끝에 매달린 것도 볼 수 있다.
+ |CompressPunctuations|로 이미 반각이 강제되고 있으므로 글자내밀기 값으로 |0.5|를
+ 주어야 전부 내밀기가 된다.
}\label{fig:vertical3}
\end{figure}
@@ -498,6 +513,7 @@ v2.0부터는 고문헌 조판에서 한글^^b7한자와 영문자가 붙어 나
가로쓰기 영역의 폰트 설정은 사용자의 몫이다.
\begin{figure}
+ \fboxsep=5pt
\framebox[\linewidth]{
\begin{vertical}{17em}
\linespread{1.5}\sffamily \verticalhangulfont
diff --git a/macros/luatex/generic/luatexko/luatexko-normalize.lua b/macros/luatex/generic/luatexko/luatexko-normalize.lua
index 2dec726fb6..a86b709390 100644
--- a/macros/luatex/generic/luatexko/luatexko-normalize.lua
+++ b/macros/luatex/generic/luatexko/luatexko-normalize.lua
@@ -13,8 +13,8 @@
luatexbase.provides_module({
name = "luatexko-normalize",
- version = "3.0",
- date = "2021/03/01",
+ version = "3.1",
+ date = "2021/04/20",
author = "Dohyun Kim, Soojin Nam",
description = "Hangul normalization",
license = "LPPL v1.3+",
diff --git a/macros/luatex/generic/luatexko/luatexko-uhc2utf8.lua b/macros/luatex/generic/luatexko/luatexko-uhc2utf8.lua
index e82bf2cdfe..d3d86fcb25 100644
--- a/macros/luatex/generic/luatexko/luatexko-uhc2utf8.lua
+++ b/macros/luatex/generic/luatexko/luatexko-uhc2utf8.lua
@@ -13,8 +13,8 @@
luatexbase.provides_module({
name = "luatexko-uhc2utf8",
- version = "3.0",
- date = "2021/03/01",
+ version = "3.1",
+ date = "2021/04/20",
author = "Dohyun Kim, Soojin Nam",
description = "UHC (CP949) input encoding",
license = "LPPL v1.3+",
diff --git a/macros/luatex/generic/luatexko/luatexko.lua b/macros/luatex/generic/luatexko/luatexko.lua
index 22fcaf54cf..d0360a8b72 100644
--- a/macros/luatex/generic/luatexko/luatexko.lua
+++ b/macros/luatex/generic/luatexko/luatexko.lua
@@ -13,8 +13,8 @@
luatexbase.provides_module {
name = 'luatexko',
- date = '2021/03/01',
- version = '3.0',
+ date = '2021/04/20',
+ version = '3.1',
description = 'typesetting Korean with LuaTeX',
author = 'Dohyun Kim, Soojin Nam',
license = 'LPPL v1.3+',
@@ -112,9 +112,6 @@ local rubyattr = attributes.luatexkorubyattr
local hangulbyhangulattr = attributes.luatexkohangulbyhangulattr
local hanjabyhanjaattr = attributes.luatexkohanjabyhanjaattr
-local vert_classic = 1
-local SC_classic = 2
-
local stretch_f = 5/100 -- should be consistent for ruby
local function get_font_data (fontid)
@@ -170,31 +167,79 @@ local function font_opt_dim (fd, optname)
end
end
-local function is_harf (f)
+local function has_harf_data (f)
if type(f) == "number" then
f = get_font_data(f)
end
return f.hb
end
-local function is_not_harf (f)
- if option_in_font(f, "mode") == "harf" then -- mode=harf with non-luahbtex
- return false
- end
- return not is_harf(f)
-end
+local harfbuzz = luaotfload.harfbuzz
+local os2tag = harfbuzz and harfbuzz.Tag.new"OS/2"
-local function harf_reordered_tonemark (curr)
- if is_harf(curr.font) then
- local props = getproperty(curr) or {}
- local actualtext = props.luaotfload_startactualtext or ""
- return actualtext:find"302[EF]$"
- end
-end
+local fontoptions = {
+ is_not_harf = setmetatable( {}, { __index = function (t, fid)
+ if fid then
+ local bool = has_harf_data(fid) and false or true
+ t[fid] = bool
+ return bool
+ end
+ end }),
-local os2tag = luaotfload.harfbuzz and luaotfload.harfbuzz.Tag.new"OS/2"
+ mode = setmetatable( {}, { __index = function (t, fid)
+ if fid then
+ local m = option_in_font(fid, "mode") or false
+ if m == "harf" and not has_harf_data(fid) then
+ m = "node" -- default mode when 'mode=harf' in non-luahbtex
+ end
+ t[fid] = m
+ return m
+ end
+ end }),
+
+ is_widefont = setmetatable( {}, { __index = function(t, fid)
+ if fid then
+ local fontdata = get_font_data(fid)
+ local format = fontdata.format
+ local encode = fontdata.encodingbytes
+ local bool = encode == 2 or format == "opentype" or format == "truetype"
+ t[fid] = bool
+ return bool
+ end
+ end }),
+
+ is_hangulscript = setmetatable( {}, { __index = function(t, fid)
+ if fid then
+ local bool = option_in_font(fid, "script") == "hang"
+ t[fid] = bool
+ return bool
+ end
+ end }),
+
+ compresspunctuations = setmetatable( {}, { __index = function(t, fid)
+ if fid then
+ local bool = option_in_font(fid, "compresspunctuations") or false
+ t[fid] = bool
+ return bool
+ end
+ end }),
+
+ removeclassicspaces = setmetatable( {}, { __index = function(t, fid)
+ if fid then
+ local bool = option_in_font(fid, "removeclassicspaces") or false
+ t[fid] = bool
+ return bool
+ end
+ end }),
+
+ slantvalue = setmetatable( {}, { __index = function(t, fid)
+ if fid then
+ local val = option_in_font(fid, "slant") or false
+ t[fid] = val
+ return val
+ end
+ end }),
-local font_options = {
charraise = setmetatable( {}, { __index = function(t, fid)
if fid then
local dim = font_opt_dim(fid, "charraise") or false
@@ -247,7 +292,7 @@ local font_options = {
hangulspaceskip = setmetatable( {}, { __index = function(t, fid)
if fid then
local newwd
- if is_harf(fid) then
+ if has_harf_data(fid) then
newwd = getparameters(fid) or false
if newwd then
newwd = { newwd.space, newwd.space_stretch, newwd.space_shrink }
@@ -274,29 +319,27 @@ local font_options = {
t[fid] = true; return true
end
-- but not in harf mode; so we simply test widths of some glyphs
- if is_harf(fid) then
- local chars = get_font_data(fid).characters or {}
- local i, M = chars[0x69], chars[0x4D]
- if i and M and i.width == M.width then
- t[fid] = true; return true
- end
+ local chars = get_font_data(fid).characters or {}
+ local i, M = chars[0x69], chars[0x4D]
+ if i and M and i.width == M.width then
+ t[fid] = true; return true
end
t[fid] = false; return false
end
end } ),
- tonemarkwidth = setmetatable( {}, { __index = function(t, fid)
+ tonemark_xmax = setmetatable( {}, { __index = function(t, fid)
if fid then
- local hwidth
- -- check horizontal width; vertical width is mostly non-zero
+ -- check horizontal metric
local fontdata = get_font_data(fid)
local shared = fontdata.shared or {}
local rawdata = shared.rawdata or {}
local descriptions = rawdata.descriptions or {}
local description = descriptions[0x302E] or {}
- hwidth = description.width or 0
- t[fid] = hwidth
- return hwidth
+ local bbox = description.boundingbox or {}
+ local xmax = bbox[3] or -1
+ t[fid] = xmax
+ return xmax
end
return 0
end } ),
@@ -307,7 +350,7 @@ local font_options = {
-- luaharfbuzz's Font:get_h_extents() gets ascender value from hhea table;
-- Node mode's parameters.ascender is gotten from OS/2 table.
-- TypoAscender in OS/2 table seems to be more suitable for our purpose.
- local hb = is_harf(fid)
+ local hb = has_harf_data(fid)
if hb and os2tag then
local hbface = hb.shared.face
local tags = hbface:get_table_tags()
@@ -348,6 +391,14 @@ local function char_in_font(fontdata, char)
end
end
+local function harf_reordered_tonemark (curr)
+ if not fontoptions.is_not_harf[curr.font] then
+ local props = getproperty(curr) or {}
+ local actualtext = props.luaotfload_startactualtext or ""
+ return actualtext:find"302[EF]$"
+ end
+end
+
local function my_node_props (n)
local t = getproperty(n)
if not t then
@@ -358,8 +409,6 @@ local function my_node_props (n)
return t.luatexko
end
-local active_processes = {}
-
local function is_hanja (c)
return c >= 0x3400 and c <= 0xA4C6
or c >= 0xF900 and c <= 0xFAD9
@@ -438,6 +487,135 @@ local function is_hangul_jamo (c)
or is_jongsong(c)
end
+local intercharclass = { [0] =
+ { [0] = nil, {1,1}, nil, {.5,.5} },
+ { [0] = nil, nil, nil, {.5,.5} }, -- openers
+ { [0] = {1,1}, {1,1}, nil, {.5,.5}, nil, {1,1}, {1,1} }, -- closers
+ { [0] = {.5,.5},{.5,.5},{.5,.5},{1,.5}, {.5,.5},{.5,.5},{.5,.5},{.5,.5} }, -- middle dots
+ { [0] = {1,0}, {1,0}, nil, {1.5,.5},nil, {1,0}, {1,0} }, -- full stops
+ { [0] = nil, {1,1}, nil, {.5,.5} }, -- leaders and ellipses
+ { [0] = {1,1}, {1,1}, nil, {.5,.5} }, -- questions and exclamations
+ { [0] = {.5,.5},{.5,.5},nil, {.5,.5} }, -- vertical colons
+}
+
+local charclass = setmetatable({
+ [0x2018] = 1, [0x201C] = 1, [0x2329] = 1, [0x3008] = 1,
+ [0x300A] = 1, [0x300C] = 1, [0x300E] = 1, [0x3010] = 1,
+ [0x3014] = 1, [0x3016] = 1, [0x3018] = 1, [0x301A] = 1,
+ [0x301D] = 1, [0xFE17] = 1, [0xFE35] = 1, [0xFE37] = 1,
+ [0xFE39] = 1, [0xFE3B] = 1, [0xFE3D] = 1, [0xFE3F] = 1,
+ [0xFE41] = 1, [0xFE43] = 1, [0xFE47] = 1, [0xFF08] = 1,
+ [0xFF3B] = 1, [0xFF5B] = 1, [0xFF5F] = 1, [0xFF62] = 1,
+ --
+ [0x2019] = 2, [0x201D] = 2, [0x232A] = 2, [0x3001] = 2,
+ [0x3009] = 2, [0x300B] = 2, [0x300D] = 2, [0x300F] = 2,
+ [0x3011] = 2, [0x3015] = 2, [0x3017] = 2, [0x3019] = 2,
+ [0x301B] = 2, [0x301E] = 2, [0x301F] = 2, [0xFE10] = 2,
+ [0xFE11] = 2, [0xFE18] = 2, [0xFE36] = 2, [0xFE38] = 2,
+ [0xFE3A] = 2, [0xFE3C] = 2, [0xFE3E] = 2, [0xFE40] = 2,
+ [0xFE42] = 2, [0xFE44] = 2, [0xFE48] = 2, [0xFF09] = 2,
+ [0xFF0C] = 2, [0xFF3D] = 2, [0xFF5D] = 2, [0xFF60] = 2,
+ [0xFF63] = 2, [0xFF64] = 2,
+ --
+ [0x00B7] = 3, [0x30FB] = 3, [0xFF1A] = 3, [0xFF1B] = 3,
+ [0xFF65] = 3,
+ --
+ [0x3002] = 4, [0xFE12] = 4, [0xFF0E] = 4, [0xFF61] = 4,
+ --
+ [0x2015] = 5, [0x2025] = 5, [0x2026] = 5, [0xFE19] = 5,
+ [0xFE30] = 5, [0xFE31] = 5,
+ --
+ [0xFE15] = 6, [0xFE16] = 6, [0xFF01] = 6, [0xFF1F] = 6,
+}, { __index = function() return 0 end })
+
+local special_classes = {
+ [0] = charclass,
+ setmetatable({ -- vert
+ [0xFF1A] = 7, [0xFF1B] = 7, -- 0xFE13, 0xFE14
+ }, { __index = charclass }),
+ setmetatable({ -- SC
+ [0xFF01] = 4, [0xFF1A] = 2, [0xFF1B] = 2, [0xFF1F] = 4,
+ }, { __index = charclass }),
+ setmetatable({ -- TC
+ [0x3001] = 3, [0x3002] = 3, [0xFF0C] = 3, [0xFF0E] = 3,
+ }, { __index = charclass }),
+ setmetatable({ -- TC vert
+ [0x3001] = 3, [0x3002] = 3, [0xFF0C] = 3, [0xFF0E] = 3,
+ [0xFF1A] = 7, [0xFF1B] = 7, -- 0xFE13, 0xFE14
+ }, { __index = charclass }),
+}
+
+local function get_char_class (c, classic)
+ return special_classes[classic or 0][c]
+end
+
+local breakable_after = setmetatable({
+ [0x21] = true, [0x22] = true, [0x25] = true, [0x27] = true,
+ [0x29] = true, [0x2C] = true, [0x2D] = true, [0x2E] = true,
+ [0x3A] = true, [0x3B] = true, [0x3E] = true, [0x3F] = true,
+ [0x5D] = true, [0x7D] = true, [0x7E] = true, [0xBB] = true,
+ [0x2013] = true, [0x2014] = true, [0x25A1] = true, [0x25CB] = true,
+ [0x2E80] = true, [0x3003] = true, [0x3005] = true, [0x3007] = true,
+ [0x301C] = true, [0x3035] = true, [0x303B] = true, [0x303C] = true,
+ [0x309D] = true, [0x309E] = true, [0x30A0] = true, [0x30FC] = true,
+ [0x30FD] = true, [0x30FE] = true, [0xFE13] = true, [0xFE14] = true,
+ [0xFE32] = true, [0xFE50] = true, [0xFE51] = true, [0xFE52] = true,
+ [0xFE54] = true, [0xFE55] = true, [0xFE57] = true, [0xFE57] = true,
+ [0xFE58] = true, [0xFE5A] = true, [0xFE5C] = true, [0xFE5E] = true,
+ [0xFF1E] = true, [0xFF5E] = true, [0xFF70] = true, [0x226B] = true, -- ≫
+},{ __index = function (_,c)
+ return is_hangul_jamo(c) -- chosong also is breakable_after
+ or is_noncjk_char(c)
+ or is_hanja(c)
+ or is_cjk_combining(c)
+ or is_kana(c)
+ or charclass[c] >= 2
+end })
+luatexko.breakableafter = breakable_after
+
+local breakable_before = setmetatable({
+ [0x28] = true, [0x3C] = true, [0x5B] = true, [0x60] = true,
+ [0x7B] = true, [0xAB] = true, [0x25A1] = true, [0x25CB] = true,
+ [0x3007] = true, [0xFE59] = true, [0xFE5B] = true, [0xFE5D] = true,
+ [0xFF1C] = true, [0x226A] = true, -- ≪
+ -- small kana
+ [0x3041] = 1000, [0x3043] = 1000, [0x3045] = 1000, [0x3047] = 1000,
+ [0x3049] = 1000, [0x3063] = 1000, [0x3083] = 1000, [0x3085] = 1000,
+ [0x3087] = 1000, [0x308E] = 1000, [0x3095] = 1000, [0x3096] = 1000,
+ [0x30A1] = 1000, [0x30A3] = 1000, [0x30A5] = 1000, [0x30A7] = 1000,
+ [0x30A9] = 1000, [0x30C3] = 1000, [0x30E3] = 1000, [0x30E5] = 1000,
+ [0x30E7] = 1000, [0x30EE] = 1000, [0x30F5] = 1000, [0x30F6] = 1000,
+ [0x31F0] = 1000, [0x31F1] = 1000, [0x31F2] = 1000, [0x31F3] = 1000,
+ [0x31F4] = 1000, [0x31F5] = 1000, [0x31F6] = 1000, [0x31F7] = 1000,
+ [0x31F8] = 1000, [0x31F9] = 1000, [0x31FA] = 1000, [0x31FB] = 1000,
+ [0x31FC] = 1000, [0x31FD] = 1000, [0x31FE] = 1000, [0x31FF] = 1000,
+ [0xFF67] = 1000, [0xFF68] = 1000, [0xFF69] = 1000, [0xFF6A] = 1000,
+ [0xFF6B] = 1000, [0xFF6C] = 1000, [0xFF6D] = 1000, [0xFF6E] = 1000,
+ [0xFF6F] = 1000, [0x1B150] = 1000, [0x1B151] = 1000, [0x1B152] = 1000,
+ [0x1B164] = 1000, [0x1B165] = 1000, [0x1B166] = 1000, [0x1B167] = 1000,
+},{ __index = function(_,c)
+ return is_hangul(c)
+ or is_compat_jamo(c)
+ or is_chosong(c)
+ or is_hanja(c)
+ or is_kana(c)
+ or charclass[c] == 1
+end
+})
+luatexko.breakablebefore = breakable_before
+
+local function is_cjk_char (c)
+ return is_hangul_jamo(c)
+ or is_hanja(c)
+ or is_cjk_combining(c)
+ or is_kana(c)
+ or charclass[c] >= 1
+ or rawget(breakable_before, c) and c >= 0x2000
+ or rawget(breakable_after, c) and c >= 0x2000
+end
+
+local active_processes = {}
+
-- font fallback
local force_hangul = {
@@ -479,7 +657,7 @@ local function hangul_space_skip (curr, newfont)
-- command does the same thing), which we will bypass here
-- for alignment of CJK and Latin glyphs in verbatim environment.
-- See http://www.ktug.org/xe/index.php?document_srl=249772
- if not font_options.monospaced[curr.font] then
+ if not fontoptions.monospaced[curr.font] then
local n = getnext(curr)
if n and n.id == glueid and n.subtype == spaceskip then
local params = getparameters(curr.font)
@@ -491,7 +669,7 @@ local function hangul_space_skip (curr, newfont)
and oldsto == 0
and oldsho == 0 then -- not user's spaceskip
- local newwd = font_options.hangulspaceskip[newfont]
+ local newwd = fontoptions.hangulspaceskip[newfont]
if newwd then
setglue(n, newwd[1], newwd[2], newwd[3])
end
@@ -516,24 +694,28 @@ local function process_fonts (head)
if p.id == glyphid and curr.font ~= p.font then
hangul_space_skip(curr, p.font)
curr.font = p.font
+ curr.lang = p.lang
end
if not active_processes.reorderTM and
hangul_tonemark[c] and
- is_not_harf(curr.font) and
- option_in_font(curr.font, "script") == "hang" then
+ fontoptions.is_not_harf[curr.font] and
+ fontoptions.is_hangulscript[curr.font] then
luatexko.activate("reorderTM") -- activate reorderTM here
end
else
+ if curr.subtype == 1 and curr.lang ~= nohyphen and is_cjk_char(c) then
+ curr.lang = langkor -- suppress hyphenation of cjk chars
+ end
+
local hf = has_attribute(curr, hangulfontattr) or false
local hjf = has_attribute(curr, hanjafontattr) or false
- local fontdata = get_font_data(curr.font)
- local format = fontdata.format
- local encode = fontdata.encodingbytes
- local widefont = encode == 2 or format == "opentype" or format == "truetype"
- if hf and widefont and force_hangul[c] and curr.lang ~= nohyphen and not font_options.monospaced[curr.font] then
+ if hf and force_hangul[c]
+ and fontoptions.is_widefont[curr.font] -- exclude legacy fonts
+ and curr.lang ~= nohyphen and not fontoptions.monospaced[curr.font] -- exclude ttfamily
+ then
curr.font = hf
elseif hf and has_attribute(curr, hangulbyhangulattr) and is_hangul_jamo(c) then
hangul_space_skip(curr, hf)
@@ -541,7 +723,7 @@ local function process_fonts (head)
elseif hjf and has_attribute(curr, hanjabyhanjaattr) and is_hanja(c) then
hangul_space_skip(curr, hjf)
curr.font = hjf
- elseif not char_in_font(fontdata, c) then
+ elseif not char_in_font(curr.font, c) then
local fbf = has_attribute(curr, fallbackfontattr) or false
for _,f in ipairs{ hf, hjf, fbf } do
if f and char_in_font(f, c) then
@@ -577,120 +759,6 @@ end
-- linebreak
-local intercharclass = { [0] =
- { [0] = nil, {1,1}, nil, {.5,.5} },
- { [0] = nil, nil, nil, {.5,.5} },
- { [0] = {1,1}, {1,1}, nil, {.5,.5}, nil, {1,1}, {1,1} },
- { [0] = {.5,.5},{.5,.5},{.5,.5},{1,.5}, {.5,.5},{.5,.5},{.5,.5} },
- { [0] = {1,0}, {1,0}, nil, {1.5,.5},nil, {1,0}, {1,0} },
- { [0] = nil, {1,1}, nil, {.5,.5} },
- { [0] = {1,1}, {1,1}, nil, {.5,.5} },
- { }, -- vertical colon
-}
-
-local charclass = setmetatable({
- [0x2018] = 1, [0x201C] = 1, [0x2329] = 1, [0x3008] = 1,
- [0x300A] = 1, [0x300C] = 1, [0x300E] = 1, [0x3010] = 1,
- [0x3014] = 1, [0x3016] = 1, [0x3018] = 1, [0x301A] = 1,
- [0x301D] = 1, [0xFE17] = 1, [0xFE35] = 1, [0xFE37] = 1,
- [0xFE39] = 1, [0xFE3B] = 1, [0xFE3D] = 1, [0xFE3F] = 1,
- [0xFE41] = 1, [0xFE43] = 1, [0xFE47] = 1, [0xFF08] = 1,
- [0xFF3B] = 1, [0xFF5B] = 1, [0xFF5F] = 1, [0xFF62] = 1,
- --
- [0x2019] = 2, [0x201D] = 2, [0x232A] = 2, [0x3001] = 2,
- [0x3009] = 2, [0x300B] = 2, [0x300D] = 2, [0x300F] = 2,
- [0x3011] = 2, [0x3015] = 2, [0x3017] = 2, [0x3019] = 2,
- [0x301B] = 2, [0x301E] = 2, [0x301F] = 2, [0xFE10] = 2,
- [0xFE11] = 2, [0xFE18] = 2, [0xFE36] = 2, [0xFE38] = 2,
- [0xFE3A] = 2, [0xFE3C] = 2, [0xFE3E] = 2, [0xFE40] = 2,
- [0xFE42] = 2, [0xFE44] = 2, [0xFE48] = 2, [0xFF09] = 2,
- [0xFF0C] = 2, [0xFF3D] = 2, [0xFF5D] = 2, [0xFF60] = 2,
- [0xFF63] = 2, [0xFF64] = 2,
- --
- [0x00B7] = 3, [0x30FB] = 3, [0xFF1A] = 3, [0xFF1B] = 3,
- [0xFF65] = 3,
- --
- [0x3002] = 4, [0xFE12] = 4, [0xFF0E] = 4, [0xFF61] = 4,
- --
- [0x2015] = 5, [0x2025] = 5, [0x2026] = 5, [0xFE19] = 5,
- [0xFE30] = 5, [0xFE31] = 5,
- --
- [0xFE15] = 6, [0xFE16] = 6, [0xFF01] = 6, [0xFF1F] = 6,
-}, { __index = function() return 0 end })
-
-local SC_charclass = setmetatable({
- [0xFF01] = 4, [0xFF1A] = 4, [0xFF1B] = 4, [0xFF1F] = 4,
-}, { __index = charclass })
-
-local vert_charclass = setmetatable({
- [0xFF1A] = 7, -- 0xFE13
- [0xFF1B] = 7, -- 0xFE14
-}, { __index = charclass })
-
-local function get_char_class (c, classic)
- if classic == vert_classic then
- return vert_charclass[c]
- elseif classic == SC_classic then
- return SC_charclass[c]
- end
- return charclass[c]
-end
-
-local breakable_after = setmetatable({
- [0x21] = true, [0x22] = true, [0x25] = true, [0x27] = true,
- [0x29] = true, [0x2C] = true, [0x2D] = true, [0x2E] = true,
- [0x3A] = true, [0x3B] = true, [0x3E] = true, [0x3F] = true,
- [0x5D] = true, [0x7D] = true, [0x7E] = true, [0xBB] = true,
- [0x2013] = true, [0x2014] = true, [0x25A1] = true, [0x25CB] = true,
- [0x2E80] = true, [0x3003] = true, [0x3005] = true, [0x3007] = true,
- [0x301C] = true, [0x3035] = true, [0x303B] = true, [0x303C] = true,
- [0x309D] = true, [0x309E] = true, [0x30A0] = true, [0x30FC] = true,
- [0x30FD] = true, [0x30FE] = true, [0xFE13] = true, [0xFE14] = true,
- [0xFE32] = true, [0xFE50] = true, [0xFE51] = true, [0xFE52] = true,
- [0xFE54] = true, [0xFE55] = true, [0xFE57] = true, [0xFE57] = true,
- [0xFE58] = true, [0xFE5A] = true, [0xFE5C] = true, [0xFE5E] = true,
- [0xFF1E] = true, [0xFF5E] = true, [0xFF70] = true,
-},{ __index = function (_,c)
- return is_hangul_jamo(c) -- chosong also is breakable_after
- or is_noncjk_char(c)
- or is_hanja(c)
- or is_cjk_combining(c)
- or is_kana(c)
- or charclass[c] >= 2
-end })
-luatexko.breakableafter = breakable_after
-
-local breakable_before = setmetatable({
- [0x28] = true, [0x3C] = true, [0x5B] = true, [0x60] = true,
- [0x7B] = true, [0xAB] = true, [0x25A1] = true, [0x25CB] = true,
- [0x3007] = true, [0xFE59] = true, [0xFE5B] = true, [0xFE5D] = true,
- [0xFF1C] = true,
- -- small kana
- [0x3041] = 1000, [0x3043] = 1000, [0x3045] = 1000, [0x3047] = 1000,
- [0x3049] = 1000, [0x3063] = 1000, [0x3083] = 1000, [0x3085] = 1000,
- [0x3087] = 1000, [0x308E] = 1000, [0x3095] = 1000, [0x3096] = 1000,
- [0x30A1] = 1000, [0x30A3] = 1000, [0x30A5] = 1000, [0x30A7] = 1000,
- [0x30A9] = 1000, [0x30C3] = 1000, [0x30E3] = 1000, [0x30E5] = 1000,
- [0x30E7] = 1000, [0x30EE] = 1000, [0x30F5] = 1000, [0x30F6] = 1000,
- [0x31F0] = 1000, [0x31F1] = 1000, [0x31F2] = 1000, [0x31F3] = 1000,
- [0x31F4] = 1000, [0x31F5] = 1000, [0x31F6] = 1000, [0x31F7] = 1000,
- [0x31F8] = 1000, [0x31F9] = 1000, [0x31FA] = 1000, [0x31FB] = 1000,
- [0x31FC] = 1000, [0x31FD] = 1000, [0x31FE] = 1000, [0x31FF] = 1000,
- [0xFF67] = 1000, [0xFF68] = 1000, [0xFF69] = 1000, [0xFF6A] = 1000,
- [0xFF6B] = 1000, [0xFF6C] = 1000, [0xFF6D] = 1000, [0xFF6E] = 1000,
- [0xFF6F] = 1000, [0x1B150] = 1000, [0x1B151] = 1000, [0x1B152] = 1000,
- [0x1B164] = 1000, [0x1B165] = 1000, [0x1B166] = 1000, [0x1B167] = 1000,
-},{ __index = function(_,c)
- return is_hangul(c)
- or is_compat_jamo(c)
- or is_chosong(c)
- or is_hanja(c)
- or is_kana(c)
- or charclass[c] == 1
-end
-})
-luatexko.breakablebefore = breakable_before
-
local allowbreak_false_nodes = {
[hlistid] = true,
[vlistid] = true,
@@ -758,12 +826,12 @@ local function insert_glue_before (head, curr, par, br, brb, classic, ict, dim,
dim = dim or 0
local gl = nodenew(glueid)
- local en = font_options.en_size[fid]
+ local en = fontoptions.en_size[fid]
if ict then
en = classic and en or en/4
setglue(gl, en * ict[1] + dim, nil, en * ict[2])
else
- local str = font_options.intercharstretch[fid] or stretch_f*en
+ local str = fontoptions.intercharstretch[fid] or stretch_f*en
setglue(gl, dim, str, str*0.6)
end
@@ -777,7 +845,7 @@ local function maybe_linebreak (head, curr, pc, pcl, cc, old, fid, par)
local ict = intercharclass[pcl][ccl]
local brb = breakable_before[cc]
local br = brb and breakable_after[pc]
- local dim = font_options.intercharacter[fid]
+ local dim = fontoptions.intercharacter[fid]
if ict or br or dim and (pcl >= 1 or ccl >= 1) then
head = insert_glue_before(head, curr, par, br, brb, old, ict, dim, fid)
end
@@ -825,69 +893,13 @@ local function process_linebreak (head, par)
return head
end
--- compress punctuations
-
-local function process_glyph_width (head)
- local curr = head
- while curr do
- local id = curr.id
- if id == glyphid then
- if curr.lang ~= nohyphen
- and option_in_font(curr.font, "compresspunctuations") then
-
- local cc = my_node_props(curr).unicode or curr.char
- local old = has_attribute(curr, classicattr)
- local class = get_char_class(cc, old)
- if class >= 1 and class <= 4 and
- (old or cc < 0x2000 or cc > 0x202F) then -- exclude general puncts
-
- -- harf-node always puts kern after the glyph
- local gpos = class == 1 and is_not_harf(curr.font) and getprev(curr) or getnext(curr)
- gpos = gpos and gpos.id == kernid and gpos.subtype == fontkern
-
- if not gpos then
- local wd = font_options.en_size[curr.font] - curr.width
- if wd ~= 0 then
- local k = nodenew(kernid) -- fontkern (subtype 0) is default
- k.kern = class == 3 and wd/2 or wd
- if class == 1 then
- head = insert_before(head, curr, k)
- elseif class == 2 or class == 4 then
- head, curr = insert_after(head, curr, k)
- else
- local k2 = nodecopy(k)
- head = insert_before(head, curr, k)
- head, curr = insert_after(head, curr, k2)
- end
- end
- end
- end
- end
- elseif id == mathid then
- curr = end_of_math(curr)
- end
- curr = getnext(curr)
- end
- return head
-end
-
-- interhangul & interlatincjk
-local function is_cjk_char (c)
- return is_hangul_jamo(c)
- or is_hanja(c)
- or is_cjk_combining(c)
- or is_kana(c)
- or charclass[c] >= 1
- or rawget(breakable_before, c) and c >= 0x2000
- or rawget(breakable_after, c) and c >= 0x2000
-end
-
local function do_interhangul_option (head, curr, pc, c, fontid, par)
local cc = (is_hangul(c) or is_compat_jamo(c) or is_chosong(c)) and 1 or 0
if cc*pc == 1 and curr.lang ~= nohyphen then
- local dim = font_options.interhangul[fontid]
+ local dim = fontoptions.interhangul[fontid]
if dim then
head = insert_glue_before(head, curr, par, true, true, false, false, dim, fontid)
end
@@ -944,11 +956,11 @@ local function do_interlatincjk_option (head, curr, pc, pf, pcl, c, cf, par)
local brb = cc == 2 or breakable_before[c] -- numletter != br_before
if brb then
local f = cc == 1 and cf or pf
- local dim = font_options.interlatincjk[f]
+ local dim = fontoptions.interlatincjk[f]
if dim then
local ict = old and intercharclass[pcl][ccl] -- under classic env. only
if ict then
- dim = font_options.intercharacter[f] or 0
+ dim = fontoptions.intercharacter[f] or 0
end
head = insert_glue_before(head, curr, par, true, brb, old, ict, dim, f)
end
@@ -1011,10 +1023,56 @@ local function process_interlatincjk (head, par)
return head
end
+-- compress punctuations
+
+local function process_glyph_width (head)
+ local curr = head
+ while curr do
+ local id = curr.id
+ if id == glyphid then
+ if curr.lang ~= nohyphen
+ and fontoptions.compresspunctuations[curr.font] then
+
+ local cc = my_node_props(curr).unicode or curr.char
+ local old = has_attribute(curr, classicattr)
+ local class = get_char_class(cc, old)
+ if class >= 1 and class <= 4 and
+ (old or cc < 0x2000 or cc > 0x202F) then -- exclude general puncts
+
+ -- harf-node always puts kern after the glyph
+ local gpos = class == 1 and fontoptions.is_not_harf[curr.font] and getprev(curr) or getnext(curr)
+ gpos = gpos and gpos.id == kernid and gpos.subtype == fontkern
+
+ if not gpos then
+ local wd = fontoptions.en_size[curr.font] - curr.width
+ if wd ~= 0 then
+ local k = nodenew(kernid) -- fontkern (subtype 0) is default
+ k.kern = class == 3 and wd/2 or wd
+ if class == 1 then
+ head = insert_before(head, curr, k)
+ elseif class == 2 or class == 4 then
+ head, curr = insert_after(head, curr, k)
+ else
+ local k2 = nodecopy(k)
+ head = insert_before(head, curr, k)
+ head, curr = insert_after(head, curr, k2)
+ end
+ end
+ end
+ end
+ end
+ elseif id == mathid then
+ curr = end_of_math(curr)
+ end
+ curr = getnext(curr)
+ end
+ return head
+end
+
-- remove classic spaces
local function process_remove_spaces (head)
- local curr, opt_name, to_free = head, "removeclassicspaces", {}
+ local curr, to_free = head, {}
while curr do
local id = curr.id
if id == glueid then
@@ -1037,7 +1095,7 @@ local function process_remove_spaces (head)
elseif id == hlistid and v.list then
vchar, vfont = hbox_char_font(v, k == "n")
end
- if vchar and vfont and option_in_font(vfont, opt_name) then
+ if vchar and vfont and fontoptions.removeclassicspaces[vfont] then
ok = is_cjk_char(vchar)
end
@@ -1243,7 +1301,7 @@ local function process_dotemph (head)
end
local currwd = curr.width
- if currwd >= font_options.en_size[curr.font] then
+ if currwd >= fontoptions.en_size[curr.font] then
local box = nodecopy(dotemphbox[dotattr]).list
-- bypass unwanted nodes injected by some other packages
while box.id ~= hlistid do
@@ -1289,7 +1347,7 @@ function luatexko.get_strike_out_down (box)
local down
local ex = get_font_param(f, "x_height") or texsp"1ex"
if is_cjk_char(c) then
- local ascender, descender = tableunpack(font_options.asc_desc[f])
+ local ascender, descender = tableunpack(fontoptions.asc_desc[f])
if ascender and descender then
down = descender - (ascender + descender)/2
else
@@ -1299,7 +1357,7 @@ function luatexko.get_strike_out_down (box)
down = -0.5*ex
end
- local raise = font_options.charraise[f] or 0
+ local raise = fontoptions.charraise[f] or 0
return down - raise
end
return -texsp"0.5ex"
@@ -1423,9 +1481,9 @@ luatexko.rubybox = rubybox
function luatexko.getrubystretchfactor (box)
local _, fid = hbox_char_font(box, true, true)
- local str = font_options.intercharstretch[fid]
+ local str = fontoptions.intercharstretch[fid]
if str then
- local em = font_options.en_size[fid] * 2
+ local em = fontoptions.en_size[fid] * 2
set_macro("luatexkostretchfactor", stringformat("%.4f", str/em/2))
end
end
@@ -1483,7 +1541,7 @@ local function process_ruby_post_linebreak (head)
local shift = shift_put_top(curr, ruby)
local _, f = hbox_char_font(curr, true, true)
- local ascender = tableunpack(font_options.asc_desc[f]) or curr.height
+ local ascender = tableunpack(fontoptions.asc_desc[f]) or curr.height
ruby.shift = shift - ascender - ruby.depth - ruby_t[2] -- rubysep
head = insert_before(head, curr, ruby)
end
@@ -1539,10 +1597,9 @@ local function process_reorder_tonemarks (head)
while curr do
local id = curr.id
if id == glyphid and
- is_not_harf(curr.font) and
- option_in_font(curr.font, "script") == "hang" then
+ fontoptions.is_not_harf[curr.font] and
+ fontoptions.is_hangulscript[curr.font] then
- local fontdata = get_font_data(curr.font)
local uni = my_node_props(curr).unicode or curr.char
if is_hangul(uni) or is_chosong(uni) or uni == 0x25CC then
init = curr
@@ -1559,7 +1616,7 @@ local function process_reorder_tonemarks (head)
n = getnext(n)
end
- if #syllable > 1 and font_options.tonemarkwidth[curr.font] ~= 0 then
+ if #syllable > 1 and fontoptions.tonemark_xmax[curr.font] >= 0 then
local TM = curr
local actual = pdfliteral_direct_actual(syllable)
@@ -1572,10 +1629,10 @@ local function process_reorder_tonemarks (head)
end
init = nil
- elseif char_in_font(fontdata, 0x25CC) then -- isolated tone mark
+ elseif char_in_font(curr.font, 0x25CC) then -- isolated tone mark
local dotcircle = nodecopy(curr)
dotcircle.char = 0x25CC
- if font_options.tonemarkwidth[curr.font] ~= 0 then
+ if fontoptions.tonemark_xmax[curr.font] >= 0 then
local actual = pdfliteral_direct_actual{ init = curr, uni }
local endactual = pdfliteral_direct_actual()
head = insert_before(head, curr, actual)
@@ -1845,7 +1902,7 @@ function luatexko.gethorizboxmoveright ()
if v and v > 0 then
local amount = get_font_data(v).vertcharraise
if amount then
- amount = amount + (font_options.charraise[v] or 0)
+ amount = amount + (fontoptions.charraise[v] or 0)
set_macro("luatexkohorizboxmoveright", texsp(amount).."sp")
break
end
@@ -1863,8 +1920,7 @@ local function process_charraise (head)
local id = curr.id
if id == glyphid then
if not has_attribute(curr,raiseattr) then
- local f = curr.font
- local raise = font_options.charraise[f]
+ local raise = fontoptions.charraise[curr.font]
if raise then
curr.yoffset = (curr.yoffset or 0) + raise
end
@@ -1896,7 +1952,7 @@ local function process_fake_slant_corr (head) -- for font fallback
break
end
- local slant = option_in_font(p.font, "slant")
+ local slant = fontoptions.slantvalue[p.font]
if slant and slant > 0 then
tableinsert(t, char_in_font(p.font, p.char).italic or 0)
end
@@ -1934,7 +1990,7 @@ local function process_fake_slant_font (fontdata, fsl)
local params = fontdata.parameters or {}
params.slant = (params.slant or 0) + fsl*65536 -- slant per point
- local hb = is_harf(fontdata)
+ local hb = has_harf_data(fontdata)
local scale = hb and hb.scale or params.factor or 655.36
local shared = fontdata.shared or {}
local descrs = shared.rawdata and shared.rawdata.descriptions or {}
@@ -1968,6 +2024,13 @@ end
-- wrap up
+add_to_callback ("hyphenate",
+function(head)
+ local head = process_fonts(head)
+ lang.hyphenate(head)
+end,
+"luatexko.hyphenate.fonts_and_languages")
+
local pass_fun = function(...) return ... end
create_callback("luatexko_prelinebreak_first", "data", pass_fun)
create_callback("luatexko_prelinebreak_second", "data", pass_fun)
@@ -1985,7 +2048,6 @@ add_to_callback("pre_shaping_filter", function(h, gc)
or gc == "vtop"
or gc == "insert"
or gc == "vcenter"
- h = process_fonts(h)
h = call_callback("luatexko_prelinebreak_first", h, par)
h = call_callback("luatexko_prelinebreak_second", h, par)
return process_linebreak(h, par)
@@ -2047,10 +2109,10 @@ otfregister {
description = "raise chars",
default = false,
manipulators = {
- node = function(fontdata)
+ node = function()
activate_process("post_shaping_filter", process_charraise, "charraise")
end,
- plug = function(fontdata)
+ plug = function()
activate_process("post_shaping_filter", process_charraise, "charraise")
end,
},
@@ -2123,25 +2185,23 @@ otfregister {
},
}
-local function process_protrusion (fontdata, _, value)
- local setup = fonts.protrusions.setups[value] or {}
- local quad = fontdata.parameters.quad
- for i, v in pairs(setup) do
- local chr = fontdata.characters[i]
- if chr then
- local wdq = chr.width/quad
- chr.left_protruding = chr.left_protruding or wdq*v[1]*1000
- chr.right_protruding = chr.right_protruding or wdq*v[2]*1000
- end
- end
- if tex.protrudechars == 0 then
- texset("global", "protrudechars", 2)
- end
- if option_in_font(fontdata, "compresspunctuations") then
- local fullname = fontdata.fullname
- fontdata_warning("protrude."..fullname,
- "Both `compresspunctuations' and `protrusion' are\nenabled for `%s'.\n"..
- "Beware bad justifications.", fullname)
+local dir_ltr = harfbuzz and harfbuzz.Direction.new"ltr"
+
+local function get_HB_variant_char (fontdata, charcode)
+ local hbfont = fontdata.hb.shared.font
+ local spec = fontdata.specification
+ local shaper = spec.features.raw.shaper
+ local buff = harfbuzz.Buffer.new()
+ buff:set_direction(dir_ltr)
+ buff:set_script(spec.script)
+ buff:set_language(spec.language)
+ buff:add_codepoints{charcode}
+ harfbuzz.shape_full(hbfont, buff, spec.hb_features, shaper and {shaper} or {})
+ local glyphs = buff:get_glyphs()
+ if glyphs and glyphs[1] then
+ local glyph = glyphs[1].codepoint
+ local offset = fontdata.hb.shared.gid_offset
+ return glyph + offset
end
end
@@ -2150,8 +2210,41 @@ otfregister {
description = "glyph protrusion",
default = false,
manipulators = {
- node = process_protrusion,
- plug = process_protrusion,
+ node = function(fontdata, _, value)
+ local setup = fonts.protrusions.setups[value] or {}
+ local quad = fontdata.parameters.quad
+ for i, v in pairs(fontdata.characters) do
+ local uni = v.unicode
+ if uni then
+ local lr = setup[uni]
+ if lr then
+ local wdq = v.width/quad*1000
+ v.left_protruding = wdq*lr[1]
+ v.right_protruding = wdq*lr[2]
+ end
+ end
+ end
+ if tex.protrudechars == 0 then
+ texset("global", "protrudechars", 2)
+ end
+ end,
+ plug = function(fontdata, _, value)
+ local setup = fonts.protrusions.setups[value] or {}
+ local quad = fontdata.parameters.quad
+ for i, v in pairs(setup) do
+ for _, ii in ipairs{i, get_HB_variant_char(fontdata,i)} do
+ local chr = fontdata.characters[ii]
+ if chr then
+ local wdq = chr.width/quad*1000
+ chr.left_protruding = wdq*v[1]
+ chr.right_protruding = wdq*v[2]
+ end
+ end
+ end
+ if tex.protrudechars == 0 then
+ texset("global", "protrudechars", 2)
+ end
+ end,
},
}
@@ -2181,32 +2274,6 @@ function luatexko.activate (name)
active_processes[name] = true
end
-add_to_callback ("hyphenate",
-function(head)
- local curr = head
- while curr do
- local id = curr.id
- if id == glyphid and curr.subtype == 1 and curr.lang ~= nohyphen then
- local c = curr.char
- if c then
- if is_unicode_var_sel(c) then
- local p = getprev(curr)
- if p.id == glyphid then
- curr.lang = p.lang
- end
- elseif is_cjk_char(c) then
- curr.lang = langkor
- end
- end
- elseif id == mathid then
- curr = end_of_math(curr)
- end
- curr = getnext(curr)
- end
- lang.hyphenate(head)
-end,
-"luatexko.hyphenate.prevent_disc_nodes")
-
-- aux functions
function luatexko.deactivateall (str)
diff --git a/macros/luatex/generic/luatexko/luatexko.sty b/macros/luatex/generic/luatexko/luatexko.sty
index f1e0179164..c44ccedcbe 100644
--- a/macros/luatex/generic/luatexko/luatexko.sty
+++ b/macros/luatex/generic/luatexko/luatexko.sty
@@ -14,7 +14,7 @@
\ifdefined\luatexkohangulfontattr \endinput\fi
\ifdefined\selectfont
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
- \ProvidesPackage{luatexko}[2021/03/01 v3.0 typesetting Korean with LuaTeX]
+ \ProvidesPackage{luatexko}[2021/04/20 v3.1 typesetting Korean with LuaTeX]
\RequirePackage{luatexbase}
\RequirePackage{fontspec}[2020/02/03]
\else
@@ -55,12 +55,57 @@
\DeclareHookRule{shipout/before}{.}{before}{luacolor}
\fi
% classic
-\protected\def\typesetclassic{\luatexkoclassicattr\z@\parindent1em }
-\protected\def\typesetvertical{\luatexkoclassicattr\@ne\parindent1em }
+\protected\def\typesetclassic{% 0
+ \ifnum\luatexkoclassicattr<\z@
+ \luatexkoclassicattr\z@
+ \parindent1em
+ \fi
+ }
+\protected\def\typesetvertical{% 1
+ \ifcase\luatexkoclassicattr
+ \luatexkoclassicattr\@ne
+ \parindent1em
+ \or
+ \or
+ \luatexkoclassicattr\@ne
+ \or
+ \luatexkoclassicattr=4\relax
+ \or
+ \else
+ \luatexkoclassicattr\@ne
+ \parindent1em
+ \fi
+ }
\protected\def\typesetmodern{\unsetattribute\luatexkoclassicattr}
\protected\def\inhibitglue{\hskip\z@skip}
-\protected\def\Schinese{\luatexkoclassicattr\tw@\parindent2em }
-\protected\def\Tchinese{\luatexkoclassicattr\thr@@\parindent2em } % +halt
+\protected\def\Schinese{% 2, 1
+ \ifcase\luatexkoclassicattr
+ \luatexkoclassicattr\tw@
+ \or
+ \or
+ \or
+ \luatexkoclassicattr\tw@
+ \or
+ \luatexkoclassicattr\@ne
+ \else
+ \luatexkoclassicattr\tw@
+ \fi
+ \parindent2em
+ }
+\protected\def\Tchinese{% 3, 4
+ \ifcase\luatexkoclassicattr
+ \luatexkoclassicattr\thr@@
+ \or
+ \luatexkoclassicattr=4\relax
+ \or
+ \luatexkoclassicattr\thr@@
+ \or
+ \or
+ \else
+ \luatexkoclassicattr\thr@@
+ \fi
+ \parindent2em
+ }
\let\korean\typesetmodern \let\japanese\typesetclassic \let\chinese\Schinese
% josa
\count@"AC00
diff --git a/macros/xetex/generic/xetexko/ChangeLog b/macros/xetex/generic/xetexko/ChangeLog
index cdad25a566..3d2c82eba2 100644
--- a/macros/xetex/generic/xetexko/ChangeLog
+++ b/macros/xetex/generic/xetexko/ChangeLog
@@ -1,3 +1,11 @@
+2021-04-20 Dohyun Kim <nomos at ktug org>
+
+ Version 3.3
+
+ * more fix on ulem package support
+ * suppress linebreak before ellipsis etc.
+ * assign U+327E to cjksymbols class
+
2021-04-08 Dohyun Kim <nomos at ktug org>
Version 3.2
diff --git a/macros/xetex/generic/xetexko/README b/macros/xetex/generic/xetexko/README
index c311723be5..4d0dfb8182 100644
--- a/macros/xetex/generic/xetexko/README
+++ b/macros/xetex/generic/xetexko/README
@@ -1,4 +1,4 @@
-XeTeX-ko Package version 3.2 (2021/04/08)
+XeTeX-ko Package version 3.3 (2021/04/20)
=========================================
XeTeX-ko is a macro package for Xe(La)TeX which supports typesetting
diff --git a/macros/xetex/generic/xetexko/xetexko-doc.pdf b/macros/xetex/generic/xetexko/xetexko-doc.pdf
index c03bfa8a4d..baec8abd9f 100644
--- a/macros/xetex/generic/xetexko/xetexko-doc.pdf
+++ b/macros/xetex/generic/xetexko/xetexko-doc.pdf
Binary files differ
diff --git a/macros/xetex/generic/xetexko/xetexko-doc.tex b/macros/xetex/generic/xetexko/xetexko-doc.tex
index 616c9fcc5b..37e1e49f7f 100644
--- a/macros/xetex/generic/xetexko/xetexko-doc.tex
+++ b/macros/xetex/generic/xetexko/xetexko-doc.tex
@@ -70,7 +70,7 @@
\title{\xetexko\ 간단 매뉴얼}
\author{Dohyun Kim \normalsize <\texttt{nomos at ktug org}> \and
\normalsize <\url{http://github.com/dohyunkim/xetexko}>}
-\date{Version 3.2\quad 2021/04/08}
+\date{Version 3.3\quad 2021/04/20}
\maketitle
\begin{quote}\small
@@ -490,10 +490,10 @@ horizontal 환경에는 가로쓰기 박스의 너비를 인자로 주어야 한
간단한 일본어, 중국어 문단 정도를 식자하는 데도 이 환경을 이용할 수 있으나
각 언어의 전용 패키지들에 비해 기능이 많이 모자란다.\footnote{%
- 그러나 \texttt{japanese}, \texttt{chinese} 환경이 여전히 제공된다.
- 특히 중국어 간체를 식자할 때는 \texttt{chinese}를 명시적으로 이용하는 게 좋다.
- \texttt{Schinese} 환경은 \texttt{chinese}의 다른 이름이다.
- \texttt{Tchinese}도 호환성을 위해 남겨두었다. }
+ 그러나 \texttt{japanese}, \texttt{Schinese}, \texttt{Tchinese} 환경이 여전히 제공된다.
+ \texttt{chinese}는 \texttt{Schinese}의 다른 이름이다.
+ 특히 중국어 폰트를 사용할 때는 \texttt{Schinese}나 \texttt{Tchinese}를 명시하는 게 좋다.
+ }
\begin{plaintex}
플레인텍에서는 다음 방식으로 사용한다.
@@ -673,11 +673,11 @@ microtype 패키지의 protrusion 기능이 잘 작동하지 않는 경우가
따위를 사용한다.
\section{밑줄긋기}
-\uwave{ulem 패키지}를 로드하는 것만으로 자동 지원된다.
+\LaTeX 에서는 \uwave{ulem 패키지}를 로드하는 것만으로 자동 지원된다.
+
+\cs{xetexkoulemsupport} 명령이 \vernote{3.3}3.3 버전부터 부활하였으므로
+플레인텍에서는 이 명령을 명시해야 할 경우가 있을 것이다.
-3.0 버전부터는\vernote{3.0} \cs{xetexkoulemsupport} 선언이
-불필요하게 되었다. 이 명령은 호환성을 위해 남겨두었으나 아무 일도
-하지 않는다.
%\hfill \fboxsep=-\fboxrule \fbox{\vbox to1em{\hbox to1em{\hss}\vss}}
@@ -687,6 +687,11 @@ microtype 패키지의 protrusion 기능이 잘 작동하지 않는 경우가
\begin{small}\linespread{1.2}\selectfont
\begin{description}\itemsep=0pt
+ \item[v3.3] 2021-04-20
+ \begin{itemize}
+ \item \cs{xetexkoulemsupport} 명령 부활
+ \item `㉾' 등 한글기호를 \verb=cjksymbols=에 할당
+ \end{itemize}
\item[v3.2] 2021-04-08
\begin{itemize}
\item 매달린 구두점이 기본값으로 따옴표에는 작동하지 않고 마침표^^b7쉼표에만 작동한다.
diff --git a/macros/xetex/generic/xetexko/xetexko.sty b/macros/xetex/generic/xetexko/xetexko.sty
index 63108b667c..67de1e2aa9 100644
--- a/macros/xetex/generic/xetexko/xetexko.sty
+++ b/macros/xetex/generic/xetexko/xetexko.sty
@@ -16,7 +16,7 @@
\ifdefined\ProvidesPackage
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
- \ProvidesPackage{xetexko}[2021/04/08 v3.2 typesetting Korean with XeTeX]
+ \ProvidesPackage{xetexko}[2021/04/20 v3.3 typesetting Korean with XeTeX]
\else
\ifdefined\@tempcnta\else \newcount\@tempcnta \fi
\ifdefined\@gobble\else \def\@gobble#1{} \fi
@@ -33,8 +33,8 @@
\newXeTeXintercharclass\XeTeXcharclassOP
\newXeTeXintercharclass\XeTeXcharclassCL
\newXeTeXintercharclass\XeTeXcharclassEX
-\let\XeTeXcharclassIS\XeTeXcharclassID
-\let\XeTeXcharclassNS\XeTeXcharclassID
+\let\XeTeXcharclassIS\XeTeXcharclassCJ
+\let\XeTeXcharclassNS\XeTeXcharclassCJ
\newXeTeXintercharclass\XeTeXcharclassCM
\input load-unicode-xetex-classes %
@@ -99,6 +99,7 @@
% ascii colons
\XeTeXcharclass "3A=\XeTeXcharclassAM % : COLON
\XeTeXcharclass "3B=\XeTeXcharclassAM % ; SEMICOLON
+\XeTeXcharclass "7E=\XeTeXcharclassAM % ~ TILDE
% ascii hyphen
\XeTeXcharclass "2D =\XeTeXcharclassAH % -
\XeTeXcharclass "2F =\XeTeXcharclassAH % /
@@ -115,6 +116,10 @@
%
\XeTeXcharclass "2019=\XeTeXcharclassCL % ’ RIGHT SINGLE QUOTATION MARK
\XeTeXcharclass "201D=\XeTeXcharclassCL % ” RIGHT DOUBLE QUOTATION MARK
+% IS : these are not expected to be input
+\XeTeXcharclass "FE10=\XeTeXcharclassCL % ︐ PRESENTATION FORM FOR VERTICAL COMMA
+\XeTeXcharclass "FE13=\XeTeXcharclassVC % ︓ PRESENTATION FORM FOR VERTICAL COLON
+\XeTeXcharclass "FE14=\XeTeXcharclassVC % ︔ PRESENTATION FORM FOR VERTICAL SEMICOLON
% NS
\XeTeXcharclass "00B7=\XeTeXcharclassMD % · MIDDLE DOT
\XeTeXcharclass "30FB=\XeTeXcharclassMD % ・ KATAKANA MIDDLE DOT
@@ -133,26 +138,50 @@
\XeTeXcharclass "2015=\XeTeXcharclassLD % ― HORIZONTAL BAR
\XeTeXcharclass "2025=\XeTeXcharclassLD % ‥ TWO DOT LEADER
\XeTeXcharclass "2026=\XeTeXcharclassLD % … HORIZONTAL ELLIPSIS
+\XeTeXcharclass "FF5E=\XeTeXcharclassLD % ~ FULLWIDTH TILDE : KS symbol
+\XeTeXcharclass "3003=\XeTeXcharclassLD % 〃 DITTO MARK : KS symbol
% 결락기호
\XeTeXcharclass "25A1=\XeTeXcharclassID % □
% some KS symbols
+\XeTeXcharclass "00AE=\XeTeXcharclassSY % ®
+\XeTeXcharclass "00B0=\XeTeXcharclassSY % °
+\XeTeXcharclass "2030=\XeTeXcharclassSY % ‰
+\XeTeXcharclass "2032=\XeTeXcharclassSY % ′
+\XeTeXcharclass "2033=\XeTeXcharclassSY % ″
\XeTeXcharclass "203B=\XeTeXcharclassSY % ※
\XeTeXcharclass "2103=\XeTeXcharclassSY % ℃
\XeTeXcharclass "2109=\XeTeXcharclassSY % ℉
\XeTeXcharclass "2113=\XeTeXcharclassSY % ℓ
+\XeTeXcharclass "2116=\XeTeXcharclassSY % №
\XeTeXcharclass "2121=\XeTeXcharclassSY % ℡
\XeTeXcharclass "2122=\XeTeXcharclassSY % ™
-\XeTeXcharclass "212B=\XeTeXcharclassSY % Å
-\count@="2160 \loop % Ⅰ..Ⅻ
+\count@="2160 \loop % Ⅰ..Ⅹ
\XeTeXcharclass\count@=\XeTeXcharclassSY
- \ifnum\count@<"216B \advance\count@\@ne \repeat
-\count@="2170 \loop % ⅰ..ⅻ
+ \ifnum\count@<"2169 \advance\count@\@ne \repeat
+\count@="2170 \loop % ⅰ..ⅹ
\XeTeXcharclass\count@=\XeTeXcharclassSY
- \ifnum\count@<"217B \advance\count@\@ne \repeat
-\XeTeXcharclass "223C=\XeTeXcharclassSY % ∼
-\count@="2460 \loop % ①..⓪
+ \ifnum\count@<"2179 \advance\count@\@ne \repeat
+\count@="2190 \loop % ←..↙
\XeTeXcharclass\count@=\XeTeXcharclassSY
- \ifnum\count@<"24EA \advance\count@\@ne \repeat
+ \ifnum\count@<"2199 \advance\count@\@ne \repeat
+\XeTeXcharclass "21D2=\XeTeXcharclassSY % ⇒
+\XeTeXcharclass "21D4=\XeTeXcharclassSY % ⇔
+\XeTeXcharclass "2225=\XeTeXcharclassSY % ∥
+\XeTeXcharclass "226A=\XeTeXcharclassSY % ≪ 꽉찬 전각! 어디에 배정해야 하나?
+\XeTeXcharclass "226B=\XeTeXcharclassSY % ≫ 꽉찬 전각! 어디에 배정해야 하나?
+\XeTeXcharclass "2299=\XeTeXcharclassSY % ⊙
+\count@="2460 \loop % ①..⑮
+ \XeTeXcharclass\count@=\XeTeXcharclassSY
+ \ifnum\count@<"246E \advance\count@\@ne \repeat
+\count@="2474 \loop % ⑴..⒂
+ \XeTeXcharclass\count@=\XeTeXcharclassSY
+ \ifnum\count@<"2482 \advance\count@\@ne \repeat
+\count@="249C \loop % ⒜..⒵
+ \XeTeXcharclass\count@=\XeTeXcharclassSY
+ \ifnum\count@<"24B5 \advance\count@\@ne \repeat
+\count@="24D0 \loop % ⓐ..ⓩ
+ \XeTeXcharclass\count@=\XeTeXcharclassSY
+ \ifnum\count@<"24E9 \advance\count@\@ne \repeat
\XeTeXcharclass "2500 = \XeTeXcharclassSY % ─
\XeTeXcharclass "2501 = \XeTeXcharclassSY % ━
\XeTeXcharclass "2502 = \XeTeXcharclassSY % │
@@ -204,22 +233,30 @@
\XeTeXcharclass "266A = \XeTeXcharclassSY % ♪
\XeTeXcharclass "266C = \XeTeXcharclassSY % ♬
\XeTeXcharclass "266D = \XeTeXcharclassSY % ♭
-\XeTeXcharclass "3012 = \XeTeXcharclassSY % 〒
-\XeTeXcharclass "301C = \XeTeXcharclassSY % 〜
+\XeTeXcharclass "3013 = \XeTeXcharclassSY % 〓
+\count@="3200 \loop % ㈀..㈞
+ \XeTeXcharclass\count@=\XeTeXcharclassSY
+ \ifnum\count@<"321E \advance\count@\@ne \repeat
+\count@="3260 \loop % ㉠..㉿
+ \XeTeXcharclass\count@=\XeTeXcharclassSY
+ \ifnum\count@<"327F \advance\count@\@ne \repeat
+\XeTeXcharclass "33C2 = \XeTeXcharclassSY % ㏂
+\XeTeXcharclass "33C7 = \XeTeXcharclassSY % ㏇
+\XeTeXcharclass "33D8 = \XeTeXcharclassSY % ㏘
\XeTeXcharclass "FF04 = \XeTeXcharclassSY % $
\XeTeXcharclass "FF05 = \XeTeXcharclassSY % %
-\XeTeXcharclass "FF5E = \XeTeXcharclassSY % ~
+\XeTeXcharclass "FF3C = \XeTeXcharclassSY % \
\XeTeXcharclass "FFE0 = \XeTeXcharclassSY % ¢
\XeTeXcharclass "FFE1 = \XeTeXcharclassSY % £
\XeTeXcharclass "FFE5 = \XeTeXcharclassSY % ¥
\XeTeXcharclass "FFE6 = \XeTeXcharclassSY % ₩
% spaces
-\def\XeKo@halfzero {\hskip 2\XeKo@halfdim \relax}
-\def\XeKo@halfhalf {\hskip 2\XeKo@halfdim minus 2\XeKo@halfdim \relax}
-\def\XeKo@halfquarter {\hskip 2\XeKo@halfdim minus \XeKo@halfdim \relax}
-\def\XeKo@quarterquarter {\hskip \XeKo@halfdim minus \XeKo@halfdim \relax}
-\def\XeKo@iiiquarterquarter{\hskip 3\XeKo@halfdim minus \XeKo@halfdim \relax}
+\def\XeKo@halfzero {\hskip 2\XeKo@quarterdim \relax}
+\def\XeKo@halfhalf {\hskip 2\XeKo@quarterdim minus 2\XeKo@quarterdim \relax}
+\def\XeKo@halfquarter {\hskip 2\XeKo@quarterdim minus \XeKo@quarterdim \relax}
+\def\XeKo@quarterquarter {\hskip \XeKo@quarterdim minus \XeKo@quarterdim \relax}
+\def\XeKo@iiiquarterquarter{\hskip 3\XeKo@quarterdim minus \XeKo@quarterdim \relax}
\let\XeKo@nobreak\nobreak
\def\XKinterhangulbreak{% compat
@@ -242,20 +279,21 @@
\ifdefined\xetexkohu
\xetexkohu plus .5\dimexpr\xetexkohu\relax minus.25\dimexpr\xetexkohu\relax
\else
- \XeKo@halfdim plus .5\XeKo@halfdim minus.25\XeKo@halfdim
+ \XeKo@quarterdim plus .5\XeKo@quarterdim minus.25\XeKo@quarterdim
\fi
+ \relax
}
\def\XeKo@latincjk@modern{%
- \hskip \ifdefined\xetexkohu \xetexkohu \else \XeKo@halfdim \fi
+ \hskip \ifdefined\xetexkohu \xetexkohu \else \XeKo@quarterdim \fi
\XeKo@stretchshrink
}
\def\XeKo@postmath@modern{%
- \hskip 2\ifdefined\xetexkohu \dimexpr\xetexkohu\relax \else \XeKo@halfdim \fi
+ \hskip 2\ifdefined\xetexkohu \dimexpr\xetexkohu\relax \else \XeKo@quarterdim \fi
\XeKo@stretchshrink
}
% 고아글자 억제. verbatim 에서는 이 명령을 꺼야 한다
-\def\XeKo@suppress@char@orphan{%
+\def\XeKo@suppress@linebreak{%
\XeKo@skip@=\lastskip \unskip
\XeKo@count@=\lastpenalty \unpenalty
\ifnum\XeKo@count@<5000 \XeKo@count@=5000 \fi
@@ -268,8 +306,8 @@
% typesetting modes
\protected\def\typesetclassic{%
\chardef\XeKo@typesetclassic\@ne
- \def\XeKo@halfdim{\dimexpr.25em\relax}%
- \def\XeKo@stretchshrink{plus.08em minus.04em}%
+ \def\XeKo@quarterdim{\dimexpr.25em\relax}%
+ \def\XeKo@stretchshrink{plus.08em minus.04em\relax}%
\let\XeKo@latincjk\XeKo@latincjk@classic
\let\XeKo@postmath\XeKo@latincjk@classic
\XeTeXlinebreakpenalty=\z@
@@ -278,8 +316,8 @@
}
\protected\def\typesetmodern{%
\chardef\XeKo@typesetclassic\z@
- \def\XeKo@halfdim{\dimexpr.05em\relax}%
- \def\XeKo@stretchshrink{plus.04em minus.02em}%
+ \def\XeKo@quarterdim{\dimexpr.05em\relax}%
+ \def\XeKo@stretchshrink{plus.04em minus.02em\relax}%
\let\XeKo@latincjk\XeKo@latincjk@modern
\let\XeKo@postmath\XeKo@postmath@modern
\XeTeXlinebreakpenalty=50
@@ -288,14 +326,21 @@
\typesetmodern
\let\japanese\typesetclassic
-\protected\def\Tchinese{\typesetclassic\parindent=2em }
-\protected\def\Schinese{\typesetclassic\parindent=2em
- \chardef\XeKo@typesetSchinese\@ne
+\protected\def\Tchinese{%
+ \typesetclassic
+ \chardef\XeKo@typesetSTchinese\tw@
+ \XeKo@Tchinese@classes
+ \parindent=2em
+ }
+\protected\def\Schinese{%
+ \typesetclassic
+ \chardef\XeKo@typesetSTchinese\@ne
\ifnum\XeKo@typesetvertical=\@ne
\XeKo@Schinese@vertical
\else
\XeKo@Schinese@horizontal
\fi
+ \parindent=2em
}
\let\chinese\Schinese
\def\XeKo@Schinese@horizontal{% these glyphs in simplified chinese fonts are left-aligned.
@@ -310,22 +355,34 @@
\XeTeXcharclass "FF1B = \XeTeXcharclassVC % ;
\XeTeXcharclass "FF1F = \XeTeXcharclassEX % ?
}
+\def\XeKo@Tchinese@classes{% these glyphs in traditional chinese fonts are center-aligned
+ \XeTeXcharclass "3001 = \XeTeXcharclassMD % 、
+ \XeTeXcharclass "3002 = \XeTeXcharclassMD % 。
+ \XeTeXcharclass "FF0C = \XeTeXcharclassMD % ,
+ \XeTeXcharclass "FF0E = \XeTeXcharclassMD % .
+ }
\chardef\XeKo@typesetvertical\z@
-\chardef\XeKo@typesetSchinese\z@
+\chardef\XeKo@typesetSTchinese\z@
\protected\def\typesetvertical{%
\chardef\XeKo@typesetvertical\@ne
\XeTeXcharclass "FF1A = \XeTeXcharclassVC % :
\XeTeXcharclass "FF1B = \XeTeXcharclassVC % ;
- \ifnum\XeKo@typesetSchinese=\@ne \XeKo@Schinese@vertical \fi
- \parindent=1em
+ \ifcase\XeKo@typesetSTchinese
+ \parindent=1em
+ \or \XeKo@Schinese@vertical
+ \or \XeKo@Tchinese@classes
+ \fi
}
\protected\def\typesethorizontal{%
\chardef\XeKo@typesetvertical\z@
\XeTeXcharclass "FF1A = \XeTeXcharclassMD % :
\XeTeXcharclass "FF1B = \XeTeXcharclassMD % ;
- \ifnum\XeKo@typesetSchinese=\@ne \XeKo@Schinese@horizontal \fi
+ \ifcase\XeKo@typesetSTchinese
+ \or \XeKo@Schinese@horizontal
+ \or \XeKo@Tchinese@classes
+ \fi
\parindent\z@
}
\protected\def\vertical#1{%
@@ -552,11 +609,12 @@
\ifnum\XeKo@charslot="FFFF
% 다음 한 줄이 없으면 한글과 한글 사이에 폰트가 변경되는 경우 글자 누락.
% 폰트 변경은 kern 에 아무 영향을 주지 않기 때문.
- \def\XeKo@maybe@gobble{\def\XeKo@maybe@gobble{%
- \ifdefined\XeKo@curr@font\expandafter\XeKo@maybe@gobble@\fi }}%
+ \let\XeKo@maybe@gobble\relax
\expandafter\XeKo@flush@toks
\else
- \ifnum\XeKo@currclass>\tw@
+ \let\XeKo@maybe@gobble\XeKo@do@maybe@gobble
+ \ifnum 0\ifnum\XeKo@currclass>4 \ifnum\XeKo@currclass<11 % AA..AH
+ 1\fi\fi >\z@
\expandafter\expandafter\expandafter\XeKo@check@next@tok@latin
\else % HG ID
\expandafter\expandafter\expandafter\XeKo@check@next@tok@cjk
@@ -574,7 +632,10 @@
\def\XeKo@check@next@tok@latin{%
% load-unicode-xetex-classes가 설정하는 모든 CM은 한글, 한자, 가나 뒤에 온다.
% 따라서 영문자는 CM을 고려할 필요가 없다.
- \ifnum\XeTeXcharclass\XeKo@charslot=\csname XeKo@\XeKo@currclass @class\endcsname
+ % 아니다!!! 위에서 FE00-FE0F를 CM으로 지정했으므로 CJK에 한정되지 않는다.
+ \ifnum 0%
+ \ifnum\XeTeXcharclass\XeKo@charslot=\csname XeKo@\XeKo@currclass @class\endcsname 1\else
+ \ifnum\XeTeXcharclass\XeKo@charslot=\XeTeXcharclassCM 1\fi\fi >\z@
\expandafter\XeKo@addto@toks
\else
\expandafter\XeKo@flush@toks
@@ -600,7 +661,7 @@
}
\def\XeKo@char@orphan{%
\ifx\XeKo@let@token\par
- \XeKo@suppress@char@orphan
+ \XeKo@suppress@linebreak
\let\XeKo@next\XeKo@flush@char@orphan
\else \ifx\@sptoken\XeKo@let@token
\XeKo@toks@ii\expandafter{\the\XeKo@toks@ii \@sptoken}%
@@ -627,7 +688,7 @@
}
\def\XeKo@char@orphan@{\afterassignment\XeKo@char@orphan@@\let\XeKo@let@token= }
\def\XeKo@char@orphan@@{\futurelet\XeKo@let@token\XeKo@char@orphan}
-\def\XeKo@flush@char@orphan{\XeKo@do@flush@toks \the\XeKo@toks@ii }
+\def\XeKo@flush@char@orphan{\expandafter \XeKo@do@flush@toks \the\XeKo@toks@ii }
\def\XeKo@char@raise@start{%
\ifdefined\xetexkocharraise
\ifx\XeKo@curr@font\XeKo@latin@font\else
@@ -655,7 +716,21 @@
\ifnum\XeKo@currclass=\tw@
\XeKo@everyhanja{\the\XeKo@toks@}% everyhanja
\else
- \the\XeKo@toks@
+ \ifnum\XeKo@compresspuncts=\@ne
+ \ifnum\XeKo@currclass=11 % OP
+ \hbox to.5em\bgroup\hss \the\XeKo@toks@ \egroup
+ \else\ifnum\XeKo@currclass=12 % CL
+ \hbox to.5em\bgroup \the\XeKo@toks@ \hss\egroup
+ \else\ifnum\XeKo@currclass=13 % MD
+ \hbox to.5em\bgroup\hss \the\XeKo@toks@ \hss\egroup
+ \else\ifnum\XeKo@currclass=14 % FS
+ \hbox to.5em\bgroup \the\XeKo@toks@ \hss\egroup
+ \else
+ \the\XeKo@toks@
+ \fi\fi\fi\fi
+ \else
+ \the\XeKo@toks@
+ \fi
\fi
\fi
\XeKo@char@raise@stop % charraise
@@ -663,13 +738,8 @@
\XeKo@post@hang % hanging punctuations
\fi
\endgroup
- \ifnum\XeKo@currclass<\thr@@ % \the\XeKo@toks@ii
- \expandafter\expandafter\expandafter\XeKo@maybe@kern@i
- \else
- \expandafter\XeKo@maybe@kern@i
- \fi
+ \futurelet\XeKo@let@token\XeKo@maybe@kern@ii
}
-\def\XeKo@maybe@kern@i{\futurelet\XeKo@let@token\XeKo@maybe@kern@ii }
\def\XeKo@maybe@kern@ii{%
\ifx\XeKo@let@token\@sptoken
\ifnum\XeKo@cjk@ignorespaces=\@ne % try to remove space
@@ -855,72 +925,57 @@
\def\XeKo@startOP#1{%
\let\XeKo@pre@hang\XeKo@undefined \let\XeKo@post@hang\XeKo@undefined
\def\XeKo@currclass{11}%
- \ifnum\XeKo@compresspuncts=\@ne
- \XeKo@toks@{\hbox to.5em\bgroup\hss #1\egroup}%
- \else
- \XeKo@toks@{#1}%
- \fi
+ \XeKo@toks@{#1}%
\XeKo@def@pre@hang{#1}%
- \XeKo@do@flush@toks
+ \XeKo@check@next@tok
}
\def\XeKo@startCL#1{%
\let\XeKo@pre@hang\XeKo@undefined \let\XeKo@post@hang\XeKo@undefined
\def\XeKo@currclass{12}%
- \ifnum\XeKo@compresspuncts=\@ne
- \XeKo@toks@{\hbox to.5em\bgroup #1\hss\egroup}%
- \else
- \XeKo@toks@{#1}%
- \fi
+ \XeKo@toks@{#1}%
\XeKo@def@post@hang{#1}%
- \XeKo@do@flush@toks
+ \XeKo@check@next@tok
}
\def\XeKo@startMD#1{%
\let\XeKo@pre@hang\XeKo@undefined \let\XeKo@post@hang\XeKo@undefined
\def\XeKo@currclass{13}%
- \ifnum\XeKo@compresspuncts=\@ne
- \XeKo@toks@{\hbox to.5em\bgroup\hss #1\hss\egroup}%
- \else
- \XeKo@toks@{#1}%
- \fi
+ \XeKo@toks@{#1}%
\XeKo@def@post@hang{#1}%
- \XeKo@do@flush@toks
+ \XeKo@check@next@tok
}
\def\XeKo@startFS#1{%
\let\XeKo@pre@hang\XeKo@undefined \let\XeKo@post@hang\XeKo@undefined
\def\XeKo@currclass{14}%
- \ifnum\XeKo@compresspuncts=\@ne
- \XeKo@toks@{\hbox to.5em\bgroup #1\hss\egroup}%
- \else
- \XeKo@toks@{#1}%
- \fi
+ \XeKo@toks@{#1}%
\XeKo@def@post@hang{#1}%
- \XeKo@do@flush@toks
+ \XeKo@check@next@tok
}
\def\XeKo@startEX#1{%
\let\XeKo@pre@hang\XeKo@undefined \let\XeKo@post@hang\XeKo@undefined
\def\XeKo@currclass{15}%
\XeKo@toks@{#1}%
\XeKo@def@post@hang{#1}%
- \XeKo@do@flush@toks
+ \XeKo@check@next@tok
}
\def\XeKo@startLD#1{%
\let\XeKo@pre@hang\XeKo@undefined \let\XeKo@post@hang\XeKo@undefined
\def\XeKo@currclass{16}%
\XeKo@toks@{#1}%
\XeKo@def@post@hang{#1}%
- \XeKo@do@flush@toks
+ \XeKo@check@next@tok
}
\def\XeKo@startVC#1{%
\let\XeKo@pre@hang\XeKo@undefined \let\XeKo@post@hang\XeKo@undefined
\def\XeKo@currclass{17}%
\XeKo@toks@{#1}%
\XeKo@def@post@hang{#1}%
- \XeKo@do@flush@toks
+ \XeKo@check@next@tok
}
\def\XeKo@maybe@gobble{%
\ifdefined\XeKo@curr@font\expandafter\XeKo@maybe@gobble@\fi
}
+\let\XeKo@do@maybe@gobble\XeKo@maybe@gobble
\def\XeKo@maybe@gobble@{%
\expandafter\expandafter\expandafter\@gobble
}
@@ -933,7 +988,7 @@
\or
\or \unkern\unkern % SY HG
\or \unkern\unkern \XeKo@latincjk % AA HG
- \or \unkern\unkern \XeKo@nobreak % AO HG
+ \or \unkern\unkern % AO HG
\or \unkern\unkern \XeKo@latincjk % AC HG
\or \unkern\unkern \XeKo@latincjk % AP HG
\or \unkern\unkern \XeKo@latincjk % AM HG
@@ -959,7 +1014,7 @@
\or
\or \unkern\unkern % SY ID
\or \unkern\unkern \XeKo@latincjk % AA ID
- \or \unkern\unkern \XeKo@nobreak % AO ID
+ \or \unkern\unkern % AO ID
\or \unkern\unkern \XeKo@latincjk % AC ID
\or \unkern\unkern \XeKo@latincjk % AP ID
\or \unkern\unkern \XeKo@latincjk % AM ID
@@ -980,23 +1035,23 @@
\XeTeXinterchartoks\XeTeXcharclassBoundary\XeTeXcharclassCJ{%
\ifnum\lastnodetype=12 %
\ifcase\lastkern
- \or \unkern\unkern \XKinterhanjabreak % HG CJ
- \or \unkern\unkern \XKinterhanjabreak\XeKo@suppress@char@orphan \XeKo@maybe@gobble % ID CJ
+ \or \unkern\unkern \XKinterhanjabreak \XeKo@suppress@linebreak % HG CJ
+ \or \unkern\unkern \XKinterhanjabreak \XeKo@suppress@linebreak \XeKo@maybe@gobble % ID CJ
\or
- \or \unkern\unkern % SY CJ
- \or \unkern\unkern \XeKo@latincjk % AA CJ
- \or \unkern\unkern \XeKo@nobreak % AO CJ
- \or \unkern\unkern \XeKo@latincjk % AC CJ
- \or \unkern\unkern \XeKo@latincjk % AP CJ
- \or \unkern\unkern \XeKo@latincjk % AM CJ
- \or \unkern\unkern \XKinterhanjabreak % AH CJ
- \or \unkern\unkern % OP CJ
- \or \unkern\unkern \XeKo@halfhalf % CL CJ
- \or \unkern\unkern \XeKo@quarterquarter % MD CJ
- \or \unkern\unkern \XeKo@halfzero % FS CJ
- \or \unkern\unkern \XeKo@halfhalf % EX CJ
- \or \unkern\unkern \XKinterhanjabreak % LD CJ
- \or \unkern\unkern \XeKo@quarterquarter % VC CJ
+ \or \unkern\unkern % SY CJ
+ \or \unkern\unkern \XeKo@latincjk % AA CJ
+ \or \unkern\unkern % AO CJ
+ \or \unkern\unkern \XeKo@latincjk % AC CJ
+ \or \unkern\unkern \XeKo@latincjk % AP CJ
+ \or \unkern\unkern \XeKo@latincjk % AM CJ
+ \or \unkern\unkern \XKinterhanjabreak % AH CJ
+ \or \unkern\unkern % OP CJ
+ \or \unkern\unkern \XeKo@halfhalf \XeKo@suppress@linebreak % CL CJ
+ \or \unkern\unkern \XeKo@quarterquarter \XeKo@suppress@linebreak % MD CJ
+ \or \unkern\unkern \XeKo@halfzero \XeKo@suppress@linebreak % FS CJ
+ \or \unkern\unkern \XeKo@halfhalf \XeKo@suppress@linebreak % EX CJ
+ \or \unkern\unkern \XKinterhanjabreak \XeKo@suppress@linebreak % LD CJ
+ \or \unkern\unkern \XeKo@quarterquarter \XeKo@suppress@linebreak % VC CJ
\fi
\else\ifnum\lastnodetype=10 % mathoff
\XeKo@postmath
@@ -1011,7 +1066,7 @@
\or
\or \unkern\unkern \XeKo@maybe@gobble % SY SY
\or \unkern\unkern % AA SY
- \or \unkern\unkern \XeKo@nobreak % AO SY
+ \or \unkern\unkern % AO SY
\or \unkern\unkern \XeKo@latincjk % AC SY
\or \unkern\unkern \XeKo@latincjk % AP SY
\or \unkern\unkern \XeKo@latincjk % AM SY
@@ -1300,23 +1355,23 @@
\XeTeXinterchartoks\XeTeXcharclassBoundary\XeTeXcharclassLD{%
\ifnum\lastnodetype=12 %
\ifcase\lastkern
- \or \unkern\unkern % HG LD
- \or \unkern\unkern % ID LD
+ \or \unkern\unkern \XKinterhanjabreak \XeKo@suppress@linebreak % HG LD
+ \or \unkern\unkern \XKinterhanjabreak \XeKo@suppress@linebreak % ID LD
\or
- \or \unkern\unkern % SY LD
- \or \unkern\unkern % AA LD
- \or \unkern\unkern % AO LD
- \or \unkern\unkern % AC LD
- \or \unkern\unkern % AP LD
- \or \unkern\unkern % AM LD
- \or \unkern\unkern % AH LD
- \or \unkern\unkern % OP LD
- \or \unkern\unkern \XeKo@nobreak\XeKo@halfhalf % CL LD
- \or \unkern\unkern \XeKo@nobreak\XeKo@quarterquarter % MD LD
- \or \unkern\unkern \XeKo@nobreak\XeKo@halfzero % FS LD
- \or \unkern\unkern % EX LD
+ \or \unkern\unkern % SY LD
+ \or \unkern\unkern % AA LD
+ \or \unkern\unkern % AO LD
+ \or \unkern\unkern % AC LD
+ \or \unkern\unkern % AP LD
+ \or \unkern\unkern % AM LD
+ \or \unkern\unkern % AH LD
+ \or \unkern\unkern % OP LD
+ \or \unkern\unkern \XeKo@halfhalf \XeKo@suppress@linebreak % CL LD
+ \or \unkern\unkern \XeKo@quarterquarter \XeKo@suppress@linebreak % MD LD
+ \or \unkern\unkern \XeKo@halfzero \XeKo@suppress@linebreak % FS LD
+ \or \unkern\unkern \XKinterhanjabreak \XeKo@suppress@linebreak % EX LD
\or \unkern\unkern \XeKo@maybe@gobble % LD LD
- \or \unkern\unkern % VC LD
+ \or \unkern\unkern \XKinterhanjabreak \XeKo@suppress@linebreak % VC LD
\fi
\fi
\XeKo@fontLD\XeKo@startLD
@@ -1375,25 +1430,62 @@
\XeTeXinterchartoks\XeTeXcharclassBoundary\XeTeXcharclassCM{%
\ifnum\lastnodetype=12 %
\ifcase\lastkern
- \or % HG
- \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM
- \or % ID
- \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % HG
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % ID
+ \or
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % SY
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % AA
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % AO
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % AC
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % AP
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % AM
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % AH
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % OP
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % CL
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % MD
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % FS
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % EX
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % LD
+ \or \unkern\unkern \expandafter\expandafter\expandafter\XeKo@startCM % VC
\fi
\fi
}
\def\XeKo@startCM#1{%
\begingroup
\XeTeXinterchartokenstate\z@
- \ifnum\lastnodetype=\@ne % hbox (charraise box)
- \setbox\XeKo@box@=\lastbox
- \XeKo@char@raise@start \unhbox\XeKo@box@ #1\XeKo@char@raise@stop
+ \ifnum\lastnodetype=\@ne % hbox
+ \ifdefined\xetexkocharraise
+ \setbox\XeKo@box@=\lastbox % charraise box
+ \XeKo@char@raise@start
+ \unhbox\XeKo@box@
+ \ifnum\lastnodetype=\@ne % hbox again
+ \XeKo@rebox@punctbox{#1}% compressed punctuation box
+ \else
+ #1\relax
+ \fi
+ \XeKo@char@raise@stop
+ \else
+ \XeKo@rebox@punctbox{#1}% compressed punctuation box
+ \fi
\else
#1\relax
\fi
\endgroup
\XeKo@insert@kerns
}
+\def\XeKo@rebox@punctbox#1{%
+ \ifnum 0\ifnum\XeKo@currclass>10 \ifnum\XeKo@currclass<15
+ 1\fi\fi >\z@
+ \setbox\XeKo@box@=\lastbox
+ \hbox to.5em\bgroup
+ \unhbox\XeKo@box@
+ \XeKo@skip@\lastskip \unskip
+ #1\hskip\XeKo@skip@
+ \egroup
+ \else
+ #1\relax
+ \fi
+ }
%%% josa selection
\begingroup
@@ -1633,7 +1725,7 @@
\let\XeKo@latincjk@classic \inhibitglue
\let\XeKo@latincjk@modern \inhibitglue
\let\XeKo@postmath@modern \inhibitglue
- \let\XeKo@suppress@char@orphan \relax
+ \let\XeKo@suppress@linebreak \relax
\chardef\XeKo@cjk@ignorespaces \z@
\chardef\XeKo@compresspuncts \z@
}
@@ -1651,8 +1743,64 @@
% no longer support these two \disable...
\let\disableautojosa\relax
\let\disablejamoautojosa\relax
-% no need xetexkoulemsupport any more
-\let\xetexkoulemsupport\relax
+% ulem support
+\ifcsname ver@xetexko.sty\endcsname
+ \def\xetexkoulemsupport{%
+ \ifdefined\UL@hook
+ \UL@hook\expandafter{%
+ \the\UL@hook
+ \let\XeKo@char@orphan\XeKo@flush@char@orphan
+ % uline 안에서 폰트가 변경되는 경우를 대비
+ \expandafter\def\expandafter\XeKo@hangul@selectfont\expandafter{%
+ \XeKo@hangul@selectfont
+ \ifdefined\XeKo@in@selectfont\else
+ \global\let\XeKo@temp@hangul@font\XeKo@hangul@font
+ \gdef\XeKo@UL@hangul@font{\let\XeKo@hangul@font\XeKo@temp@hangul@font}%
+ \aftergroup\aftergroup\aftergroup\XeKo@UL@hangul@font
+ \fi }%
+ \expandafter\def\expandafter\XeKo@hanja@selectfont\expandafter{%
+ \XeKo@hanja@selectfont
+ \ifdefined\XeKo@in@selectfont\else
+ \global\let\XeKo@temp@hanja@font\XeKo@hanja@font
+ \gdef\XeKo@UL@hanja@font{\let\XeKo@hanja@font\XeKo@temp@hanja@font}%
+ \aftergroup\aftergroup\aftergroup\XeKo@UL@hanja@font
+ \fi }%
+ \expandafter\def\expandafter\XeKo@latin@selectfont\expandafter{%
+ \XeKo@latin@selectfont
+ \ifdefined\XeKo@in@selectfont\else
+ \global\let\XeKo@temp@latin@font\XeKo@latin@font
+ \gdef\XeKo@UL@latin@font{\let\XeKo@latin@font\XeKo@temp@latin@font}%
+ \aftergroup\aftergroup\aftergroup\XeKo@UL@latin@font
+ \fi }%
+ }%
+ \fi
+ }
+\else
+ \let\XeKo@UL@hangul@patch\relax
+ \let\XeKo@UL@hanja@patch \relax
+ \def\xetexkoulemsupport{%
+ \ifdefined\UL@hook
+ \UL@hook\expandafter{%
+ \the\UL@hook
+ \let\XeKo@char@orphan\XeKo@flush@char@orphan
+ \def\XeKo@UL@hangul@patch{%
+ \global\let\XeKo@temp@hangul@font\XeKo@hangul@font
+ \global\let\XeKo@temp@latin@font\XeKo@latin@font
+ \gdef\XeKo@UL@hangul@font{%
+ \let\XeKo@hangul@font\XeKo@temp@hangul@font
+ \let\XeKo@latin@font\XeKo@temp@latin@font }%
+ \aftergroup\aftergroup\aftergroup\XeKo@UL@hangul@font }%
+ \def\XeKo@UL@hanja@patch{%
+ \global\let\XeKo@temp@hanja@font\XeKo@hanja@font
+ \global\let\XeKo@temp@latin@font\XeKo@latin@font
+ \gdef\XeKo@UL@hanja@font{%
+ \let\XeKo@hanja@font\XeKo@temp@hanja@font
+ \let\XeKo@latin@font\XeKo@temp@latin@font }%
+ \aftergroup\aftergroup\aftergroup\XeKo@UL@hanja@font }%
+ }%
+ \fi
+ }
+\fi
% math hangul
\def\setmathhangulblock#1#2{%
@@ -1669,13 +1817,21 @@
\afterassignment\XeKo@hangulfont@setup\font\XeKo@hangul@font
}
\def\XeKo@hangulfont@setup{%
- \expandafter\let\expandafter\XeKo@latin@font\the\font
+ \ifdefined\XeKo@curr@font
+ \ifx\XeKo@curr@font\XeKo@hangul@font\else
+ \ifx\XeKo@curr@font\XeKo@hanja@font\else
+ \expandafter\let\expandafter\XeKo@latin@font\the\font
+ \fi\fi
+ \else
+ \expandafter\let\expandafter\XeKo@latin@font\the\font
+ \fi
\edef\XeKo@hangul@font{%
\the\XeKo@hangul@font
\ifdefined\xetexkohu \def\noexpand\xetexkohu{\xetexkohu}\fi
\ifdefined\xetexkointerhchar \def\noexpand\xetexkointerhchar{\xetexkointerhchar}\fi
\ifdefined\xetexkocharraise \def\noexpand\xetexkocharraise{\xetexkocharraise}\fi
}%
+ \XeKo@UL@hangul@patch
}
\protected\def\sethangulfont#1{%
\def\@tempa{#1}%
@@ -1685,26 +1841,43 @@
}
\def\XeKo@sethangulfont@setup{%
\expandafter\edef\@tempa{%
- \let\noexpand\XeKo@latin@font=\the\font
+ \let\noexpand\XeKo@latin@font=%
+ \ifdefined\XeKo@curr@font
+ \ifx\XeKo@curr@font\XeKo@hangul@font \the\XeKo@latin@font \else
+ \ifx\XeKo@curr@font\XeKo@hanja@font \the\XeKo@latin@font \else
+ \the\font
+ \fi\fi
+ \else
+ \the\font
+ \fi
\def\noexpand\XeKo@hangul@font{%
\csname XeKo@hangul@font@\@tempb\endcsname
\ifdefined\xetexkohu \def\noexpand\xetexkohu{\xetexkohu}\fi
\ifdefined\xetexkointerhchar \def\noexpand\xetexkointerhchar{\xetexkointerhchar}\fi
\ifdefined\xetexkocharraise \def\noexpand\xetexkocharraise{\xetexkocharraise}\fi
}%
+ \noexpand\XeKo@UL@hangul@patch
}%
}
\protected\def\hanjafont{%
\afterassignment\XeKo@hanjafont@setup\font\XeKo@hanja@font
}
\def\XeKo@hanjafont@setup{%
- \expandafter\let\expandafter\XeKo@latin@font\the\font
+ \ifdefined\XeKo@curr@font
+ \ifx\XeKo@curr@font\XeKo@hangul@font\else
+ \ifx\XeKo@curr@font\XeKo@hanja@font\else
+ \expandafter\let\expandafter\XeKo@latin@font\the\font
+ \fi\fi
+ \else
+ \expandafter\let\expandafter\XeKo@latin@font\the\font
+ \fi
\edef\XeKo@hanja@font{%
\the\XeKo@hanja@font
\ifdefined\xetexkohu \def\noexpand\xetexkohu{\xetexkohu}\fi
\ifdefined\xetexkointerhchar \def\noexpand\xetexkointerhchar{\xetexkointerhchar}\fi
\ifdefined\xetexkocharraise \def\noexpand\xetexkocharraise{\xetexkocharraise}\fi
}%
+ \XeKo@UL@hanja@patch
}
\protected\def\sethanjafont#1{%
\def\@tempa{#1}%
@@ -1714,13 +1887,22 @@
}
\def\XeKo@sethanjafont@setup{%
\expandafter\edef\@tempa{%
- \let\noexpand\XeKo@latin@font=\the\font
+ \let\noexpand\XeKo@latin@font=%
+ \ifdefined\XeKo@curr@font
+ \ifx\XeKo@curr@font\XeKo@hangul@font \the\XeKo@latin@font \else
+ \ifx\XeKo@curr@font\XeKo@hanja@font \the\XeKo@latin@font \else
+ \the\font
+ \fi\fi
+ \else
+ \the\font
+ \fi
\def\noexpand\XeKo@hanja@font{%
\csname XeKo@hanja@font@\@tempb\endcsname
\ifdefined\xetexkohu \def\noexpand\xetexkohu{\xetexkohu}\fi
\ifdefined\xetexkointerhchar \def\noexpand\xetexkointerhchar{\xetexkointerhchar}\fi
\ifdefined\xetexkocharraise \def\noexpand\xetexkocharraise{\xetexkocharraise}\fi
}%
+ \noexpand\XeKo@UL@hanja@patch
}%
}
\protected\def\hanjabyhangulfont{\let\XeKo@hanja@font\XeKo@hangul@font }
@@ -2257,6 +2439,7 @@
\ifdefined\XeKo@hanja@font\else
\let\XeKo@hanja@font \XeKo@hangul@font
\fi
+ \@ifpackageloaded{ulem}{\xetexkoulemsupport}{}
\@ifpackageloaded{hyperref}{\pdfstringdefDisableCommands{%
\let\hangulalphs\relax
\let\hangulnums\relax