diff options
author | Norbert Preining <norbert@preining.info> | 2021-11-01 03:02:12 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-11-01 03:02:12 +0000 |
commit | b27d5ecc7cba92635475b78660b083793d93a3e7 (patch) | |
tree | 19a78e0cdc4b9270d4ce8ab2d2b492dd332c7f2a /macros/latex/contrib | |
parent | 7d4662184ed36e01faf1fbe7b6e19567a331da2f (diff) |
CTAN sync 202111010302
Diffstat (limited to 'macros/latex/contrib')
21 files changed, 5695 insertions, 1546 deletions
diff --git a/macros/latex/contrib/colorist/colorart.cls b/macros/latex/contrib/colorist/colorart.cls index 52dd155072..3ca992b8f6 100644 --- a/macros/latex/contrib/colorist/colorart.cls +++ b/macros/latex/contrib/colorist/colorart.cls @@ -17,7 +17,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2020-10-01] \ProvidesClass{colorart} - [2021/10/23 A colorful article style] + [2021/10/30 A colorful article style] \def\colorclass@baseclass{article} \RequirePackage{kvoptions} \RequirePackage{etoolbox} @@ -208,6 +208,7 @@ \PassOptionsToPackage{verbose=silent}{microtype} \RequirePackage{microtype} +\AtEndPreamble{\AtBeginDocument{\microtypesetup{disable}{\scshape}\microtypesetup{enable}}} \PassOptionsToPackage{all}{nowidow} \RequirePackage{nowidow} \RequirePackage{embrac} diff --git a/macros/latex/contrib/colorist/colorbook.cls b/macros/latex/contrib/colorist/colorbook.cls index e2064dd0ee..8f0ea853cf 100644 --- a/macros/latex/contrib/colorist/colorbook.cls +++ b/macros/latex/contrib/colorist/colorbook.cls @@ -17,7 +17,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2020-10-01] \ProvidesClass{colorbook} - [2021/10/23 A colorful book style] + [2021/10/30 A colorful book style] \def\colorclass@baseclass{book} \RequirePackage{kvoptions} \RequirePackage{etoolbox} @@ -208,6 +208,7 @@ \PassOptionsToPackage{verbose=silent}{microtype} \RequirePackage{microtype} +\AtEndPreamble{\AtBeginDocument{\microtypesetup{disable}{\scshape}\microtypesetup{enable}}} \PassOptionsToPackage{all}{nowidow} \RequirePackage{nowidow} \RequirePackage{embrac} diff --git a/macros/latex/contrib/colorist/colorist-doc.pdf b/macros/latex/contrib/colorist/colorist-doc.pdf Binary files differindex 763ab08460..18066ee037 100644 --- a/macros/latex/contrib/colorist/colorist-doc.pdf +++ b/macros/latex/contrib/colorist/colorist-doc.pdf diff --git a/macros/latex/contrib/colorist/colorist-doc.tex b/macros/latex/contrib/colorist/colorist-doc.tex index 321a22d5b7..3196e88533 100644 --- a/macros/latex/contrib/colorist/colorist-doc.tex +++ b/macros/latex/contrib/colorist/colorist-doc.tex @@ -93,9 +93,9 @@ \title{{\normalfont\bfseries\color{maintext}\colorist{}}\\write your articles or books in a colorful way} \author{Jinwen XU} -\thanks{Corresponding to: \texttt{\colorist{} 2021/10/23}} +\thanks{Corresponding to: \texttt{\colorist{} 2021/10/30}} \email{\href{mailto:ProjLib@outlook.com}{ProjLib@outlook.com}} -\date{October 2021, Paris} +\date{October 2021, in Paris} \maketitle diff --git a/macros/latex/contrib/colorist/colorist.sty b/macros/latex/contrib/colorist/colorist.sty index 13aadd2605..f8ef3e99ad 100644 --- a/macros/latex/contrib/colorist/colorist.sty +++ b/macros/latex/contrib/colorist/colorist.sty @@ -17,7 +17,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2020-10-01] \ProvidesPackage{colorist} - [2021/10/23 A colorful style for articles and books] + [2021/10/30 A colorful style for articles and books] \RequirePackage{kvoptions} \RequirePackage{etoolbox} \SetupKeyvalOptions{% @@ -503,7 +503,7 @@ \RequirePackage{hyperref} \fi -\PassOptionsToPackage{nothms}{PJLthm} +\PassOptionsToPackage{nothms,simplename}{PJLthm} \RequirePackage{PJLthm} \pretocmd{\theoremnameEN}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL} diff --git a/macros/latex/contrib/microtype/README.md b/macros/latex/contrib/microtype/README.md index 80aaec1811..8e9ed3466f 100644 --- a/macros/latex/contrib/microtype/README.md +++ b/macros/latex/contrib/microtype/README.md @@ -4,7 +4,7 @@ The `microtype` package **Subliminal refinements towards typographical perfection** - (v2.8c -- 2021/03/14) + (v3.0 -- 2021/10/31) Overview @@ -33,7 +33,8 @@ The alternative package `letterspace`, which also works with plain TeX, provides the user commands for letterspacing only, omitting support for all other extensions. -The documentation can be found in `microtype.pdf`. +The documentation can be found in `microtype.pdf` (User manual) and +`microtype-code.pdf` (Implementation). Installation @@ -55,6 +56,9 @@ To install the package, use one of the following methods and move all generated files into a directory where LaTeX will find them, e.g., `TEXMF/tex/latex/microtype/`. +- To use the latest development version, clone the github repository at + `https://github.com/schlcht/microtype` and run `make`. + License ------- @@ -65,11 +69,12 @@ your option) any later version. The latest version of this license is in: http://www.latex-project.org/lppl.txt, and version 1.3c or later is part of all distributions of LaTeX version 2005/12/01 or later. -This work has the LPPL maintenance status 'author-maintained'. +This work has the LPPL maintenance status 'maintained'. -This work consists of the files `microtype.dtx` and `microtype.ins` and the -derived files `microtype.sty`, `microtype-pdftex.def`, `microtype-luatex.def`, -`microtype-xetex.def`, `microtype.lua` and `letterspace.sty`. +This work consists of the files `microtype.dtx`, `microtype-utf.dtx` and +`microtype.ins` and the derived files `microtype.sty`, `microtype-pdftex.def`, +`microtype-luatex.def`, `microtype-xetex.def`, `microtype.lua`, `letterspace.sty` +and `microtype-show.sty`. Modified versions of the configuration files (`*.cfg`) may be distributed provided that: (1) the original copyright statement is not removed, and diff --git a/macros/latex/contrib/microtype/microtype-code.pdf b/macros/latex/contrib/microtype/microtype-code.pdf Binary files differnew file mode 100644 index 0000000000..be3360f0aa --- /dev/null +++ b/macros/latex/contrib/microtype/microtype-code.pdf diff --git a/macros/latex/contrib/microtype/microtype-utf.dtx b/macros/latex/contrib/microtype/microtype-utf.dtx index c553e53e2d..9db817002d 100644 --- a/macros/latex/contrib/microtype/microtype-utf.dtx +++ b/macros/latex/contrib/microtype/microtype-utf.dtx @@ -1,7 +1,5 @@ %\iffalse meta-comment -% !Mode:: "TeX:DTX:UK" -% !smartQuote:: "English" -% !DTXversion:: "2.8b" +% % ------------------------------------------------------------------------ % The `microtype' package % Subliminal refinements towards typographical perfection @@ -13,26 +11,30 @@ % http://www.latex-project.org/lppl.txt, and version 1.3c or later is part % of all distributions of LaTeX version 2005/12/01 or later. % -% This work has the LPPL maintenance status `author-maintained'. +% This work has the LPPL maintenance status `maintained'. % -% This work consists of the files microtype.dtx and microtype.ins and the -% derived files microtype.sty, microtype-pdftex.def, microtype-luatex.def, -% microtype-xetex.def, microtype.lua and letterspace.sty. +% This work consists of the files microtype.dtx, microtype-utf.dtx and +% microtype.ins and the derived files microtype.sty, microtype-pdftex.def, +% microtype-luatex.def, microtype-xetex.def, microtype.lua, letterspace.sty +% and microtype-show.sty. % % Modified versions of the configuration files (*.cfg) may be distributed % provided that: (1) the original copyright statement is not removed, and % (2) the identification string is changed. % ------------------------------------------------------------------------ % +%<*!EBGaramond> \ProvidesFile +%</!EBGaramond> %<*driver> - {\jobname.dtx}[2021/03/14 v2.8c] + {\jobname.dtx}[2021/10/31 v3.0] %</driver> %<CharisSIL> {mt-CharisSIL.cfg}[2017/07/07 v1.1 microtype config. file: Charis SIL (RS)] %<LatinModernRoman> {mt-LatinModernRoman.cfg}[2021/02/21 v1.1 microtype config. file: Latin Modern Roman (RS)] +%<NewComputerModern> {mt-NewComputerModern.cfg}[2021/08/08 v1.0 microtype config. file: New Computer Modern (AT)] %<Palatino> {mt-Palatino.cfg}[2012/03/10 v1.0 microtype config. file: Palatino and similar fonts (LBD)] -%<Lato> {mt-Lato.cfg}[2021/02/22 v1.0 microtype config. file: Lato (RS)] -%<FontAwesome> {mt-FontAwesome.cfg}[2021/02/22 v1.0 microtype config. file: Font Awesome (RS)] +%<TU-basic> {mt-TU-basic.cfg}[2021/06/22 v1.1 microtype config. file: fonts with basic glyph set (RS)] +%<TU-empty> {mt-TU-empty.cfg}[2021/06/22 v1.1 microtype config. file: fonts with nonstandard glyph set (RS)] %<*driver> \documentclass[10pt,a4paper]{ltxdoc} \usepackage{fontspec} @@ -44,12 +46,15 @@ \usepackage{microtype-doc} \luatexbase@directlua{luatexbase.remove_from_callback('process_input_buffer', 'luainputenc.fake_utf_read')} \def\setmacrofont#1{\par\def\macro@font{#1}\footnotesize} + \defaultfontfeatures{RawFeature={notdef=false},WordSpace=2} + \def\normalwordspace{\fontdimen2\font=.5\fontdimen2\font} \newfontface\LMR{Latin Modern Roman} + \newfontface\NCM{NewCM10-Book.otf}[WordSpace=1] \newfontface\CharisSIL{Charis SIL} \newfontface\Palatino{TeX Gyre Pagella} + \newfontface\EBGaramond{EBGaramond-Regular} % \newfontface\Palatino[RawFeature={fallback=charisfallback}]{TeX Gyre Pagella} % \directlua{luaotfload.add_fallback("charisfallback",{"CharisSIL:color=F70A12;mode=harf;"})} - \newfontface\Lato{Lato} \usepackage{luacode} \tracinglostchars2 % we replace any missing characters (in Palatino) with CharisSIL @@ -96,7 +101,7 @@ local nodeprocessor = function (head) lastfont = currfont if not characters[char] then head = node.insert_before(head,n,node.copy(color_push)) - node.remove(head,node.next(n)) -- remove .notdef char (new in luaotfload 2.98) + -- node.remove(head,node.next(n)) -- remove .notdef char (new in luaotfload 2.98) node.insert_after(head,n,node.copy(color_pop)) n.font = fallbackfont if not fontcharacters[fallbackfont][char] then -- not even in Charis SIL @@ -109,6 +114,36 @@ local nodeprocessor = function (head) end luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missing glyphs") \end{luacode} +% communicate counters and bookmarks in microtype-utf.tmp +% (via aux file to get page numbers right) +\let\UTF@bookmarks\@gobble +\def\addto@UTF@bookmarks#1{\edef\UTF@bookmarks{\UTF@bookmarks,#1}} +\def\MT@rempt#1.#2\@nil{#1} +\def\addtoUTFbookmarks#1{% + \protected@write\@auxout{}{% + \string\addto@UTF@bookmarks{% page,section,level,heading,label + \string\number\numexpr\thepage-\startpage,% + \expandafter\MT@rempt\@currentHref\@nil,% + \the\c@section@level,\@currentlabelname,#1}}} +\AddToHook{enddocument/afteraux}{ + \begingroup + \def\setcounter#1#2{\expandafter\ifnum\csname c@#1\endcsname=#2 \else\@tempswatrue\fi} + \def\UTF@setbookmarks#1{\MT@ifstreq{#1}{\UTF@bookmarks}\relax\@tempswatrue} + \InputIfFileExists{microtype-utf.tmp}\@tempswafalse\@tempswatrue + \if@tempswa % only write file if anything has changed + \newwrite\utftmp + \immediate\openout \utftmp=microtype-utf.tmp + \immediate\write \utftmp{\string\setcounter{CodelineNo}{\the\c@CodelineNo}} + \immediate\write \utftmp{\string\setcounter{footnote}{\the\c@footnote}} + \immediate\write \utftmp{\string\UTF@setbookmarks{\UTF@bookmarks}} + \immediate\closeout\utftmp + \fi + \endgroup} +\AddToHook{begindocument}{ + \InputIfFileExists{microtype-code.tmp}\relax\relax + \edef\startpage{\thepage} + \stepcounter{page}} +\CodelineIndex \DisableCrossrefs \RecordChanges \begin{document} @@ -128,25 +163,20 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi %\changes{v2.5a}{2013/05/15}{include OpenType configuration files} %\changes{v2.6}{2015/12/07}{missing characters printed with Charis <SIL>} %\ImplementationSettings -%\InputIfFileExists{microtype-utf.tmp}\relax\relax -%\edef\startpage{\thepage} -%\stepcounter{page} -% -%\newwrite\utftmp -%\immediate\openout\utftmp=microtype.tmp % %\section{OpenType configuration files} +%\addtoUTFbookmarks{sec:OpenType} % % These are the configuration files for the following OpenType fonts:\footnote{This is file \file{\jobname.dtx}.} % %\begin{itemize} -% \item {\LMR -% Latin Modern Roman} -% \item {\CharisSIL -% Charis <SIL>}\footnote{Available at \url{http://software.sil.org/charis}.} -% \item {\Palatino -% Palatino}\footnote{These settings have been contributed by -% \contributor Loren B. Davis <davislo\at eecs.oregonstate.edu>.} +% \item {\LMR\normalwordspace Latin Modern Roman} +% \item {\NCM New Computer Modern}\footnote{These settings have been contributed by +% \contributor Antonis Tsolomitis <antonis.tsolomitis\at gmail.com>.} +% \item {\CharisSIL\normalwordspace Charis <SIL>} +% \item {\EBGaramond\normalwordspace <EB> Garamond} +% \item {\Palatino Palatino}\footnote{These settings have been contributed by +% \contributor Loren~B. Davis <davislo\at eecs.oregonstate.edu>.} %\end{itemize} % %\noindent @@ -154,8 +184,7 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi % %\subsection{Character inheritance} %\GeneralChanges{Inheritance} -%\edef\x{\string\def\string\utfsectioni{\number\numexpr\thepage-\startpage\relax}} -%\immediate\write\expandafter\utftmp\expandafter{\x} +%\addtoUTFbookmarks{sub:OT-inheritance} % % OpenType fonts may differ considerably in how complete their arsenal of glyphs is. % Therefore, each font family should have their own inheritance settings. @@ -167,16 +196,26 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi %%% INHERITANCE %% for xetex (EU1) and luatex (EU2), resp. both (TU) -%<*LatinModernRoman> +% \end{macrocode} +%\subsubsection{Latin Modern Roman/New Computer Modern} +%\addtoUTFbookmarks{subsub:OT-inh-LMR} +% \begin{macrocode} +%<*LatinModernRoman|NewComputerModern> \DeclareCharacterInheritance { encoding = {EU1,EU2,TU}, - family = Latin Modern Roman } +%<LatinModernRoman> family = Latin Modern Roman } +%<NewComputerModern> family = {New Computer Modern} } % \end{macrocode} %\changes{v2.8a}{2021/02/21}{specify `ff' ligature as Unicode instead of glyph name} -%{\setmacrofont\LMR +%\changes{v3.0}{2021/08/08}{settings for New Computer Modern (provided by +% \contributor Antonis Tsolomitis <antonis.tsolomitis\at gmail.com>)} +%{\setmacrofont\NCM % \begin{macrocode} - { A = {À,Á,Â,Ã,Ä,Å,Ā,Ă,Ą,Ǻ,Ȁ,Ạ,Ả,Ấ,Ầ,Ẩ,Ẫ,Ậ,Ắ,Ằ,Ẳ,Ặ, - Α}, % Greek + { + A = {À,Á,Â,Ã,Ä,Å,Ā,Ă,Ą,Ǻ,Ȁ,Ạ,Ả,Ấ,Ầ,Ẩ,Ẫ,Ậ,Ắ,Ằ,Ẳ,Ặ, +%<LatinModernRoman> Α % Greek +%<NewComputerModern> Α,Ά,ᾼ,Ά,Ᾰ,Ᾱ % Ἁ,Ἂ,Ἃ,Ἄ,Ἅ,Ἆ,Ἇ,ᾈ,ᾉ,ᾊ,ᾋ,ᾌ,ᾍ,ᾎ,ᾏ,Ὰ, % Greek + }, Æ = {Ǽ}, B = {฿, Β}, % Greek @@ -184,11 +223,19 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi D = {Ð,Ď,Đ,Ḍ,Ḏ}, E = {È,É,Ê,Ë,Ē,Ĕ,Ė,Ę,Ě,Ȅ,Ẹ,Ẻ,Ẽ,Ề,Ế,Ễ,Ể,Ệ, Ε}, % Greek +%<NewComputerModern> (l)E = {Έ,Ἐ,Ἑ,Ἒ,Ἓ,Ἔ,Ἕ,Ὲ,Έ}, % Greek accents fully protruded left G = {Ĝ,Ğ,Ġ,Ģ,Ǧ,Ǵ}, H = {Ĥ,Ħ,Ḥ,Ḧ,Ḫ, - Η}, % Greek +%<LatinModernRoman> Η % Greek +%<NewComputerModern> Η,ῌ % Greek + }, +%<NewComputerModern> (l)H = {Ἠ,Ἡ,Ἢ,Ἣ,Ἤ,Ἥ,Ἦ,Ἧ,ᾘ,ᾙ,ᾚ,ᾛ,ᾜ,ᾝ,ᾞ,ᾟ}, % Greek accents fully protruded left +%<NewComputerModern> %(l)/uni1FCC.alt = {/uni1F98.alt}, I = {Ì,Í,Î,Ï,Ĩ,Ī,Ĭ,Į,İ,Ȉ,Ỉ,Ị, - Ι}, % Greek +%<LatinModernRoman> Ι % Greek +%<NewComputerModern> Ι,Ῐ,Ῑ % Greek + }, +%<NewComputerModern> (l)I = {Ἰ,Ἱ,Ἲ,Ἳ,Ἴ,Ἵ,Ἶ,Ἷ,Ὶ,Ί}, % Greek J = {Ĵ}, K = {Ķ, Κ}, % Greek @@ -198,7 +245,9 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi Ν}, % Greek O = {Ò,Ó,Ô,Õ,Ö,Ø,Ō,Ŏ,Ő,Ọ,Ơ,Ǫ,Ǿ,Ȍ,Ỏ,Ố,Ồ,Ổ,Ỗ,Ộ,Ớ,Ờ,Ỡ,Ở,Ợ, Ο}, % Greek +%<NewComputerModern> (l)O = {Ό,Ὀ,Ὁ,Ὂ,Ὃ,Ὄ,Ὅ,Ὸ}, % Greek accents except Ό that has indep. protrusion numbers (below) P = {Ρ}, % Greek +%<NewComputerModern> (l)P = {Ῥ}, % Greek accents fully protruded left R = {Ŕ,Ŗ,Ř,Ȑ,Ṛ,Ṙ,Ṝ}, S = {Ś,Ŝ,Ş,Š,Ș,Ṣ}, T = {Ţ,Ť,Ț,Ṭ,Ṯ, @@ -207,6 +256,8 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi W = {Ŵ,Ẁ,Ẃ,Ẅ}, X = {Χ}, % Greek Y = {Ý,Ŷ,Ÿ,Ỵ,Ỷ,Ỹ}, +%<NewComputerModern> Υ = {Ϋ,Ῠ,Ῡ}, +%<NewComputerModern> (l)Υ = {Ύ,Ὺ,Ύ,Ὑ,Ὓ,Ὕ,Ὗ}, Z = {Ź,Ż,Ž,Ẓ, Ζ}, % Greek a = {à,á,â,ã,ä,å,ā,ă,ą,ǻ,ȁ,ạ,ả,ấ,ầ,ẩ,ẫ,ậ,ắ,ằ,ẳ,ẵ}, @@ -214,7 +265,7 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi c = {ç,ć,ĉ,ċ,č}, d = {đ,ḍ,ḏ}, e = {è,é,ê,ë,ē,ĕ,ė,ę,ě,ȅ,ẹ,ẻ,ẽ,ế,ề,ể,ễ,ệ}, - f = {ff}, % Unicode 64256, glyph name in Latin Modern: /f_f ; in New Computer Modern: /ff + f = {ff}, % Unicode 64256, glyph name in Latin Modern Roman: /f_f ; in New Computer Modern: /ff g = {ĝ,ğ,ġ,ģ,ǧ,ǵ}, h = {ĥ,ħ,ḥ,ḧ,ḫ}, i = {ì,í,î,ï,ĩ,ī,ĭ,į,ı,ȉ,ỉ,ị}, @@ -222,7 +273,9 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi k = {ķ}, l = {ĺ,ļ,ł,ḷ,ḹ}, % ľ,l· n = {ñ,ń,ņ,ň,ṅ,ṇ}, - o = {ò,ó,ô,õ,ö,ø,ō,ŏ,ő,ọ,ơ,ǫ,ǿ,ȍ,ỏ,ố,ồ,ổ,ỗ,ộ,ớ,ờ,ỡ,ở,ợ}, + o = {ò,ó,ô,õ,ö,ø,ō,ŏ,ő,ọ,ơ,ǫ,ǿ,ȍ,ỏ,ố,ồ,ổ,ỗ,ộ,ớ,ờ,ỡ,ở,ợ +%<NewComputerModern> ,ο,ό,ὀ,ὁ,ὂ,ὃ,ὄ,ὅ,ὸ,ό % Greek + }, r = {ŕ,ŗ,ř,ȑ,ṛ,ṙ,ṝ}, s = {ś,ŝ,ş,š,ș,ṣ}, t = {ţ,ț,ṭ,ṯ,ẗ}, % ť @@ -230,11 +283,24 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi w = {ŵ,ẁ,ẃ,ẅ}, y = {ý,ŷ,ÿ,ỳ,ỵ,ỷ,ỹ}, z = {ź,ż,ž,ẓ}, +%<*NewComputerModern> + α = {ἁ,ἂ,ἃ,ἄ,ἅ,ἆ,ἇ,ᾀ,ᾁ,ᾂ,ᾃ,ᾄ,ᾅ,ᾆ,ᾇ,ὰ}, + ε = {έ,ἐ,ἑ,ἒ,ἓ,ἔ,ἕ,ὲ,έ}, + η = {ἠ,ἡ,ἢ,ἣ,ἤ,ἥ,ἦ,ἧ,ᾐ,ᾑ,ᾒ,ᾓ,ᾔ,ᾕ,ᾖ}, + ι = {ἰ,ἱ,ὶ,ί,ῐ,ῑ,ϊ,ΐ}, + ϊ = {ἲ,ἳ,ἴ,ἵ,ἶ,ἷ,ῐ,ῑ,ΐ}, + υ = {ύ,ὺ,ύ,ὑ,ὓ,ὕ,ὗ,ϋ,ῠ,ῡ,ϋ,ΰ}, + ω = {ώ,ὠ,ὡ,ὢ,ὣ,ὤ,ὥ,ὦ,ὧ,ᾠ,ᾡ,ᾢ,ᾣ,ᾤ,ᾥ,ᾦ}, +%</NewComputerModern> } % \end{macrocode} %} % \begin{macrocode} -%</LatinModernRoman> +%</LatinModernRoman|NewComputerModern> +% \end{macrocode} +%\subsubsection{Charis SIL} +%\addtoUTFbookmarks{subsub:OT-inh-Charis} +% \begin{macrocode} %<*CharisSIL> \DeclareCharacterInheritance { encoding = {EU1,EU2,TU}, @@ -359,13 +425,233 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi ү = {ұ}, Г = {Γ}, % Greek П = {Π}, % Greek - } - % missing: tipa, math, symbols, ... + } % \end{macrocode} %} % \begin{macrocode} %</CharisSIL> +% \end{macrocode} +%\subsubsection{EB Garamond} +%\addtoUTFbookmarks{subsub:OT-inh-EBGaramond} +%\changes{v3.0}{2021/08/08}{settings for <EB> Garamond (OpenType)} +% \begin{macrocode} +%<*EBGaramond> +\DeclareCharacterInheritance + { encoding = {TU,EU1,EU2}, + family = EBGaramond } +% \end{macrocode} +%{\setmacrofont\EBGaramond +% \begin{macrocode} + { + A = {À,Á,Â,Ã,Ä,Å,Ā,Ă,Ą,Ǎ,Ǟ,Ǡ,Ǻ,Ȁ,Ȃ,Ȧ,Ạ,Ả,Ấ,Ầ,Ẩ,Ẫ,Ậ,Ắ,Ằ,Ẳ,Ẵ,Ặ,Å,/Adieresis.deu, + А,Ӑ,Ӓ, % Cyrillic + Α,Ά,Ἀ,Ἁ,Ἂ,Ἃ,Ἄ,Ἅ,Ἆ,Ἇ,ᾈ,ᾉ,ᾊ,ᾋ,ᾌ,ᾍ,ᾎ,ᾏ,Ᾰ,Ᾱ,Ὰ,Ά,ᾼ}, % Greek +% (l)Α {Ά,Ἀ,Ἁ,Ἂ,Ἃ,Ἄ,Ἅ,Ἆ,Ἇ,ᾈ,ᾉ,ᾊ,ᾋ,ᾌ,ᾍ,ᾎ,ᾏ,Ᾰ,Ᾱ,Ὰ,Ά,ᾼ}, % (accents not protruded) + B = {Ḃ,Ḅ,Ḇ, + В, % Cyrillic + Β}, % Greek + C = {Ç,Ć,Ĉ,Ċ,Č,Ḉ, + Ϲ,С,Ҫ, % Cyrillic + Ⅽ}, % Roman numeral + D = {Ď,Đ,Ð,Ḋ,Ḍ,Ḏ,Ḑ,Ḓ, + Ɖ,Ɗ, % Cyrillic + Ⅾ}, % Roman numeral + E = {È,É,Ê,Ë,Ē,Ĕ,Ė,Ę,Ě,Ḕ,Ḗ,Ȩ,Ḙ,Ḛ,Ḝ,Ẹ,Ẻ,Ẽ,Ế,Ề,Ể,Ễ,Ệ,Ȅ,Ȇ, + Ѐ,Ё,Ӗ,Е, % Cyrillic + Ε}, % Greek + (l)Ε = {Έ,Ἐ,Ἑ,Ἒ,Ἓ,Ἔ,Ἕ,Ὲ,Έ}, % Greek (accents protruded) + F = {Ḟ}, + G = {Ĝ,Ğ,Ġ,Ģ,Ǥ,Ǧ,Ǵ,Ḡ}, + H = {Ĥ,Ħ,Ȟ,Ḣ,Ḥ,Ḧ,Ḩ,Ḫ,ῌ,Ⱨ, + Н,Ң,Ӊ,Ӈ, % Ҥ % Cyrillic + Η}, % Greek + (l)Η = {Ή,Ἠ,Ἡ,Ἢ,Ἣ,Ἤ,Ἥ,Ἦ,Ἧ,Ὴ,Ή,ᾘ,ᾙ,ᾚ,ᾛ,ᾜ,ᾝ,ᾞ,ᾟ}, + I = {Ì,Í,Î,Ï,Ĩ,Ī,Ĭ,Į,İ,Ǐ,Ȉ,Ȋ,Ḭ,Ḯ,Ỉ,Ị, + І,Ї,Ӏ, % Cyrillic + Ι, % Greek + Ⅰ,Ⅱ,Ⅲ}, % Roman numeral + (l)Ι = {Ί,Ϊ,Ἰ,Ἱ,Ἲ,Ἳ,Ἴ,Ἵ,Ἶ,Ἷ,Ῐ,Ῑ,Ὶ,Ί}, % Greek + J = {Ĵ, + Ј}, % Cyrillic + K = {Ķ,Ǩ,Ḱ,Ḳ,Ḵ,Ⱪ, + Κ,K}, % Greek + L = {Ĺ,Ļ,Ľ,Ŀ,Ł,Ḷ,Ḹ,Ḻ,Ḽ,Ⱡ,Ɫ, + Ⅼ}, % Roman numeral + M = {Ḿ,Ṁ,Ṃ, + М,Ӎ, % Cyrillic + Μ, % Greek + Ⅿ}, % Roman numeral + N = {Ñ,Ń,Ņ,Ň,Ŋ,Ǹ,Ṅ,Ṇ,Ṉ,Ṋ, + Ν}, % Greek + O = {Ò,Ó,Ô,Õ,Ö,Ø,Ō,Ŏ,Ő,Ǒ,Ǫ,Ǭ,Ǿ,Ȍ,Ȏ,Ȫ,Ȭ,Ȯ,Ȱ,Ṍ,Ṏ,Ṑ,Ṓ,Ọ,Ỏ,Ố,Ồ,Ổ,Ỗ,Ộ,Ớ,Ờ,Ở,Ỡ,Ợ,Ơ,/Odieresis.deu, + О,Ӧ,Ө,Ӫ, % Cyrillic + Ο,Ό,Ὀ,Ὁ,Ὂ,Ὃ,Ὄ,Ὅ,Ὸ,Ό}, % Greek +% (l)Ο = {Ό,Ὀ,Ὁ,Ὂ,Ὃ,Ὄ,Ὅ,Ὸ,Ό}, % (accents not protruded) + P = {Ṕ,Ṗ,Ᵽ, + Р,Ҏ, % Cyrillic + Ρ}, % Greek + (l)Ρ = {Ῥ}, % Greek + Q = {Ԛ}, % Cyrillic + R = {Ŕ,Ŗ,Ř,Ȑ,Ȓ,Ṙ,Ṛ,Ṝ,Ṟ,Ɽ,}, + S = {Ś,Ŝ,Ş,Š,Ș,Ṡ,Ṣ,Ṥ,Ṧ,Ṩ, + Ѕ}, % Cyrillic + T = {Ţ,Ť,Ŧ,Ț,Ṫ,Ṭ,Ṯ,Ṱ, + Т,Ҭ, % Cyrillic + Τ}, % Greek + U = {Ù,Ú,Û,Ü,Ũ,Ū,Ŭ,Ů,Ű,Ų,Ǔ,Ǖ,Ǘ,Ǚ,Ǜ,Ȕ,Ȗ,Ṳ,Ṵ,Ṷ,Ṹ,Ṻ,Ụ,Ủ,Ứ,Ừ,Ử,Ữ,Ự}, % /Udieresis.deu ? + V = {Ṽ,Ṿ,/U.LAT, + Ⅴ}, % Roman numeral + W = {Ŵ,Ẁ,Ẃ,Ẅ,Ẇ,Ẉ, + Ԝ}, % Cyrillic + X = {Ẋ,Ẍ, + Х,Ҳ,Ӽ,Ӿ, % Cyrillic + Χ, % Greek + Ⅹ}, % Roman numeral + Y = {Ý,Ŷ,Ÿ,Ȳ,Ẏ,Ỳ,Ỵ,Ỷ,Ỹ, + Ү,Ұ}, % Cyrillic + Z = {Ź,Ż,Ž,Ẑ,Ẓ,Ẕ,Ⱬ, + Ζ}, % Greek + a = {à,á,â,ã,ä,å,ā,ă,ą,ǎ,ǟ,ǡ,ǻ,ȁ,ȃ,ȧ,ḁ,ạ,ả,ấ,ầ,ẩ,ẫ,ậ,ắ,ằ,ẳ,ẵ,ặ,ẚ, + а,ӑ,ӓ}, % Cyrillic + b = {ḃ,ḅ,ḇ}, + c = {ç,ć,ĉ,ċ,č,ḉ, + с,ҫ, % Cyrillic + ⅽ}, % Roman numeral + d = {ď,đ,ḋ,ḍ,ḏ,ḑ,ḓ, + ⅾ}, % Roman numeral + e = {è,é,ê,ë,ē,ĕ,ė,ę,ě,ȩ,ḕ,ḗ,ḙ,ḛ,ḝ,ẹ,ẻ,ẽ,ế,ề,ể,ễ,ệ,ȅ,ȇ, + е,ѐ,ё,ӗ}, % Cyrillic + f = {ḟ,ff,/f.long,/f.DEU,/f_f}, + fl = {ffl,/longs_l,/longs_longs_l,/f_l}, + fi = {ffi,/longs_i,/longs_longs_i,/f_i}, + /f.short = {/f_f.short}, + g = {ĝ,ğ,ġ,ģ,ḡ,ǥ,ǧ,ǵ}, + h = {ĥ,ħ,ḣ,ḥ,ḧ,ḩ,ḫ,ẖ,ȟ,ⱨ, + ԧ,ԧ}, % Cyrillic + i = {ì,í,î,ï,ĩ,ī,ĭ,į,ı,ǐ,ȉ,ȋ,ḭ,ỉ,ị,ḯ,/i.TRK, + і,ї, % Cyrillic + ⅰ,ⅱ,ⅲ}, % Roman numeral + j = {ĵ,ǰ, + ј}, % Cyrillic + k = {ķ,ǩ,ḱ,ḳ,ḵ,ⱪ}, + l = {ĺ,ļ,ľ,ŀ,ł,ḷ,ḹ,ḻ,ḽ,ⱡ, + ӏ, % palochka + ⅼ}, % Roman numeral + m = {ḿ,ṁ,ṃ, + ⅿ}, % Roman numeral + n = {ñ,ń,ņ,ň,ŋ,ṅ,ṇ,ṉ,ṋ,ǹ}, % ʼn + o = {ò,ó,ô,õ,ö,ø,ō,ŏ,ő,ǒ,ǫ,ǭ,ǿ,ȍ,ȏ,ȫ,ȭ,ȯ,ȱ,ṍ,ṏ,ṑ,ṓ,ọ,ỏ,ố,ồ,ổ,ỗ,ộ,ớ,ờ,ở,ỡ,ợ, + о,ӧ}, % Cyrillic + p = {ṕ,ṗ, + р,ҏ}, % Cyrillic + q = {ԛ}, % Cyrillic + r = {ŕ,ŗ,ř,ȑ,ȓ,ṙ,ṛ,ṝ,ṟ}, + s = {ś,ŝ,ş,š,ș,ṡ,ṣ,ṥ,ṧ,ṩ, + ѕ}, % Cyrillic + t = {ţ,ť,ŧ,ț,ṫ,ṭ,ṯ,ṱ,ẗ}, + u = {ù,ú,û,ü,ũ,ū,ŭ,ů,ű,ų,ǔ,ǖ,ǘ,ǚ,ǜ,ȕ,ȗ,ṳ,ṵ,ṷ,ṹ,ṻ,ụ,ủ,ứ,ừ,ử,ữ,ự,/u.LATmedi}, + v = {ṽ,ṿ, + ⅴ}, % Roman numeral + w = {ŵ,ẁ,ẃ,ẅ,ẇ,ẉ,ẘ, + ԝ}, % Cyrillic + x = {ẋ,ẍ, + х,ҳ, % Cyrillic + ⅹ}, % Roman numeral + y = {ý,ÿ,ŷ,ȳ,ẏ,ẙ,ỳ,ỵ,ỷ,ỹ, + у,ӯ,ӱ,ӳ,ў}, % Cyrillic + z = {ź,ż,ž,ⱬ,ẑ,ẓ,ẕ}, + Æ = {Ǣ,Ǽ, + Ӕ}, % Cyrillic + æ = {ǣ,ǽ, + ӕ}, % Cyrillic + DZ = {DŽ}, + Dz = {Dž}, + dz = {dž}, + % Smallcaps + /a.sc = {/A.sc}, + /ae.sc = {/AE.sc}, + /d.sc = {/D.sc}, + /f.sc = {/F.sc}, + /g.sc = {/G.sc}, + /j.sc = {/J.sc}, + /l.sc = {/L.sc}, + /o.sc = {/O.sc}, + /oe.sc = {/OE.sc}, + /q.sc = {/Q.sc}, + /r.sc = {/R.sc}, + /t.sc = {/T.sc}, + /y.sc = {/Y.sc}, + % Cyrillic + Г = {Ґ,Ғ,Ѓ,Ӷ}, + Ж = {Җ,Ӝ,Ӂ,Ѫ}, + З = {Ҙ,Ӟ}, + И = {Й,Ҋ,Ӣ,Ӥ,Ѝ}, + К = {Қ,Ҝ,Ҟ,Ҡ,Ќ,Ӄ}, + Л = {Ӆ,Ԓ,Ԯ}, + П = {Ԥ}, + У = {Ӯ,Ӱ,Ӳ,Ў}, + Ц = {Ҵ,Џ}, + Ч = {Ҷ,Ҹ,Ӌ,Ӵ}, + Ш = {Щ}, + Ы = {Ӹ}, + Ь = {Ҍ}, + Э = {Ӭ}, + Ѵ = {Ѷ}, + Ҽ = {Ҿ}, + Ә = {Ӛ}, + г = {ѓ,ґ,ғ,ӷ}, + ж = {җ,ӂ,ӝ,ѫ}, + з = {ҙ,ӟ}, + и = {й,ѝ,ҋ,ӣ,ӥ}, + к = {ќ,қ,ҝ,ӄ}, % ҟ,ҡ + л = {ӆ,ԓ,ԯ}, + м = {ӎ}, + н = {ң,ӈ,ӊ,ԩ}, % ҥ + п = {ԥ}, + т = {ҭ}, + ц = {ҵ}, + ч = {ҷ,ҹ,ӌ,ӵ}, + ш = {щ}, + ы = {ӹ}, + э = {ӭ}, + ѳ = {ө,ӫ}, + ѵ = {ѷ}, + ү = {ұ}, + ҽ = {ҿ}, + ә = {ӛ}, + % Greek + Υ = {Ϋ,ϒ,ϔ,Ῠ,Ῡ}, + (l)Υ = {Ύ,ϓ,Ὑ,Ὓ,Ὕ,Ὗ,Ὺ,Ύ}, + (l)Ω = {Ώ,Ὠ,Ὡ,Ὢ,Ὣ,Ὤ,Ὥ,Ὦ,Ὧ,ᾨ,ᾩ,ᾪ,ᾫ,ᾬ,ᾭ,ᾮ,ᾯ,Ὼ,Ώ}, + Ω = {ῼ,Ω}, % math + Δ = {∆}, % math + Π = {∏}, % math + α = {ά,ἀ,ἁ,ἂ,ἃ,ἄ,ἅ,ἆ,ἇ,ὰ,ά,ᾀ,ᾁ,ᾂ,ᾃ,ᾄ,ᾅ,ᾆ,ᾇ,ᾰ,ᾱ,ᾲ,ᾳ,ᾴ,ᾶ,ᾷ}, + ε = {έ,ἐ,ἑ,ἒ,ἓ,ἔ,ἕ,ὲ,έ}, + η = {ή,ἠ,ἡ,ἢ,ἣ,ἤ,ἥ,ἦ,ἧ,ὴ,ή,ῂ,ῃ,ῄ,ῆ,ῇ,ᾐ,ᾑ,ᾒ,ᾓ,ᾔ,ᾕ,ᾖ,ᾗ}, + ι = {ί,ϊ,ἰ,ἱ,ἲ,ἳ,ἴ,ἵ,ἶ,ἷ,ὶ,ί,ῐ,ῑ,ῒ,ΐ,ῖ,ῗ,ΐ}, + ο = {ό,ϙ,ὀ,ὁ,ὂ,ὃ,ὄ,ὅ,ὸ,ό}, + ρ = {ῤ,ῥ}, + υ = {ΰ,ϋ,ύ,ὐ,ὑ,ὒ,ὓ,ὔ,ὕ,ὖ,ὗ,ὺ,ύ,ῠ,ῡ,ῢ,ΰ,ῦ,ῧ}, + ω = {ώ,ὠ,ὡ,ὢ,ὣ,ὤ,ὥ,ὦ,ὧ,ὼ,ώ,ᾠ,ᾡ,ᾢ,ᾣ,ᾤ,ᾥ,ᾦ,ᾧ,ῲ,ῳ,ῴ,ῶ,ῷ}, + % other + ⑴ = {⑵,⑶,⑷,⑸,⑹,⑺,⑻,⑼,⑽,⑾,⑿,⒀,⒁,⒂,⒃,⒄,⒅,⒆,⒇}, + ⒜ = {⒝,⒞,⒟,⒠,⒡,⒢,⒣,⒤,⒥,⒦,⒧,⒨,⒩,⒪,⒫,⒬,⒭,⒮,⒯,⒰,⒱,⒲,⒳,⒴,⒵}, + 🇦 = {🇧,🇨,🇩,🇪,🇫,🇬,🇭,🇮,🇯,🇰,🇱,🇲,🇳,🇴,🇵,🇶,🇷,🇸,🇹,🇺,🇻,🇼,🇽,🇾,🇿}, + ! = {‼}, + ? = {⁇}, + . = {/onedotenleader}, + /endash = {/figuredash}, + } +% \end{macrocode} +%} +% \begin{macrocode} +%</EBGaramond> +% \end{macrocode} +%\subsubsection{Palatino} +%\addtoUTFbookmarks{subsub:OT-inh-Palatino} +% \begin{macrocode} %<*Palatino> \DeclareCharacterInheritance { encoding = {EU1,EU2,TU}, @@ -374,7 +660,7 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi % Unfortunately, I don't have a Palatino variant containing all of the following % glyphs. The settings are typeset in \TeX\ Gyre Pagella; % missing glyphs, printed in red, are taken from Charis <SIL>; -% glyphs missing even in Charis <SIL> appear as `\char"FFFD@'. +% glyphs missing even in Charis <SIL> appear as `\char"FFFD'. % To see the real settings, consult \file{mt-Palatino.cfg}. %{\setmacrofont\Palatino % \begin{macrocode} @@ -434,76 +720,92 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi % \begin{macrocode} %</Palatino> % \end{macrocode} -% Less characters in the Lato font \dots +%\subsubsection{Basic glyph set} +%\addtoUTFbookmarks{subsub:OT-inh-basic} +% There are quite a few fonts out there that don't even fill the <T1> glyph set. +% To prevent a plethora of warnings, they may be aliased to the surrogate font +% |TU-basic|. Examples of such fonts are: Lato, Fontin and Bergamo. %\changes{v2.8b}{2021/02/21}{settings for the Lato font (\file{mt-Lato.cfg}) % (reported by \contributor dsedivec <@\at @>)} % ^^A https://tex.stackexchange.com/questions/380812/microtype-warning-unknown-slot-number-of-character-with-lato-font +%\changes{v3.0}{2021/06/22}{generalise basic inheritance settings} % \begin{macrocode} -%<*Lato> +%<*TU-basic> \DeclareCharacterInheritance { encoding = {TU,EU1,EU2}, - family = {Lato} } -% \end{macrocode} -%{\setmacrofont\Lato -% \begin{macrocode} - { A = {À,Á,Â,Ã,Ä,Å,Ą}, - a = {à,á,â,ã,ä,å,ą}, - C = {Ć,Ç}, - c = {ć,ç}, + family = {TU-basic} } + { A = {À,Á,Â,Ã,Ä,Å}, + a = {à,á,â,ã,ä,å}, + C = {Ç}, + c = {ç}, D = {Ð}, - E = {È,É,Ê,Ë,Ę}, - e = {è,é,ê,ë,ę}, + E = {È,É,Ê,Ë}, + e = {è,é,ê,ë}, I = {Ì,Í,Î,Ï}, i = {ì,í,î,ï,ı}, L = {Ł}, l = {ł}, - N = {Ń,Ñ}, - n = {ń,ñ}, + N = {Ñ}, + n = {ñ}, O = {Ø,Ò,Ó,Ô,Õ,Ö}, o = {ø,ò,ó,ô,õ,ö}, - S = {Ś,Š}, - s = {ś,š}, + S = {Š}, + s = {š}, U = {Ù,Ú,Û,Ü}, u = {ù,ú,û,ü}, Y = {Ý,Ÿ}, - y = {ý,ÿ}, - Z = {Ź,Ż,Ž}, - z = {ź,ż,ž} - } % \end{macrocode} -%} +% For some reason, the \"y in the next line comes out as \ss. +% Don't worry, there's really a |y diaeresis| in the source. % \begin{macrocode} -%</Lato> + y = {ý,ÿ}, + Z = {Ž}, + z = {ž} + } +%</TU-basic> % \end{macrocode} -% \dots\ and even less in the self-professedly awesone Font Awesome font. +%\subsubsection{Empty glyph set} +%\addtoUTFbookmarks{subsub:OT-inh-empty} +% Other fonts, \eg, the self-professedly awesone Font Awesome font, +% have no meaningful glyph arsenal at all, and should therefore be +% aliased so that empty settings are applied. %\changes{v2.8b}{2021/02/21}{dummy settings for the Font Awesome font (\file{mt-FontAwesome.cfg})} +%\changes{v3.0}{2021/06/22}{generalise empty settings} % \begin{macrocode} -%<*FontAwesome> +%<*TU-empty> \DeclareCharacterInheritance { encoding = {TU,EU1,EU2}, - family = {FontAwesome} } + family = {TU-empty} } { } -%</FontAwesome> +%</TU-empty> % \end{macrocode} % %\subsection{Character protrusion} %\GeneralChanges{Protrusion} -%\edef\x{\string\def\string\utfsectionii{\number\numexpr\thepage-\startpage\relax}} -%\immediate\write\expandafter\utftmp\expandafter{\x} +%\addtoUTFbookmarks{sub:OT-protrusion} % % \begin{macrocode} %%% ----------------------------------------------------------------------- %%% PROTRUSION -%<*LatinModernRoman> +% \end{macrocode} +%\subsubsection{Latin Modern Roman/New Computer Modern} +%\addtoUTFbookmarks{subsub:OT-prot-LMR} +%\changes{v3.0}{2021/08/08}{settings for New Computer Modern (provided by +% \contributor Antonis Tsolomitis <antonis.tsolomitis\at gmail.com>)} +%\changes{v3.0}{2021/08/13}{fix quotation marks in <LMR>} +% \begin{macrocode} +%<*LatinModernRoman|NewComputerModern> \SetProtrusion - [ name = LMR-default ] +%<LatinModernRoman> [ name = LMR-default ] +%<NewComputerModern> [ name = NCM-default ] { encoding = {EU1,EU2,TU}, - family = Latin Modern Roman } +%<LatinModernRoman> family = Latin Modern Roman } +%<NewComputerModern> family = {New Computer Modern} } { % \end{macrocode} -%{\setmacrofont\LMR +%{\setmacrofont\NCM % \begin{macrocode} A = {50,50}, Æ = {50, }, @@ -516,8 +818,14 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi W = {50,50}, X = {50,50}, Y = {50,50}, +%<NewComputerModern> /a.end = {,330}, +%<NewComputerModern> /e.end = {,350}, k = { ,50}, +%<NewComputerModern> /k.alt = { ,50}, r = { ,50}, +%<NewComputerModern> /r.end = {,300}, +%<NewComputerModern> /m.end = {,200}, +%<NewComputerModern> /n.end = {,300}, t = { ,70}, v = {50,50}, w = {50,50}, @@ -551,8 +859,8 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi / = {200,300}, /backslash = {200,300}, ' = {300,400}, % /quotesingle - ‘ = {500,700}, ’ = {500,600}, - “ = {500,300}, ” = {200,600}, + ‘ = {300,400}, ’ = {300,400}, + “ = {300,300}, ” = {300,300}, ‚ = {400,400}, „ = {400,400}, ‹ = {400,400}, › = {300,500}, « = {300,200}, » = {100,400}, @@ -587,30 +895,121 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi /three.oldstyle = { 30, 80}, /four.oldstyle = { 50, 50}, /seven.oldstyle = { 50, 80}, +%<*NewComputerModern> + Ά = {50,50}, % /Alphatonos + Ὰ = {120,50}, % + Ἀ = {120,50}, % + Ἁ = {80,50}, % + Ἂ = {220,50}, % + Ἃ = {220,50}, % + Ἄ = {170,50}, % + Ἅ = {170,50}, % + Ἆ = {190,50}, % + Ἇ = {190,50}, % + ᾈ = {150,50}, % + ᾉ = {80,50}, % + ᾊ = {220,50}, % + ᾋ = {220,50}, % + ᾌ = {170,50}, % + ᾍ = {170,50}, % + ᾎ = {210,50}, % + ᾏ = {210,50}, % + /uni1FBC.alt = {,205}, % Alpha prosgegrammeni + /uni1F88.alt = {50,190}, %Alpha psili prosgegrammeni + /uni1F89.alt = {,200}, %Alpha dasia prosgegrammeni + /uni1F8A.alt = {130,180}, %Alpha psili baria prosgegrammeni + /uni1F8B.alt = {130,190}, %Alpha dasia baria prosgegrammeni + /uni1F8C.alt = {100,190}, %Alpha psili oxia prosgegrammeni + /uni1F8D.alt = {70,190}, %Alpha dasia oxia prosgegrammeni + /uni1F8E.alt = {120,190}, %Alpha psili perispomeni prosgegrammeni + /uni1F8F.alt = {120,190}, %Alpha dasia perispomeni prosgegrammeni + % + /uni1FCC.alt = {,205}, % Eta prosgegrammeni + /uni1F98.alt = {185,170}, %Eta psili prosgegrammeni + /uni1F99.alt = {185,170}, %Eta dasia prosgegrammeni + /uni1F9A.alt = {220,170}, %Eta psili baria prosgegrammeni + /uni1F9B.alt = {220,170}, %Eta dasia baria prosgegrammeni + /uni1F9C.alt = {220,170}, %Eta psili oxia prosgegrammeni + /uni1F9D.alt = {220,170}, %Eta dasia oxia prosgegrammeni + /uni1F9E.alt = {255,170}, %Eta psili perispomeni prosgegrammeni + /uni1F9F.alt = {255,170}, %Eta dasia perispomeni prosgegrammeni + % + Ό = {95,50}, % +%</NewComputerModern> Γ = { ,180}, % /Gamma - Δ = {100,100}, % /Delta +%<LatinModernRoman> Δ = {100,100}, % /Delta +%<NewComputerModern> Δ = {50,50}, % /Delta Θ = { 50, 50}, % /Theta - Λ = {100,100}, % /Lambda +%<LatinModernRoman> Λ = {100,100}, % /Lambda +%<NewComputerModern> Λ = {50,50}, % /Lambda % Ξ = {,}, % /Xi % Π = {,}, % /Pi Σ = { 50, 50}, % /Sigma - Υ = {100,100}, % /Upsilon +%<LatinModernRoman> Υ = {100,100}, % /Upsilon +%<NewComputerModern> Υ = {80,80}, % /Upsilon Φ = { 50, 50}, % /Phi Ψ = { 50, 50}, % /Psi -% Ω = {,}, % /Omega +%<*NewComputerModern> + Ω = { 20, 30}, % /Omega + Ώ = {150,30}, + Ὠ = {220,30}, + Ὡ = {205,30}, + Ὢ = {285,30}, + Ὣ = {285,30}, + Ὤ = {270,30}, + Ὥ = {270,30}, + Ὦ = {310,30}, + Ὧ = {310,30}, + ᾨ = {205,30}, + ᾩ = {205,30}, + ᾪ = {285,30}, + ᾫ = {285,30}, + ᾬ = {270,30}, + ᾭ = {270,30}, + ᾮ = {310,30}, + ᾯ = {310,30}, + /uni1FFC.alt = {,230}, % Omega prosgegrammeni + /uni1FA8.alt = {185,190}, %Omega psili prosgegrammeni + /uni1FA9.alt = {185,190}, %Omega dasia prosgegrammeni + /uni1FAA.alt = {220,190}, %Omega psili baria prosgegrammeni + /uni1FAB.alt = {220,190}, %Omega dasia baria prosgegrammeni + /uni1FAC.alt = {220,190}, %Omega psili oxia prosgegrammeni + /uni1FAD.alt = {220,190}, %Omega dasia oxia prosgegrammeni + /uni1FAE.alt = {255,190}, %Omega psili perispomeni prosgegrammeni + /uni1FAF.alt = {255,190}, %Omega dasia perispomeni prosgegrammeni + % + α = {,50}, + γ = {50,50}, + ζ = {,50}, + θ = {30,40}, + ι = {,50}, + ϊ = {-20,-30}, + κ = {50,50}, + λ = {50,50}, + ν = {50,25}, + π = {50,50}, + σ = {,50}, + ς = {,50}, + τ = {50,50}, + χ = {50,50}, + ψ = {50,50}, +% /uni1F98.alt = {,}, +%</NewComputerModern> % \end{macrocode} %} % \begin{macrocode} } \SetProtrusion - [ name = LMR-it ] +%<LatinModernRoman> [ name = LMR-it ] +%<NewComputerModern> [ name = NCM-it ] { encoding = {EU1,EU2,TU}, - family = Latin Modern Roman, +%<LatinModernRoman> family = Latin Modern Roman, +%<NewComputerModern> family = {New Computer Modern}, shape = {it,sl} } { % \end{macrocode} -%{\setmacrofont\LMR +%{\setmacrofont\NCM % \begin{macrocode} A = {125,100}, Æ = {125,-55}, @@ -668,6 +1067,14 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi x = {65,-40}, y = {130,-20}, z = {110,-80}, +%<*NewComputerModern> + /a.end = {,330}, %Fix + /e.end = {,350}, %Fix + /k.alt = { ,50}, %Fix + /r.end = {,300}, %Fix + /m.end = {,200}, %Fix + /n.end = {,300}, %Fix +%</NewComputerModern> 0 = {170,-85}, 1 = {230,110}, 2 = {130,-70}, @@ -738,19 +1145,115 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi Γ = {100,120}, % /Gamma Δ = {120,100}, % /Delta Θ = {120, 50}, % /Theta - Λ = {130,100}, % /Lambda +%<LatinModernRoman> Λ = {130,100}, % /Lambda +%<NewComputerModern> Λ = {160,100}, % /Lambda Ξ = {100,}, % /Xi Π = {100,}, % /Pi Σ = {100, 50}, % /Sigma - Υ = {180,100}, % /Upsilon +%<LatinModernRoman> Υ = {180,100}, % /Upsilon +%<NewComputerModern> Υ = {260,100}, % /Upsilon Φ = {130, 70}, % /Phi Ψ = {130, 50}, % /Psi Ω = { 50,}, % /Omega +%<*NewComputerModern> + Ὰ = {190,50}, % + Ἀ = {220,50}, % + Ἁ = {200,50}, % + Ἂ = {300,50}, % + Ἃ = {300,50}, % + Ἄ = {300,50}, % + Ἅ = {300,50}, % + Ἆ = {320,50}, % + Ἇ = {320,50}, % + ᾈ = {200,50}, % + ᾉ = {200,50}, % + ᾊ = {300,50}, % + ᾋ = {300,50}, % + ᾌ = {300,50}, % + ᾍ = {300,50}, % + ᾎ = {320,50}, % + ᾏ = {320,50}, % + /uni1FBC.alt = {,205}, % Alpha prosgegrammeni + /uni1F88.alt = {50,190}, %Alpha psili prosgegrammeni + /uni1F89.alt = {,200}, %Alpha dasia prosgegrammeni + /uni1F8A.alt = {130,180}, %Alpha psili baria prosgegrammeni + /uni1F8B.alt = {130,190}, %Alpha dasia baria prosgegrammeni + /uni1F8C.alt = {100,190}, %Alpha psili oxia prosgegrammeni + /uni1F8D.alt = {70,190}, %Alpha dasia oxia prosgegrammeni + /uni1F8E.alt = {120,190}, %Alpha psili perispomeni prosgegrammeni + /uni1F8F.alt = {120,190}, %Alpha dasia perispomeni prosgegrammeni + % + /uni1FCC.alt = {,205}, % Eta prosgegrammeni + /uni1F98.alt = {185,170}, %Eta psili prosgegrammeni + /uni1F99.alt = {185,170}, %Eta dasia prosgegrammeni + /uni1F9A.alt = {220,170}, %Eta psili baria prosgegrammeni + /uni1F9B.alt = {220,170}, %Eta dasia baria prosgegrammeni + /uni1F9C.alt = {220,170}, %Eta psili oxia prosgegrammeni + /uni1F9D.alt = {220,170}, %Eta dasia oxia prosgegrammeni + /uni1F9E.alt = {255,170}, %Eta psili perispomeni prosgegrammeni + /uni1F9F.alt = {255,170}, %Eta dasia perispomeni prosgegrammeni + % + Ό = {95,50}, % + Ω = {120, 30}, % /Omega + Ώ = {160,30}, + Ὠ = {250,30}, + Ὡ = {250,30}, + Ὢ = {300,30}, + Ὣ = {300,30}, + Ὤ = {300,30}, + Ὥ = {300,30}, + Ὦ = {330,30}, + Ὧ = {330,30}, + ῼ = {30,30}, + ᾨ = {230,30}, + ᾩ = {230,30}, + ᾪ = {300,30}, + ᾫ = {300,30}, + ᾬ = {300,30}, + ᾭ = {300,30}, + ᾮ = {330,30}, + ᾯ = {330,30}, + /uni1FFC.alt = {,230}, % Omega prosgegrammeni + /uni1FA8.alt = {185,190}, %Omega psili prosgegrammeni + /uni1FA9.alt = {185,190}, %Omega dasia prosgegrammeni + /uni1FAA.alt = {220,190}, %Omega psili baria prosgegrammeni + /uni1FAB.alt = {220,190}, %Omega dasia baria prosgegrammeni + /uni1FAC.alt = {220,190}, %Omega psili oxia prosgegrammeni + /uni1FAD.alt = {220,190}, %Omega dasia oxia prosgegrammeni + /uni1FAE.alt = {255,190}, %Omega psili perispomeni prosgegrammeni + /uni1FAF.alt = {255,190}, %Omega dasia perispomeni prosgegrammeni + % + α = {50,50}, + γ = {100,50}, + δ = {30,50}, + ε = {30,}, + ζ = {20,50}, + θ = {30,40}, + ι = {,50}, + ϊ = {-20,-30}, + κ = {50,50}, + λ = {-20,50}, + ν = {50,25}, + ο ={40,}, + π = {50,50}, + σ = {40,50}, + ς = {20,50}, + τ = {50,50}, + υ = {80,}, + φ = {80,}, + χ = {20,}, + ψ = {80,}, +% /uni1F98.alt = {,}, +%</NewComputerModern> % \end{macrocode} %} % \begin{macrocode} } -%</LatinModernRoman> +%</LatinModernRoman|NewComputerModern> +% \end{macrocode} +%\subsubsection{Charis SIL} +%\addtoUTFbookmarks{subsub:OT-prot-Charis} +% \begin{macrocode} %<*CharisSIL> \SetProtrusion [ name = Charis-default ] @@ -1091,10 +1594,7 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi family = Charis SIL, shape = {sc} } { -% \end{macrocode} -%{\setmacrofont\CharisSIL -% \begin{macrocode} - % ᴀ = {100,100}, % etc., doesn't work with \textsc +% ᴀ = {100,100}, % etc., doesn't work with \textsc /a.\MT@CHARIS@SC = {100,100}, /c.\MT@CHARIS@SC = {50, }, /d.\MT@CHARIS@SC = { ,50}, @@ -1113,11 +1613,303 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi /w.\MT@CHARIS@SC = {50,50}, /x.\MT@CHARIS@SC = {50,50}, /y.\MT@CHARIS@SC = {50,50} + } +%</CharisSIL> +% \end{macrocode} +%\subsubsection{EB Garamond} +%\addtoUTFbookmarks{subsub:OT-prot-EBGaramond} +%\changes{v3.0}{2021/10/25}{settings for <EB> Garamond (OpenType)} +% \begin{macrocode} +%<*EBGaramond> +\SetProtrusion + [ name = EBGaramond-TU, + load = EBGaramond-T1-LF ] + { encoding = {TU,EU1,EU2}, + family = EBGaramond } + { + /one.tosf = {150,150}, + /two.tosf = {50,50}, + /three.tosf = {50,50}, + /four.tosf = {50,50}, + /five.tosf = {50,50}, + /six.tosf = {50,50}, + /seven.tosf = {50,80}, + /eight.tosf = {50,50}, + /nine.tosf = {50,50}, + /one.lf = {50,50}, + /two.lf = {50,50}, + /four.lf = {50,50}, + /seven.lf = {50,50}, + /one.osf = {50,50}, + /two.osf = {50,50}, + /four.osf = {50,50}, + /seven.osf = {50,50}, +% \end{macrocode} +%{\setmacrofont\EBGaramond +% \begin{macrocode} + Ⅳ = { , 35}, + Ⅵ = { 35, }, + Ⅶ = { 30, }, + Ⅷ = { 25, }, + Ⅸ = { , 35}, + Ⅺ = { 35, }, + Ⅻ = { 30, }, + ⅳ = { , 25}, + ⅵ = { 25, }, + ⅶ = { 20, }, + ⅷ = { 20, }, + ⅸ = { , 25}, + ⅺ = { 25, }, + ⅻ = { 20, }, + % textcomp + \textquotesingle = {400,500}, + ˷ = {200,250}, + ƒ = { ,100}, + ₡ = { 50, }, + † = {100,100}, + ‡ = { 80, 80}, + • = { ,100}, + · = {300,400}, % periodcentered + /twodotenleader = {150,200}, + /ellipsis = {100,150}, + ℃ = { 80, }, + ° = {400,400}, + ™ = {100,100}, + © = {100,100}, + ® = {100,100}, + ª = {200,200}, + º = {200,200}, + ¹ = {200,200}, + ² = {200,200}, + ³ = {200,200}, + ¬ = {200, }, + ¶ = { ,100}, + − = {300,300}, % minus + ± = {150,200}, + × = {100,150}, + ÷ = {150,200}, + € = { 50,100}, + ¥ = { 50, 50}, + % Greek + Γ = { ,150}, + Δ = {100,100}, + Θ = { 50, 50}, + Λ = {100,100}, + Ξ = { 50, 50}, + Υ = {100,100}, + Φ = { 50, 50}, + Ψ = { 50, 50}, + Ω = { , 50}, + ζ = { , 50}, + λ = { 50, 50}, + γ = { 50, 50}, + π = { 50, 50}, + ρ = { , 50}, + σ = { 50, 50}, + τ = { 50, 50}, + χ = { 50, 50}, + φ = { 50, 50}, + ϙ = { 50, 50}, + ψ = { 50, 50}, + % Cyrillic + Г = { ,150}, + Д = { 50, 50}, + Ж = { 50, 50}, + К = { , 50}, + Л = { 50, }, + Љ = { 50, 50}, + З = { 50, 50}, + У = { 50,100}, + Ф = { 50, 50}, + Ч = { 70, }, + Я = { 50, }, + Ъ = { 50, 50}, + Ь = { , 50}, + ж = { 50, 50}, + ф = { 50, 50}, + ъ = { 50, 50}, + Ѱ = { 50, 50}, + г = { , 50}, + Ѵ = { 50, 50}, + % other + Þ = { , 50}, + þ = { , 50}, + Ʌ = {100,100}, + ⑴ = { 35, 65}, + ⒜ = { 30, 60}, % \end{macrocode} %} % \begin{macrocode} - } -%</CharisSIL> + } + +\SetProtrusion + [ name = EBGaramond-it-TU, + load = EBGaramond-it-T1-LF ] + { encoding = {TU,EU1,EU2}, + family = EBGaramond, + shape = it } + { + /zero.tosf = {150,150}, + /one.tosf = {150,150}, + /two.tosf = {80,80}, + /three.tosf = {50,80}, + /four.tosf = {50,80}, + /five.tosf = {50,80}, + /six.tosf = {50,50}, + /seven.tosf = {50,100}, + /eight.tosf = {50,50}, + /nine.tosf = {50,80}, + /one.lf = {50,50}, + /two.lf = {50,50}, + /three.lf = {80,50}, + /four.lf = {50,50}, + /five.lf = {50,50}, + /six.lf = {50,50}, + /seven.lf = {50,50}, + /eight.lf = {50,50}, + /nine.lf = {50, }, + /one.osf = {50,50}, + /two.osf = {50,50}, + /three.osf = { ,80}, + /four.osf = {50,50}, + /seven.osf = {50,50}, +% \end{macrocode} +%{\setmacrofont\EBGaramond +% \begin{macrocode} + % textcomp + \textquotesingle = {800,100}, + − = {300,300}, % minus + ˷ = {200,250}, + † = {200,100}, + ‡ = { 80, 80}, + • = {300, }, + ℃ = {200, }, + ƒ = {100, }, + ₡ = {100, }, + ™ = {200, }, + © = {200,100}, + ® = {200,100}, + ¬ = {300, }, + ° = {500,100}, + ± = {200,150}, + ¹ = {300,100}, + ² = {300, }, + ³ = {300, }, + · = {300,500}, % periodcentered + /twodotenleader = {150,300}, + /ellipsis = {100,200}, + € = {100, }, + × = {200,100}, + ÷ = {200,200}, + ¶ = { ,100}, + ª = {200,200}, + º = {200,200}, + ¥ = { 50, 50}, + % Greek + Δ = {150, }, + Θ = { 50, }, + Λ = {150, }, + Υ = {100, 50}, + Φ = { 50, }, + Χ = { 50, }, + Ψ = {100, }, + Ω = { 50, }, + γ = { , 50}, + λ = { 50, }, + % Cyrillic + Ү = { 50, }, + Ч = {100, }, + З = {100, }, + % other + Þ = { 50, 50}, + þ = { , 50}, +% \end{macrocode} +%} +% \begin{macrocode} + } + +\SetProtrusion + [ name = EBGaramond-sc-TU, + load = EBGaramond-TU ] + { encoding = {TU,EU1,EU2}, + family = EBGaramond, + shape = sc } + { +% \end{macrocode} +%{\setmacrofont\EBGaramond +% \begin{macrocode} + a = {50,50}, + \ae = {50, }, + d = { ,50}, + f = { ,50}, + g = {50, }, + j = {50, }, + l = { ,50}, + o = {50,50}, + \oe = {50, }, + q = {50,70}, + r = { , 0}, + t = {50,50}, + y = {50,50}, + % Greek + α = {50,50}, + γ = { ,50}, + δ = {50,50}, + λ = {50,50}, + ο = {50,50}, + τ = {50,50}, + υ = {50,50}, + ψ = {50,50}, + % Cyrillic + т = {50,50}, +% \end{macrocode} +%} +% \begin{macrocode} + } + +\SetProtrusion + [ name = EBGaramond-scit-TU, + load = EBGaramond-it-TU ] + { encoding = {TU,EU1,EU2}, + family = EBGaramond, + shape = scit } + { +% \end{macrocode} +%{\setmacrofont\EBGaramond +% \begin{macrocode} + a = {50,50}, + \ae = {50, }, + d = { ,50}, + f = { ,50}, + g = {50, }, + j = {50, }, + l = { ,50}, + o = {50,50}, + \oe = {50, }, + q = {50,70}, + r = { , 0}, + t = {50,50}, + y = {50,50}, + % Greek + α = {50,50}, + γ = { ,50}, + δ = {50,50}, + λ = {50,50}, + ο = {50,50}, + τ = {50,50}, + υ = {50,50}, + ψ = {50,50}, + % Cyrillic + т = {50,50}, +% \end{macrocode} +%} +% \begin{macrocode} + } +%</EBGaramond> +% \end{macrocode} +%\subsubsection{Palatino} +%\addtoUTFbookmarks{subsub:OT-prot-Palatino} +% \begin{macrocode} %<*Palatino> \SetProtrusion [ name = palatino-default ] @@ -1352,18 +2144,26 @@ luatexbase.add_to_callback("pre_linebreak_filter", nodeprocessor, "replace missi % \begin{macrocode} } %</Palatino> -%<Lato> %% No settings yet. -%<*FontAwesome> +% \end{macrocode} +%\subsubsection{Basic glyph set} +% The protrusion settings will still be loaded from \file{microtype.cfg}. +%\addtoUTFbookmarks{subsub:OT-prot-basic} +% \begin{macrocode} +%<TU-basic> %% No settings. +% \end{macrocode} +%\subsubsection{Empty glyph set} +%\addtoUTFbookmarks{subsub:OT-prot-empty} +% \begin{macrocode} +%<*TU-empty> \SetProtrusion [ name = empty ] { encoding = {TU,EU1,EU2}, - family = {FontAwesome} } + family = {TU-empty} } { } -%</FontAwesome> +%</TU-empty> % \end{macrocode} -%\immediate\write \utftmp{\string\setcounter{CodelineNo}{\the\c@CodelineNo}} -%\immediate\write \utftmp{\string\setcounter{footnote}{\the\c@footnote}} -%\immediate\closeout\utftmp % \endinput +% +% % vim: ts=2:sw=2:et: diff --git a/macros/latex/contrib/microtype/microtype.dtx b/macros/latex/contrib/microtype/microtype.dtx index 088b55ea1f..942782e93d 100644 --- a/macros/latex/contrib/microtype/microtype.dtx +++ b/macros/latex/contrib/microtype/microtype.dtx @@ -1,7 +1,5 @@ %\iffalse meta-comment -% !Mode:: "TeX:DTX:UK" -% !smartQuote:: "English" -% !DTXversion:: "2.8c" +% % ------------------------------------------------------------------------ % The `microtype' package % Subliminal refinements towards typographical perfection @@ -13,46 +11,49 @@ % http://www.latex-project.org/lppl.txt, and version 1.3c or later is part % of all distributions of LaTeX version 2005/12/01 or later. % -% This work has the LPPL maintenance status `author-maintained'. +% This work has the LPPL maintenance status `maintained'. % -% This work consists of the files microtype.dtx and microtype.ins and the -% derived files microtype.sty, microtype-pdftex.def, microtype-luatex.def, -% microtype-xetex.def, microtype.lua and letterspace.sty. +% This work consists of the files microtype.dtx, microtype-utf.dtx and +% microtype.ins and the derived files microtype.sty, microtype-pdftex.def, +% microtype-luatex.def, microtype-xetex.def, microtype.lua, letterspace.sty +% and microtype-show.sty. % % Modified versions of the configuration files (*.cfg) may be distributed % provided that: (1) the original copyright statement is not removed, and % (2) the identification string is changed. % ------------------------------------------------------------------------ % -%<package|letterspace>\NeedsTeXFormat{LaTeX2e} +%<package|letterspace|show>\NeedsTeXFormat{LaTeX2e} %<*driver> \ProvidesFile{\jobname.dtx} %</driver> -%<package|letterspace>\ProvidesPackage -%<config|pdftex-def|luatex-def|xetex-def>\ProvidesFile +%<package|letterspace|show>\ProvidesPackage +%<config|pdf-|lua-|xe->\ProvidesFile %<package> {microtype} %<letterspace> {letterspace} +%<show> {microtype-show} %<m-t> {microtype.cfg} -%<pdftex-def> {microtype-pdftex.def} -%<luatex-def> {microtype-luatex.def} -%<xetex-def> {microtype-xetex.def} -%<*package|letterspace|m-t|pdftex-def|luatex-def|xetex-def> - [2021/03/14 v2.8c +%<pdf-> {microtype-pdftex.def} +%<lua-> {microtype-luatex.def} +%<xe-> {microtype-xetex.def} +%<*package|letterspace|m-t|pdf-|lua-|xe-|show> + [2021/10/31 v3.0 %<package> Micro-typographical refinements %<letterspace> Robust letterspacing +%<show> Visual debugging for the microtype package %<m-t> microtype main configuration file -%<pdftex-def|luatex-def|xetex-def> Definitions specific to -%<pdftex-def> pdftex -%<luatex-def> luatex -%<xetex-def> xetex +%<pdf-|lua-|xe-> Definitions specific to +%<pdf-> pdftex +%<lua-> luatex +%<xe-> xetex (RS)] -%</package|letterspace|m-t|pdftex-def|luatex-def|xetex-def> +%</package|letterspace|m-t|pdf-|lua-|xe-|show> %<luafile>microtype = microtype or {} %<luafile>local microtype = microtype %<luafile>microtype.module = { %<luafile> name = "microtype", -%<luafile> version = "2.8c", -%<luafile> date = "2021/03/14", +%<luafile> version = "3.0", +%<luafile> date = "2021/10/31", %<luafile> description = "microtype module.", %<luafile> author = "E. Roux, R. Schlicht and P. Gesang", %<luafile> copyright = "E. Roux, R. Schlicht and P. Gesang", @@ -62,7 +63,7 @@ %<bch> {mt-bch.cfg}[2007/03/03 v1.5 microtype config. file: Bitstream Charter (RS)] %<blg> {mt-blg.cfg}[2007/07/14 v1.0 microtype config. file: Bitstream Letter Gothic (RS)] %<cmr> {mt-cmr.cfg}[2013/05/19 v2.2 microtype config. file: Computer Modern Roman (RS)] -%<ebg> {mt-EBGaramond.cfg}[2021/02/22 v1.6 microtype config. file: EB Garamond / Adobe Garamond (RS)] +%<ebg> {mt-EBGaramond.cfg}[2021/10/25 v2.0 microtype config. file: EB Garamond / Adobe Garamond (RS)] %<pmn> {mt-pmn.cfg}[2009/11/14 v1.3 microtype config. file: Adobe Minion (HH/KK)] %<ppl> {mt-ppl.cfg}[2005/11/16 v1.6 microtype config. file: Palatino (RS)] %<ptm> {mt-ptm.cfg}[2006/04/20 v1.7 microtype config. file: Times (RS)] @@ -81,17 +82,29 @@ \documentclass[10pt,a4paper]{ltxdoc} \makeatletter %</driver> +% Compiling microtype.dtx with the command line option +% --jobname=microtype-code +% will produce the document microtype-code.pdf, +% containing only the Implementation. +\expandafter\newif\csname ifcodedoc\endcsname +\edef\@tempa{\jobname} +\edef\@tempb{\detokenize{microtype-code}} +\ifx\@tempa\@tempb + \codedoctrue +\fi +%<docsty>\codedoctrue % Let's abolish CM! We use Charter and Letter Gothic % (for the pre-built documentation on CTAN): -\usepackage[T1]{fontenc} +\usepackage[LGR,T1]{fontenc} \usepackage[charter]{mathdesign} \def\rmdefault{bch} % not scaled \def\sfdefault{SourceSansPro-TLF} \def\SourceSansPro@scale{1.02} - \def\ttdefault{blg} +\IfFileExists{t1blg.fd} + {\def\ttdefault{blg}} + {\def\ttdefault{ulg}} {\ttfamily\selectfont - \DeclareFontShape{T1}{blg}{eb}{n}{<-> ssub * blg/b/n}{}} -\usepackage{textcomp} + \DeclareFontShape{T1}{\ttdefault}{eb}{n}{<-> ssub * \ttdefault/b/n}{}} \usepackage{iftex} %<*!docsty> \ifxetex\else @@ -99,11 +112,11 @@ \fi %</!docsty> \GetFileInfo{\jobname.dtx} -\usepackage[expansion=false,kerning=true]{microtype}[\filedate] +\usepackage{microtype}[\filedate] \DeclareMicrotypeSet*[protrusion] { doc } { encoding = {*, TS1, OMS}, - family = {rm*, tt*}, + family = {rm*, sf*, tt*}, size = {footnotesize, small, normalsize} } \SetProtrusion { encoding = OMS, @@ -124,41 +137,23 @@ \DisableLigatures[?,!]{encoding = *, family = rm* } \fi % Fraktur sample in section \ref{sec:lettersp} - \IfFileExists{t1mwr.fd} - {\def\textfrak##1{{\fontfamily{mwr}\selectfont ##1}} - \ifpdf - \SetTracking[no ligatures={f,s,c}]{encoding=T1,family=mwr}{120} - \fi} - {\IfFileExists{yfonts.sty} +\IfFileExists{t1mwr.fd} + {\def\textfrak##1{{\fontfamily{mwr}\selectfont ##1}} + \SetTracking[no ligatures={f,s,c}]{encoding=T1,family=mwr}{120}} + {\IfFileExists{yfonts.sty} {\usepackage{yfonts} - \ifpdf - \SetTracking[no ligatures={f,s,c}]{encoding=LY,family=yfrak}{120} - \fi} + \SetTracking[no ligatures={f,s,c}]{encoding=LY,family=yfrak}{120}} {\def\textfrak{\rule{.5em}{1.5ex}\@gobble}}} -\ifpdftex\else - \microtypesetup{kerning=false} +\ifpdftex + \microtypesetup{kerning=true} +\fi +\ifluatex % microtype.dtx finally compiles with 0.35! + \usepackage{luatex85} \fi -\tolerance=700 \ifpdf - \ifluatex % microtype.dtx finally compiles with 0.35! - \def\pdftexversion{200} % in TeX Live 2015, they let this to \luatexversion - \let\pdfxform \saveboxresource - \let\pdflastxform \lastsavedboxresourceindex - \protected\edef\pdfminorversion {\pdfvariable minorversion} - \protected\def\pdfobj {\pdfextension obj } - \protected\def\pdfcatalog {\pdfextension catalog } - \protected\def\pdfannot {\pdfextension annot } - \protected\def\pdfoutline {\pdfextension outline } - \protected\def\pdfmapline {\pdfextension mapline } - \protected\def\pdfglyphtounicode {\pdfextension glyphtounicode } - \protected\def\pdflastobj {\numexpr\pdffeedback lastobj\relax} - \fi - \ifnum\pdftexversion<140 \else % pdftex 1.40, including textmatrix patch, - \microtypesetup{expansion=alltext,step=1} % hence we can activate expansion ... - \tolerance=300 % ... and make TeX almost as intolerant as it normally is - \g@addto@macro\macrocode{\microtypesetup{expansion=false}} - \pdfminorversion=5 % for the OCGs (default since TeX Live 2010) - \fi + \microtypesetup{expansion=alltext} % with activated expansion ... + \tolerance=300 % ... we can make TeX almost as intolerant as it normally is + \g@addto@macro\macrocode{\microtypesetup{expansion=false}} % bonus material \InputIfFileExists{microtype-logo.dtx}\relax\relax \InputIfFileExists{microtype-lssample.dtx}\relax\relax @@ -179,6 +174,7 @@ \definecolor{theframe} {gray}{0.75} \definecolor{theshade} {gray}{0.94} \usepackage{graphicx} +\usepackage{etoolbox} % general layout \frenchspacing \DeclareRobustCommand\textoractual[2]{\ifpdf @@ -196,7 +192,7 @@ \setlength\textheight{49\baselineskip} \else \let\bfdefault\bfdefault@previous % undo mathdesign's \def\bfdefault{b} - \def\Module#1{{\color{theblue}\textoractual{$\langle$}{<}\textit{#1}\textoractual{$\rangle$}{>}}} + \def\Module#1{{\color{theblue}\textoractual{$\langle$}{<}\texttt{\itshape#1}\textoractual{$\rangle$}{>}}} \DeclareRobustCommand\TeX{\textoractual{T\kern-.1em\lower.4ex\hbox{E}\kern-.075emX\@}{TeX}} \DeclareRobustCommand\LaTeX{\textoractual{L\kern-.26em{\sbox\z@ T\vbox to\ht\z@{% \hbox{\check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont A}% @@ -212,32 +208,24 @@ \addtolength\textheight{\topskip} \setlength\topmargin{5pt} % sections -%\def\@seccntformat#1{\setbox0\hbox to0pt{\hss\colorbox{theshade}{\space\color{sectioning}\csname the#1\endcsname\strut\space}\hskip\marginparsep}\ht0=0pt \dp0=0pt \box0} \def\@seccntformat#1{\llap{\csname the#1\endcsname\hskip\marginparsep}} -\def\section{\@startsection {section}{1}{\z@}% - {-3.5ex \@plus -1ex \@minus -.2ex}% - {2.3ex \@plus.2ex}% - {\normalfont\Large\ifcmr\fontseries{bx}\else\fontseries{eb}\fi\sffamily\color{sectioning}}} -\def\subsection{\@startsection{subsection}{2}{\z@}% - {-3.25ex\@plus -1ex \@minus -.2ex}% - {1.5ex \@plus .2ex}% - {\normalfont\large\ifcmr\fontseries{bx}\else\fontseries{eb}\fi\sffamily\color{sectioning}}} -\def\subsubsection{\@startsection{subsubsection}{3}{\z@}% - {-3.25ex\@plus -1ex \@minus -.2ex}% - {1.5ex \@plus .2ex}% - {\normalfont\normalsize\ifcmr\fontseries{bx}\else\fontseries{eb}\fi\sffamily\color{sectioning}}} +\def\MTsectionfont{\ifcmr\fontseries{bx}\else\fontseries{eb}\fi\sffamily\color{sectioning}} +\patchcmd\section {\bfseries}{\MTsectionfont}\relax\relax +\patchcmd\subsection {\bfseries}{\MTsectionfont}\relax\relax +\patchcmd\subsubsection{\bfseries}{\MTsectionfont}\relax\relax \def\paragraph{\@startsection{paragraph}{4}% {0pt}{8pt plus 2pt minus 1pt}{-1em}% {\normalfont\normalsize\itshape}} % title \def\@maketitle{% \newpage\null\vskip 2em - \begin{center}\let\footnote\thanks\sffamily - {\huge \@title\par}\vskip 1.5em - {\large \parbox{.33\textwidth}{\centering\@author}% - \parbox{.33\textwidth}{\centering\@date}}% - \vskip2.5em\rule{\textwidth}{.4pt}% - \end{center}\par\vskip1.5em} + \begin{center}\sffamily + {\huge \@title\par\vskip 1.5em}% + {\large\hspace{4.5em}\parbox{.33\textwidth}{\@author}% + \parbox{.33\textwidth}{\@date}\par\vskip 1em + \textls*[-20]{\url{\githuburl}}}% + \vskip 2.5em\rule{\textwidth}{.4pt}% + \end{center}\par\vskip 1.5em} \def\abstractname{} % headers \headheight=15pt @@ -255,24 +243,17 @@ % toc \let\l@section@\l@section \def\l@section{\vskip -1.25ex\l@section@} -\def\l@subsection{\vskip.35ex \penalty\@secpenalty \@dottedtocline{2}{1.5em}{2.7em}} +\def\l@subsection{\vskip.35ex \penalty\@secpenalty \@dottedtocline{2}{1.5em}{2.2em}} \def\l@subsubsection#1#2{% - \leftskip 4.2em + \leftskip 3.7em \rightskip 2em plus 2em \parindent 0pt {\let\numberline\@gobble{\small #1~[#2]}}} \def\l@table{\@dottedtocline{1}{0pt}{1.5em}} \def\@pnumwidth{1.7em} -\ifpdf - \let\ORIGpdfoutline\pdfoutline - \def\special@outlines{attr{/F 01}} - \def\normaloutline {\protected@write\@outlinefile{}{\let\pdfoutline \ORIGpdfoutline}} - \def\specialoutline{\protected@write\@outlinefile{}{\def\pdfoutline{\ORIGpdfoutline\special@outlines}}} - \g@addto@macro\appendix{\specialoutline} -\fi \def\defspecial@toc#1#2#3{\long\def#1{% - \ifpdf\phantomsection\specialoutline\pdfbookmark[1]{#2}{#3}\normaloutline\fi - \section*{#2}\@mkboth{\textls*[70]{\MakeUppercase{#2}}}{}% + \ifpdf\phantomsection\bookmarksetupnext{italic}\pdfbookmark[1]{#2}{#3}\fi + \section*{#2}\@mkboth{\textls*[70]{\MakeUppercase{\contentsname}}}{}% \@starttoc{#3}}} \defspecial@toc\tableofcontents\contentsname{toc} \defspecial@toc\listoftables\listtablename{lot} @@ -280,19 +261,19 @@ \def\@cite#1#2{#1\if@tempswa, #2\fi} \def\thebibliography#1{% \section{\refname}% - \list{}{\leftmargin 0pt}% - \sloppy + \list{}{\leftmargin 0pt}% \sloppy \clubpenalty 4000 \@clubpenalty \clubpenalty \widowpenalty 4000} \def\@biblabel#1{} % footnotes +\def\@makefnmark{\raisebox{0.3ex}{\sffamily\footnotesize\,\@thefnmark}} \long\def\@makefntext#1{% \leftskip 0pt \parindent 0pt \everypar{\parindent 0pt}% - \leavevmode\llap{\@thefnmark\hskip\marginparsep}#1} -\renewcommand\footnoterule{% + \leavevmode\llap{\sffamily\@thefnmark\hskip\marginparsep}#1} +\def\footnoterule{% \kern-3\p@ \hrule\@width \columnwidth \kern2.6\p@} @@ -340,8 +321,7 @@ \setlength\fboxsep{3pt} \setlength\arrayrulewidth{0.4pt} % tables -\def\topfraction{1} -\def\textfraction{0} +\usepackage{tabularx} \setlength\tabcolsep{2pt} \newbox\mt@box \newdimen\mt@unvdimen @@ -357,19 +337,27 @@ \vskip-\mt@unvdimen} % index and change log \IndexPrologue{\section{Index}% - Numbers in upright shape refer to the page where the corresponding entry is described - (bold face) resp. occurs. Numbers in italics refer to the code line - where the corresponding entry is defined (underlined) resp. used.} -\GlossaryPrologue{\section{Change history}\label{sec:changes}\vspace*{-\multicolsep}} + \ifcodedoc + Numbers in upright shape refer to the \textit{page} where the corresponding entry + is described (bold face) resp. occurs. + Numbers in italics refer to the \textit{code line} where the corresponding entry + is defined (underlined) resp. used. + Numbers prefixed with `U' refer to the User manual. + \fi +} +\GlossaryPrologue{\section{Change history}\label{sec:changes}% + \ifcodedoc \PrintHistory \par\medskip\noindent + Numbers prefixed with `U' refer to the User manual.\fi + \vspace*{-\multicolsep}} %\setcounter{finalcolumnbadness}{100} %\raggedcolumns \setcounter{IndexColumns}{2} \def\IndexMin{12\baselineskip} \g@addto@macro\IndexParms{% - \footnotesize + \ifcodedoc\footnotesize\else\small\fi \def\indexspace#1{% \end{multicols} - \vspace*{-2\baselineskip}% + \vspace{-20pt}% \begin{multicols}{2} \ifpdf{\let\bfseries\empty\let\hfil\empty\phantomsection\pdfbookmark[2]{#1}{#1}}\fi \setbox0\hbox{\sffamily\hss#1}% @@ -392,11 +380,71 @@ \llap{\mdseries\color{thegrey}\footnotesize \csname MTversiondate##2\endcsname\hskip\marginparsep}% Version ##2\else ##2\fi}][6\baselineskip] + \label{sub:changes:##2}% \GlossaryParms \rightskip 15pt plus 5pt \let\item\@idxitem \ignorespaces \makeatletter \scan@allowedfalse}% \def\subitem{\par\hangindent 15pt}% \def\subsubitem{\subitem\hspace*{7.5pt}}} +% change history +% (lots of the following stolen from Tom Bombadil's answer: +% https://tex.stackexchange.com/a/61251/7674) +%<*!docsty> +\ifcodedoc +\usepackage{tikz,pgfcalendar} +\usetikzlibrary{calc} +\newcounter{MThistitem} +\def\MThistlastnode{n-0} +\pgfmathsetmacro{\MThistfirstyear}{2004} % v1.0 2004/09/11 +\pgfmathsetmacro{\MThistlastyear}{\year} +\pgfmathsetmacro{\MThistyears}{\MThistlastyear-\MThistfirstyear} +\pgfmathsetmacro{\MThistvsep}{1.75} +\pgfmathsetmacro{\MThisthshift}{3} +\pgfmathsetmacro{\MThistnodewidth}{3mm} +\def\MThistprepare{% + \pgfmathsetmacro{\MThistnodesep}{(\textwidth+\MThisthshift cm-\MThistnodewidth-1pt)/\theMThistitem} + \setcounter{MThistitem}{0} + \node[inner sep=0pt] (n-0) at (-\MThisthshift,\MThistvsep) {}; } +\let\MThistshow\@empty +\def\MThist@versiondate#1#2{% count items and reverse order + \gpreto\MThistshow{\MT@doversion{#1}{#2}} + \stepcounter{MThistitem}} +\def\MT@doversion#1#2{% + \stepcounter{MThistitem} + \node[right=\MThistnodesep,text width=\MThistnodewidth,inner sep=1pt,outer sep=0pt,fill=theshade,align=center] + (n-\theMThistitem) at (\MThistlastnode.west) {\hyperref[sub:changes:#1]{#1\strut}}; + \draw (n-\theMThistitem.north west) -- (n-\theMThistitem.north east); + \draw (n-\theMThistitem.south west) -- (n-\theMThistitem.south east); + \MThist@splitdate#2\relax + \pgfcalendardatetojulian{\MTYear-\MTMonth-\MTDay}{\@tempcnta} + \pgfcalendardatetojulian{\MTYear-1-1}{\@tempcntb} + \advance\@tempcnta-\@tempcntb + \pgfmathsetmacro{\MTDate}{\MTYear-\MThistfirstyear+\@tempcnta/365} + \expandafter\edef\csname MThistnodetime\theMThistitem\endcsname{\MTDate} + \edef\MThistlastnode{n-\theMThistitem}} +\def\MThist@splitdate#1/#2/#3\relax{\def\MTYear{#1}\def\MTMonth{#2}\def\MTDay{#3}} +\def\MThisttimeline{% + \draw[very thick,-latex] (0,0) -- ($(\MThistlastnode.east)-(0,\MThistvsep)+(1,0)$) ; + \path (n-\theMThistitem.east); \pgfgetlastxy{\MT@tempdim}{\@tempdima}; + \pgfmathsetmacro{\MThistxposition}{\MT@tempdim/28.452755} + \foreach \x in {1,...,\theMThistitem}{ + \pgfmathsetmacro{\MThisttimeposition}{\MThistxposition/(\MThistlastyear-\MThistfirstyear)*\csname MThistnodetime\x \endcsname} + \draw[rounded corners=2pt] (\MThisttimeposition,0) -- (\MThisttimeposition,0.5) -- ($(n-\x.south)-(0,0.5)$) -- (n-\x.south); } + \foreach \x in {0,...,\MThistyears}{ + \pgfmathsetmacro{\MThistlabelposition}{\MThistxposition/(\MThistlastyear-\MThistfirstyear)*\x} + \node[below] (label-\x) at (\MThistlabelposition,-0.2) {\number\numexpr\MThistfirstyear+\x}; + \draw (label-\x.north) -- ++ (0,0.2); }} +\def\PrintHistory{% + \InputIfFileExists{microtype-hist.tmp}{\let\VersionDate\MThist@versiondate\@firstofone}\@gobble + {\hypersetup{linkcolor=thered}% + \hspace{-\MThisthshift cm}% + \rlap{\begin{tikzpicture}[color=thegrey,font=\fontsize{4.5}{6}\selectfont] + \MThistprepare + \MThistshow + \MThisttimeline + \end{tikzpicture}}}} +\fi +%</!docsty> % macro code \MacroTopsep=0pt \MacrocodeTopsep=3pt @@ -404,7 +452,7 @@ \def\theCodelineNo{\reset@font\sffamily\color{thegrey}\scriptsize \textoractual{\arabic{CodelineNo}\ }{}}% don't copy line numbers \def\MacroFont{\ttfamily\small} -\def\AltMacroFont{\ttfamily\footnotesize} +\setcounter{StandardModuleDepth}{99} \def\PrintMacroName#1{\strut\MacroFont\string #1\hskip15pt} \def\ImplementationSettings{% \linespread{1}% @@ -423,7 +471,7 @@ \begingroup\MakePrivateLetters\Describe@Package} \def\Describe@Package#1{\endgroup \marginpar{\raggedleft\PrintDescribeOption{#1.sty}}% - \CatIndex{#1}{package}\@esphack\ignorespaces} + \CatMainIndex{#1}{package}\@esphack\ignorespaces} \def\DescribeValues#1#2{% \let\@tempa\@empty \let\Option@default\@empty \@for\@tempb:=#2\do{% @@ -452,18 +500,24 @@ \def\MaybeDefault#1{\textrm{*}\,#1} \def\OptionSep{{\rmfamily, }} \def\MacroSep{\,} \def\EnvironmentSep{\,} \def\PrintValues[#1]{{\MacroFont\expandafter\@gobble\@tempa\hfill #1}\\*[.25\baselineskip]} -\def\CatIndex#1#2{\index{#1\actualchar{\protect\ttfamily #1} (#2)\encapchar hyperpage}} -\def\CatIndeX#1#2#3{\index{#2\actualchar#1\ (#3)\encapchar hyperpage}} +\def\CatIndex#1#2{\index{#1\actualchar{\protect\ttfamily #1} (#2)\encapchar \ifcodedoc\else doc\fi hyperpage}} +\def\CatIndeX#1#2#3{\index{#2\actualchar#1\ (#3)\encapchar \ifcodedoc\else doc\fi hyperpage}} +\def\CatMainIndex#1#2{\index{#1\actualchar{\protect\ttfamily #1} (#2)\encapchar docmain}} \def\SpecialOptionIndex#1{\@bsphack \index{\quotechar/#1% sort options as `Symbols' - \actualchar{\protect\ttfamily#1}\encapchar usage}% - \CatIndex{#1}{option}\@esphack} + \actualchar{\protect\ttfamily#1}\encapchar docmain}% + \CatMainIndex{#1}{option}\@esphack} \def\SpecialUsageIndex#1{\@bsphack \index{\quotechar1% sort commands as `Numbers' \actualchar\string\verb - \quotechar*\verbatimchar\string#1\verbatimchar\encapchar usage}% - {\let\special@index\index\SpecialIndex@{#1}{\encapchar usage}}\@esphack} -\def\SpecialEnvIndex#1{\CatIndex{#1}{environment}} + \quotechar*\verbatimchar\string#1\verbatimchar\encapchar docmain}% + {\let\special@index\index\SpecialIndex@{#1}{\encapchar docmain}}\@esphack} +\def\SpecialEnvIndex#1{\CatMainIndex{#1}{environment}} +\def\cmd#1{\orig@cs{\expandafter\cmd@to@cs\string#1}} +\DeclareRobustCommand\orig@cs[1]{\texttt{\char`\\#1}} +\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}% + {\let\special@index\index + \expandafter\SpecialIndex@\expandafter{\csname#1\endcsname}{\encapchar \ifcodedoc\else doc\fi hyperpage}}} %</driver|docsty> % microtype's index style (microtype-gind.ist): %<docist>actual '=' @@ -500,14 +554,8 @@ \fcolorbox{theframe}{white}{\mdseries\small\strut\color{sectioning}% \,\expandafter\@gobble\@tempa\,}}} % ... and whistles -{\catcode`\"\active - \gdef\verbatim#1 - {\catcode`\"\active \def"##1"{\colorbox{theshade}{% - \textrm{Text lost! Please install the \pkg{listings} package.}}}% - \@beginparpenalty\predisplaypenalty\@verbatim\MacroFont - \frenchspacing\@vobeyspaces\expandafter\@xverbatim\@gobble}} \usepackage{listings} -\lstset{ +\lstdefinestyle{microtype}{ gobble=1,columns=flexible,keepspaces,upquote,escapechar=", basicstyle=\MacroFont, keywords=[0]{\microtypesetup,\DeclareMicrotypeSet,\UseMicrotypeSet, @@ -515,12 +563,12 @@ \SetExtraKerning,\SetExtraSpacing,\DisableLigatures,\DeclareCharacterInheritance, \DeclareMicrotypeVariants,\DeclareMicrotypeAlias,\DeclareMicrotypeBabelHook, \LoadMicrotypeFile,\microtypecontext,\textmicrotypecontext, - \textls,\lsstyle,\lslig,\Microtype@Hook}, + \textls,\lsstyle,\lslig,\leftprotrusion,\rightprotrusion,\Microtype@Hook}, keywordstyle=[0]\color{thegreen}, - keywords=[1]{protrusion,expansion,activate,DVIoutput,draft,final,verbose, + keywords=[1]{protrusion,expansion,activate,DVIoutput,disable,verbose, config,factor,auto,stretch,shrink,step,selected,unit,tracking,kerning, - spacing,letterspace,babel,context, - %defersetup,copyfonts,enable,disable,% undocumented + spacing,letterspace,babel,context,patch,nopatch, + %defersetup,copyfonts,deactivate,reactivate,% undocumented noligatures,outerspacing,outerkerning}, % there are three \nobreakspace in this line keywordstyle=[1]\color{thered}, comment=[l]\%, @@ -529,81 +577,92 @@ frame=single,backgroundcolor=\color{theshade},rulecolor=\color{theframe}, framerule=\fboxrule,xleftmargin=3.4pt,xrightmargin=3.4pt,belowskip=\smallskipamount } +\lstset{style=microtype} +\lstdefinestyle{message}{deletekeywords={[1]{expansion,protrusion,auto}}, + belowskip=-\smallskipamount,frame=none,xleftmargin=0pt,backgroundcolor=, + basicstyle=\MacroFont\footnotesize,delim=[is][\itshape\color{thegreen}]{<}{>}} \let\verbatim\relax \lstnewenvironment{verbatim}[1][]{\lstset{#1}}{} -\ifpdf - \font\dummyspace=dummy-space - \pdfglyphtounicode{space}{0020} - \def\lst@outputspace{% copy spaces (from a font that really has a space at x20) - \setbox0\hbox{ }\@tempdima\wd0 - \setbox0\hbox{\dummyspace\char"20}\advance\@tempdima-\wd0 - \unhbox0 \kern\@tempdima} -\fi \def\todo#1{\changes{zTo Do}{0000/00/00}{#1}% - \marginpar{\rightskip2\marginparsep plus1em\hangindent1.5em\hangafter-2 - \smash{\rlap{\raisebox{-3.3ex}{\colorbox{thered}{\Large\color{white}!}}}}% + \marginpar{\rightskip2\marginparsep plus1em \hangindent1.5em \hangafter-2 + \smash{\llap{\raisebox{-1.4ex}{\colorbox{thered}{\Large\color{white}!} }}}% \footnotesize\textcolor{thered}{#1}}} \let\todo\@gobble -\newcommand\microtypesample[1]{\begin{quote}#1\end{quote}} -\let\emptypdfpageresources\relax % fancy PDF document \ifpdf - \ifx\eTeXversion\@undefined \else % errors when not using etex (conflict with multicol) - \ifnum\pdftexversion < 140 % no longer required with pdftex 1.40 - \usepackage{pdfcolmk} - \fi\fi - \usepackage[bookmarks,bookmarksopen,pdfdisplaydoctitle, + \usepackage{xr-hyper} + \usepackage[bookmarks,pdfdisplaydoctitle, colorlinks,linkcolor=theblue,citecolor=theblue,urlcolor=thered, hyperindex=false,hyperfootnotes=false] {hyperref} + \usepackage[atend]{bookmark} +%<*!docsty> + \BookmarkAtEnd{% + \bookmark[startatroot,level=0,bold,gotor={microtype\ifcodedoc\else-code\fi.pdf}] + {\ifcodedoc User manual\else Implementation\fi}} +%</!docsty> + \externaldocument{microtype\ifcodedoc\else-code\fi} \PassOptionsToPackage{nodvi}{totpages} % remove annoying log output - \usepackage{hyperxmp} % (hyperxmp loads totpages) + \usepackage{hyperxmp} % (hyperxmp loads totpages) \usepackage{attachfile} \usepackage{pdfpages} \hypersetup{ keeppdfinfo, - pdftitle={The microtype package}, + pdftitle={The microtype package\ifcodedoc\space-- Implementation\fi}, pdfauthor={R Schlicht <w.m.l@gmx.net>}, pdfsubject={Subliminal refinements towards typographical perfection}, pdfkeywords={TeX, LaTeX, pdfTeX, LuaTeX, XeTeX, typography, micro-typography, character protrusion, margin kerning, optical alignment, font expansion, font scaling, hz, kerning, spacing, glue, letterspacing, tracking, ligatures}, - pdfcopyright={\textcopyright\ 2004--2021 R Schlicht\012% + pdfcopyright={\textcopyright\ 2004--2021 R Schlicht\textLF This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this - license or (at your option) any later version.\012% - This work has the LPPL maintenance status `author-maintained'.}, - pdflicenseurl={http://www.latex-project.org/lppl/} + license or (at your option) any later version.\textLF + This work has the LPPL maintenance status `maintained'.}, + pdflicenseurl={http://www.latex-project.org/lppl/}, + pdflang={en-GB} } - \pdfcatalog{/Lang(en-GB)} - \ifnum\pdftexversion < 130 \else - \usepackage{hypdestopt}\fi - \def\usage#1{\textbf{\hyperpage{#1}}}% for indexing of \DescribeMacro ... - \def\changes@#1#2#3{% ... the changes ... + % we no longer use {hypdestopt}, as it would break the external references + \def\changes@#1#2#3{% recording the changes ... \protected@edef\@tempa{\noexpand\glossary{#1\levelchar \ifx\saved@macroname\@empty \space\actualchar\generalname \else\expandafter\@gobble\saved@macroname\actualchar \string\verb\quotechar*\verbatimchar\saved@macroname\verbatimchar\fi - :\levelchar #3\encapchar hyperpage}}% + :\levelchar #3\encapchar \ifcodedoc\else doc\fi hyperpage}}% \@tempa\endgroup\@esphack} - \def\theCodelineNo{% ... and everything else + \def\MTrmn#1{\ifrmnum{#1}{\rmntonum{#1}}{#1}} + % remove double entries (\dochyperpage followed by \docmain) + \def\dochyperpage#1{\def\MT@curr@index{#1}\@ifnextchar,\dochyperpage@{\doc@hyperpage{#1}}} + \def\dochyperpage@,{\@ifnextchar\docmain\dochyperpage@@\dochyperpage@x} + \def\dochyperpage@@\docmain#1{\MT@ifstreq{#1}{\MT@curr@index}\relax\dochyperpage@x\docmain{#1}} + \def\dochyperpage@x{\expandafter\doc@hyperpage\expandafter{\MT@curr@index}, } + % indexing user doc ... + \ifcodedoc + \def\doc@hyperpage#1{\href[page={\MTrmn{#1}}]{microtype.pdf}{U\MTrmn{#1}}} + \def\docmain#1{\href[page={\MTrmn{#1}}]{microtype.pdf}{\textbf{U\MTrmn{#1}}}} + \def\main#1{\underline{\itshape\hyperlink{L:#1}{#1}}} + \def\SpecialIndex#1{\@bsphack\special@index{% + \expandafter\@gobble\string#1\actualchar + \string\verb\quotechar*\verbatimchar\string#1\verbatimchar + \encapchar codeline}\@esphack} + \else + % write references to the User manual intermediarily in roman numerals + % in order to separate them from those in the Implementation part + \def\@wrindex#1{\protected@write\@indexfile{\let\@roman\relax}{\string\indexentry{#1}{\@roman\thepage}}\endgroup\@esphack} + \def\HyInd@pagelink#1{\begingroup\toks@={}\edef\x{\MTrmn{#1} }\expandafter\HyInd@removespaces\x\@nil\endgroup} + \def\docmain#1{\textbf{\hyperpage{#1}}} + \let\doc@hyperpage\hyperpage + \fi + \def\theCodelineNo{% ... and implementation \reset@font\sffamily\color{thegrey}\scriptsize \@tempcnta\arabic{CodelineNo}\advance\@tempcnta by\@ne \hypertarget{L:\number\@tempcnta} {\textoractual{\arabic{CodelineNo}\ }{}}}% don't copy line numbers - \def\main#1{\underline{\itshape\hyperlink{L:#1}{#1}}} \def\codeline#1{{\itshape\link@sanitize#1-\@nil{#1}}} \def\link@sanitize#1-#2\@nil{\link@@sanitize#1,\@nil} \def\link@@sanitize#1,#2\@nil{\hyperlink{L:#1}} - \def\SpecialIndex#1{\@bsphack\special@index{\expandafter\@gobble - \string#1\actualchar - \string\verb\quotechar*\verbatimchar\string#1\verbatimchar - \encapchar codeline}% - \@esphack} - \def\ctanurl#1{Available from \acronym{CTAN} at - \href{http://mirror.ctan.org/#1}{\nolinkurl{/#1}}} - \def\ctanpkgurl#1{Available from \acronym{CTAN} at - \href{https://www.ctan.org/pkg/#1}{\nolinkurl{pkg/#1}}} + \def\ctanurl#1{Available from \acronym{CTAN} at \href{http://mirror.ctan.org/#1}{\nolinkurl{/#1}}} + \def\ctanpkgurl#1{Available from \acronym{CTAN} at \href{https://www.ctan.org/pkg/#1}{\nolinkurl{pkg/#1}}} \DeclareRobustCommand\mailto[1]{\href{mailto:#1}{\nolinkurl{#1}}} \def\mailtoRS{\href % some PDF viewers don't like spaces: {mailto:Robert\%20Schlicht\%3cw.m.l@gmx.net\%3e?subject=[microtype\%20\fileversion]} @@ -654,7 +713,7 @@ /A << /S/SetOCGState /State[/Toggle \csname mt@#1@true\endcsname \csname mt@#1@false\endcsname] >>} #1 \hfill\pdfendlink & \mt@layer{#1true}{\rlap{on}}\mt@layer{#1false}{off}} - \renewcommand\microtypesample[1]{% + \long\def\microtypesample#1{% \begingroup \leftskip 15pt \rightskip 15pt \parskip 4pt \parindent 0pt @@ -689,20 +748,31 @@ \endgroup \edef\x{\pdfpageresources{/Properties <<\mt@resources>>}}\x} \def\emptypdfpageresources{\pdfpageresources{}} + \font\dummyspace=dummy-space + \pdfglyphtounicode{space}{0020} + \def\lst@outputspace{% copy spaces (from a font that really has a space at x20) + \setbox0\hbox{ }\@tempdima\wd0 + \setbox0\hbox{\dummyspace\char"20}\advance\@tempdima-\wd0 + \unhbox0 \kern\@tempdima} \fi \else - \usepackage{url} + \usepackage{url,xr} + \externaldocument{microtype\ifcodedoc\else-code\fi} \newcommand\hyperref[2][]{#2} \let\hyperpage\@firstofone + \let\dochyperpage\@firstofone + \let\docmain\main \let\texorpdfstring\@firstoftwo \def\ctanurl{Available from \acronym{CTAN} at \url} \let\ctanpkgurl\ctanurl \let\nolinkurl\url \let\mailto\texttt \def\mailtoRS{\mailto{w.m.l@gmx.net}} - \let\href\texttt + \let\href\@gobble \newcommand\textattachfile[3][]{#3 \textit{[File \file{#2} not attached, because \file{microtype.dtx} hasn't been compiled with \pdftex.]}} + \long\def\microtypesample#1{\begin{quote}#1\end{quote}} + \let\emptypdfpageresources\relax \fi \ifx\l@ukenglish\@undefined \hyphenation{let-ter-spac-ing let-ter-spaced let-ter-space} @@ -731,6 +801,7 @@ \DeclareRobustCommand\xetex{\xe\kern-.1em\TeX\CatIndeX{\xe\TeX}{xetex}{engine}} \DeclareRobustCommand\texlive{\TeX~Live\CatIndeX{\TeX~Live}{TeXLive}{distribution}} \DeclareRobustCommand\miktex{MiK\TeX\CatIndeX{MiK\TeX}{MiKTeX}{distribution}} +\def\githuburl{https://github.com/schlcht/microtype} \def\microtype{{\PackageFont microtype}} \def\letterspace{\pkg{letterspace}} \def\fontdim{\cmd\fontdimen\,} @@ -747,19 +818,31 @@ \AtBeginDocument{\catcode`\<=\active \def<#1>{\acronym{#1}} \def\contributor#1 <#2\at#3>{\@contributor{#1}{#2@#3}}}} -\DeclareRobustCommand\@contributor[2]{\textit{#1}} +%\DeclareRobustCommand\@contributor[2]{\textit{#1}} %\DeclareRobustCommand\@contributor[2]{\href{mailto:#2}{\textit{#1}}} -%\DeclareRobustCommand\@contributor[2]{\textit{#1}% -% \expandafter\index\expandafter{\@getlastname#1 \@nil\actualchar %\href{mailto:#2}{#1} -% #1 (contributor)\encapchar hyperpage}} -%\def\@getlastname#1 #2\@nil{\ifx\@nil#2\@nil#1\else\@getlastname#2\@nil\fi} +\ifcodedoc \else + \newwrite\@contributorsfile + \immediate\openout\@contributorsfile=microtype.cdx +\fi +\DeclareRobustCommand\@contributor[2]{\textit{#1}% + {\ifcodedoc\else\let\@indexfile\@contributorsfile\fi + \expandafter\index\expandafter{\@getlastname#1 \@nil\actualchar %\href{mailto:#2}{#1} + \textit{#1} (contributor)\encapchar \ifcodedoc\else doc\fi hyperpage}}} +\def\@getlastname#1 #2\@nil{\ifx\@nil#2\@nil#1\else\@getlastname#2\@nil\fi} %<*driver> \CodelineIndex \EnableCrossrefs \RecordChanges -%\OnlyDescription +\ifcodedoc + \let\printlogo\undefined + \InputIfFileExists{microtype-hist.tmp} + {\def\VersionDate##1##2{\global\expandafter\def\csname MTversiondate##1\endcsname{##2}}} + \relax +\else + \OnlyDescription +\fi \begin{document} - \DocInput{\jobname.dtx} + \DocInput{microtype.dtx} \end{document} %</driver> %</driver|docsty> @@ -767,18 +850,24 @@ % % ^^A ------------------------------------------------------------------------- %\GeneralChanges* +%\ifcodedoc\else %\changes{v1.0}{2004/09/11}{Initial version} %\changes{v2.0}{2006/12/29}{new package \letterspace: a stripped-down version, % containing the letterspacing commands only} +%\changes{v3.0}{2021/10/31}{move development to \href{\githuburl}{GitHub}} %\GeneralChanges{Documentation} %\changes{v1.9b}{2006/01/13}{activate expansion in the distributed <PDF>} %\changes{v2.2}{2007/04/01}{logo transparency and amusement} -% ^^A Adobe Reader 8.0 had serious bugs with transparency. Fixed in 8.1. +%\changes{v3.0}{2021/06/01}{\relax split up in User manual (\file{microtype.pdf}) +% and Implementation doc (\file{microtype-code.pdf})} +%\fi % -% \GetFileInfo{microtype.dtx} +% \GetFileInfo{\jobname.dtx} % \title{\ifx\printlogo\undefined\else\printlogo\fi -% \textls[40]{The \microtype\ package}\\[.3\baselineskip]\large -% Subliminal refinements towards typographical perfection} +% \textls[40]{The \microtype\ package}% +% \\[6pt]\large +% Subliminal refinements towards typographical perfection +% \ifcodedoc\\[9pt]{\Large--- \textls[60]{IMPLEMENTATION} ---}\fi}% % \author{R Schlicht\\\mailtoRS} % \date{\fileversion\\\filedate} % @@ -808,7 +897,7 @@ % % The alternative package \letterspace, which also works with plain \TeX, % provides the user commands for letterspacing only, omitting support for all -% other extensions (see section~\ref{sec:lettersp}). +% other extensions (see section~\ref{sec:lettersp}\ifcodedoc\space of the User manual\fi). % %\bigskip\noindent % This package is copyright \textcopyright\ 2004\kern.09em--2021 R Schlicht. @@ -816,18 +905,32 @@ % \IfFileExists{lppl.tex}{\hyperref[LPPL:LPPL]}{\href{http://www.latex-project.org/lppl/}} % {\LaTeX\ Project Public License}, % either version~1.3c of this license or (at your option) any later version. -% This work has the <LPPL> maintenance status `author-maintained'. +% This work has the <LPPL> maintenance status `maintained'. %\end{abstract} % % %\newpage %\emptypdfpageresources ^^A layers of the logo +% %{\sffamily\def\familydefault{\sfdefault}\ifcmr\else\DeclareFontSeriesDefault[sf]{bf}{sb}\fi % \tableofcontents % \listoftables +% \vskip2\baselineskip +% \Large\MTsectionfont +% \noindent +% \ifpdf +% \ifcodedoc +% \href{file:microtype.pdf}{User manual} +% \else +% \href{file:microtype-code.pdf}{Implementation} +% \fi +% \normalfont\normalsize (external document) +% \fi %} % % +%\ifcodedoc\else +% %\newpage %\section{Micro-typography with \TeX}\label{sec:micro-type} % @@ -912,7 +1015,7 @@ % influence the interword space. Also, the settings shipped with \microtype\ % are but a first approximation, and I~would highly welcome corrections and % improvements. I suggest reading the reasoning behind the settings in -% section~\ref{sub:conf-spacing}. +% the Implementation part, section~\ref{sub:conf-spacing}. % % The possibility, finally, to \emph{disable all or selected ligatures} is % particularly useful for typewriter fonts. @@ -948,7 +1051,7 @@ % \item Enable the desired micro-typographic features, either via the % respective package option or with the \cs{microtypesetup} command % (section~\ref{sec:options}). -% \item Select the fonts to which this feature should be applied by declaring +% \item Select the fonts to which the features should be applied by declaring % and activating `sets of fonts'. A number of sets are predefined, which may be % activated directly in the package options % (section~\ref{sec:font-sets}). @@ -960,6 +1063,8 @@ % \item You are even countenanced to leave the path of typographic virtue and % steal some sheep (section~\ref{sec:lettersp}) or trespass in other ways % (section~\ref{sec:disable-ligatures}). +% \item For the pedantic or the perfectionist, sections \ref{sec:pedantic} +% and \ref{sec:contrib} are warmly recommended. % \item Should you encounter any obstacles, follow the hints and caveats % (section~\ref{sec:caveats}). %\end{itemize} @@ -1080,7 +1185,7 @@ % \luatex ^^A we will have to re-model kerning and spacing with \luatex % & $\geq$ 0.30 & <DVI> & ! & ? & _ & _ & _ & _\\ % & & <PDF> & ! & ? & ! & _ & _ & _\\ -% & $\geq$ 0.62 & <DVI> & ! & _ & \hskip1em\llap{(}\textcolor{theblue}{$\boxtimes$})\textsuperscript{\itshape a} & ? & _ & _\\ +% & $\geq$ 0.62 & <DVI> & ! & _ & \hskip1em\llap{(}\textcolor{theblue}{$\boxtimes$})\raisebox{0.4ex}{\sffamily\itshape\footnotesize a} & ? & _ & _\\ % & & <PDF> & ! & _ & ! & ? & _ & _\\ %\cmidrule(r){1-3} % \let\textoractual\@firstoftwo ^^A why? @@ -1095,7 +1200,7 @@ % ? = not enabled\quad % _ = not available %\hfill -% \textit{a}\quad by means of variable tracking +% {\sffamily\itshape a}\quad by means of variable tracking %\vskip4pt %\end{minipage}^^A %}\kern-\dimexpr\fboxsep+\fboxrule\relax ^^A end \fcolorbox @@ -1129,8 +1234,16 @@ % more modest protrusion). % %\medskip +%\Describe{Option}{patch}{!all,none,:list of patches} +%\DescribeOption{nopatch} +% These options provide control over various patches meant to fix protrusion +% at margins other than the text block margins. +% They are described in detail in section~\ref{sec:pedantic}. +% +%\pagebreak ^^A layout +%\medskip %\Describe{Option}{unit}{!character,:dimension} -% This option is described in section~\ref{sub:protrusion}, apropos the command +% This option is described in section~\ref{sub:protrusion}, apropos of the command % \cs{SetProtrusion}. Use with care. % % @@ -1194,18 +1307,20 @@ % in case you are using a pre-1.40 \pdftex\ version, \opt{step} is by default % set to one fifth of the smaller value of \opt{stretch} and \opt{shrink}. % +%\enlargethispage{\baselineskip} ^^A layout %\medskip %\Describe{Option}{selected}{true,!false} % When applying font expansion, it is possible to restrict the expansion of some % characters that are more sensitive to deformation than others (\eg, the `O', % in contrast to the `I'). This is called \emph{selected expansion}, and its -% usage allows increasing the stretch and shrink limits (to, say, 30 instead +% use allows increasing the stretch and shrink limits (to, say, 30 instead % of 20); however, the gain is limited since at the same time the average % stretch variance will be decreased. Therefore, this option is by default % set to |false|, so that all characters will be expanded by the same amount. % See section~\ref{sub:expansion} for a more detailed discussion. % % +%\pagebreak ^^A layout %\subsection[Tracking] % {Tracking \requires{\pdftex~1.40,\luatex~0.62}} % \label{sub:options-tracking} @@ -1219,18 +1334,20 @@ % %\subsection{Miscellaneous options}\label{sub:options-misc} % -%\changes{v2.0}{2006/11/28}{add remark about `\opt{draft}' option disabling \microtype\ +%\changes{v2.0}{2006/11/28}{add remark about `\opt{disable}' (previously |draft|) option disabling \microtype\ % (noted by \contributor Michalis Miatidis <miatidis\at informatik.rwth-aachen.de>)} % ^^A private mail, 2006/11/26 -%\Describe{Option}{draft}{true,!false} -%\DescribeOption{final} -% If the \opt{draft} option is passed to the package, \emph{all -% micro-typographic extensions will be disabled}, which may lead to different -% line, and hence page, breaks. The \opt{draft} and \opt{final} options may -% also be inherited from the class options; of course, you can override them in -% the package options. E.g., if you are using the class option |draft| to -% show any overfull boxes, you should load \microtype\ with the |final| -% option. +%\changes{v3.0}{2021/09/28}{rename option |draft| option to \opt{disable} +% (insistently requested by \contributor Frank Mittelbach <frank.mittelbach\at latex-project.org>)} +% ^^A private mail, 2018/07/04 +%\Describe{Option}{disable}{true,!false,ifdraft} +% If the \opt{disable} option is passed to the package, all +% micro-typographic extensions will be disabled, which may lead to different +% line, and hence even page, breaks. This option replaces the |draft| option +% from previous versions, which could be inherited from the class options; +% to restore the previous behaviour, you may pass the value |ifdraft|: +% in this case, the \opt{disable} option will be set to |true| if and only if +% the document class has been loaded with the |draft| option. % %\medskip %\Describe{Option}{verbose}{true,!false,errors,silent} @@ -1266,7 +1383,7 @@ % instead, it is recommended to just call the respective program (|latex| resp. % |dvilualatex|). %\changes{v2.8}{2020/04/02}{declare \opt{DVIoutput} option deprecated} -% For \xetex, this option is not applicable. +% For \xetex, this option is not applicable.\looseness=-1 ^^A layout % %\iffalse %\changes{v1.5}{2004/12/15}{add note about \opt{DVIoutput} option} @@ -1322,6 +1439,8 @@ % |compatibility| or |nocompatibility|, and \key{tracking}, \key{kerning} and % \key{spacing} with the admissible values |true| or |false|. % Passing the name of a font set is not allowed. +% Additionally, it accepts the options \key{patch} and \key{nopatch} +% (see section~\ref{sec:pedantic}). % Using this command, you could for instance temporarily disable font expansion % by saying: %\begin{verbatim} @@ -1430,7 +1549,7 @@ %\fcolorbox{theframe}{white}{^^A %\begin{minipage}{\textwidth} %\def\arraystretch{1.2} -%\begin{tabular}{@{}L{65pt}L{80pt}*2{L{40pt}}L{43pt}L{67pt}@{}} +%\begin{tabular}{@{}L{65pt}L{82pt}*2{L{41pt}}L{43pt}L{62pt}@{}} % \footnotesize Set name % & \multicolumn{5}{l}{\footnotesize Font attributes}\\ %\cmidrule{2-6} @@ -1519,7 +1638,6 @@ %\usepackage[protrusion=allmath,tracking=smallcaps]{microtype} %\end{verbatim} % -%\ifcmr\else\pagebreak\fi ^^A layout %\medskip %\Describe{Macro}{\UseMicrotypeSet}{?features,set name} % This command activates a font set previously declared by \cs{DeclareMicrotypeSet}. @@ -1635,7 +1753,7 @@ % (since the value that comes last will take precedence). Font settings % will be loaded recursively. % The following options will affect all loaded lists, in other words, -% any options from the loaded lists will be ignored:\looseness=-1 ^^A layout +% any options from the loaded lists will be ignored: %\changes{v1.8}{2005/06/23}{add example for \texttt{factor} option} % \item[\key{factor}] This option can be used to influence all protrusion % factors of the list, overriding any global \opt{factor} setting (see @@ -1748,7 +1866,7 @@ % This method of employing contexts to temporarily apply different % expansion parameters only works with \pdftex\ version 1.40.4 or later,^^A % \footnote{For older versions, a dirty trick is laid out in -% section~\ref{sub:font-setup} on page~\pageref{exp-hack}.} +% the Implementation part, section~\ref{sub:font-setup}, page~\pageref{exp-hack}.} % or with \luatex. % Also note that both \pdftex\ and \luatex\ prohibit the use of fonts with different expansion % limits or steps (even of different fonts) within one paragraph, hence @@ -1866,7 +1984,7 @@ % As an %\else %\changes{v2.3}{2007/11/03}{add letterspacing illustration} -%\medskip\noindent +%\noindent % Since a picture is worth a thousand words, probably even more if, in our % case, it depicts a couple of letterspaced words, let's bring one to sum up % these somewhat confusing options. Suppose you had the following settings @@ -2097,10 +2215,11 @@ % list. Additionally, it accepts the \key{inputenc} key to set the input encoding % for this list. The font set can be declared in the usual way. The inheritance % lists are declared as pairs of \meta{base character}\,|=|\,\meta{list of -% inheriting characters}. Unless you are using a different encoding or a very -% peculiarly shaped font, there should be no need to change the default -% character inheritance settings. +% inheriting characters}. % +% With \pdftex, there should be no need to change the default +% character inheritance settings, unless you are using a different encoding or +% a very peculiarly shaped font. % The situation is different with \luatex\ and \xetex, however: the default % inheritance settings only contain those glyhps that can safely be assumed to % exist in any font; but since OpenType fonts may contain many more glyphs for @@ -2108,6 +2227,34 @@ % settings are necessary, which should be specified in the font's configuration % file (see next section). % +%\medskip\noindent +% Additionally, this command provides the possibility to have the desired +% protrusion amount calculated automatically based on the difference of character widths. +% If the base character is preceded with either `|(l)|', `|(r)|' or `|(lr)|', +% the characters in the list will not only inherit the protrusion of the base character, +% but will be additionally protruded by the result of +% |charwidth(|\meta{inheriting character}|)|$-$|charwidth|\allowbreak|(|\meta{base character}|)|: +% for `|(l)|' and `|(r)|', this amount will be added to the given protrusion on +% the respective side, for `|(lr)|' half of the amount will be added to both sides. +% So that, \eg, with +%\begin{verbatim} +%\DeclareCharacterInheritance +% { encoding = TU, family = {GFS Porson} } +% { (l)"\rlap{\sffamily H}" = {"\fontencoding{LGR}\sffamily\~>\textEta"}, +% (lr)I = {T} } +%\end{verbatim} +% the accent before the `H' would be fully protruded into the left margin, +% while the stem of the `T' would be aligned with that of the `I' if at either margin. +% This feature is especially useful for Greek typography, where capital letters +% at the beginning of a line should be placed as if they had no accent (the `H' in +% the example above). +% Base characters may have both unprefixed and prefixed inheritance lists; +% characters in the latter will be implicitly added to the corresponding unprefixed one. +% Inheriting characters may appear in both `|(l)|' and `|(r)|'-prefixed lists at the +% same time, whereas lists prefixed with `|(l)|' or `|(r)|' and those prefixed with +% `|(lr)|' are mutually exclusive. +% For all other features except protrusion, these prefixed lists will be ignored. +%\looseness=-1 ^^A layout % % %\subsection{Configuration files}\label{sub:config-file} @@ -2125,11 +2272,13 @@ % described in the current section~\ref{sec:fine-tuning}. These files will be % loaded automatically if you are actually using the respective fonts. % This package ships with configuration files for a number of font families. -% Table~\ref{tab:fonts} lists them all. +% They are listed in tables~\ref{tab:type1-fonts} (Type\,1 fonts) and +% \ref{tab:ot-fonts} (OpenType fonts). % %\begin{table}[t]\small %\changes{v1.6a}{2005/02/02}{add table of fonts with tailored protrusion settings} -%\caption{Fonts with tailored protrusion settings}\label{tab:fonts} +%\caption[Type\,1 fonts with tailored protrusion settings] +% {Type\,1 fonts with\\tailored protrusion settings}\label{tab:type1-fonts} %\setlength\fboxsep{4pt} %\leavevmode\kern-\dimexpr\fboxsep+\fboxrule\relax %\fcolorbox{theframe}{white}{^^A @@ -2140,20 +2289,20 @@ % \leftskip 1.2em % \parindent -1.2em % \everypar{\parindent -1.2em}% -% \leavevmode\hbox to 1.2em{\@thefnmark\hss}#1} +% \leavevmode\hbox to 1.2em{\sffamily\@thefnmark\hss}#1} %\let\footnoterule\relax -%\def\fnref#1{\textsuperscript{\itshape\ifpdf\ref*{#1}\else\ref{#1}\fi}} -%\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}*3l@{}} +%\def\thempfootnote{{\itshape\ifnum\c@mpfootnote=10 \global\advance\c@mpfootnote 1 \fi\@alph\c@mpfootnote}} +%\def\fnref#1{\raisebox{0.3ex}{\sffamily\itshape\footnotesize\,\ifpdf\ref*{#1}\else\ref{#1}\fi}} +%\begin{tabularx}{\textwidth}{@{\extracolsep{\fill}}>{\leftprotrusion}Xll@{}} % \footnotesize Font family (<NFSS> code) % & \multicolumn{2}{l}{\footnotesize Features}\\ -%\cmidrule{1-1}\cmidrule{2-3} -%\itshape\footnotesize Type 1 fonts +%\cmidrule(r){2-3} % & \footnotesize Encodings % & \footnotesize Shapes\\ -%\cmidrule{1-1}\cmidrule{2-2}\cmidrule{3-3} +%\cmidrule(r){1-1}\cmidrule(r){2-2}\cmidrule(r){3-3} % Generic -% & <OT1>, <T1>, <T2A>, <LY1>, <QX>, (<TS1>)\footnote{Incomplete\label{fn:incmpl}} -% & n, (it, sl, sc)\fnref{fn:incmpl} \\ +% & <OT1>, <T1>, <T2A>, <LY1>, <QX>, (<TS1>)\fnref{fn:t1-incmpl} +% & n, (it, sl, sc)\fnref{fn:t1-incmpl} \\ % Computer Modern Roman (|cmr|)\footnote{Aliases: Latin Modern Roman (|lmr|), % \pkg{ae} (|aer|), \pkg{zefonts} (|zer|), % \pkg{eco} (|cmor|), \pkg{hfoldsty} (|hfor|), \pkg{mlmodern}~(|mlmr|)} @@ -2162,10 +2311,10 @@ % Bitstream Charter (|bch|)\footnote{Aliases: \pkg{mathdesign}/Charter (|mdbch|), % MicroPress's \pkg{chmath} (|chr|), \pkg{XCharter}} % & <OT1>, <T1>, <T5>, <LY1>, <TS1> -% & n, it, (sl)\footnote{Settings inherited from italic shape\label{fn:it-sl}}, sc \\ +% & n, it, (sl)\fnref{fn:t1-itsl}, sc \\ % <EB> Garamond\footnote{Alias: Adobe Garamond (|pad|, |padx|, |padj|)} % & <OT1>, <T1>, <LY1>, <TS1> -% & n, it, (sl)\fnref{fn:it-sl}, sc \\ +% & n, it, sc, si \\ % <URW> Garamond (|ugm|)\footnote{Aliases: \pkg{mathdesign}/<URW> Garamond (|mdugm|), \pkg{garamondx} (|zgmx|, |zgmj|)} % & <OT1>, <T1>, <TS1> % & n, it\\ @@ -2174,17 +2323,17 @@ % & n, it \\ % Adobe Minion (|pmnx|, |pmnj|) % & <OT1>, <T1>, <T2A>, <LY1>, <TS1> -% & n, it, (sl)\fnref{fn:it-sl}, sc, si\\ +% & n, it, (sl)\fnref{fn:t1-itsl}, sc, si\\ % Palatino (|ppl|, |pplx|, |pplj|)\footnote{Aliases: \pkg{pxfonts} (|pxr|), % \pkg{qfonts}/QuasiPalatino, \TeX\ Gyre Pagella (|qpl|), % \pkg{newpx}, <FPL> Neu (|fp9x|, |fp9j|), \pkg{domitian}} -% & <OT1>, <OT4>, <T1>, <LY1>, (<TS1>)\fnref{fn:incmpl} -% & n, it, (sl)\fnref{fn:it-sl}, sc \\ +% & <OT1>, <OT4>, <T1>, <LY1>, (<TS1>)\fnref{fn:t1-incmpl} +% & n, it, (sl)\fnref{fn:t1-itsl}, sc \\ % Times (|ptm|, |ptmx|, |ptmj|)\footnote{Aliases: \pkg{txfonts} (|txr|), % \pkg{qfonts}/QuasiTimes, \TeX\ Gyre Termes (|qtm|), % \pkg{newtx}, \pkg{tempora}, \pkg{step}, \pkg{stix}/\pkg{stix2}} -% & <OT1>, <OT4>, <T1>, <LY1>, <QX>, (<TS1>)\fnref{fn:incmpl} -% & n, it, (sl)\fnref{fn:it-sl}, sc \\ +% & <OT1>, <OT4>, <T1>, <LY1>, <QX>, (<TS1>)\fnref{fn:t1-incmpl} +% & n, it, (sl)\fnref{fn:t1-itsl}, sc \\ % Computer Modern math (|cmsy|, |cmm|)\footnote{Aliases: Latin Modern (|lmsy|, |lmm|), \pkg{mlmodern} (|mlmsy|, |mlmm|)} % & <OML>/<OMS> % & n/it \\ @@ -2196,31 +2345,60 @@ % & n\\ % Euro symbols (Adobe, <ITC>, \pkg{marvosym}) % & <U>/<OT1> -% & n, it \\ -%\cmidrule{1-1}\cmidrule{2-2}\cmidrule{3-3} -%\itshape\footnotesize OpenType fonts -% & \footnotesize Scripts -% & \footnotesize Shapes\\ -%\cmidrule{1-1}\cmidrule{2-2}\cmidrule{3-3} +% & n, it\phantom{^^A +% \footnote{Incomplete\label{fn:t1-incmpl}} +% \footnote{Settings inherited from italic shape\label{fn:t1-itsl}}} \\ +%\bottomrule +%\end{tabularx}^^A +%\end{minipage}^^A +%}\kern-\dimexpr\fboxsep+\fboxrule\relax ^^A end \fcolorbox +%\end{table} +% +%\begin{table}[t]\small +%\changes{v3.0}{2021/06/16}{split up table of fonts with tailored protrusion settings} +%\caption{OpenType fonts with tailored protrusion settings}\label{tab:ot-fonts} +%\setlength\fboxsep{4pt} +%\leavevmode\kern-\dimexpr\fboxsep+\fboxrule\relax +%\fcolorbox{theframe}{white}{^^A +%\begin{minipage}{\textwidth} +%\def\arraystretch{1.2} +%\long\def\@makefntext#1{% +% \raggedright +% \leftskip 1.2em +% \parindent -1.2em +% \everypar{\parindent -1.2em}% +% \leavevmode\hbox to 1.2em{\sffamily\@thefnmark\hss}#1} +%\let\footnoterule\relax +%\def\fnref#1{\raisebox{0.3ex}{\sffamily\itshape\footnotesize\,\ifpdf\ref*{#1}\else\ref{#1}\fi}} +%\begin{tabularx}{\textwidth}{@{\extracolsep{\fill}}>{\leftprotrusion}Xll@{}} +% \footnotesize Font family +% & \multicolumn{2}{l}{\footnotesize Features}\\ +%\cmidrule(r){2-3} +% & \rlap{\footnotesize Scripts}\hphantom{<OT1>, <OT4>, <T1>, <T2A>, <T5>, <LY1>, <TS1>} +% & \rlap{\footnotesize Shapes}\hphantom{n, it, (sl)\fnref{fn:t1-itsl}, sc, si}\\ +%\cmidrule(r){1-1}\cmidrule(r){2-2}\cmidrule(r){3-3} % Generic % & Latin -% & n, (it, sl, sc)\fnref{fn:incmpl} \\ -% Latin Modern Roman\footnote{Alias: New Computer Modern} +% & n, (it, sl, sc)\fnref{fn:ot-incmpl} \\ +% Latin Modern Roman +% & Latin +% & n, it, (sl)\fnref{fn:ot-itsl}\\ +% New Computer Modern % & Latin, Greek -% & n, it, (sl)\fnref{fn:it-sl}\\ +% & n, it, (sl)\fnref{fn:ot-itsl}\\ % Charis <SIL> -% & Latin, Cyrillic, Greek +% & Latin, Cyrillic % & n, it, sc\\ -%\iffalse ^^A provided with the EB Garamond package % <EB> Garamond % & Latin, Cyrillic, Greek % & n, it, sc, si\\ -%\fi % Palatino\footnote{Aliases: Palatino Linotype, Palatino <LT> Std, \TeX\ Gyre Pagella, Domitian} % & Latin -% & n, it, sc\\ +% & n, it, sc\phantom{^^A +% \footnote{Incomplete\label{fn:ot-incmpl}} +% \footnote{Settings inherited from italic shape\label{fn:ot-itsl}}} \\ %\bottomrule -%\end{tabular*}^^A +%\end{tabularx}^^A %\end{minipage}^^A %}\kern-\dimexpr\fboxsep+\fboxrule\relax ^^A end \fcolorbox %\end{table} @@ -2252,7 +2430,7 @@ %\DeclareMicrotypeAlias{lmr}{cmr} %\end{verbatim} % which would make the package, whenever it encounters the font |lmr| and does -% not find settings for it, also try the font |cmr|. In fact, you will find +% not find settings for it, also try the font name |cmr|. In fact, you will find % this very line, along with some others, in the default configuration file. % %\medskip @@ -2262,7 +2440,7 @@ % to extend settings defined in a file that would otherwise not be loaded % automatically, or would be loaded too late.\footnote{ % Font package authors might also want to have a look at the hook -% \cs{Microtype@Hook}, described in the implementation part, +% \cs{Microtype@Hook}, described in the Implementation part, % section~\ref{sub:hook}.} % This command will load the file `|mt-|\meta{font name}|.cfg|'. % @@ -2369,7 +2547,7 @@ % %\section[Letterspacing revisited] % {Letterspacing revisited \requires{\pdftex~1.40,\luatex~0.62}} -% \label{sec:lettersp} +% \label{sec:lettersp} ^^A [also referenced in microtype.ins] % %\Describe{Macro}{\textls}{?amount,general text} % While the \opt{tracking} feature, described in section~\ref{sub:tracking}, @@ -2399,11 +2577,11 @@ %\medskip %\Describe{Macro}{\lslig}{ligature} % Since the commands \cs{textls} and \cs{lsstyle} will also evaluate the -% `\texttt{no ligatures}' key for the respective font, you need not worry +% `\texttt{no ligatures}' key for the respective font, you usually need not worry % about protecting or breaking ligatures with most fonts. However, in certain % situations, there may be a conflict of ligatures beginning with the same -% letter, where some of them should be inhibited, while others should not. When -% letterspacing text typeset in Fraktur fonts, for example, the ligatures `ch', +% letter, where some of them should be inhibited, while others should not. For +% example, when letterspacing text typeset in Fraktur fonts, the ligatures `ch', % `ck', `tz' and `sz'~(`\textfrak{sz}') should never be broken up; you also usually % see the `st'~(`\textfrak{st}') ligature in letterspaced text. Furthermore, at % least the \pkg{yfonts} package realises the short~s~(`\textfrak{s:}') as the @@ -2417,7 +2595,7 @@ % (namely, `\textls{\def\!#1{\textcolor{thegreen}{\lslig{#1}}}^^A % \def\?#1{\textcolor{thered}{#1}}^^A % \textfrak{Au\!{s:}\?{si}\!{ch}t\!{s:}lo\?{si}gkeit}}', -% with ligatures shown in green, inhibited ligatures in red). +% with ligatures here shown in green, inhibited ligatures in red). % %\begin{verbatim}[morekeywords={[0]{\kern}}] %\SetTracking[noligatures={f}]{encoding = LY, family = yfrak}{120} @@ -2436,7 +2614,7 @@ % \microtype, omitting support for all the other extensions (and also omitting % the possibilities of the \cs{SetTracking} command -- all `|f|' ligatures will % be disabled, inner and outer spacing and outer kerning will be set to the -% default values described in section~\ref{sub:tracking}). If you prefer to +% default values described in section~\ref{sub:tracking}). If you would rather % forgo \microtype's specialties, you may load the \letterspace\ package % instead. Both packages should not be used at the same time. % @@ -2476,7 +2654,151 @@ % ^^A Otherwise, it won't work at all % % -%\section{Hints and caveats}\label{sec:caveats} +%\section{Being pedantic about protrusion}\label{sec:pedantic} +% +% Protrusion works well in running paragraphs, but may also be desirable +% in situations where \TeX, in contrast to human eyes, would not see a margin,^^A +% \footnote{Possibly because \TeX\ tends to look through its gastro-intestinal tract.} +% \eg, in |itemize| or |tabular| environments. +% The \microtype\ package offers two commands that may be inserted at +% such an effective inner margin to make the first respectively last glyph +% protrude as if it were located at a normal outer margin: +% +%\medskip +%\Describe{Macro}{\leftprotrusion}{general text} +% This command will add left protrusion for the following text. +% You may also just say \cs{leftprotrusion} (without an argument), and +% \microtype\ will gather the next glyph (possibly a ligature) before +% adding protrusion on its left hand side. +% For instance, you could add this command to tabular cell definitions +% (using the \pkg{array} package): +%\begin{verbatim} +%\begin{tabular}{l>{\leftprotrusion}p{9cm}r} +%\end{verbatim} +% in order to get protrusion at the beginning of the |p| cell. +% +%\medskip +%\Describe{Macro}{\rightprotrusion}{general text} +% will typeset \meta{general text} and then add protrusion on the right side. +% (Unfortunately, \TeX\ cannot look backwards at what it has already typeset, +% so this command requires that the text be given in the argument.) +% +%\medskip\noindent +%\DescribeMacro{\noprotrusion} +% is a command from \LaTeX\ proper, so it's just mentioned apropos. +% When added to the beginning or end of a line, protrusion at the respective +% margin will be prevented. +% +%\medskip\noindent +% The \microtype\ package defines a number of patches in order to get protrusion +% right (with dedicated patches for the classes and packages indicated in +% parentheses; they may still work with other classes or packages): +%\begingroup +%\list{}{\labelwidth=3em \itemindent\z@ \leftmargin=\labelwidth +% \def\makelabel#1{\hskip\labelsep\texttt{#1}\hss}} +%\def\MTsupp#1{\unskip\nobreak\hfil\penalty50 \hskip2em\hbox{}\nobreak\hfil +% {\smaller(#1)}\parfillskip=0pt \finalhyphendemerits=0 +%} +%^^A \microtypesetup{nopatch=item} +% \item[item] Affects the first line of \cmd\item\kern.6pts in various environments, so that, +% \eg, the two\break A's here -- the one in the current line and the one in the +% line above -- are neatly aligned; without the patch, the first A would be +% slightly shifted to the right. +% This patch also affects environments such as |quote| or |flushleft|, which are +% implemented in \LaTeX\ as lists with an implicit empty item. +% \MTsupp{standard classes, \pkg{beamer}, \pkg{simplecv}} +% \item[toc] Adds protrusion at the left margin of sectioning titles in the Table of Contents +% and similar Lists of \meta{Things}. +% \MTsupp{standard classes, \pkg{memoir}} +% \item[footnote] Protrusion for the first line of footnote text (only visible when +% the footnote text is set in block paragraphs, like in this document). +% \MTsupp{standard classes, \pkg{memoir}, <KOMA> classes} +% \item[eqnum] Protrusion for equation numbers on either side. +% \MTsupp{standard classes, \pkg{amsmath}} +%\endlist\endgroup +% +%\medskip\noindent +% By default, all of the above patches will be applied. Should this not be desired, +% or in case you are running into problems, you may prevent or undo the patches through +% the \textcolor{thered}{\opt{patch}} and \textcolor{thered}{\opt{nopatch}} options, +% either when loading the package: +%\begin{verbatim} +%\usepackage[nopatch=toc]{microtype} +%\end{verbatim} +% or, possibly temporarily, within the document: +%\begin{verbatim} +%\microtypesetup{nopatch=item} +%\end{verbatim} +% +%\medskip\noindent +%\leavevmode\llap{\itshape\color{thegrey}Help wanted!\hskip\marginparsep}^^A +%\leftprotrusion These pedantic protrusion patches are work-in-progress. I suspect many use cases +% where they either do not work as advertised, or worse, where they may even lead to errors. +% Also, I am aware that there are myriads of classes and packages out there that +% modify internal commands in their own ways, possibly rendering the patches useless. +% Finally, there will certainly be many more situations where protrusion would be appropriate. +% I would be happy to include more patches, or enhance the existing ones, +% so I welcome any suggestions and problem reports you may have. +% +% +%\section{Creating configurations and contributing}\label{sec:contrib} ^^A [also referencd in microtype.ins] +% +% I would also be glad to include configuration files for more fonts. Preparing such +% configurations is quite a time-consuming task and requires a lot of patience. +% To alleviate this process, \microtype\ includes the companion package +%\DescribePackage{microtype-show} +% \pkg{microtype-show}, which offers some tools to visually debug protrusion +% settings. It should not be used in production contexts. +% +%\medskip\noindent +%^^A don't index the commands from microtype-show as "Commands" +%{\def\SpecialUsageIndex#1{\let\special@index\index\SpecialIndex@{#1}{\encapchar dochyperpage}}^^A +%\DescribeMacro{\ShowCharacterInheritance} +% These commands show all defined inheritance resp. protrusion settings +% (the latter relative to character width, to \EM{1}, and as the effective kerning amount) +%\DescribeMacro{\ShowProtrusion} +% for the current font. They are most useful for consistency checks. +% +%\DescribeMacro{\ShowMissingGlyphstrue} +% If the boolean \cs{ifShowMissingGlyphs} is set to true, the glyphs \textit{not} +% included in the configuration will also be shown. Setting the switch +%\DescribeMacro{\ShowGlyphIndextrue} +% \cs{ifShowGlyphIndex} to true will additionally display the glyph (\pdftex) +%\DescribeMacro{\GlyphScaleFactor} +% respectively Unicode (\luatex) index number. Furthermore, you may alter the glyphs' +% display size by redefining \cs{GlyphScaleFactor} (default:~|2|). +% +%\medskip\noindent +%\DescribeMacro{\ShowProtrusionAll} +% When preparing the actual protrusion settings, these commands may prove helpful. +% Conveniently placing the glyphs at the margins, they show, respectively: +%\DescribeMacro{\ShowProtrusionDefined} +% all glyphs in the current font; only those with defined protrusion settings; +%\DescribeMacro{\ShowProtrusionMissing} +% or those without any protrusion settings. +% (Note that here, the protrusion amounts are given in 1000ths of \EM{1}, not in +% 1000ths of character widths). +%^^A +% The package also includes a test file that shows all of these commands in action +% (\file{test-microtype.tex}). +%} +% +%\medskip\noindent +% If you have created a configuration file for another font, or if you have any +% suggestions for enhancements in the default configuration files, I~would +% gratefully accept them: \mailtoRS. +%\iffalse\footnote{^^A ... OK, so nobody has any ... +% Should you have lots of \pkg{pdfcprot} configuration files lying around, +% I can also provide you with a \TeX\ conversion script. Just ask me.} +%\fi +% +%\medskip\noindent +% Development of the package takes place on GitHub, which also provides an +% issue tracker for submitting bug reports and feature requests: +% \url{\githuburl/issues}. +% +% +%\section{Hints and caveats}\label{sec:caveats} ^^A [also referenced in: \MT@warn@unknown@once] % %\paragraph{Use settings that match your font.} % Although the default settings should give reasonable results for most fonts, @@ -2484,8 +2806,8 @@ % shapes that necessitate more or less protrusion. In particular, % italic letter shapes may differ wildly in different fonts, hence I have % decided against providing default protrusion settings for them. -% The file \file{test-microtype.tex} might be of some help when adjusting the -% protrusion settings for a font. +% See the previous section for some tools for the preparation +% of protrusion settings. % %\paragraph{Don't use too large a value for expansion.} % Font expansion is a feature that is supposed to enhance the typographic @@ -2498,6 +2820,8 @@ % Multiple Master font, you may set expansion limits to up to 4\%. % %\changes{v2.0}{2006/12/13}{qualify hint about web documents with regard to older \pdftex\ versions} +%\changes{v3.0}{2021/05/25}{remove hint about web documents with pre-1.40 \pdftex\ (it's been 14 years~\dots)} +%\iffalse ^^A pdftex 1.40 was released in 2007 ... %\paragraph{Don't use font expansion for web documents (with older \pdftex\ versions).} % With \pdftex\ versions older than 1.40, each expanded instance of the font % will be embedded in the <PDF> file, hence the file size may increase by quite @@ -2506,10 +2830,14 @@ % creating files to be distributed electronically. With \pdftex\ 1.40 and \luatex, which % use a different technique of expansion, the increase of file size can be % neglected. +%\fi % %\changes{v2.2}{2007/07/06}{add hint about extra <TOC> leader dot % (first discovered by \contributor Morten H\o gholm <morten.hoegholm\at latex-project.org>)} % ^^A private mail, 2006/08/26 +%\changes{v3.0}{2021/05/15}{remove hint about extra <TOC> leader dot +% (fixed in \LaTeX)} +%\iffalse %\paragraph{You might want to disable protrusion in the Table of Contents.} % In unfortunate situations, enabled protrusion might internally alter the line % length in the <TOC> and similar lists in such a way that an excess leader dot @@ -2519,6 +2847,7 @@ %\tableofcontents %\microtypesetup{protrusion=true} %\end{verbatim} +%\fi % %\changes{v1.9}{2005/07/10}{add hint about \texttt{verbatim} environment} %\todo{option to patch \texttt{verbatim}?} ^^A for Karl @@ -2587,11 +2916,11 @@ %\changes{v2.7b}{2018/09/18}{update hint about non-7-bit characters % (notified by \contributor Frank Mittelbach <frank.mittelbach\at latex-project.org>)} % ^^A private mail, 2018/08/14 -% \item Even though all configuration files are still provided in legacy (7-bit) -% format, using multi-byte (Unicode) characters in the settings should run +% \item Even though most configuration files are still provided in legacy (7-bit) +% format, using multi-byte (Unicode) characters in the settings will run % smoothly with an up-to-date \LaTeX\ system. -% For older systems or documents in legacy encodings, in contrast, this requires -% loading the \pkg{inputenc} package first. +% For older systems or documents in legacy encodings, in contrast, +% the \pkg{inputenc} package must be loaded first. % Furthermore, when using multiple input encodings in a document, 8-bit characters in % the settings will only work reliably if you specify the |inputenc| key. %\changes{v2.3a}{2008/02/25}{add hint about \pkg{babel} having to be loaded first} @@ -2628,27 +2957,27 @@ %\end{itemize} % %\changes{v1.8}{2005/06/23}{add hint about error messages} -%\paragraph{Possible error messages and how to get rid of them (\textcolor{thegreen}{specs} may differ):} +%\paragraph{Possible warning and error messages and how to get rid of them +% (\textcolor{thegreen}{specs} may differ):} %\begin{itemize} -%\lstset{deletekeywords={[1]{expansion,auto}},belowskip=-\smallskipamount,frame=none, -% xleftmargin=0pt,backgroundcolor=,basicstyle=\MacroFont\footnotesize, -% delim=[is][\itshape\color{thegreen}]{<}{>}} -%\changes{v1.9a}{2005/11/15}{add explanation for error message in <DVI> mode} +%\lstset{style=message} % \item %\begin{verbatim} %! Font csnameendcsname=<cmr10+20 at 10.0pt> not loadable: Metric (TFM) file not found. %\end{verbatim} +%\changes{v1.9a}{2005/11/15}{add explanation for error message in <DVI> mode} % This error message will occur if you are trying to employ font expansion % while creating <DVI> output. Remember that \emph{automatic} font expansion % only works when running \pdftex\ or \luatex\ in <PDF> mode. Although expansion is also % possible in <DVI> mode with \pdftex, it requires that all instances of the expanded fonts % exist on your \TeX\ system. % -%\changes{v2.2}{2007/06/13}{add hint about error message with \pdftex\ 1.40} +%\pagebreak ^^A layout % \item %\begin{verbatim} %! pdfTeX error (font expansion): auto expansion is only possible with scalable fonts. %\end{verbatim} +%\changes{v2.2}{2007/06/13}{add hint about error message with \pdftex\ 1.40} % Automatic font expansion has been improved in \pdftex\ 1.40, in that it now % not only works with Type\,1 fonts but also with TrueType, OpenType and even % non-embedded fonts. The above error message indicates either that you are @@ -2656,12 +2985,35 @@ % possible, or that the font isn't found at all, \eg, because of missing map % entries. % -%\changes{v2.0}{2006/12/13}{qualify hints about expansion error messages with -% regard to older \pdftex\ versions} +% \item +%\begin{verbatim} +%Package microtype Warning: Unknown slot number of character +%(microtype) `<\k A>' +%(microtype) in font encoding `TU' in inheritance list +%(microtype) `microtype.cfg/406(protrusion)'. +%\end{verbatim} +%\changes{v3.0}{2021/06/26}{add hint about unknown slot numbers} +% If you receive lots of warnings like the above, and you are running \luatex\ +% or \xetex, this probably means that the font you are using contains less +% glyphs than are defined in the default protrusion and/or inheritance settings. +% For such fonts, the \microtype\ package defines basic inheritance settings +% to which you may alias your font (the generic protrusion settings will +% still be loaded). Try adding the line: +%\begin{verbatim}[style=microtype,belowskip=0pt] +%\DeclareMicrotypeAlias{"\rmfamily\meta{your font}"}{TU-basic} +%\end{verbatim} +% to the preamble. For symbol fonts, you may even use the alias |TU-empty|, +% which is, well, empty, meaning that no protrusion will be applied at all +% to this font. Note that these aliases are just meant to provide an easy way +% of getting rid of the warnings, while the proper solution would be to create +% inheritance and protrusion settings specific to the font in question. +% % \item %\begin{verbatim} %Warning: pdflatex: font <ptmr8r> cannot be expanded (not an included Type1 font) %\end{verbatim} +%\changes{v2.0}{2006/12/13}{qualify hints about expansion error messages with +% regard to older \pdftex\ versions} % and the <PDF> viewer complains about a missing font, \eg, Adobe Reader thusly: %\begin{verbatim}[aboveskip=\smallskipamount] %Could not find a font in the Resources dictionary - using Helvetica instead. @@ -2673,23 +3025,23 @@ % distributions, this can be changed in the file \file{updmap.cfg} by setting % |pdftexDownloadBase14| to |true|. % -%\changes{v1.9a}{2005/11/15}{add explanation for error message with non-Type\,1 fonts} % \item %\begin{verbatim} %Warning: pdflatex (file <ecrm1000+20>): Font <ecrm1000+20 at 1200> not found %\end{verbatim} +%\changes{v1.9a}{2005/11/15}{add explanation for error message with non-Type\,1 fonts} % Furthermore, \pdftex\ versions older than 1.40 require Type\,1 fonts for % automatic font expansion. When you receive a message like the above, you are % probably trying to apply font expansion to a bitmap or TrueType font. With % older \pdftex\ versions, this is only possible if you manually create % expanded instances of the fonts. % -%\changes{v2.0}{2006/11/05}{add hint about how to increase \texttt{font\textunderscore max} -% and \texttt{font\textunderscore mem\textunderscore size}} % \item %\begin{verbatim} %! Font <T1/cmr/m/n/10>=<ecrm1000 at 10.0pt> not loaded: Not enough room left. %\end{verbatim} +%\changes{v2.0}{2006/11/05}{add hint about how to increase \texttt{font\textunderscore max} +% and \texttt{font\textunderscore mem\textunderscore size}} % Memory parameter `|font_mem_size|' too small. % \item %\begin{verbatim} @@ -2709,12 +3061,13 @@ % for \miktex, in the file \file{miktex.ini} (2.4 or older) resp. % \file{pdflatex.ini} (2.5 or newer). % -%\changes{v2.0}{2007/01/05}{add hint about warning when tracking \emph{and} -% expansion is applied to a font} % \item -%\begin{verbatim}[deletekeywords={[1]{expansion}}] +%\pagebreak ^^A layout +%\begin{verbatim} %pdfTeX warning (font expansion): font should be expanded before its first use %\end{verbatim} +%\changes{v2.0}{2007/01/05}{add hint about warning when tracking \emph{and} +% expansion is applied to a font} % This warning will occur with \pdftex\ versions older than 1.40.4, if tracking % \emph{and} expansion is applied to a font. It is harmless and can be ignored. %\end{itemize} @@ -2727,29 +3080,13 @@ % \href{http://mirror.ctan.org/macros/latex/contrib/microtype/} % {\acronym{CTAN}}. % For the source code of the logo on the title page and of the letterspacing -% sample from section~\ref{sub:tracking}, see the appendices~\ref{sec:title-logo} -% and \ref{sec:letterspace-ill}. +% sample from section~\ref{sub:tracking}, see the Implementation part, +% appendices~\ref{sec:title-logo} and \ref{sec:letterspace-ill}. %\changes{v2.5a}{2013/05/23}{add notes on typesetting the documentation} % If you want to re-typeset the documentation, read the comments at the end of % \file{microtype.dtx}. % % -%\section{Contributions} -% -% I would be glad to include configuration files for more fonts. Preparing such -% configurations is quite a time-consuming task and requires a lot of patience. -% To alleviate this process, this package also includes a test file that can be -% used to check at least the protrusion settings (\file{test-microtype.tex}). -%^^A -% If you have created a configuration file for another font, or if you have any -% suggestions for enhancements in the default configuration files, I~would -% gratefully accept them: \mailtoRS. -%\iffalse\footnote{^^A ... OK, so nobody has any ... -% Should you have lots of \pkg{pdfcprot} configuration files lying around, -% I can also provide you with a \TeX\ conversion script. Just ask me.} -%\fi -% -% %\section{Acknowledgments} % % This package would be pointless if @@ -2774,8 +3111,7 @@ % interword spacing adjustment and additional character kerning. % \contributor Georg Duffner <g.duffner\at gmail.com> has patiently tested % \microtype\ under \xetex\ and \luatex\ with his beautiful OpenType font -% <EB>~Garamond\footnote{\ctanpkgurl{ebgaramond}, including configuration -% files for \microtype.}. +% <EB>~Garamond. % My thanks also go to % \contributor Maciej Eder <maciej_eder\at poczta.onet.pl> % for contributing settings for the <QX> encoding, as well as to @@ -2785,7 +3121,12 @@ % who made substantial improvements to the Computer Modern Roman italic settings. % I thank % \contributor Loren~B. Davis <davislo\at eecs.oregonstate.edu> -% for providing protrusion settings for OpenType versions of Palatino Linotype. +% for providing protrusion settings for OpenType versions of Palatino Linotype, +% as well as +% \contributor Antonis Tsolomitis <antonis.tsolomitis\at gmail.com> +% for settings for his New Computer Modern font. The latter also showcase the +% new feature of automatically calculated protrusion, which was an original idea by +% \contributor Daniel Benjamin Miller <dbmiller\at dbmiller.org>. ^^A also https://tex.stackexchange.com/users/176404/d909 % I am also very much indebted to % \contributor \'Elie Roux <elie.roux\at telecom-bretagne.eu>, % who not only contributed the |lua| module in the first place, but also, @@ -2894,14 +3235,19 @@ % \contributor Paolo Polesana <@\at @>, ^^A https://tex.stackexchange.com/users/95083/paolo-polesana % \contributor Oliver Kopp <koppdev\at gmail.com>, % \contributor Hironori Kitagawa <h_kitagawa2001\at yahoo.co.jp>, -% \contributor Daniel Benjamin Miller <dbmiller\at dbmiller.org>, ^^A also https://tex.stackexchange.com/users/176404/d909 +% \contributor Aman Mehra <reportaman\at gmail.com>, ^^A also https://tex.stackexchange.com/users/192717/reportaman % \contributor Md Ayquassar <mdayq0\at lenta.ru>, +% \contributor Holger Gerhardt <holger.gerhardt\at uni-bonn.de>, % \contributor Marcel Kr\"uger <tex\at 2krueger.de>, % \contributor Ekkehart Schlicht <ekkehart.schlicht\at gmail.com>, % `\contributor Canageek <@\at @>', ^^A https://tex.stackexchange.com/users/7880/canageek -% `\contributor dsedivec <@\at @>' ^^A https://tex.stackexchange.com/users/1680/dsedivec +% `\contributor dsedivec <@\at @>', ^^A https://tex.stackexchange.com/users/1680/dsedivec +% `\contributor DORpapst <@\at @>', ^^A https://tex.stackexchange.com/users/104965/dorpapst +% `\contributor chsk <@\at @>', ^^A https://tex.stackexchange.com/users/158639/chsk +% `\contributor tnull <@\at @>', ^^A https://tex.stackexchange.com/users/91987/tnull +% `\contributor azur <@\at @>' ^^A https://tex.stackexchange.com/users/216369/azur % and -% `\contributor DORpapst <@\at @>'. ^^A https://tex.stackexchange.com/users/104965/dorpapst +% `\contributor Safron <@\at @>'. ^^A https://tex.stackexchange.com/users/149123/safron % % %\iffalse @@ -2975,7 +3321,7 @@ % \bibitem[\pdftex\ manual]{pdftexman} % \thanh, Sebastian Rahtz, Hans Hagen, Hartmut Henkel, Pawe\l\ Jackowski, Martin Schr\"oder, Karl Berry, % \emph{The \pdftex\ user manual}, -% \newblock 2~March 2020. +% \newblock 18~February 2021. % \newblock (\ctanurl{systems/doc/pdftex/manual/pdftex-a.pdf}) % ^^A latest version at \url{http://sarovar.org/projects/pdftex/} % ^^A or even \url{http://foundry.supelec.fr/scm/?group_id=23} @@ -2986,8 +3332,8 @@ % \newblock (\ctanurl{info/fontname/fontname.pdf}) % % \bibitem[\LaTeXe\ font selection]{fntguide} -% \LaTeX3 Project Team, \emph{\LaTeXe\ font selection}, -% \newblock November 2020. +% \LaTeX\ Project Team, \emph{\LaTeXe\ font selection}, +% \newblock March 2021. % \newblock (\ctanurl{macros/latex/base/fntguide.pdf}) % % \bibitem[\pkg{fontspec}]{fontspec} @@ -2997,9 +3343,9 @@ % \newblock (\ctanpkgurl{fontspec}) % % \bibitem[\pkg{luaotfload}]{luaotfload} -% \'Elie Roux, Khaled Hosny, Philipp Gesang, Ulrike Fischer, Marcel Kr\"uger, +% \LaTeX3 Project, \'Elie Roux, Khaled Hosny, Philipp Gesang, Ulrike Fischer, Marcel Kr\"uger, % \emph{The \pkg{luaotfload} package}, -% \newblock 8~January 2021. +% \newblock 21~May 2021. % \newblock (\ctanpkgurl{luaotfload}) % % \bibitem[\pkg{pdfcprot}]{pdfcprot} @@ -3019,14 +3365,11 @@ %\end{thebibliography} % % -%\section{Short history} +%\section{Changes} %\changes{v1.5}{2004/12/11}{add `Short history'} % -% The comprehensive list of changes can be -% \expandafter\ifx\csname r@sec:changes\endcsname\relax -% obtained by running `\texttt{makeindex \mbox{-s gglo.ist} -% \mbox{-o microtype.gls} microtype.glo}'\else -% found in appendix~\ref{sec:changes}\fi. +% The comprehensive list of changes can be found in the Implementation part, +% appendix~\ref{sec:changes}. % The following is a list of all changes relevant in the user land; bug and % compatibility fixes are swept under the rug. Numbers in brackets indicate % the relevant section in this manual. @@ -3046,11 +3389,29 @@ % \vskip\topsep % \nopagebreak} %\newcommand\VersionDate[2]{^^A needed in the Change history -% \global\expandafter\def\csname MTversiondate#1\endcsname{#2}} +% \global\expandafter\def\csname MTversiondate#1\endcsname{#2}^^A +% \immediate\write\histtmp{\string\VersionDate{#1}{#2}}} +% +%\newwrite \histtmp +%\immediate\openout \histtmp=microtype-hist.tmp % %\begin{History} % -%\VersionDate{\expandafter\@gobble\fileversion}{\filedate} +%\Version{\expandafter\@gobble\fileversion}{\filedate} +% \item Possibility of automatical protrusion based on difference of character widths +% \refsection{\ref{sub:inheritance}} +% \item New commands \cs{leftprotrusion} and \cs{rightprotrusion}; +% various patches to get protrusion right \refsection{\ref{sec:pedantic}} +% \item New option \opt{disable}, replacing the |draft| option; deprecate option |final| +% \refsection{\ref{sub:options-misc}} +% \item New package \pkg{microtype-show} for visual debugging of protrusion settings +% \refsection{\ref{sec:contrib}} +% \item Protrusion settings for New Computer Modern (OpenType) +% \item Protrusion settings for <EB> Garamond (OpenType) +% \item New generic protrusion settings for \luatex/\xetex\ \refsection{\ref{sec:caveats}} +% \item Move development to \href{\githuburl}{GitHub} +% +%\VersionDate{2.8c}{2021/03/14} % %\VersionDate{2.8b}{2021/02/25} % @@ -3072,7 +3433,7 @@ % \item Allow automatic expansion and letterspacing with \luatex\ in <DVI> mode % (aka. \texttt{dvilualatex}) % \refsection{\ref{sub:options-microtype}, \ref{sub:options-expansion}, table~\ref{tab:available-features}} -% \item Compatibility with \LaTeX\ 2017/01/01 (fix warnings) +%^^A \item Compatibility with \LaTeX\ 2017/01/01 (fix warnings) % %\VersionDate{2.6a}{2016/05/14} % @@ -3091,7 +3452,7 @@ % \item Support for protrusion with \xetex\ $\geq$ 0.9997 % \item Support for tracking/letterspacing with \luatex\ $\geq$ 0.62 % \item Allow context-sensitive setup with \luatex -% \item Info if protrusion settings are generic +% \item Info instead of warning if protrusion settings are generic % \item Protrusion settings for Latin Modern Roman (OpenType) % \item Protrusion settings for Charis SIL (OpenType) % \item Protrusion settings for Palatino Linotype (OpenType) @@ -3221,7 +3582,7 @@ % \item New option `\opt{unit}' to measure protrusion factors relative to a % dimension instead of the character width % \refsection{\ref{sub:protrusion}} -% \item Renamed commands from \cs{..MicroType..} to \cs{..Microtype..} +% \item Renamed commands from \cmd{\..MicroType..} to \cmd{\..Microtype..} % \item Protrusion settings for <AMS> math fonts % \item Protrusion settings for Times in <LY1> encoding completed % \item The `|allmath|' font set also includes <U> encoding @@ -3238,10 +3599,10 @@ % \item New command \cs{LoadMicrotypeFile} to load a configuration file manually % \refsection{\ref{sub:config-file}} % \item New command \cs{Microtype@Hook} for font package authors -% \refsection{\ref{sub:hook}} +% \refsection{Implementation, \ref{sub:hook}} % \item New option `\opt{verbose}|=errors|' to turn all warnings into errors %^^A \item Disable expansion inside \cmd\showhyphens -% \item Warning when running in draft mode +% \item Warning when running in disable mode % %\VersionDate{1.6a}{2005/02/02} % @@ -3305,14 +3666,24 @@ % \item First <CTAN> release %\end{History} % +%\immediate\closeout\histtmp +% +%\fi ^^A ifcodedoc +% % %\def\AppendixSettings{ -% \addtolength\textwidth{50pt} -% \addtolength{\oddsidemargin}{-50pt} -% \setlength{\columnwidth}{\textwidth} -% \setlength{\hsize}{\textwidth} -% \setlength{\linewidth}{\textwidth} -% \footnotesize +% \ifcodedoc +% \addtocontents{toc}{\protect\pagebreak} ^^A layout +% \addtolength\textwidth{50pt} +% \addtolength{\oddsidemargin}{-50pt} +% \setlength{\columnwidth}{\textwidth} +% \setlength{\hsize}{\textwidth} +% \setlength{\linewidth}{\textwidth} +% \newpage +% \footnotesize +% \else +% \small +% \fi %} % %\def\LPPLSettings{ @@ -3334,12 +3705,9 @@ %\StopEventually{ % \GeneralChanges{Documentation} % \ifx\Finale\relax -% \newpage -% \appendix % \AppendixSettings % \fi % \PrintIndex -% \InputIfFileExists{lppl.tex}\LPPLSettings\relax %} % % \GeneralChanges* @@ -3374,75 +3742,92 @@ % \advance,\afterassignment,\aftergroup,\begingroup,\bgroup,\catcode,\char, % \chardef,\csname,\def,\divide,\edef,\egroup,\else,\endcsname,\endgroup, % \endinput,\escapechar,\everypar,\expandafter,\fi,\futurelet,\gdef,\global, -% \hbadness,\hbox,\hsize,\hskip,\if,\ifcase,\ifcat,\ifdim,\iffalse,\ifhbox, -% \ifhmode,\ifmmode,\ifnum,\iftrue,\ifx,\immediate,\input,\inputlineno,\jobname, -% \kern,\lastkern,\lastskip,\let,\lowercase,\maxdimen,\meaning,\multiply, -% \newlinechar,\noexpand,\number,\or,\parfillskip,\pretolerance,\relax,\setbox, -% \showboxdepth,\string,\the,\tolerance,\unkern,\unskip,\uppercase,\vbox,\wd, -% \write,\xdef} -%^^A\DoNotIndex{\font,\fontdimen,\nullfont,\sfcode,\spacefactor,\spaceskip, -%^^A \xspaceskip} ^^A tex +% \hbadness,\hbox,\hfill,\hrule,\hsize,\hskip,\if,\ifcase,\ifcat,\ifdim,\iffalse,\ifhbox, +% \ifhmode,\ifmmode,\ifnum,\iftrue,\ifx,\ignorespaces,\immediate,\input, +% \inputlineno,\jobname,\kern,\lastbox,\lastkern,\lastskip,\leaders,\let,\lowercase, +% \maxdimen,\meaning,\multiply,\newlinechar,\noexpand,\noindent,\number, +% \or,\parfillskip,\pretolerance,\relax,\setbox,\showboxdepth,\splittopskip, +% \string,\the,\tolerance,\unkern,\unskip,\unvbox,\uppercase,\vbadness,\vbox, +% \vrule,\vsplit,\wd,\write,\xdef} +%^^A\DoNotIndex{\font,\fontdimen,\fontname,\nullfont,\sfcode,\spacefactor, +%^^A \spaceskip,\xspaceskip} ^^A tex %\DoNotIndex{\currentgrouplevel,\currentgrouptype,\currentiflevel,\detokenize, -% \dimexpr,\eTeXversion,\ifcsname,\ifdefined,\numexpr} +% \dimexpr,\eTeXversion,\ifcsname,\ifdefined,\lastnodetype,\numexpr} %^^A\DoNotIndex{\fontcharwd,\iffontchar} ^^A e-tex -%\DoNotIndex{\pdfannot,\pdfescapestring,\pdfmatch,\pdfoutput,\pdfstrcmp, +%\DoNotIndex{\pdfannot,\pdfmatch,\pdfoutput,\pdfstrcmp, % \pdftexrevision,\pdftexversion} %^^A\DoNotIndex{\(ef,lp,rp,kn(ac,bc),(kn,sh,st)bs)code,\(left,right)marginkern, %^^A \tagcode,\letterspacefont,\pdfcopyfont,\pdffontexpand,\pdfnoligatures, %^^A \pdfprotrudechars,\pdfadjust(interwordglue,spacing),\pdf(ap,pre)pendkern, %^^A \pdftracingfonts} ^^A pdftex -%\DoNotIndex{\XeTeXversion,\XeTeXrevision,\strcmp} ^^A xetex +%\DoNotIndex{\XeTeXversion,\XeTeXrevision,\strcmp} %^^A\DoNotIndex{\XeTeXcharglyph,\XeTeXfonttype,\XeTeXglyph,\XeTeXglyphindex, -%^^A \XeTeXglyphname,\XeTeXlastfontchar,\XeTeXprotrudechars} -%\DoNotIndex{\directlua,\glet,\luatexversion} ^^A luatex +%^^A \XeTeXglyphname,\XeTeXlastfontchar,\XeTeXprotrudechars} ^^A xetex +%\DoNotIndex{\directlua,\glet,\luatexversion} %^^A\DoNotIndex{\adjustspacing,\copyfont,\expandglyphsinfont, -%^^A \ignoreligaturesinfont,\outputmode,\protrudechars,\tracingfonts} +%^^A \ignoreligaturesinfont,\outputmode,\protrudechars,\tracingfonts} ^^A luatex %\DoNotIndex{\eplain,\usepkg@pkg} ^^A eplain -%\DoNotIndex{\@backslashchar,\@cclv,\@cclvi,\@classoptionslist,\@currext, -% \@currname,\@defaultunits,\@empty,\@expandtwoargs,\@firstofone,\@firstoftwo, -% \@gobble,\@gobbletwo,\@ifclassloaded,\@ifl@t@r,\@ifl@aded,\@ifpackagelater, -% \@ifpackageloaded,\@ifstar,\@ifundefined,\@let@token,\@m,\@makeother, -% \@minus,\@nameuse,\@ne,\@nil,\@nnil,\@onelevel@sanitize,\@onlypreamble, -% \@percentchar,\@pkgextension,\@plus,\@ptionlist,\@removeelement,\@secondoftwo, -% \@spaces,\@sptoken,\@tempa,\@tempb,\@tempc,\@tempcnta,\@tempcntb,\@tempdima, -% \@typeset@protect,\@undefined,\@unprocessedoptions,\@unusedoptionlist, -% \@xobeysp,\check@icr,\color@begingroup,\color@endgroup,\g@addto@macro, -% \hmode@bgroup,\m@ne,\maybe@ic,\maybe@ic@,\nfss@text,\not@math@alphabet, -% \on@line,\p@,\set@display@protect,\strip@prefix,\strip@pt,\tw@,\z@,\z@skip, -% \zap@space,\active,\documentclass,\fmtversion,\leavevmode,\makeatletter, -% \mbox,\newcommand,\newcount,\newdimen,\newif,\newskip,\newtoks,\nobreak, -% \nonfrenchspacing,\normalsize,\renewcommand,\space,\AddToHook,\AtBeginDocument, -% \AtEndOfPackage,\CheckCommand,\CurrentOption,\DeclareRobustCommand,\IfFileExists, -% \InputIfFileExists,\MessageBreak,\PackageError,\PackageInfo,\PackageWarning, -% \RequirePackage,\@@enc@update,\cf@encoding,\f@encoding} -%^^A\DoNotIndex{\add@accent,\curr@fontshape,\define@newfont,\do@subst@correction, -%^^A \every@math@size,\f@size,\font@name,\glb@currsize,\glb@settings,\normalfont, -%^^A \pickup@font,\remove@tlig,\selectfont,\set@fontsize,\showhyphens} ^^A latex +%\DoNotIndex{\@backslashchar,\@car,\@cclvi,\@classoptionslist,\@currext, +% \@currname,\@defaultunits,\@empty,\@eqnnum,\@expandtwoargs,\@firstofone, +% \@firstoftwo,\@footnotetext,\@gobble,\@gobbletwo,\@ifclassloaded,\@ifl@t@r, +% \@ifl@aded,\@ifpackagelater,\@ifpackageloaded,\@ifstar,\@ifundefined,\@item, +% \@let@token,\@m,\@M,\@makeother,\@minus,\@nameuse,\@ne,\@newlistfalse,\@nil,\@nnil, +% \@onelevel@sanitize,\@onlypreamble,\@pkgextension,\@plus,\@ptionlist,\@removeelement, +% \@secondoftwo,\@spaces,\@sptoken,\@tempa,\@tempb,\@tempc,\@tempcnta,\@tempcntb,\@tempdima, +% \@typeset@protect,\@undefined,\@unprocessedoptions,\@unusedoptionlist,\@xobeysp, +% \check@icr,\color@begingroup,\color@endgroup,\g@addto@macro,\hmode@bgroup,\m@ne, +% \maybe@ic,\maybe@ic@,\nfss@text,\not@math@alphabet,\on@line,\p@,\set@display@protect, +% \strip@prefix,\strip@pt,\@text@composite,\tw@,\z@,\z@skip,\zap@space, +% \active,\documentclass,\dotfill,\fbox,\fboxrule,\fboxsep,\fmtversion,\footnotesize, +% \leavevmode,\llap,\makeatletter,\makebox,\mathrm,\mbox,\medskip,\newbox,\newcommand, +% \newcount,\newdimen,\newif,\newline,\newskip,\newtoks,\nobreak,\nonfrenchspacing, +% \normalbaselineskip,\normalsize,\numberline,\par,\parbox,\quad,\raggedright, +% \renewcommand,\scalebox,\space,\strut,\textwidth,\texttt,\tiny,\usefont, +% \AddToHook,\AtBeginDocument,\AtEndOfPackage,\CheckCommand,\CurrentOption, +% \DeclareOption,\DeclareRobustCommand,\IfFileExists,\IfFormatAtLeastTF,\InputIfFileExists, +% \MessageBreak,\PackageError,\PackageInfo,\PackageWarning,\PassOptionsToPackage, +% \ProcessOptions,\RequirePackage,\@@enc@update,\UnicodeEncodingName} +%^^A\DoNotIndex{\add@accent,\cf@encoding,\curr@fontshape,\define@newfont, +%^^A \do@subst@correction,\f@encoding,\f@family,\f@size,\font@name,\fontencoding, +%^^A \fontseries,\fontshape,\glb@currsize,\glb@settings,\normalfont,\pickup@font, +%^^A \remove@tlig,\selectfont,\seriesdefault,\shapedefault,\set@fontsize,\showhyphens} ^^A latex %\DoNotIndex{\normalpdfoutput,\normalpdftexversion,\normalpdftexrevision} ^^A tex live 2004 %\DoNotIndex{\foreign@language,\languagename,\select@language,\shorthandoff} ^^A babel %\DoNotIndex{\percentsign} ^^A babel/spanish,galician,mexican %\DoNotIndex{\CJK@ifundefined,\CJK@plane,\CJK@temp,\CJK@addcmap} ^^A CJK,CJKutf8 +%\DoNotIndex{\color} ^^A color %\DoNotIndex{\@disablequotes} ^^A csquotes %\DoNotIndex{\pdfstringdefDisableCommands,\pdfstringdefWarn} ^^A hyperref -%\DoNotIndex{\ifpdf} ^^A ifpdf +%\DoNotIndex{\ifpdf,\ifetex,\ifluatex,\ifxetex} ^^A ifpdf/iftex %\DoNotIndex{\@inpenc@undefined@,\IeC,\inputencoding,\inputencodingname} ^^A inputenc -%\DoNotIndex{\UTFviii@defined} ^^A inputenc/utf8 +%^^A\DoNotIndex{\UTFviii@defined,\UTF@four@octets@noexpand, ^^A inputenc/utf8 +%^^A \UTF@three@octets@noexpand,\UTF@two@octets@noexpand, +%^^A \UTFviii@four@octets,\UTFviii@three@octets,\UTFviii@two@octets} %\DoNotIndex{\PrerenderUnicode,\unicode@charfilter} ^^A inputenc/utf8x %\DoNotIndex{\define@key,\KV@@sp@def,\setkeys} ^^A keyval %\DoNotIndex{\l@dunhbox@line} ^^A ((r)e)ledmac,((r)e)ledpar %\DoNotIndex{\lst@ProcessLetter} ^^A listings -%\DoNotIndex{\RequireLuaModule} ^^A luatexbase +%\DoNotIndex{\newluafunction} ^^A luatexbase %\DoNotIndex{\pdf@escapestring} ^^A pdftexcmds %\DoNotIndex{\py@macron} ^^A pinyin %\DoNotIndex{\SOUL@,\SOUL@doword,\soulregister} ^^A soul %\DoNotIndex{\tikz@expandcount} ^^A tikz %\DoNotIndex{\conditionally@traceoff} ^^A trace %\DoNotIndex{\@xspace,\@xspace@firsttrue} ^^A xspace +%\DoNotIndex{\apptocmd,\patchcmd} ^^A etoolbox +%\DoNotIndex{\beamer@@callorigitem,\beamer@callorigitem} ^^A beamer +%\DoNotIndex{\eqref,\tagform@} ^^A amsmath +%\DoNotIndex{\@topic@item} ^^A simplecv +%\DoNotIndex{\booknumberline,\chapternumberline,\foottextfont,\partnumberline, +% \cftbookafterpnum,\cftchapterafterpnum,\cftfigureafterpnum,\cftparagraphafterpnum, +% \cftpartafterpnum,\cftsectionafterpnum,\cftsubparagraphafterpnum,\cftsubsectionafterpnum, +% \cftsubsubsectionafterpnum,\cfttableafterpnum} ^^A memoir +%\DoNotIndex{\setuptoc,\unsettoc,\scr@saved@footnotetext} ^^A koma (tocbasic) %\DoNotIndex{\x,\MT@dinfo,\MT@dinfo@nl,\tracingmicrotype,\tracingmicrotypeinpdf, % \ifMT@inannot,\MT@inannottrue,\MT@inannotfalse,\MT@addto@annot,\MT@pdf@annot, % \MT@show@pdfannot,\iftracingmicrotypeinpdfall,\tracingmicrotypeinpdfalltrue, -% \tracingmicrotypeinpdfallfalse,\DeclareMicroTypeSet,\DeclareMicroTypeAlias, -% \UseMicroTypeSet,\LoadMicroTypeFile,\MicroType@Hook} ^^A microtype +% \tracingmicrotypeinpdfallfalse,\DeclareMicroTypeAlias,\DeclareMicroTypeSet, +% \LoadMicroTypeFile,\UseMicroTypeSet,\MicroType@Hook} ^^A microtype % % ^^A ------------------------------------------------------------------------- % @@ -3456,9 +3841,10 @@ % \begin{description} % \item[|driver|] The documentation driver, only visible in the \file{dtx} file. % \item[|package|] The code for the \microtype\ package (\file{microtype.sty}). -% \item[|pdftex-def|] Definitions specific to \pdftex\ (\file{microtype-pdftex.def}). -% \item[|xetex-def|] Definitions specific to \xetex\ (\file{microtype-xetex.def}). -% \item[|luatex-def|] Definitions specific to \luatex\ (\file{microtype-luatex.def}). +% \item[|show|] The code for the \pkg{microtype-show} package (\file{microtype-show.sty}). +% \item[|pdf-|] Definitions specific to \pdftex\ (\file{microtype-pdftex.def}). +% \item[|lua-|] Definitions specific to \luatex\ (\file{microtype-luatex.def}). +% \item[|xe-|] Definitions specific to \xetex\ (\file{microtype-xetex.def}). % \item[|letterspace|] The code for the \letterspace\ package (\file{letterspace.sty}). % \begin{description} % \item[|plain|] Code for \pkg{eplain}, \pkg{miniltx} (\letterspace\ only). @@ -3608,13 +3994,15 @@ \expandafter\let\csname ver@letterspace.sty\endcsname\@empty % \end{macrocode} %\begin{macro}{\MT@old@cmd} -% The old command names had one more hunch. -%\changes{v1.8}{2005/04/28}{renamed commands from \cs{..MicroType..} to \cs{..Microtype..}} +% The old command names had one more hunch (|\..MicroType..|). +% Before finally letting them sink into oblivion, raise an error. +%\changes{v1.8}{2005/04/28}{renamed commands from \cmd{\..MicroType..} to \cmd{\..Microtype..}} +%\changes{v3.0}{2020/04/10}{old command names will raise an error} % \begin{macrocode} \def\MT@old@cmd#1#2{% - \newcommand*#1{\MT@warning{% + \newcommand*#1{\MT@error{% \string#1 is deprecated. Please use\MessageBreak - \string#2 instead}% + \string#2 instead}{As I said}% \let #1#2#2}} % \end{macrocode} %\end{macro} @@ -3764,6 +4152,7 @@ } %</debug> %</package> +%</package|letterspace> % \end{macrocode} %\end{macro} %\ifpdf\ifx\tracingmicrotypeinpdf\undefined\else @@ -3771,8 +4160,384 @@ % \tracingmicrotype0 %\fi\fi % +%\subsubsection{Visual debugging} +% +%\changes{v3.0}{2021/06/02}{new package: \pkg{microtype-show} for visual debugging} +% The \pkg{microtype-show} package offers some tools for preparing +% protrusion settings. We make use of the \microtype\ infrastructure, +% redefining some of its internal commands (done later, +% in sections \ref{ssub:setup-prot} and \ref{ssub:setup-config}). +% First, some preparation: +% \begin{macrocode} +%<*show> +\RequirePackage{iftex} +\ifetex\else + \PackageError{microtype-show} + {This package only works with e-TeX}{Use e-TeX} +\fi +\ifxetex + \PackageError{microtype-show} + {This package only works with pdfTeX or luaTeX}{Don't use XeTeX} +\fi +\PackageWarning{microtype-show}{DO NOT USE THIS PACKAGE FOR REAL DOCUMENTS\@gobble} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{microtype}} +\ProcessOptions\relax +\PassOptionsToPackage{verbose}{microtype} +\RequirePackage{microtype,graphicx,xcolor} +% \end{macrocode} +%\begin{macro}{\ifShowGlyphIndex} +%\begin{macro}{\ifShowMissingGlyphs} +%\begin{macro}{\GlyphScaleFactor} +%\begin{macro}{\Showbaselinecolor} +%\begin{macro}{\Showposcolor} +%\begin{macro}{\Shownegcolor} +% The following commands are configurable: +% \begin{macrocode} +\newif\ifShowGlyphIndex +\newif\ifShowMissingGlyphs +\newcommand*\GlyphScaleFactor{2} +\newcommand*\Showbaselinecolor{\color{black!40}} +\newcommand*\Showposcolor{\color{green!50}} +\newcommand*\Shownegcolor{\color{red!50}} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MTS@printtext} +%\begin{macro}{\MTS@show@index} +%\begin{macro}{\MTS@crulefill} +% Make sure to have a readable font. +% \begin{macrocode} +\ifluatex + \def\MTS@printtext#1{{\usefont{TU}{lmr}{m}{n}#1}} +\else + \def\MTS@printtext#1{{\usefont{T1}{cmr}{m}{n}#1}} +\fi +\def\MTS@show@index#1{\ifShowGlyphIndex{\tiny$_{#1}% + % \ifluatex^{\mathrm{% + % \MT@lua{tex.print(luaotfload.aux.name_of_slot(tonumber([[#1]])))}}}\fi + $}\fi\space} +\def\MTS@crulefill{\leaders\hrule height \dimexpr1ex/2+.4pt depth -\dimexpr1ex/2\hfill} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MTS@Prot} +%\begin{macro}{\MTS@Char} +% Add the |show| commands to \microtype's setup. +% \begin{macrocode} +\g@addto@macro\MT@setupfont{\MTS@Prot\MTS@Char} +\let\MTS@Prot\relax +\let\MTS@Char\relax +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MTS@setup} +%\begin{macro}{\MTS@glyphlist} +% Common setup. \cs{MTS@glyphlist} stores all glyphs we've seen. +% \begin{macrocode} +\def\MTS@setup{% + \fboxsep=0pt + \fboxrule=.1pt + \raggedright + \let\MTS@glyphlist\@gobble + \def\MT@feat{pr}% +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\ShowProtrusion} +% Activate the sleeper command, then trigger the setup. +% \begin{macrocode} +\newcommand*\ShowProtrusion{% + \begingroup + \MTS@setup + \let\MTS@Prot\MTS@Prot@do + \def\MT@cat{c}% + \selectfont +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MTS@Prot@do} +% But in all other cases of a font being picked up, there should +% be no special treatment. After we're done, select the previous +% font again. +% \begin{macrocode} +\def\MTS@Prot@do{% + \MT@ltx@pickupfont + \let\MT@pr@split@val\MTS@pr@split@val + \let\MT@load@list\MTS@load@list + \let\MT@set@pr@prefixes@\MTS@set@pr@prefixes@ + \MTS@show@pr + \endgroup + \aftergroup\selectfont +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ShowCharacterInheritance} +% \begin{macrocode} +\newcommand*\ShowCharacterInheritance{% + \begingroup + \MTS@setup + \let\MTS@Char\MTS@Char@do + \def\MT@cat{inh}% + \selectfont +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MTS@Char@do} +% \begin{macrocode} +\def\MTS@Char@do{% + \MT@ltx@pickupfont + \let\MT@set@pr@prefixes@\MTS@set@pr@prefixes@ + \MTS@show@inheritance + \endgroup + \aftergroup\selectfont +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ShowProtrusionLineGlyph} +% By glyph. +% \begin{macrocode} +\newcommand*\ShowProtrusionLineGlyph[1]{% + {\MTS@setup + \MTS@showprotrusionline{`#1}}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ShowProtrusionLineIndex} +% By glyph number. +% \begin{macrocode} +\newcommand*\ShowProtrusionLineIndex[1]{% + {\MTS@setup + \MTS@showprotrusionline{#1}}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MTS@showprotrusionline} +%\begin{macro}{\MTS@lpcode} +%\begin{macro}{\MTS@rpcode} +% \begin{macrocode} +\def\MTS@showprotrusionline#1{% + \edef\MTS@lpcode{\number\lpcode\font#1}% + \edef\MTS@rpcode{\number\rpcode\font#1}% + \char#1% + lorem ipsum dolor sit amet, \MTS@crulefill\ % + \MTS@printtext{\ifnum\MTS@lpcode=\z@\Showbaselinecolor\fi[\MTS@lpcode]} + \fbox{\char#1}\MTS@show@index{\number#1} + \MTS@printtext{\ifnum\MTS@rpcode=\z@\Showbaselinecolor\fi[\MTS@rpcode]} + \MTS@crulefill\ you know the rest% + \char#1\par + \ShowDummyLine +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\ShowDummyLine} +% The first and last glyphs in this line should have a straight (non-protruded) shape. +% We also reset to default shape and series, because that's what, say, italic shapes +% should be matched with. +% \begin{macrocode} +\newcommand*\ShowDummyLine{% + {\fontencoding{\encodingdefault}\fontseries{\seriesdefault}\fontshape{\shapedefault}% + \selectfont\noindent + here is the beginning of a line, \dotfill and here is its end}\par +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ShowProtrusionAll} +% \begin{macrocode} +\newcommand*\ShowProtrusionAll{% + {\MTS@setup + \MTS@lede{}% + \MT@do@font{\iffontchar\font\@tempcnta\MTS@showprotrusionline{\@tempcnta}\fi}}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ShowProtrusionDefined} +% \begin{macrocode} +\newcommand*\ShowProtrusionDefined{% + {\MTS@setup + \MTS@lede{defined}% + \let\MTS@first\@gobble + \let\MTS@second\@firstofone + \MT@do@font{% + \MTS@firstorsecond + \MTS@temp{% + \iffontchar\font\@tempcnta\MTS@showprotrusionline{\@tempcnta}\else + \MT@warning@nl{Glyph \the\@tempcnta\space is missing in font + \MessageBreak\font@name}% + \fi}}}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ShowProtrusionMissing} +% \begin{macrocode} +\newcommand*\ShowProtrusionMissing{% + {\MTS@setup + \MTS@lede{missing}% + \let\MTS@first\@firstofone + \let\MTS@second\@gobble + \MT@do@font{% + \MTS@firstorsecond + \iffontchar\font\@tempcnta\MTS@temp{\MTS@showprotrusionline{\@tempcnta}}\fi}}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MTS@lede} +% \begin{macrocode} +\def\MTS@lede#1{% + \selectfont + \edef\MTS@font{\expandafter\string\font@name}% + \MTS@printtext{All glyphs \MT@ifempty{#1}{in}{#1 in protrusion list for} + font \texttt{\MTS@font}:}\par + \ShowDummyLine +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MTS@firstorsecond} +% \begin{macrocode} +\def\MTS@firstorsecond{% + \let\MTS@temp\MTS@first + \ifnum\lpcode\font\@tempcnta=\z@ \else + \let\MTS@temp\MTS@second + \fi + \ifnum\rpcode\font\@tempcnta=\z@ \else + \let\MTS@temp\MTS@second + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MTS@charwd} +%\begin{macro}{\MTS@lp@} +%\begin{macro}{\MTS@rp@} +%\begin{macro}{\MTS@show@char@pr} +% Display the glyph with protrusion. +% \begin{macrocode} +\newdimen\MTS@charwd +\newdimen\MTS@lp@ +\newdimen\MTS@rp@ +\def\MTS@show@char@pr#1{% + \xdef\MTS@glyphlist{\MTS@glyphlist,#1}% + \scalebox{\GlyphScaleFactor}{\strut\escapechar`\\ + \MTS@charwd=\fontcharwd\MT@font#1\relax +% \end{macrocode} +% The baseline rule. +% \begin{macrocode} + {\Showbaselinecolor\vrule width \dimexpr\MTS@charwd+.3em\relax height 1sp depth 0pt}% + \hskip-\dimexpr\MTS@charwd+.15em\relax +% \end{macrocode} +% Left protrusion. +% \begin{macrocode} + {\ifdim\MTS@lp@<\z@\Shownegcolor\else\Showposcolor\fi + \vrule width \ifdim\MTS@lp@<\z@ -\fi\MTS@lp@ height 1em depth .2em}% + \hskip\dimexpr\MTS@charwd\ifdim\MTS@lp@>\z@-\MTS@lp@\fi + \ifdim\MTS@rp@>\z@-\MTS@rp@\fi\relax +% \end{macrocode} +% Right protrusion. +% \begin{macrocode} + {\ifdim\MTS@rp@<\z@\Shownegcolor\else\Showposcolor\fi + \vrule width \ifdim\MTS@rp@<\z@ -\fi\MTS@rp@ height 1em depth .2em}% + \hskip-\dimexpr\MTS@charwd+\fboxrule\ifdim\MTS@rp@<\z@-\MTS@rp@\fi\relax +% \end{macrocode} +% Finally the glyph, so that it's on top. +% \begin{macrocode} + \fbox{\char#1}}\,% + \MTS@show@index{#1}% +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MTS@show@char} +%\begin{macro}{\MTS@show@char@x} +% Just show the glyph; the second command also remembers it. +% \begin{macrocode} +\def\MTS@show@char#1{\scalebox{\GlyphScaleFactor}{% + \strut\fbox{\char#1}}\MTS@show@index{#1}} +\def\MTS@show@char@x#1{\xdef\MTS@glyphlist{\MTS@glyphlist,#1}\MTS@show@char{#1}} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MTS@show@missing} +% \begin{macrocode} +\def\MTS@show@missing{% + \MT@ifdefined@c@T\MT@pr@inh@name{% + \MTS@lp@=\z@ \MTS@rp@=\z@ + \par \MTS@printtext{Glyphs not included in configuration (with defined heirs):}% + \MT@do@font{% + \edef\MT@temp{\the\@tempcnta}% + \MT@ifdefined@n@T{MT@inh@\MT@pr@inh@name @\MT@temp @}{% + \MT@exp@one@n\MT@in@clist\MT@temp\MTS@glyphlist + \ifMT@inlist@\else \newline + \llap{\MTS@show@char@pr{\MT@temp} \MTS@printtext{=} }% + \MT@exp@cs\MT@map@tlist@c + {MT@inh@\MT@pr@inh@name @\the\@tempcnta @}% + \MTS@show@char@x + \fi + }% + }% + }% + \MTS@show@missing@ +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MTS@show@missing@} +% \begin{macrocode} +\def\MTS@show@missing@{% + \par \MTS@printtext{Other glyphs not in configuration:}\newline + \MT@do@font{% + \edef\MT@temp{\the\@tempcnta}% + \MT@exp@one@n\MT@in@clist\MT@temp\MTS@glyphlist + \ifMT@inlist@\else + \MTS@show@char\MT@temp + \fi + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MTS@show@inheritance} +% \begin{macrocode} +\def\MTS@show@inheritance{% + \MT@get@inh@list + \MTS@printtext{Character inheritance for font `\texttt{\MT@@font}':}\\ + \MT@ifdefined@c@TF\MT@listname{% + \MTS@printtext{First matching list is for `\texttt{\@tempa}':\\ + \texttt{\MT@listname}:}\par\leavevmode + \MT@do@font{% + \MT@ifdefined@n@T{MT@inh@\MT@listname @\the\@tempcnta @}{% + \newline + \xdef\MTS@glyphlist{\MTS@glyphlist,\the\@tempcnta}% + \llap{\MTS@show@char{\the\@tempcnta}\MTS@printtext{= }}% + \MT@exp@cs\MT@map@tlist@c + {MT@inh@\MT@listname @\the\@tempcnta @}% + \MTS@show@char@x + }% + }% + \MT@ifdefined@n@T{MT@inh@\MT@listname @prefixes}{% + \par \MTS@printtext{(with prefixes:)}% + \@tempcntb=\z@ + \let\MTS@show@char@pr\MTS@show@char@x + \MT@set@pr@prefixheirs}% + \ifShowMissingGlyphs\MTS@show@missing@\fi + }{% + \MTS@printtext{NOT DEFINED}% + }% + \par +} +%</show> +% \end{macrocode} +%\end{macro} +% %\subsubsection{Requirements} % +% Back to the user packages. +% %\begin{macro}{\MT@plain} % The \letterspace\ package works with: %\begin{enum} @@ -3783,6 +4548,7 @@ %\end{enum} % For plain usage, we have to copy some commands from \file{latex.ltx}. % \begin{macrocode} +%<*package|letterspace> %<*plain> \def\MT@plain{2} \ifx\documentclass\@undefined @@ -3919,8 +4685,7 @@ % available, and some specifics have changed over time. Therefore, we have to % test which \pdftex\ we're using, if any. \cs{MT@pdftex@no} will be used % throughout the package to respectively do the right thing. -% -% Currently, we have to distinguish seven cases for \pdftex: +% Currently, we have to distinguish the following cases for \pdftex: %\begin{enum} % \item not running \pdftex % \item \pdftex\ ($\less$~0.14f) @@ -3930,13 +4695,13 @@ % protrusion no longer has to be set up first; % scale factor fixed to 1000; % default \cmd\efcode\,=\,1000 ($\geq$~1.20) -%\changes{v1.8}{2005/04/15}{case 5: \pdftex\ 1.30} % \item + \cmd{\(left,right)marginkern}; +%\changes{v1.8}{2005/04/15}{case 5: \pdftex\ 1.30} % \cmd\pdfnoligatures; % \cmd\pdfstrcmp; % \cmd\pdfescapestring\ ($\geq$~1.30) -%\changes{v2.0}{2005/08/20}{case 6: \pdftex\ 1.40} ^^A (beta:1) % \item + adjustment of interword spacing; +%\changes{v2.0}{2005/08/20}{case 6: \pdftex\ 1.40} ^^A (beta:1) % extra kerning; % \cmd\letterspacefont; % \cmd\pdfmatch\footnote{This command was actually introduced @@ -3944,21 +4709,28 @@ % \cmd\pdftracingfonts; % always \etex\ % ($\geq$~1.40) -%\changes{v2.2}{2007/02/23}{case 7: \pdftex\ 1.40.4} % \item + \cmd\letterspacefont\ doesn't disable ligatures and kerns; +%\changes{v2.2}{2007/02/23}{case 7: \pdftex\ 1.40.4} % \cmd\pdfcopyfont\ % ($\geq$~1.40.4) +% \item + \cmd\letterspacefont\ uses explicit \fontdim6 if specified +%\changes{v3.0}{2021/07/01}{case 8: \pdftex\ 1.40.23} +% ^^A https://git.texlive.info/texlive/commit/?id=1c7ff5528e10e989ba7ea7b72182d5f34d4d4e29 +% ($\geq$~1.40.23) %\end{enum} %\changes{v1.1}{2004/09/13}{fix: version check % (reported by \contributor Harald Harders <h.harders\at tu-bs.de>)} % ^^A private mail, 2004/09/13 % \begin{macrocode} -%<*pdftex-def> +%<*pdf-> %<debug>\MT@dinfo@nl{0}{this is pdftex \the\pdftexversion(\pdftexrevision)} -\def\MT@pdftex@no{7} +\def\MT@pdftex@no{8} \ifnum\pdftexversion = 140 - \ifnum\pdftexrevision < 4 - \def\MT@pdftex@no{6} + \ifnum\pdftexrevision < 23 + \def\MT@pdftex@no{7} + \ifnum\pdftexrevision < 4 + \def\MT@pdftex@no{6} + \fi \fi \else \ifnum\pdftexversion < 140 @@ -3984,14 +4756,14 @@ \fi \fi %<debug>\MT@dinfo@nl{0}{pdftex no.: \MT@pdftex@no} -%</pdftex-def> +%</pdf-> % \end{macrocode} %\end{macro} %\changes{v2.5}{2010/05/05}{protrusion with \xetex} %\begin{macro}{\MT@xetex@no} % \xetex\ supports character protrusion since version 0.9997. % \begin{macrocode} -%<*xetex-def> +%<*xe-> %<debug>\MT@dinfo@nl{0}{this is xetex (\the\XeTeXversion\XeTeXrevision)} \ifdim 0\XeTeXrevision pt < 0.9997pt \def\MT@xetex@no{1} @@ -3999,7 +4771,7 @@ \def\MT@xetex@no{2} \fi %<debug>\MT@dinfo@nl{0}{xetex no.: \MT@xetex@no} -%</xetex-def> +%</xe-> % \end{macrocode} %\end{macro} %\changes{v2.3c}{2008/09/09}{\luatex\ supported by default} @@ -4017,7 +4789,7 @@ % ($\geq$~0.62) % \item + almost all of the \pdftex\ primitives have been renamed ($\geq$~0.85) % \item + default \cmd\efcode\,=\,1000; -% \cmd\protrusionboundary\ [not yet supported] ($\geq$~0.90) +% \cmd\protrusionboundary\ [doesn't seem to work] ($\geq$~0.90) %\todo{interface for \cmd\protrusionboundary} % \item + \cmd\glet ($\geq$~1.10) %\end{enum} @@ -4025,7 +4797,7 @@ % Also, sometime between 1.0.4 and 1.0.7, the function |font.setexpansion| % has been introduced (but we're not using it for now). % \begin{macrocode} -%<*luatex-def> +%<*lua-> %<debug>\MT@dinfo@nl0{this is luatex (\the\luatexversion)} % \end{macrocode} %\begin{macro}{\MT@lua} @@ -4057,13 +4829,13 @@ %\end{macro} % \begin{macrocode} %<debug>\MT@dinfo@nl{0}{luatex no.: \MT@luatex@no} -%</luatex-def> +%</lua-> % \end{macrocode} %\end{macro} % \begin{macrocode} -%<*pdftex-def|xetex-def|letterspace> +%<*pdf-|xe-|letterspace> \ifnum -%<pdftex-def|xetex-def> \csname MT@\MT@engine tex@no\endcsname < 2 +%<pdf-|xe-> \csname MT@\MT@engine tex@no\endcsname < 2 %<letterspace> \MT@engine@tooold=\z@ \MT@warning@nl{You %<*letterspace> @@ -4074,8 +4846,8 @@ \else %</letterspace> are using a \MT@engine tex version older than -%<pdftex-def> 0.14f% -%<xetex-def> 0.9997% +%<pdf-> 0.14f% +%<xe-> 0.9997% %<letterspace> \MT@pdf@or@lua{1.40}{0.62}% .\MessageBreak `\MT@MT' does not work with this version.\MessageBreak @@ -4084,16 +4856,19 @@ .\MessageBreak I will quit now} \MT@clear@options \endinput\fi -%</pdftex-def|xetex-def|letterspace> +%</pdf-|xe-|letterspace> % \end{macrocode} % Still there? Then we can begin: % We need the \pkg{keyval} package, including the `new' \cmd\KV@@sp@def\ % implementation. %\changes{v2.1}{2007/01/15}{fix: \letterspace\ package forgot to load \pkg{keyval}} +% For the \opt{patch} option, we use \pkg{etoolbox}, which requires \etex. +%\changes{v3.0}{2021/05/17}{require package \pkg{etoolbox} (for \opt{patch} option)} % \begin{macrocode} %<*package|letterspace> \RequirePackage{keyval}[1997/11/10] %<*package> +^^X\RequirePackage{etoolbox} % \end{macrocode} %\begin{macro}{\MT@toks} % We need a token register. @@ -4117,6 +4892,7 @@ %\begin{macro}{\ifMT@selected} %\begin{macro}{\ifMT@noligatures} %\begin{macro}{\ifMT@draft} +%\begin{macro}{\ifMT@disable} %\begin{macro}{\ifMT@spacing} %\begin{macro}{\ifMT@kerning} %\begin{macro}{\ifMT@tracking} @@ -4129,6 +4905,7 @@ \newif\ifMT@selected \newif\ifMT@noligatures \newif\ifMT@draft +\newif\ifMT@disable \newif\ifMT@spacing \newif\ifMT@kerning \newif\ifMT@tracking @@ -4144,6 +4921,7 @@ %\end{macro} %\end{macro} %\end{macro} +%\end{macro} % [This line intentionally left blank.] %\begin{macro}{\MT@pr@level} %\begin{macro}{\MT@ex@level} @@ -4267,19 +5045,19 @@ %\begin{macro}{\MT@requires@luatex} % For definitions that depend on a particular \pdftex\ resp. \luatex\ version. % \begin{macrocode} -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \def -%<pdftex-def> \MT@requires@pdftex% -%<luatex-def> \MT@requires@luatex% +%<pdf-> \MT@requires@pdftex% +%<lua-> \MT@requires@luatex% #1{\ifnum -%<pdftex-def> \MT@pdftex@no -%<luatex-def> \MT@luatex@no +%<pdf-> \MT@pdftex@no +%<lua-> \MT@luatex@no <#1 \expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi} -%<luatex-def&debug>\MT@requires@luatex4{\MT@lua{tex.enableprimitives('pdf',{'tracingfonts'})}}\relax -%<pdftex-def&debug>\MT@requires@pdftex6{ +%<lua-&debug>\MT@requires@luatex4{\MT@lua{tex.enableprimitives('pdf',{'tracingfonts'})}}\relax +%<pdf-&debug>\MT@requires@pdftex6{ %<debug>\pdftracingfonts=1 -%<pdftex-def&debug>}\relax -%</pdftex-def|luatex-def> +%<pdf-&debug>}\relax +%</pdf-|lua-> % \end{macrocode} %\end{macro} %\end{macro} @@ -4292,19 +5070,21 @@ %\changes{v2.7}{2017/02/08}{drop \pkg{luatexbase} with recent \LaTeX} % we load the \pkg{luatexbase} package. % \begin{macrocode} -%<*luatex-def> -\@ifl@t@r\fmtversion{2016/01/01}\relax{\RequirePackage{luatexbase}} +%<lua->\@ifl@t@r\fmtversion{2016/01/01}\relax{\RequirePackage{luatexbase}} % \end{macrocode} % We load \pkg{luaotfload}, because some of its functions are % required in \file{microtype.lua}. This eliminates the need for the user to % load \pkg{fontspec} before \microtype. % There will hardly be any \luatex\ documents that don't load this package, anyway. %\changes{v2.6}{2013/06/19}{load \pkg{luaotfload} with \luatex} +%\changes{v3.0}{2021/03/21}{\letterspace\ loads \file{microtype.lua}} % Since 2017/01/01, it is already loaded in the format. % \begin{macrocode} -\@ifl@t@r\fmtversion{2017/01/01}\relax{\RequirePackage{luaotfload}} -\MT@lua{require("microtype")} -%</luatex-def> +%<lua->\@ifl@t@r\fmtversion{2017/01/01}\relax{\RequirePackage{luaotfload}} +%<letterspace>\MT@pdf@or@lua\relax{ +%<letterspace>\ifx\newluafunction\@undefined \input ltluatex \fi +%<lua-|letterspace>\MT@lua{require("microtype")} +%<letterspace>} % \end{macrocode} % Here it begins. The module was contributed by \'Elie Roux. %\changes{v2.4}{2009/11/12}{new file \file{microtype.lua} containing the \texttt{lua} functions @@ -4345,7 +5125,7 @@ end %\changes{v2.8a}{2020/02/01}{use \luatex's \cmd\glet, if available} % (finally implemented in \luatex). % \begin{macrocode} -%<luatex-def>\MT@requires@luatex6{\let\MT@glet\glet}\relax +%<lua->\MT@requires@luatex6{\let\MT@glet\glet}\relax %<*package|letterspace> \def\MT@glet{\global\let} % \end{macrocode} @@ -4442,15 +5222,15 @@ end % \end{macrocode} %\end{macro} % You do not wonder why |\MT@exp@one@c| doesn't exist, do you? -%\changes{v1.6}{2005/01/19}{use \etex's \cs{ifcsname} and \cs{ifdefined} if defined} +%\changes{v1.6}{2005/01/19}{use \etex's \orig@cs{ifcsname} and \orig@cs{ifdefined} if defined} %\begin{macro}{\MT@ifdefined@c@T} %\changes{v1.9a}{2005/11/08}{new macros: true case only} %\begin{macro}{\MT@ifdefined@c@TF} %\begin{macro}{\MT@ifdefined@n@T} %\begin{macro}{\MT@ifdefined@n@TF} % Wrapper for testing whether command resp. \cmd\csname\ sequence is defined. -% If we are running \etex, we will use its primitives \cs{ifdefined} and -% \cs{ifcsname}, which decreases memory use substantially. +% If we are running \etex, we will use its primitives \orig@cs{ifdefined} and +% \orig@cs{ifcsname}, which decreases memory use substantially. % \begin{macrocode} \def\MT@ifdefined@c@T#1{% ^^X \ifdefined#1\expandafter\@firstofone\else\expandafter\@gobble\fi @@ -4537,9 +5317,9 @@ end % \begin{macrocode} %</package> %</package|letterspace> -%<pdftex-def>\MT@requires@pdftex6{ +%<pdf->\MT@requires@pdftex6{ %<letterspace>\MT@pdf@or@lua{ -%<*pdftex-def|letterspace> +%<*pdf-|letterspace> \def\MT@ifint#1{% \ifcase\pdfmatch{^-*[0-9]+ *$}{#1}\relax \expandafter\@secondoftwo @@ -4548,8 +5328,8 @@ end \fi } }{ -%</pdftex-def|letterspace> -%<*pdftex-def|xetex-def|letterspace> +%</pdf-|letterspace> +%<*pdf-|xe-|letterspace> \def\MT@ifint#1{% \if!\ifnum9<1#1!\else?\fi \expandafter\@firstoftwo @@ -4557,9 +5337,9 @@ end \expandafter\@secondoftwo \fi } -%</pdftex-def|xetex-def|letterspace> -%<pdftex-def|letterspace>} -%<luatex-def>\def\MT@ifint#1{\csname\MT@lua{microtype.if_int([[#1]])}\endcsname} +%</pdf-|xe-|letterspace> +%<pdf-|letterspace>} +%<lua->\def\MT@ifint#1{\csname\MT@lua{microtype.if_int([[#1]])}\endcsname} %<*luafile> local function if_int(s) if find(s,"^-*[0-9]+ *$") then @@ -4584,7 +5364,7 @@ microtype.if_int = if_int %\changes{v2.2}{2007/05/10}{employ \luatex\ features if available} %\todo{fix \texttt{lua} expression} % \begin{macrocode} -%<*pdftex-def> +%<*pdf-> \MT@requires@pdftex6{ \def\MT@ifdimen#1{% \ifcase\pdfmatch{^([0-9]+([.,][0-9]+)?|[.,][0-9]+)% @@ -4595,8 +5375,8 @@ microtype.if_int = if_int \fi } }{ -%</pdftex-def> -%<*pdftex-def|xetex-def> +%</pdf-> +%<*pdf-|xe-> \def\MT@ifdimen#1{% \setbox\z@=\hbox{% \MT@count=1#1\relax @@ -4607,9 +5387,9 @@ microtype.if_int = if_int \fi }% } -%</pdftex-def|xetex-def> -%<pdftex-def>} -%<luatex-def>\def\MT@ifdimen#1{\csname\MT@lua{microtype.if_dimen([[#1]])}\endcsname} +%</pdf-|xe-> +%<pdf->} +%<lua->\def\MT@ifdimen#1{\csname\MT@lua{microtype.if_dimen([[#1]])}\endcsname} %<*luafile> local function if_dimen(s) if (find(s, "^-*[0-9]+(%a*) *$") or @@ -4647,18 +5427,18 @@ microtype.if_dimen = if_dimen %\changes{v2.2}{2007/05/10}{employ \luatex\ features if available} %\changes{v2.8}{2020/06/18}{use \xetex's \cmd\stringcmp} % \begin{macrocode} -%<*pdftex-def|xetex-def> -%<pdftex-def>\MT@requires@pdftex5{ +%<*pdf-|xe-> +%<pdf->\MT@requires@pdftex5{ \def\MT@ifstreq#1#2{% -%<pdftex-def> \ifnum\pdfstrcmp{#1}{#2}=\z@ -%<xetex-def> \ifnum\strcmp{#1}{#2}=\z@ +%<pdf-> \ifnum\pdfstrcmp{#1}{#2}=\z@ +%<xe-> \ifnum\strcmp{#1}{#2}=\z@ \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi } -%</pdftex-def|xetex-def> -%<*pdftex-def> +%</pdf-|xe-> +%<*pdf-> }{ \def\MT@ifstreq#1#2{% \edef\MT@res@a{#1}% @@ -4670,8 +5450,8 @@ microtype.if_dimen = if_dimen \fi } } -%</pdftex-def> -%<luatex-def>\def\MT@ifstreq#1#2{\csname\MT@lua{microtype.if_str_eq([[#1]],[[#2]])}\endcsname} +%</pdf-> +%<lua->\def\MT@ifstreq#1#2{\csname\MT@lua{microtype.if_str_eq([[#1]],[[#2]])}\endcsname} %<*luafile> local function if_str_eq(s1, s2) if s1 == s2 then @@ -4730,7 +5510,7 @@ microtype.if_str_eq = if_str_eq \fi } % \end{macrocode} -%\todo{think \cs{@nil} should be defined as itself} +%\todo{think \cmd\@nil\ should be defined as itself} % \begin{macrocode} \def\MT@map@clist@c#1{\MT@exp@one@n\MT@map@clist@n#1} \def\MT@map@clist@#1,{% @@ -4905,28 +5685,30 @@ microtype.if_str_eq = if_str_eq % For fonts loaded by \pkg{luaotfload} we query the font's table. % \begin{macrocode} %<letterspace>\MT@pdf@or@lua{\let\MT@if@luaotf@font\@secondoftwo}{ -%<luatex-def|letterspace>\def\MT@if@luaotf@font{\csname\MT@lua{% -%<luatex-def> microtype.if_luaotf_font() -%<*luafile|letterspace> -%<luafile>local function if_luaotf_font() +%<*lua-|letterspace> +\def\MT@if@luaotf@font{\csname\MT@lua{% + microtype.if_luaotf_font() + }\endcsname +} +%</lua-|letterspace> +%<letterspace>} +%<*luafile> +local function if_luaotf_font() local thefont = font.getfont(font.current()) if thefont and ( thefont.format == "opentype" or thefont.format == "truetype" ) then tex.write("@firstoftwo") else tex.write("@secondoftwo") end -%<luafile>end -%<luafile>microtype.if_luaotf_font = if_luaotf_font -%<luafile> -%</luafile|letterspace> -%<luatex-def|letterspace> }\endcsname -%<luatex-def|letterspace>} -%<letterspace>} +end +microtype.if_luaotf_font = if_luaotf_font + +%</luafile> % \end{macrocode} %\end{macro} %\begin{macro}{\MT@do@font} % Execute \meta{\#1} 256 times, % \begin{macrocode} -%<pdftex-def|letterspace>\def\MT@do@font{\MT@while@num\z@\@cclvi} +%<pdf-|letterspace>\def\MT@do@font{\MT@while@num\z@\@cclvi} % \end{macrocode} % resp. for the whole font for \luatex, if it's a Unicode font. %\changes{v2.5}{2010/08/14}{adapt for \luatex} @@ -4936,24 +5718,28 @@ microtype.if_str_eq = if_str_eq % ^^A private mail, 2016/05/10 %\changes{v2.8}{2020/06/20}{simplify \texttt{lua} function} % \begin{macrocode} -%<*luatex-def> +%<*lua-> \def\MT@do@font#1{% \MT@if@luaotf@font{% \def\MT@dofont@function{#1}% \MT@lua{microtype.do_font()}% }{\MT@while@num\z@\@cclvi{#1}}% } -%</luatex-def> +%</lua-> % \end{macrocode} % This is the |lua| function, which is much faster than looping through all glyphs -% in \TeX. Legacy fonts (which this function should never work on) don't contain a |v.index| field. +% in \TeX. Legacy fonts (which this function should never work on) don't contain a +% |v.index| field. +%\changes{v3.0}{2021/10/26}{guard against return values outside Unicode range (for HarfBuzz)} +% Our test whether |i| is larger than 1114111 may seem strange, but with the +% HarfBuzz renderer, we are not guaranteed to get a number within the Unicode range. % \begin{macrocode} %<*luafile> local function do_font() local thefont = font.getfont(font.current()) if thefont then for i,v in next,thefont.characters do - if v.index == nil or v.index > 0 then + if v.index == nil or ( v.index > 0 and i < 1114112 ) then microtype.sprint([[\@tempcnta=]]..i..[[\relax\MT@dofont@function]]) end end @@ -4967,7 +5753,7 @@ microtype.do_font = do_font %\changes{v2.5}{2010/05/18}{adapt for \xetex} %\changes{v2.8}{2020/02/06}{fix for \xetex} % \begin{macrocode} -%<*xetex-def> +%<*xe-> \def\MT@do@font#1{% \@tempcnta=\z@ \MT@loop @@ -4975,7 +5761,7 @@ microtype.do_font = do_font \advance\@tempcnta\@ne \ifnum\@tempcnta < \XeTeXlastfontchar\MT@font \MT@repeat } -%</xetex-def> +%</xe-> %<*package> % \end{macrocode} %\end{macro} @@ -4997,7 +5783,7 @@ microtype.do_font = do_font %\end{macro} %\end{macro} %\begin{macro}{\MT@scale} -%\changes{v1.7}{2005/02/12}{new macro: use \etex's \cs{numexpr} if available} +%\changes{v1.7}{2005/02/12}{new macro: use \etex's \cmd\numexpr\ if available} %\changes{v1.8}{2005/03/30}{fix: remove spaces in \nonetex\ variant % (reported by \contributor Mark Rossi <mark.rossi\at de.bosch.com>)} % ^^A MID: <d6uhag$qoi$1@ns2.fe.internet.bosch.com> @@ -5230,8 +6016,8 @@ microtype.do_font = do_font % The successor packages \pkg{eledmac} and \pkg{reledmac} are also supported. % \begin{macrocode} %</package> -%<pdftex-def>\MT@requires@pdftex5{ -%<*pdftex-def|luatex-def|xetex-def> +%<pdf->\MT@requires@pdftex5{ +%<*pdf-|lua-|xe-> \def\MT@ledmac@setup{% \ifMT@protrusion \MT@ifdefined@c@TF\l@dunhbox@line{% @@ -5260,8 +6046,8 @@ microtype.do_font = do_font }% \fi } -%</pdftex-def|luatex-def|xetex-def> -%<*pdftex-def> +%</pdf-|lua-|xe-> +%<*pdf-> }{ \def\MT@ledmac@setup{% \ifMT@protrusion @@ -5273,7 +6059,7 @@ microtype.do_font = do_font \fi } } -%</pdftex-def> +%</pdf-> % \end{macrocode} %\end{macro} % The \pkg{shapepar} package (v2.2) fixes this in a similar manner by itself, @@ -5300,12 +6086,18 @@ microtype.do_font = do_font % \end{macrocode} %\end{macro} %\changes{v2.8c}{2021/03/12}{add to hook for \pkg{fontspec}} +%\changes{v3.0}{2021/09/27}{fix for changed hook name order +% (reported by \contributor Frank Mittelbach <frank.mittelbach\at latex-project.org> +% and \contributor Karl Berry <karl\at freefriends.org>)} +% ^^A private mails, 2021/09/06 and 2021/09/26 %\end{macro} % We need the correct value of the former for configuration commands % inside the preamble (to get the default families right). % \begin{macrocode} \@ifl@t@r\fmtversion{2020/10/01} - {\AddToHook{package/after/fontspec}{\MT@fontspectrue}}\relax + {\IfFormatAtLeastTF{2021/11/15} + {\AddToHook{package/fontspec/after}{\MT@fontspectrue}} + {\AddToHook{package/after/fontspec}{\MT@fontspectrue}}}\relax % \end{macrocode} %\begin{macro}{\MT@maybe@gobble@with@tikz} %\begin{macro}{\MT@tikz@setup} @@ -5431,6 +6223,12 @@ time will almost certainly lead to undesired results. Have your choice!}% % ^^A https://tex.stackexchange.com/questions/165846/ % \begin{macrocode} \MT@glet\MT@setupfont@hook\@empty +% \end{macrocode} +% \microtype\ is so so loquacious~\dots\ +% Sometimes you just want to silence it when debugging a document. +% \begin{macrocode} + %\gdef\MT@setupfont@hook{\tracingnone + % \MT@info{Silently doing my `magic' (Mittelbach) for font\MessageBreak\MT@@font}}% \MT@if@false \MT@with@babel@and@T{spanish} \MT@if@true \MT@with@babel@and@T{galician}\MT@if@true @@ -5566,8 +6364,249 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@MT@pickupfont}% }% }% +% \end{macrocode} +%\changes{v3.0}{2021/04/16}{compatibility fix for \pkg{unicode-math} with \pkg{luainputenc} +% (reported by \contributor tnull <@\at @>)} +% ^^A https://tex.stackexchange.com/questions/592946/microtype-unknown-slot-number-of-character-for-palatino-in-classicthesis-w-l +% The \pkg{luainputenc} package makes all characters active, which can lead into +% problems when the \pkg{unicode-math} package is loaded, as the latter doesn't +% always define characters in <LICR>-conforming ways. By disabling the following command, +% we prevent errors; warnings about unknown slots, however, may still occur -- +% but that's one of the unavoidable downsides of using \pkg{luainputenc}. +% \begin{macrocode} + \MT@with@package@T{unicode-math}{% + \MT@let@nc{__um_sub_or_super:n}\relax + }% %</package> } +%<*package> +% \end{macrocode} +% +%\subsubsection{Protrusion patches} +% +%\begin{macro}{\ifMT@patch@ok} +%\begin{macro}{\MT@patch@info} +%\begin{macro}{\MT@patch@warn} +%\begin{macro}{\MT@patch@undef} +% We have to patch some macros to get protrusion right. +% \begin{macrocode} +\newif\ifMT@patch@ok +\def\MT@patch@info#1{\MT@info{Applying patch `#1'}} +\def\MT@patch@warn#1{\MT@warning{Unable to apply patch `#1'}} +\def\MT@patch@undef#1{\MT@warning{Patch `#1' undefined. Cannot apply it}} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@patches@def} +%\begin{macro}{\MT@define@patch} +% Define a patch and it add to the list of patches. +% The third argument may contain more revert commands, but will +% mostly be empty. +% \begin{macrocode} +\let\MT@patches@def\@gobble +\def\MT@define@patch#1#2#3{% + \g@addto@macro\MT@patches@def{,#1}% + \MT@def@n{MT@patch@@#1}{#2}% + \MT@def@n{MT@patch@undo@@#1}{#3}% +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@append@patch} +%\begin{macro}{\MT@patch@patch} +% Wrappers around \pkg{etoolbox} commands. +% We also remember the original command to allow unpatching. +% \begin{macrocode} +\def\MT@append@patch#1#2{% + \MT@remember@patch{#1}% + \apptocmd#1{#2}\relax\MT@patch@okfalse +} +\def\MT@patch@patch#1#2#3{% + \MT@remember@patch{#1}% + \patchcmd#1{#2}{#3}\relax\MT@patch@okfalse +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@remember@patch} +% Remember the original definition and add to undo command. +% \begin{macrocode} +\def\MT@remember@patch#1{% + \MT@ifdefined@n@TF{MT@patch@saved@\string#1}\relax + {\MT@let@nc{MT@patch@saved@\string#1}#1% + \MT@exp@cs\g@addto@macro{MT@patch@undo@@\MT@patch@name}% + {\MT@let@cn#1{MT@patch@saved@\string#1}}}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@patches@applied} +%\begin{macro}{\MT@apply@patch} +% Apply a previously defined patch. +% \begin{macrocode} +\let\MT@patches@applied\@gobble +\def\MT@apply@patch#1{% + \MT@patch@oktrue + \MT@ifdefined@n@TF{MT@patch@@#1} + {\MT@in@clist{#1}\MT@patches@applied + \ifMT@inlist@ + \MT@warning{Patch `#1' has already been applied,\MessageBreak + cannot reapply it}% + \else + \def\MT@patch@name{#1}% + \g@addto@macro\MT@patches@applied{,#1}% + \@nameuse{MT@patch@@#1}% + \@nameuse{MT@patch@\ifMT@patch@ok info\else warn\fi}{#1}% + \fi} + {\MT@patch@undef{#1}}% +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@undo@patch} +% Undo a patch (if indeed previously applied). +% \begin{macrocode} +\def\MT@undo@patch#1{% + \MT@in@clist{#1}\MT@patches@applied + \ifMT@inlist@ + \MT@rem@from@clist{#1}\MT@patches@applied + \@nameuse{MT@patch@undo@@#1}% + \else + \MT@warning{Patch `#1' hasn't been applied,\MessageBreak cannot revert it}% + \fi +} +% \end{macrocode} +%\end{macro} +% Unfortunately, \pkg{etoolbox} is a bit bitchy with hashes in arguments +% (but who would blame it), so I currently see no other solution than to +% temporarily reset the catcode of the \# character. +% \begin{macrocode} +{\catcode`\#=12 +\MT@addto@setup{% +% \end{macrocode} +% Now for the actual patches: +%\begin{description} +% \item [|item|] \cmd\@item, which is a kind of catch-all, as it's internally +% used for most basic environments (\eg, |itemize|, |enumerate|, but also +% |quote|, |flushleft| etc.). For |verse| (and probably other environments), ^^A found by \contributor Antonis Tsolomitis <antonis.tsolomitis\at gmail.com>, private mail, 2021/08/01 +% we also have to patch \cmd\everypar~\dots +% \begin{itemize} +% \item \pkg{beamer} patches it too +%\changes{v3.0}{2021/05/20}{protrusion patch for \cmd\item} +% \begin{macrocode} + \@ifclassloaded{beamer} + {\MT@define@patch{item} + {\MT@append@patch\@item\leftprotrusion + \MT@patch@patch\@item{\everypar{}}{\everypar{\leftprotrusion}}% + \MT@append@patch\beamer@@callorigitem\leftprotrusion + \MT@patch@patch\beamer@callorigitem{\ignorespaces}{\ignorespaces\leftprotrusion}} + {}} +% \end{macrocode} +% \item the \pkg{simplecv} class +% \begin{macrocode} + {\@ifclassloaded{simplecv} + {\MT@define@patch{item} + {\MT@append@patch\@item\leftprotrusion + \MT@append@patch\@topic@item\leftprotrusion + \MT@patch@patch\@item{\everypar{}}{\everypar{\leftprotrusion}}} + {}}% +% \end{macrocode} +% \item standard \LaTeX\ classes +% \begin{macrocode} + {\MT@define@patch{item} + {\MT@append@patch\@item\leftprotrusion + \MT@patch@patch\@item{\everypar{}}{\everypar{\leftprotrusion}}} + {}}}% +% \end{macrocode} +% \end{itemize} +% \item [|toc|] <TOC> and friends +% \begin{itemize} +% \item for the \pkg{memoir} class we also fix the extra leader problem~\dots +%\changes{v3.0}{2021/05/20}{protrusion patch for <TOC>} +% \begin{macrocode} + \@ifclassloaded{memoir} + {\MT@define@patch{toc} + {\MT@append@patch\numberline\leftprotrusion + \MT@append@patch\booknumberline\leftprotrusion + \MT@append@patch\partnumberline\leftprotrusion + \MT@append@patch\chapternumberline\leftprotrusion + \MT@append@patch\cftbookafterpnum\noprotrusion + \MT@append@patch\cftpartafterpnum\noprotrusion + \MT@append@patch\cftchapterafterpnum\noprotrusion + \MT@append@patch\cftsectionafterpnum\noprotrusion + \MT@append@patch\cftsubsectionafterpnum\noprotrusion + \MT@append@patch\cftsubsubsectionafterpnum\noprotrusion + \MT@append@patch\cftparagraphafterpnum\noprotrusion + \MT@append@patch\cftsubparagraphafterpnum\noprotrusion + \MT@append@patch\cftfigureafterpnum\noprotrusion + \MT@append@patch\cfttableafterpnum\noprotrusion} + {}} +% \end{macrocode} +% \item for the <KOMA> classes (which load the \pkg{tocbasic} package) +% we additionally have to switch protrusion back on; this will +% re-introduce the risk of getting an extra leader dot, but I +% currently don't see how to easily add \cmd\noprotrusion. +% Therefore, I'll skip this patch for now, saving the joy of wading +% through |scr| files for later, all the while waiting for somebody +% who would understand <KOMA> better than me. +%\todo{fix KOMA patch (add \cmd\noprotrusion)} +% \begin{macrocode} +% {\@ifpackageloaded{tocbasic} +% {\MT@define@patch{toc} +% {\MT@append@patch\numberline\leftprotrusion +% \setuptoc{toc}{noprotrusion}% +% \setuptoc{lof}{noprotrusion}% +% \setuptoc{lot}{noprotrusion}} +% {\unsettoc{toc}{noprotrusion}% +% \unsettoc{lof}{noprotrusion}% +% \unsettoc{lot}{noprotrusion}}} +% \end{macrocode} +% \item \dots, and for the rest: +% \begin{macrocode} + {\MT@define@patch{toc} + {\MT@append@patch\numberline\leftprotrusion} + {}}% +% \end{macrocode} +% \item (a patch for \pkg{titletoc} would also be worthwhile~\dots) +%\todo{patch for \pkg{titletoc}} +% \end{itemize} +% \item [|eqnum|] equation numbers (with or without \pkg{amsmath}). \cmd\eqref\ relies +% on \cmd\tagform@, so we have to make it use the original definition. +%\changes{v3.0}{2021/05/21}{protrusion patch for equation numbers +% (provided by \contributor Holger Gerhardt <holger.gerhardt\at uni-bonn.de>)} +% \begin{macrocode} + \@ifpackageloaded{amsmath} + {\MT@define@patch{eqnum} + {\MT@patch@patch\tagform@{(}{\leftprotrusion{(}}% + \MT@patch@patch\tagform@{)}{\rightprotrusion{)}}% + \MT@patch@patch\eqref{\tagform@}{\@nameuse{MT@patch@saved@\string\tagform@}}}% + {}} + {\MT@define@patch{eqnum} + {\MT@patch@patch\@eqnnum{(}{\leftprotrusion{(}}% + \MT@patch@patch\@eqnnum{)}{\rightprotrusion{)}}}% + {}}% +% \end{macrocode} +% \item [|footnote|] footnote text (only visible with block paragraphs). +%\changes{v3.0}{2021/05/25}{protrusion patch for footnote text} +% \begin{macrocode} + \@ifclassloaded{memoir} + {\MT@define@patch{footnote} + {\MT@patch@patch\@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}% + \MT@patch@patch\@footnotetext{\foottextfont #1}{\foottextfont\leftprotrusion #1}} + {}} + {\@ifpackageloaded{scrbase} + {\MT@define@patch{footnote} + {\MT@patch@patch\scr@saved@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}} + {}} + {\MT@define@patch{footnote} + {\MT@patch@patch\@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}} + {}}}% +}} +% \end{macrocode} +%\end{description} +% \begin{macrocode} +%</package> %</package|letterspace> % \end{macrocode} %\changes{v1.6}{2005/01/19}{load a font if none is selected} @@ -5582,7 +6621,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % Setting up a font entails checking for each feature whether it should be % applied to the current font (\cs{MT@font}). % \begin{macrocode} -%<*pdftex-def|xetex-def|luatex-def> +%<*pdf-|lua-|xe-> \def\MT@setupfont{% % \end{macrocode} %\changes{v2.5}{2012/08/22}{select font with \pkg{fontspec} (found by \contributor Georg Duffner <g.duffner\at gmail.com>)} @@ -5595,7 +6634,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % hence we might see a wrong font (in \cs{MT@get@slot}). % Therefore, we first load the current font. % \begin{macrocode} -%<xetex-def|luatex-def> \MT@font +%<xe-|lua-> \MT@font % \end{macrocode} % We might have to disable stuff when used together with adventurous % packages. @@ -5606,9 +6645,9 @@ time will almost certainly lead to undesired results. Have your choice!}% % and the use of more than one set of protrusion factors for a font within one % paragraph). % \begin{macrocode} -%<pdftex-def>\MT@requires@pdftex7{ -%<pdftex-def|luatex-def>\g@addto@macro\MT@setupfont\MT@copy@font -%<pdftex-def>}\relax +%<pdf->\MT@requires@pdftex7{ +%<pdf-|lua->\g@addto@macro\MT@setupfont\MT@copy@font +%<pdf->}\relax % \end{macrocode} % The font properties must be extracted from \cs{MT@font}, since the current % value of \cmd\f@encoding\ and friends may be wrong! @@ -5638,9 +6677,9 @@ time will almost certainly lead to undesired results. Have your choice!}% % Tracking has to come first, since it means actually loading a different font. %\changes{v2.2}{2007/04/15}{only add features that are available with the respective \pdftex} % \begin{macrocode} -%<pdftex-def>\MT@requires@pdftex6 -%<luatex-def>\MT@requires@luatex3 -%<pdftex-def|luatex-def> {\g@addto@macro\MT@setupfont\MT@tracking}\relax +%<pdf->\MT@requires@pdftex6 +%<lua->\MT@requires@luatex3 +%<pdf-|lua-> {\g@addto@macro\MT@setupfont\MT@tracking}\relax \g@addto@macro\MT@setupfont{% \MT@check@font \ifMT@inlist@ @@ -5657,22 +6696,22 @@ time will almost certainly lead to undesired results. Have your choice!}% % with 1.20, the order doesn't matter. % \begin{macrocode} \MT@protrusion -%<pdftex-def|luatex-def> \MT@expansion +%<pdf-|lua-> \MT@expansion } % \end{macrocode} % Interword spacing and kerning (\pdftex\ 1.40). % \begin{macrocode} -%<*pdftex-def> +%<*pdf-> \MT@requires@pdftex6{ \g@addto@macro\MT@setupfont{\MT@spacing\MT@kerning} }\relax -%</pdftex-def> +%</pdf-> % \end{macrocode} % Disable ligatures (\pdftex\ 1.30). % \begin{macrocode} -%<pdftex-def>\MT@requires@pdftex5{ -%<pdftex-def|luatex-def>\g@addto@macro\MT@setupfont\MT@noligatures -%<pdftex-def>}\relax +%<pdf->\MT@requires@pdftex5{ +%<pdf-|lua->\g@addto@macro\MT@setupfont\MT@noligatures +%<pdf->}\relax \g@addto@macro\MT@setupfont{% % \end{macrocode} % Debugging. @@ -5684,7 +6723,7 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@register@font \fi } -%</pdftex-def|xetex-def|luatex-def> +%</pdf-|lua-|xe-> % \end{macrocode} %\end{macro} %\begin{macro}{\MT@copy@font} @@ -5696,9 +6735,9 @@ time will almost certainly lead to undesired results. Have your choice!}% % \cs{SetProtrusion} or \cs{SetExpansion} in the preamble, or when the package % has been loaded with the \opt{copyfonts} option. % \begin{macrocode} -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \let\MT@copy@font\relax -%<pdftex-def>\MT@requires@pdftex7{ +%<pdf->\MT@requires@pdftex7{ \def\MT@copy@font@{% % \end{macrocode} %\begin{macro}{\MT@font@copy} @@ -5721,7 +6760,7 @@ time will almost certainly lead to undesired results. Have your choice!}% \else \MT@exp@two@c\let\font@name\MT@font@orig \fi -%<pdftex-def> \global\MT@exp@two@c\pdfcopyfont\MT@font@copy\font@name +%<pdf-> \global\MT@exp@two@c\pdfcopyfont\MT@font@copy\font@name % \end{macrocode} %\end{macro} % Even though \luatex\ also provides the primitive from \pdftex\ (even renamed to @@ -5734,7 +6773,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % ^^A https://tex.stackexchange.com/questions/419288/microtypecontext-with-lualatex % Therefore, we do not copy the font but load it anew. % \begin{macrocode} -%<luatex-def> \MT@exp@two@c\MT@lua@copyfont\meaning\font@name\@nil +%<lua-> \MT@exp@two@c\MT@lua@copyfont\meaning\font@name\@nil %<debug>\MT@dinfo1{creating new copy: \MT@font@copy}% % \end{macrocode} % Since it's a new font, we have to remove it from the context lists. @@ -5767,16 +6806,16 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@font \csname MT@\@tempa @#1font@list\endcsname \fi } -%<pdftex-def>}\relax +%<pdf->}\relax % \end{macrocode} %\end{macro} %\begin{macro}{\MT@lua@copy@font} % \meta{\#1} and \meta{\#2} are `|select|' and `|font|', respectively, % \meta{\#3} is the font spec. % \begin{macrocode} -%<luatex-def>\def\MT@lua@copyfont #1 #2 #3\@nil{% -%<luatex-def> \global\expandafter\font\MT@font@copy=#3\relax} -%</pdftex-def|luatex-def> +%<lua->\def\MT@lua@copyfont #1 #2 #3\@nil{% +%<lua-> \global\expandafter\font\MT@font@copy=#3\relax} +%</pdf-|lua-> % \end{macrocode} %\end{macro} %\ifpdf\phantomsection\fi\label{exp-hack} @@ -5823,20 +6862,20 @@ time will almost certainly lead to undesired results. Have your choice!}% % \xetex\ doesn't provide an equivalent to \cmd\pdffontsize, so we use the % nominal size instead. % \begin{macrocode} -%<*pdftex-def|luatex-def|xetex-def> +%<*pdf-|lua-|xe-> \def\MT@fix@fontdimen@six{% \ifnum\fontdimen6\MT@font=\z@ \fontdimen6\MT@font=% -%<pdftex-def> \pdffontsize\MT@font -%<luatex-def> \MT@requires@luatex4{\pdffeedback fontsize}{\pdffontsize}\MT@font -%<xetex-def> \MT@size pt +%<pdf-> \pdffontsize\MT@font +%<lua-> \MT@requires@luatex4{\pdffeedback fontsize}{\pdffontsize}\MT@font +%<xe-> \MT@size pt \MT@info{Fixing zero \string\fontdimen 6 for font `\MT@@font'\MessageBreak (new value: \the\fontdimen6\MT@font)}% - \MT@glet@nc{\MT@@font-fake6}\@empty +%<pdf-> \MT@requires@pdftex8\relax{\MT@glet@nc{\MT@@font-fake6}\@empty}% \fi \edef\MT@dimen@six{\number\fontdimen6\MT@font}% } -%</pdftex-def|luatex-def|xetex-def> +%</pdf-|lua-|xe-> % \end{macrocode} %\end{macro} %\end{macro} @@ -6076,7 +7115,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % \end{macrocode} %\end{macro} % -%\subsubsection{Protrusion} +%\subsubsection{Protrusion}\label{ssub:setup-prot} % %\begin{macro}{\ifMT@nofamily} % Info for settings that are not family-specific. @@ -6088,14 +7127,13 @@ time will almost certainly lead to undesired results. Have your choice!}% % ^^A (beta:07) % \begin{macrocode} \newif\ifMT@nofamily -%</package> % \end{macrocode} %\end{macro} %\begin{macro}{\MT@protrusion} % Set up for protrusion? % \begin{macrocode} -%<*pdftex-def|xetex-def|luatex-def> \def\MT@protrusion{\MT@maybe@do{pr}} +%</package> % \end{macrocode} %\end{macro} %\begin{macro}{\MT@set@pr@codes} @@ -6105,8 +7143,11 @@ time will almost certainly lead to undesired results. Have your choice!}% % characters} %\changes{v1.6}{2004/12/18}{introduce \texttt{factor} option} % \begin{macrocode} -\def\MT@set@pr@codes{% - \MT@nofamilyfalse +%<*pdf-|lua-|xe-|show> +%<show>\def\MTS@show@pr +%<pdf-|lua-|xe->\def\MT@set@pr@codes + {% +%<pdf-|lua-|xe-> \MT@nofamilyfalse % \end{macrocode} % Check whether and if, which list should be applied to the current font. % If family-specific settings don't exist, we write it to the log @@ -6115,7 +7156,9 @@ time will almost certainly lead to undesired results. Have your choice!}% % ^^A private mail, 2013/01/24 % (for each encoding). % \begin{macrocode} +%<show> \MTS@printtext{Protrusion settings for font `\texttt{\MT@@font}':}\\ \MT@if@list@exists{% +%<*pdf-|lua-|xe-> \ifMT@nofamily \MT@ifdefined@n@TF{\MT@encoding-\MT@family-settings}\relax{% \MT@info@nl{Loading generic protrusion settings for font family\MessageBreak @@ -6125,6 +7168,8 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@glet@nc{\MT@encoding-\MT@family-settings}\@empty }% \fi +%</pdf-|lua-|xe-> +%<show> \MTS@printtext{First matching list is for `\texttt{\@tempa}':\\\texttt{\MT@pr@c@name}}% \MT@get@opt \MT@reset@pr@codes % \end{macrocode} @@ -6145,7 +7190,22 @@ time will almost certainly lead to undesired results. Have your choice!}% % \begin{macrocode} \MT@let@cn\@tempc{MT@pr@c@\MT@pr@c@name}% \expandafter\MT@set@codes\@tempc,\relax,% - }\MT@reset@pr@codes +%<show> \vrule width 4cm height .5pt \\ +%<show> \MTS@printtext{End of list `\texttt{\MT@pr@c@name}'}\\[.5em] +%<show> \MT@ifdefined@c@T\MT@pr@inh@name{% +%<show> \MT@ifdefined@n@T{MT@inh@\MT@pr@inh@name @prefixes}{% +%<show> \par \MTS@printtext{(with prefixes:)}% +%<show> \@tempcntb=\z@ +% \end{macrocode} +% Set unconditional heirs. +% \begin{macrocode} + \MT@set@pr@prefixheirs +%<show> }}% +%<show> \ifShowMissingGlyphs\MTS@show@missing\fi + }% +%<show> {\MTS@printtext{NOT DEFINED}% + \MT@reset@pr@codes +%<show> }\par } % \end{macrocode} %\end{macro} @@ -6158,6 +7218,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % ^^A https://tex.stackexchange.com/questions/25036/microtype-package-v-2-5-beta-06-and-footnote-protrusion % ^^A (beta:08) % \begin{macrocode} +%<*pdf-|lua-|xe-> \def\MT@set@all@pr#1#2{% %<debug>\MT@dinfo@nl{3}{-- lp/rp: setting all to #1/#2}% \let\MT@temp\@empty @@ -6185,14 +7246,14 @@ time will almost certainly lead to undesired results. Have your choice!}% % the margin kerns. This will be activated in \cs{MT@set@tr@codes}. % \begin{macrocode} \def\MT@the@pr@code{\@tempcntb} -%<*pdftex-def|luatex-def> -%<pdftex-def>\MT@requires@pdftex6 -%<luatex-def>\MT@requires@luatex3 +%<*pdf-|lua-> +%<pdf->\MT@requires@pdftex6 +%<lua->\MT@requires@luatex3 {\def\MT@the@pr@code@tr{% \numexpr\@tempcntb+\MT@letterspace@/2\relax } }\relax -%</pdftex-def|luatex-def> +%</pdf-|lua-> % \end{macrocode} %\end{macro} %\end{macro} @@ -6219,8 +7280,8 @@ time will almost certainly lead to undesired results. Have your choice!}% \def\@tempa{#1}% \ifx\@tempa\@empty \else \MT@get@slot -%<pdftex-def|luatex-def> \ifnum\MT@char > \m@ne -%<xetex-def> \ifx\MT@char\@empty \else +%<pdf-|lua-> \ifnum\MT@char > \m@ne +%<xe-> \ifx\MT@char\@empty \else \MT@get@char@unit \csname MT@\MT@feat @split@val\endcsname#2\relax \fi @@ -6230,19 +7291,34 @@ time will almost certainly lead to undesired results. Have your choice!}% %\end{macro} %\begin{macro}{\MT@pr@split@val} % \begin{macrocode} -\def\MT@pr@split@val#1,#2\relax{% - \def\@tempb{#1}% - \MT@ifempty\@tempb\relax{% - \MT@scale@to@em - \lpcode\MT@font\MT@char=\MT@the@pr@code -%<debug>\MT@dinfo@nl{4}{;;; lp (\MT@char): \number\lpcode\MT@font\MT@char\space: [#1]}% +\def\MT@pr@split@val#1,#2\relax +%</pdf-|lua-|xe-> +%<show>\def\MTS@pr@split@val#1,#2\relax + {\def\@tempb{#1}% + \MT@ifempty\@tempb +%<pdf-|lua-|xe-> \relax +%<show> {\MTS@lp@=\z@ \let\MTS@lpcode\@empty}% + {\MT@scale@to@em +%<pdf-|lua-|xe-> \lpcode\MT@font\MT@char=\MT@the@pr@code +%<show> \MTS@lp@=\dimexpr\@tempcntb em/1000\relax\relax +%<show> \edef\MTS@lpcode{[\@tempb] \the\@tempcntb/\the\MTS@lp@}% +%<debug>\MT@dinfo@nl{4}{;;; lp (\MT@char): \number\lpcode\MT@font\MT@char: [#1]}% }% \def\@tempb{#2}% - \MT@ifempty\@tempb\relax{% - \MT@scale@to@em - \rpcode\MT@font\MT@char=\MT@the@pr@code -%<debug>\MT@dinfo@nl{4}{;;; rp (\MT@char): \number\rpcode\MT@font\MT@char\space: [#2]}% + \MT@ifempty\@tempb +%<pdf-|lua-|xe-> \relax +%<show> {\MTS@rp@=\z@ \let\MTS@rpcode\@empty}% + {\MT@scale@to@em +%<pdf-|lua-|xe-> \rpcode\MT@font\MT@char=\MT@the@pr@code +%<show> \MTS@rp@=\dimexpr\@tempcntb em/1000\relax\relax +%<show> \edef\MTS@rpcode{[\@tempb] \the\@tempcntb/\the\MTS@rp@}% +%<debug>\MT@dinfo@nl{4}{;;; rp (\MT@char): \number\rpcode\MT@font\MT@char: [#2]}% }% +%<show> \llap{\MTS@show@char@pr\MT@char\quad}% +%<show> \parbox[b][][b]{3.5cm}{\MTS@printtext{% +%<show> \footnotesize\makebox[.4cm][l]{L:} \MT@ifempty{\MTS@lpcode}{---}{\MTS@lpcode}\\ +%<show> \makebox[.4cm][l]{R:} \MT@ifempty{\MTS@rpcode}{---}{\MTS@rpcode}}}% +%<show> \parbox[t][][t]{\dimexpr\textwidth-3.5cm}{% % \end{macrocode} % Now we can set the values for the inheriting characters. Their slot numbers % are saved in the macro |\MT@inh@|\meta{list name}|@|\meta{slot number}|@|. @@ -6251,10 +7327,13 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@ifdefined@n@T{MT@inh@\MT@pr@inh@name @\MT@char @}{% \MT@exp@cs\MT@map@tlist@c {MT@inh@\MT@pr@inh@name @\MT@char @}% - \MT@set@pr@heirs +%<pdf-|lua-|xe-> \MT@set@pr@heirs +%<show> \MTS@show@char@pr }% }% +%<show> }\newline } +%<*pdf-|lua-|xe-> % \end{macrocode} %\end{macro} %\begin{macro}{\MT@scale@to@em} @@ -6266,21 +7345,21 @@ time will almost certainly lead to undesired results. Have your choice!}% %\changes{v1.5}{2004/12/10}{don't use \cmd\lpcode\ and \cmd\rpcode\ for the % calculation} % Unlike \file{protcode.tex} and \pkg{pdfcprot}, we do not calculate with -% \cs{lpcode} resp. \cs{rpcode}, since this would disallow protrusion factors -% larger than the character width (since \cs{[lr]pcode}'s limit is 1000). Now, +% \cmd\lpcode\ resp. \cmd\rpcode, since this would disallow protrusion factors +% larger than the character width (since \verb!\[lr]pcode!'s limit is 1000). Now, % the maximum protrusion is \EM{1} of the font. % % The unit is in \cs{MT@count}, the desired factor in \cmd\@tempb, and the % result will be returned in \cmd\@tempcntb. % \begin{macrocode} -%<pdftex-def>\MT@requires@pdftex3{ +%<pdf->\MT@requires@pdftex3{ \def\MT@scale@to@em{% \@tempcntb=\MT@count\relax % \end{macrocode} % For really huge fonts (100\,pt or so), an arithmetic overflow could occur % with vanilla \TeX. Using \etex, this can't happen, since the intermediate % value is 64\,bit, which could only be reached with a character width larger -% than \cs{maxdimen}. +% than \cmd\maxdimen. % \begin{macrocode} \MT@scale\@tempcntb \@tempb \MT@dimen@six \ifnum\@tempcntb=\z@ \else @@ -6296,24 +7375,24 @@ time will almost certainly lead to undesired results. Have your choice!}% %\changes{v1.8}{2005/05/25}{warning for missing (resp. zero-width) characters} % \begin{macrocode} \def\MT@get@charwd{% -%<*pdftex-def> +%<*pdf-> ^^X \MT@count=\fontcharwd\MT@font\MT@char\relax ^^Q \setbox\z@=\hbox{\MT@font \char\MT@char}% ^^Q \MT@count=\wd\z@ -%</pdftex-def> -%<luatex-def> \MT@count=\fontcharwd\MT@font\MT@char\relax +%</pdf-> +%<lua-> \MT@count=\fontcharwd\MT@font\MT@char\relax % \end{macrocode} % \cs{MT@char} contains a slot number (legacy fonts), a Unicode number, % or a glyph name (if \cs{MT@char@} is negative). % \begin{macrocode} -%<*xetex-def> +%<*xe-> \ifnum\MT@char@<\z@ \setbox\z@=\hbox{\MT@font \XeTeXglyph-\MT@char@}% \MT@count=\wd\z@ \else \MT@count=\fontcharwd\MT@font\MT@char@\relax \fi -%</xetex-def> +%</xe-> \ifnum\MT@count=\z@ \MT@info@missing@char \fi } % \end{macrocode} @@ -6323,7 +7402,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % \cs{MT@set@pr@codes}. % The letterspaced font is already loaded so that \EM{1} = \fontdim6. % \begin{macrocode} -%<*pdftex-def> +%<*pdf-> \MT@requires@pdftex6{ \g@addto@macro\MT@get@charwd{% \MT@ifdefined@c@T\MT@letterspace@ @@ -6346,8 +7425,9 @@ time will almost certainly lead to undesired results. Have your choice!}% % \begin{macrocode} \def\MT@get@charwd{\MT@count=\MT@dimen@six} } -%</pdftex-def> -%</pdftex-def|xetex-def|luatex-def> +%</pdf-> +%</pdf-|lua-|xe-> +%</pdf-|lua-|xe-|show> % \end{macrocode} %\begin{macro}{\MT@get@font@dimen} % For the |space| unit. @@ -6610,26 +7690,89 @@ time will almost certainly lead to undesired results. Have your choice!}% %<debug>\MT@dinfo@nl{1}{loading input encoding: \@nameuse{\@tempa}}% \inputencoding{\@nameuse{\@tempa}}% } -%</package> % \end{macrocode} %\end{macro} %\begin{macro}{\MT@set@pr@heirs} % Set the inheriting characters. % \begin{macrocode} -%<*pdftex-def|xetex-def|luatex-def> \def\MT@set@pr@heirs#1{% \lpcode\MT@font #1=\lpcode\MT@font\MT@char\relax \rpcode\MT@font #1=\rpcode\MT@font\MT@char\relax %<debug>\MT@dinfo@nl{2}{-- heir of \MT@char: #1}% -%<debug>\MT@dinfo@nl{4}{;;; lp/rp (#1): \number\lpcode\MT@font\MT@char\space/% -%<debug> \number\rpcode\MT@font\MT@char\space}% +%<debug>\MT@dinfo@nl{4}{;;; lp/rp (#1): \number\lpcode\MT@font\MT@char/% +%<debug> \number\rpcode\MT@font\MT@char}% } % \end{macrocode} %\end{macro} +%\begin{macro}{\MT@set@pr@prefixheirs} +% Inheriting characters that have been specified in a prefixed list. +% \begin{macrocode} +\def\MT@set@pr@prefixheirs{% + \MT@ifdefined@c@T\MT@pr@inh@name{% + \MT@ifdefined@n@T{MT@inh@\MT@pr@inh@name @prefixes}{% + \MT@exp@cs\MT@map@tlist@c + {MT@inh@\MT@pr@inh@name @prefixes}% + \MT@set@pr@prefixes + }% + }% +} +%</package> +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@pr@prefixes} +%\begin{macro}{\MT@set@pr@prefixes@} +% Add |charwidth(inheriting char)-charwidth(base char)| to either left or +% right side or half the amount to both sides. For \xetex, we may have to +% translate to glyph numbers because \cmd\fontcharwd\ doesn't have the nice +% feature of understanding the `|U|' or `|/|' prefixes. +% \begin{macrocode} +%<*pdf-|lua-|xe-|show> +%<pdf-|lua-|xe->\def\MT@set@pr@prefixes#1{\MT@set@pr@prefixes@#1} +%<pdf-|lua-|xe->\def\MT@set@pr@prefixes@#1#2#3#4% +%<show>\def\MTS@set@pr@prefixes@#1#2#3#4% + {% +%<show> \MTS@lp@=\z@ \MTS@rp@=\z@ +%<show> \ifnum#1=\@tempcntb \else +%<show> \par\leavevmode +%<show> \llap{\MTS@show@char@pr{#1} \MTS@printtext{=} }% +%<show> \fi +%<*xe-> + \edef\@tempa{\expandafter\ifx\@car#1\@nil U\@gobble#1\else\number\XeTeXglyphindex"#1" \fi}% + \edef\@tempb{\expandafter\ifx\@car#2\@nil U\@gobble#2\else\number\XeTeXglyphindex"#2" \fi}% +%</xe-> + \@tempcnta=\z@ + \ifnum#3>\z@ + \@tempcnta=\numexpr +%<pdf-|lua-|show> (\fontcharwd\MT@font#2-\fontcharwd\MT@font#1)% +%<xe-> (\fontcharwd\MT@font\@tempb-\fontcharwd\MT@font\@tempa)% + *#3/\MT@dimen@six\relax + \fi +%<pdf-|lua-|xe-> \lpcode\MT@font #2=\numexpr\lpcode\MT@font#1+\@tempcnta\relax +%<show> \MTS@lp@=\dimexpr\numexpr\lpcode\MT@font#1+\@tempcnta\relax em/1000\relax + \@tempcnta=\z@ + \ifnum#4>\z@ + \@tempcnta=\numexpr +%<pdf-|lua-|show> (\fontcharwd\MT@font#2-\fontcharwd\MT@font#1)% +%<xe-> (\fontcharwd\MT@font\@tempb-\fontcharwd\MT@font\@tempa)% + *#4/\MT@dimen@six\relax + \fi +%<pdf-|lua-|xe-> \rpcode\MT@font #2=\numexpr\rpcode\MT@font#1+\@tempcnta\relax +%<show> \MTS@rp@=\dimexpr\numexpr\rpcode\MT@font#1+\@tempcnta\relax em/1000\relax +%<debug>\MT@dinfo@nl{2}{-- (prefix) heir of #1: #2}% +%<debug>\MT@dinfo@nl{4}{;;; lp/rp (#2): \number\lpcode\MT@font#2/% +%<debug> \number\rpcode\MT@font#2}% +%<show> \MTS@show@char@pr{#2}% +%<show> \@tempcntb=#1\relax +} +%</pdf-|lua-|xe-|show> +% \end{macrocode} +%\end{macro} +%\end{macro} %\begin{macro}{\MT@preset@pr} %\begin{macro}{\MT@preset@pr@} % Preset characters. Presetting them relative to their widths is not allowed. % \begin{macrocode} +%<*package> \def\MT@preset@pr{% \expandafter\expandafter\expandafter\MT@preset@pr@ \csname MT@pr@c@\MT@pr@c@name @preset\endcsname\@nil @@ -6674,10 +7817,299 @@ time will almost certainly lead to undesired results. Have your choice!}% \def\MT@warn@preset@towidth#1{% \MT@warning@nl{% Cannot preset characters relative to their widths\MessageBreak - for \@nameuse{MT@abbr@#1} list `\@nameuse{MT@#1@c@name}'. Presetting them% - \MessageBreak relative to 1em instead}% + for \@nameuse{MT@abbr@#1} list `\@nameuse{MT@#1@c@name}'. + Presetting them\MessageBreak relative to 1em instead}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\noprotrusion} +%\changes{v3.0}{2021/05/15}{provide command for older \LaTeX\ versions} +% This command may be used to inhibit protrusion on either side. It's part +% of \LaTeX\ since 2018-12-01. +% We provide it for older releases. +% \begin{macrocode} +\MT@ifdefined@c@TF\noprotrusion\relax{ + \DeclareRobustCommand\noprotrusion{\leavevmode\kern-\p@\kern\p@} +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@tempbox} +%\begin{macro}{\MT@leftmarginkern} +%\begin{macro}{\MT@rightmarginkern} +% \begin{macrocode} +\newbox\MT@tempbox +\newdimen\MT@leftmarginkern +\newdimen\MT@rightmarginkern +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\leftprotrusion} +%\changes{v3.0}{2021/05/15}{new command} +% This command may be used to add protrusion on the left hand side. +% We try to reconstruct the next glyph (possibly a ligature).\footnote{ +% \luatex\ offers the command \cmd\protrusionboundary, which could +% potentially be very helpful here, but it doesn't seem to do what it +% promises (not even the example from the manual works as advertised).} +% ^^A cf. https://mailman.ntg.nl/pipermail/dev-luatex/2021-May/006486.html +% \begin{macrocode} +\DeclareRobustCommand\leftprotrusion{% + \MT@toks{}% + \MT@prot@get@firstchar +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@prot@l} +% These macros need to be \cmd\long. +% \begin{macrocode} +\long\def\MT@prot@l#1{% + \MT@get@prot{#1}% + \ifdim\MT@leftmarginkern=\z@ \else + \leavevmode + \MT@vinfo{|<< adding left margin kern for `\@tempa':\MessageBreak + \the\MT@leftmarginkern \on@line}% + \kern\MT@leftmarginkern + \fi + #1% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\rightprotrusion} +% Unfortunately, there's no way to retrieve anything that's already been typeset, +% so the counterpart cannot be symmetric. +%\changes{v3.0}{2021/05/15}{new command} +% \begin{macrocode} +\DeclareRobustCommand\rightprotrusion{\MT@prot@r} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@prot@r} +% \begin{macrocode} +\long\def\MT@prot@r#1{% + #1% + \MT@get@prot{#1}% + \ifdim\MT@rightmarginkern=\z@ \else + \MT@vinfo{>>| adding right margin kern for `\@tempa':\MessageBreak + \the\MT@rightmarginkern \on@line}% + \kern\MT@rightmarginkern + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@get@prot} +% Typeset the text inside a box and get the left and right margin kerns. +% We add an extra \cmd\vbox\ in case we're inside a |tabular|. +% \cmd\@newlistfalse\ is meant to make \cmd\\ work in |centering| etc. +% \begin{macrocode} +\long\def\MT@get@prot#1{% + \MT@leftmarginkern=\z@ + \MT@rightmarginkern=\z@ + \begingroup + \setbox\MT@tempbox\vbox{% + \everypar{}% + \parfillskip=\z@skip + \hbadness\@M + \@newlistfalse + \noindent #1}% + \vbadness=\@M + \splittopskip=\z@ + \setbox\MT@tempbox\vbox{% + \global\setbox\MT@tempbox=\vsplit\MT@tempbox to \normalbaselineskip + \unvbox\MT@tempbox + \global\setbox\MT@tempbox=\lastbox + }% + \endgroup + \ifhbox\MT@tempbox + \def\@tempa{#1}% + \MT@leftmarginkern=\leftmarginkern\MT@tempbox\relax + \MT@rightmarginkern=\rightmarginkern\MT@tempbox\relax + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@prot@ifx} +% Test next token. +% \begin{macrocode} +\def\MT@prot@ifx#1{% + \ifx\MT@prot@next#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@prot@ifcat} +% Test catcode of next token. +% \begin{macrocode} +\def\MT@prot@ifcat#1{% + \ifcat#1\noexpand\MT@prot@next\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@prot@ifmacro} +%\begin{macro}{\MT@prot@ifmacro@} +%\begin{macro}{\MT@prot@ifmacro@@} +% Test whether \meta{\#1} is a macro or an active character +% that does not take an argument. +% (inspired by Joseph Wright). ^^A https://tex.stackexchange.com/a/331696/ +% Only works with \etex. +% \begin{macrocode} +^^X\def\MT@prot@ifmacro{% +^^X \expandafter\MT@prot@ifmacro@\meaning\MT@prot@next\@nil +^^X} +^^X\edef\MT@prot@ifmacro@#1\@nil{% +^^X \noexpand\MT@prot@ifmacro@@#1{}{}\detokenize{macro:->}\noexpand\@nil +^^X} +^^X\edef\MT@temp{% +^^X \def\noexpand\MT@prot@ifmacro@@##1\detokenize{macro:->}##2\noexpand\@nil{% +^^X \noexpand\ifx\relax##1\relax +^^X \unexpanded{\expandafter\@firstofone\else\expandafter\@gobble\fi}% +^^X }% +^^X} +^^X\MT@temp +^^Q\let\MT@prot@ifmacro\@gobble +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@prot@iffirstcmd} +% Test for the first command. +% \begin{macrocode} +\def\MT@prot@iffirstcmd#1{% + \ifx\relax#1\relax\expandafter\@secondoftwo\else + \MT@exp@two@c\ifx\@car\MT@prot@next\relax\@empty\@nil#1% + \expandafter\expandafter\expandafter\@firstoftwo + \else + \expandafter\expandafter\expandafter\@secondoftwo + \fi + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@prot@iflicrcmd} +% Fun with <LICR>: +% Test if the first command of the third command of the first command +% is \cmd\@text@composite, in which case also grab the next token, +% otherwise it should be a text command. +% \begin{macrocode} +\def\MT@getthird#1#2#3#4\@nil{#3} +\def\MT@prot@iflicrcmd#1{% + \MT@exp@cs\MT@prot@iffirstcmd{#1-cmd}{% + \expandafter\expandafter\expandafter\let + \expandafter\expandafter\expandafter\@tempa + \expandafter\MT@getthird\MT@prot@next\relax\@nil + \MT@exp@two@c\ifx\@car\@tempa\relax\@nil\@text@composite + \def\MT@temp*##1##2{\MT@prot@l{##1##2}}% + \else + \def\MT@temp*##1{\MT@prot@l{##1}}% + \fi + \@gobble + }\@firstofone +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@prot@get@firstchar} +%\begin{macro}{\MT@prot@get@nextchar} +% Scan token by token. +% \begin{macrocode} +\def\MT@prot@get@firstchar{\futurelet\MT@prot@next\MT@prot@get@first@char} +\def\MT@prot@get@nextchar{\futurelet\MT@prot@next\MT@prot@get@next@char} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@prot@get@first@char} +% If next char is |{|, treat what follows as an argument, else continue until +% we find a beginning char. +% \begin{macrocode} +\def\MT@prot@get@first@char{% + \def\MT@temp*##1{\MT@prot@get@firstchar}% + \MT@prot@ifcat\bgroup{% + \long\def\MT@temp*##1{{\MT@prot@l{##1}}}% + }{% + \MT@prot@ifx\ignorespaces\relax{% + \MT@prot@ifx\relax\relax{% + \MT@prot@ifx\@sptoken{% + \def\MT@temp* {\MT@prot@get@firstchar}% + }{% +% \end{macrocode} +% But only add it if it's a letter or a character, \dots +% \begin{macrocode} + \def\MT@temp*{\MT@prot@addtoken@first}% + \MT@prot@ifcat{a}\relax{% + \MT@prot@ifcat{!}\relax{% +% \end{macrocode} +% \dots~or a command/active char whose first command is one of the below. +% \begin{macrocode} + \def\MT@temp*{}% + \MT@prot@ifmacro{% + \MT@prot@iffirstcmd\UTFviii@two@octets{% + \def\MT@temp*##1##2{\MT@prot@l{##1##2}}% + }{% + \MT@prot@iffirstcmd\UTFviii@three@octets{% + \def\MT@temp*##1##2##3{\MT@prot@l{##1##2##3}}% + }{% + \MT@prot@iffirstcmd\UTFviii@four@octets{% + \def\MT@temp*##1##2##3##4{\MT@prot@l{##1##2##3##4}}% + }{% + \MT@prot@iflicrcmd{T1}{% + \MT@prot@iflicrcmd{TU}{% + \MT@prot@iflicrcmd{LY1}{% + \MT@prot@iflicrcmd{OT1}{% + \MT@prot@iflicrcmd{T2A}\relax % should we add more encodings? + }% + }% + }% + }% + }% + }% + }% + }% + }% + }% + }% + }% + }% + }% + \MT@temp*% } -%</pdftex-def|xetex-def|luatex-def> +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@prot@ifx} +% Continue if letter or other. +% \begin{macrocode} +\def\MT@prot@get@next@char{% + \def\MT@temp*{\MT@prot@addtoken@next}% + \MT@prot@ifcat{a}\relax{% + \MT@prot@ifcat{!}\relax{% + \def\MT@temp*{\MT@prot@l{\the\MT@toks}}% + }% + }% + \MT@temp*% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@prot@addtoken@first} +% Begin filling toks. +% \begin{macrocode} +\def\MT@prot@addtoken@first#1{% + \edef\MT@temp{\MT@toks={\the\MT@toks\noexpand#1}}\MT@temp + \MT@prot@get@nextchar +} +%</package> +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@prot@addtoken@next} +% Add token to our toks and test whether we've seen enough (ligature completed). +% For luatex, we have to jump through another hoop (\ie, box), because, contrary +% to the manual, \cmd\lastnodetype\ isn't really compatible. ^^A cf. https://mailman.ntg.nl/pipermail/dev-luatex/2021-August/006536.html et seqq. +% \begin{macrocode} +%<*pdf-|lua-|xe-> +\def\MT@prot@addtoken@next#1{% + \edef\MT@temp{\MT@toks={\the\MT@toks\noexpand#1}}\MT@temp + \setbox\MT@tempbox\hbox{\the\MT@toks +%<pdf-|xe-> \relax +%<lua-> }\setbox\MT@tempbox\hbox{\unhbox\MT@tempbox + \ifnum\lastnodetype=7 \aftergroup\@firstoftwo\else\aftergroup\@secondoftwo\fi}% + \MT@prot@get@nextchar + {\MT@prot@l{\the\MT@toks}}% +} +%</pdf-|lua-|xe-> % \end{macrocode} %\end{macro} % @@ -6686,7 +8118,7 @@ time will almost certainly lead to undesired results. Have your choice!}% %\begin{macro}{\MT@expansion} % Set up for expansion? % \begin{macrocode} -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \def\MT@expansion{\MT@maybe@do{ex}} % \end{macrocode} %\end{macro} @@ -6711,7 +8143,7 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@expandfont }\relax } -%</pdftex-def|luatex-def> +%</pdf-|lua-> % \end{macrocode} %\end{macro} % @@ -6726,7 +8158,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % \end{macrocode} %\end{macro} % \begin{macrocode} -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \def\MT@set@ex@codes@n{% \MT@nonselectedtrue \MT@if@list@exists @@ -6763,7 +8195,7 @@ time will almost certainly lead to undesired results. Have your choice!}% %\changes{v2.7d}{2019/11/17}{use \luatex\ function \texttt{font.}\penalty\exhyphenpenalty\texttt{setexpansion} if available} %\fi % \begin{macrocode} -%<*luatex-def> +%<*lua-> \MT@requires@luatex3{ \MT@requires@luatex4{\let\pdffontexpand\expandglyphsinfont}\relax \ifnum\luatexversion<79 @@ -6776,11 +8208,11 @@ time will almost certainly lead to undesired results. Have your choice!}% } \fi }{ -%</luatex-def> +%</lua-> \def\MT@expandfont{% \pdffontexpand\MT@font \MT@stretch@ \MT@shrink@ \MT@step@ \MT@auto@\relax } -%<luatex-def>} +%<lua->} % \end{macrocode} %\end{macro} %\begin{macro}{\MT@set@all@ex} @@ -6802,8 +8234,8 @@ time will almost certainly lead to undesired results. Have your choice!}% %\changes{v1.6a}{2005/01/30}{only reset \cmd\efcode s for older \pdftex\ versions} %\changes{v2.7}{2017/02/13}{only reset \cmd\efcode s for older \luatex\ versions} % \begin{macrocode} -%<pdftex-def>\MT@requires@pdftex4 -%<luatex-def>\MT@requires@luatex5 +%<pdf->\MT@requires@pdftex4 +%<lua->\MT@requires@luatex5 { \def\MT@reset@ef@codes{% \ifnum\MT@ex@factor@=\@m \else @@ -6876,9 +8308,9 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@get@ex@opt@{stretch}{Setting stretch limit to \number\MT@stretch@}% \MT@get@ex@opt@{shrink} {Setting shrink limit to \number\MT@shrink@}% \MT@get@ex@opt@{step} {Setting expansion step to \number\MT@step@}% -%<luatex-def> \MT@requires@luatex3\relax{% +%<lua-> \MT@requires@luatex3\relax{% \MT@get@ex@opt@{auto}{\MT@ifstreq{\MT@auto@}{autoexpand}{En}{Dis}abling automatic expansion}% -%<luatex-def> }% +%<lua-> }% \MT@ifdefined@n@T{MT@ex@c@\MT@ex@c@name @preset}{% \MT@preset@ex \let\MT@reset@ef@codes\relax @@ -6919,7 +8351,7 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@scale@factor \MT@set@all@ex\@tempcntb } -%</pdftex-def|luatex-def> +%</pdf-|lua-> % \end{macrocode} %\end{macro} % @@ -6928,7 +8360,7 @@ time will almost certainly lead to undesired results. Have your choice!}% %\begin{macro}{\MT@spacing} % Adjustment of interword spacing? Only works with \pdftex. % \begin{macrocode} -%<*pdftex-def> +%<*pdf-> \MT@requires@pdftex6{ \def\MT@spacing{\MT@maybe@do{sp}} % \end{macrocode} @@ -7140,7 +8572,7 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@set@all@kn\@tempa\@tempb } }\relax -%</pdftex-def> +%</pdf-> % \end{macrocode} %\end{macro} %\end{macro} @@ -7151,9 +8583,9 @@ time will almost certainly lead to undesired results. Have your choice!}% %\changes{v2.5}{2010/09/17}{letterspacing with \luatex\ 0.62} ^^A (beta:03) % or \luatex\ 0.62. % \begin{macrocode} -%<*pdftex-def|luatex-def> -%<pdftex-def>\MT@requires@pdftex6 -%<luatex-def>\MT@requires@luatex3 +%<*pdf-|lua-> +%<pdf->\MT@requires@pdftex6 +%<lua->\MT@requires@luatex3 { % \end{macrocode} %\begin{macro}{\MT@tracking} @@ -7174,9 +8606,9 @@ time will almost certainly lead to undesired results. Have your choice!}% \fi \fi } -%</pdftex-def|luatex-def> -%<pdftex-def|luatex-def|letterspace>\let\MT@tracking -%<pdftex-def|luatex-def> \MT@tracking@ +%</pdf-|lua-> +%<pdf-|lua-|letterspace>\let\MT@tracking +%<pdf-|lua-> \MT@tracking@ %<letterspace> \relax % \end{macrocode} %\end{macro} @@ -7187,26 +8619,33 @@ time will almost certainly lead to undesired results. Have your choice!}% % settings from \cs{SetTracking}, or the global \opt{letterspace} option, in % this order. % -% Tracking won't work if the original font's \fontdim6 is zero, in which +% Tracking won't work with older \pdftex\ versions (\less\ 1.40.23) +% if the original font's \fontdim6 is zero, in which +%\changes{v3.0}{2021/06/11}{with \luatex, tracking also works for fonts with a zero \fontdim6} +%\changes{v3.0}{2021/07/01}{with \pdftex\ 1.40.23, tracking also works for fonts with a zero \fontdim6} % case we issue a warning (once for every font). % \begin{macrocode} -%<*pdftex-def|luatex-def|letterspace> +%<*pdf-|lua-|letterspace> \def\MT@set@tr@codes{% -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \MT@vinfo{Tracking font `\MT@@font'\on@line}% - \MT@ifdefined@n@TF{\MT@@font-fake6}{% - \expandafter\ifx\csname\MT@@font-fake6\endcsname\@empty - \MT@warning@nl{% - Font `\MT@@font' does not specify its\MessageBreak - \@backslashchar fontdimen 6 (width of an `em')! Therefore,\MessageBreak - \@nameuse{MT@abbr@\MT@feat} will not work with this font}% - \MT@glet@nc{\MT@@font-fake6}\relax - \fi +%<*pdf-> + \MT@requires@pdftex8\@firstofone{% + \MT@ifdefined@n@TF{\MT@@font-fake6}{% + \expandafter\ifx\csname\MT@@font-fake6\endcsname\@empty + \MT@warning@nl{% + Font `\MT@@font' does not specify its\MessageBreak + \@backslashchar fontdimen 6 (width of an `em')! Therefore,\MessageBreak + tracking will not work with this font}% + \MT@glet@nc{\MT@@font-fake6}\relax + \fi + }% }{% +%</pdf-> \MT@if@list@exists \MT@get@tr@opt \relax -%</pdftex-def|luatex-def> +%</pdf-|lua-> \MT@ifdefined@c@TF\MT@letterspace@\relax{\let\MT@letterspace@\MT@letterspace}% \ifnum\MT@letterspace@=\z@ % \end{macrocode} @@ -7215,7 +8654,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % \begin{macrocode} \MT@set@tr@zero \else -%<pdftex-def|luatex-def> \MT@vinfo{... Tracking by \number\MT@letterspace@}% +%<pdf-|lua-> \MT@vinfo{... Tracking by \number\MT@letterspace@}% % \end{macrocode} % Letterspacing only works in <PDF> mode. % \begin{macrocode} @@ -7246,24 +8685,21 @@ time will almost certainly lead to undesired results. Have your choice!}% % use when dealing with non-legacy fonts, as it is less problematic and faster % than the \pdftex\ primitive \cmd\letterspacefont. % \begin{macrocode} -%<*luatex-def|letterspace> +%<*lua-|letterspace> \MT@if@luaotf@font{% -%<luatex-def&debug>\MT@dinfo@nl{1}{... luaotf font: \MessageBreak -%<luatex-def&debug> \expandafter\fontname\font@name}% - \ifnum\MT@letterspace@<\z@\def\MT@minus{-}\else\let\MT@minus\@empty\fi - \global\expandafter\font\MT@lsfont=% - \expandafter\MT@exp@two@c\expandafter\MT@ls@fontspec@font - \expandafter\fontname\expandafter\font@name\space \@nil +%<lua-&debug>\MT@dinfo@nl{1}{... luaotf font: \MessageBreak +%<lua-&debug> \expandafter\fontname\font@name}% + \global\expandafter\font\MT@lsfont=\MT@ls@fontspec@font }{% -%</luatex-def|letterspace> -%<luatex-def&debug>\MT@dinfo@nl{1}{... legacy font}% +%</lua-|letterspace> +%<lua-&debug>\MT@dinfo@nl{1}{... legacy font}% \global\expandafter\letterspacefont\MT@lsfont\font@name\MT@letterspace@ -%<luatex-def|letterspace> }% +%<lua-|letterspace> }% % \end{macrocode} %\changes{v2.2}{2007/06/16}{possibility to customise interword spacing} % Scale interword spacing (not configurable in \letterspace). % \begin{macrocode} -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \MT@ifdefined@c@TF\MT@tr@ispace {\let\@tempa\MT@tr@ispace}% {\edef\@tempa{\MT@letterspace@*,,}}% @@ -7271,7 +8707,7 @@ time will almost certainly lead to undesired results. Have your choice!}% {\edef\@tempa{\@tempa,\MT@tr@ospace}}% {\edef\@tempa{\@tempa,,,}}% \expandafter\MT@tr@set@space\@tempa,% -%</pdftex-def|luatex-def> +%</pdf-|lua-> %<*letterspace> % spacing = {<letterspace amount>*,,} \fontdimen2\MT@lsfont=\dimexpr\numexpr 1000+\MT@letterspace@\relax sp @@ -7283,7 +8719,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % ^^A MID: <46aa1cbb$0$31620$9b4e6d93@newsspool3.arcor-online.net> % Adjust outer kerning (\microtype\ only). % \begin{macrocode} -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \MT@ifdefined@c@TF\MT@tr@okern{\let\@tempa\MT@tr@okern}{\def\@tempa{*,*}}% \expandafter\MT@tr@set@okern\@tempa,% % \end{macrocode} @@ -7292,7 +8728,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % Disable ligatures (not configurable in \letterspace). % \begin{macrocode} \MT@ifdefined@c@T\MT@tr@ligatures\MT@tr@noligatures -%</pdftex-def|luatex-def> +%</pdf-|lua-> %<*letterspace> % no ligatures = {f} \tagcode\MT@lsfont`f=\m@ne @@ -7308,12 +8744,12 @@ time will almost certainly lead to undesired results. Have your choice!}% % (reported by \contributor Wolfram Schaalo <schaalo\at gmx.net>)} % ^^A private mail, 2008/05/12 % \begin{macrocode} -%<luatex-def|letterspace> \MT@if@luaotf@font\relax{% +%<lua-|letterspace> \MT@if@luaotf@font\relax{% %<debug>\MT@dinfo@nl{2}{... compensating for tracking (\number\MT@letterspace@)}% \MT@do@font{\lpcode\MT@lsfont\@tempcnta=\numexpr\MT@letterspace@/2\relax \rpcode\MT@lsfont\@tempcnta=\numexpr\MT@letterspace@/2\relax}% \let\MT@the@pr@code\MT@the@pr@code@tr -%<luatex-def|letterspace> }% +%<lua-|letterspace> }% \fi % \end{macrocode} % Finally, let the letterspaced font propagate. @@ -7321,8 +8757,8 @@ time will almost certainly lead to undesired results. Have your choice!}% %\changes{v2.5a}{2013/05/15}{fix: load font for \pkg{fontspec}} ^^A for MT@get@slot % \begin{macrocode} \aftergroup\MT@set@lsfont -%<pdftex-def|luatex-def> \let\MT@font\MT@lsfont -%<luatex-def> \MT@if@luaotf@font\MT@font\relax +%<pdf-|lua-> \let\MT@font\MT@lsfont +%<lua-> \MT@if@luaotf@font\MT@font\relax % \end{macrocode} %\begin{macro}{\MT@set@curr@ls} %\begin{macro}{\MT@curr@ls} @@ -7339,11 +8775,11 @@ time will almost certainly lead to undesired results. Have your choice!}% % We get the current outer spacing and adjust it, then, after the end of the % current outer group, set the current outer spacing, again, and adjust. % \begin{macrocode} -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \MT@outer@space=\csname MT@outer@space\expandafter\string\font@name\endcsname\relax \xdef\MT@set@curr@os{\MT@outer@space=\the\MT@outer@space\relax}% \MT@tr@outer@l -%</pdftex-def|luatex-def> +%</pdf-|lua-> % \end{macrocode} %\end{macro} % If \cs{MT@ls@adjust} is empty, it's the starred version of \cs{textls}. @@ -7357,14 +8793,14 @@ time will almost certainly lead to undesired results. Have your choice!}% % Otherwise, get the current outer kerning and adjust it, for left and right % side (\microtype\ only). % \begin{macrocode} -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \else \MT@outer@kern=\expandafter\expandafter\expandafter\@firstoftwo \csname MT@outer@kern\expandafter\string\font@name\endcsname\relax \ifdim\MT@outer@kern=\z@\else \MT@ls@outer@k \fi \MT@outer@kern=\expandafter\expandafter\expandafter\@secondoftwo \csname MT@outer@kern\expandafter\string\font@name\endcsname\relax -%</pdftex-def|luatex-def> +%</pdf-|lua-> %<*letterspace> \xdef\MT@set@curr@ok{\MT@outer@kern=\the\MT@outer@kern\relax}% \MT@afteraftergroup{% @@ -7373,7 +8809,7 @@ time will almost certainly lead to undesired results. Have your choice!}% }% %</letterspace> \fi -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> % \end{macrocode} %\begin{macro}{\MT@set@curr@ok} % Carry the outer kerning amount to outside the next group, then set outer @@ -7390,9 +8826,9 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@set@curr@ok \noexpand\MT@tr@outer@r }% -%</pdftex-def|luatex-def> +%</pdf-|lua-> \fi -%<pdftex-def|luatex-def> }% +%<pdf-> }% } % \end{macrocode} %\end{macro} @@ -7412,36 +8848,50 @@ time will almost certainly lead to undesired results. Have your choice!}% }% %<!letterspace> }% } -%</pdftex-def|luatex-def|letterspace> +%</pdf-|lua-|letterspace> % \end{macrocode} %\end{macro} -%\begin{macro}{\MT@ls@fontspec@colon} %\begin{macro}{\MT@ls@fontspec@font} %\changes{v2.6a}{2016/05/03}{fix for value of \textpm1000} %\changes{v2.7}{2017/02/10}{fix for `\texttt{file:}\meta{font}' spec -% (reported by \contributor Reinhard Kotucha <reinhard.kotucha\at web.de>)} +% (reported by \contributor Reinhard Kotucha <reinhard.kotucha\at web.de>)} % ^^A http://tug.org/pipermail/lualatex-dev/2017-February/001670.html -% Add the |kernfactor| feature to a font loaded by \pkg{fontspec} -% (we might have to add the colon ourselves). +%\changes{v3.0}{2021/03/19}{use \texttt{lua} to parse font spec\slash fix for font spec containing spaces +% (reported by \contributor Aman Mehra <reportaman\at gmail.com>)} +% ^^A https://tex.stackexchange.com/questions/567698/luatex-microtype-fontspec-luaotfload-buggy-interaction-canceling-each-others-s +% Add the |kernfactor| feature to a font loaded by \pkg{fontspec}. % \begin{macrocode} -%<*luatex-def|letterspace> -\def\MT@ls@fontspec@colon#1:#2:#3:#4\@nil{\ifx\\#3\\#1:#2\else#1:#2:#3\fi} -\def\MT@ls@fontspec@font#1 #2\@nil{% - "\MT@ls@fontspec@colon#1:::\relax\@nil - kernfactor=\MT@minus \ifnum\MT@letterspace@=1000 1\else 0.% - \ifnum\MT@minus\MT@letterspace@<100 0\fi - \ifnum\MT@minus\MT@letterspace@<10 0\fi - \number\MT@minus\MT@letterspace@ \fi;" - \ifx\\#2\\ at \f@size pt\else#2\fi\relax +%<*lua-|letterspace> +\def\MT@ls@fontspec@font{% + \MT@lua{microtype.add_ls([[\MT@letterspace@]])}% } -%</luatex-def|letterspace> +%</lua-|letterspace> +%<*luafile> +local function add_ls(k) + local f = tex.fontname(font.current()) + local spec,size = match(f,'^(.+)( at .+)$') + if not spec then spec = f end + local a,b,c = match(spec,'^([^:]+):?([^:]*):?(.*)$') + local ls = "kernfactor=" .. k/1000 .. ';' + microtype.sprint(a..':') + if (a == "name" or a == "file") then + microtype.sprint(b..':'..ls..c) + else + microtype.sprint(ls..b) + end + if size then + microtype.sprint(size) + end +end +microtype.add_ls = add_ls + +%</luafile> % \end{macrocode} %\end{macro} -%\end{macro} %\begin{macro}{\MT@get@tr@opt} % Various settings (only for the \microtype\ version). % \begin{macrocode} -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \def\MT@get@tr@opt{% \MT@set@listname \let\MT@tr@factor@\@m @@ -7497,14 +8947,14 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@ifdefined@n@T{MT@tr@c@\MT@tr@c@name @#1}% {\MT@let@nn{MT@tr@#2}{MT@tr@c@\MT@tr@c@name @#1}}% } -%</pdftex-def|luatex-def> +%</pdf-|lua-> % \end{macrocode} %\end{macro} %\begin{macro}{\MT@set@lsfont} % Redefine \cmd\font@name, which will be called a second later (in % \cmd\selectfont). % \begin{macrocode} -%<*pdftex-def|luatex-def|letterspace> +%<*pdf-|lua-|letterspace> %<plain>\MT@requires@latex2{ \def\MT@set@lsfont{\MT@exp@two@c\let\font@name\MT@lsfont} % \end{macrocode} @@ -7540,8 +8990,8 @@ time will almost certainly lead to undesired results. Have your choice!}% \DeclareRobustCommand\lsstyle{% \not@math@alphabet\lsstyle\textls \let\glb@currsize\@empty -%<pdftex-def|luatex-def> \MT@maybe@gobble@with@tikz{\aftergroup\glb@settings}% -%<pdftex-def|luatex-def> \def\MT@feat{tr}% +%<pdf-|lua-> \MT@maybe@gobble@with@tikz{\aftergroup\glb@settings}% +%<pdf-|lua-> \def\MT@feat{tr}% \let\MT@tracking\MT@set@tr@codes \selectfont } @@ -7625,15 +9075,15 @@ time will almost certainly lead to undesired results. Have your choice!}% \aftergroup\MT@set@lsbasefont \fi } -%</pdftex-def|luatex-def|letterspace> +%</pdf-|lua-|letterspace> % \end{macrocode} %\end{macro} %\end{macro} %\begin{macro}{\MT@tr@noligatures} % \pdftex\ 1.40.0--1.40.3 disabled all ligatures in letterspaced fonts. % \begin{macrocode} -%<*pdftex-def|luatex-def> -%<pdftex-def>\MT@requires@pdftex7{ +%<*pdf-|lua-> +%<pdf->\MT@requires@pdftex7{ \def\MT@tr@noligatures{% \ifx\MT@tr@ligatures\@empty \MT@noligatures@\MT@lsfont\@undefined @@ -7641,7 +9091,7 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@noligatures@\MT@lsfont\MT@tr@ligatures \fi } -%<*pdftex-def> +%<*pdf-> }{ \def\MT@tr@noligatures{% \MT@warning@nl{% @@ -7650,7 +9100,7 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@glet\MT@tr@noligatures\relax } } -%</pdftex-def> +%</pdf-> % \end{macrocode} %\end{macro} %\begin{macro}{\MT@outer@space} @@ -7787,8 +9237,8 @@ time will almost certainly lead to undesired results. Have your choice!}% %\end{macro} %\end{macro} %\begin{macro}{\MT@if@outer@next} -% We avoid using \cs{ifx} tests, in case \cs{MT@tr@outer@next} is \cmd\let\ to -% \cs{fi} etc. +% We avoid using \orig@cs{ifx} tests, in case \cs{MT@tr@outer@next} is \cmd\let\ to +% \orig@cs{fi} etc. %\changes{v2.5}{2012/02/20}{fix: conflict with \pkg{amsmath} % (reported by \contributor Scott Pakin <scott\at pakin.org>)} % ^^A private mail, 2012/02/09 @@ -7933,8 +9383,8 @@ time will almost certainly lead to undesired results. Have your choice!}% }{ \DeclareRobustCommand\lsstyle{% \MT@error{Letterspacing only works with \MT@engine tex version -%<pdftex-def> 1.40% -%<luatex-def> 0.62% +%<pdf-> 1.40% +%<lua-> 0.62% \MessageBreak or newer} {Upgrade \MT@engine tex, or try the `soul' package instead.}% \MT@glet\lsstyle\relax @@ -7943,14 +9393,14 @@ time will almost certainly lead to undesired results. Have your choice!}% % \end{macrocode} % And for \xetex, too. % \begin{macrocode} -%</pdftex-def|luatex-def> -%<*xetex-def> +%</pdf-|lua-> +%<*xe-> \DeclareRobustCommand\lsstyle{% \MT@error{Letterspacing currently doesn't work with xetex} {Run pdftex or luatex, or use the `soul' package instead.}% \MT@glet\lsstyle\relax } -%</xetex-def> +%</xe-> % \end{macrocode} %\begin{macro}{\textls} %\changes{v2.0}{2005/09/21}{new command: letterspacing} ^^A (beta:1) @@ -8022,11 +9472,11 @@ time will almost certainly lead to undesired results. Have your choice!}% \def\MT@ls@too@large#1{% \ifnum#1>\MT@tr@max \MT@warning{Maximum for option `letterspace' is \number\MT@tr@max}% - \let#1\MT@tr@max + \edef#1{\number\MT@tr@max}% \else \ifnum#1<\MT@tr@min \MT@warning{Minimum for option `letterspace' is \number\MT@tr@min}% - \let#1\MT@tr@min + \edef#1{\number\MT@tr@min}% \fi \fi } @@ -8040,7 +9490,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % \begin{macrocode} \newdimen\MT@outer@kern %</package|letterspace> -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \def\MT@tr@set@okern#1,#2,{% \let\MT@temp\@empty \MT@ifempty{#1}{\MT@tr@set@okern@{*}}{\MT@tr@set@okern@{#1}}% @@ -8069,7 +9519,7 @@ time will almost certainly lead to undesired results. Have your choice!}% * \fontdimen6\MT@lsfont/2000\relax \edef\MT@temp{\MT@temp{\the\@tempdima}}% } -%</pdftex-def|luatex-def> +%</pdf-|lua-> % \end{macrocode} %\end{macro} %\begin{macro}{\MT@ls@outer@k} @@ -8077,7 +9527,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % for cases of nested letterspacing without anything actually printed. ^^A eg. \LaTeX! %\changes{v2.5a}{2013/05/15}{add marker for tightly nested letterspacing} % \begin{macrocode} -%<*pdftex-def|luatex-def|letterspace> +%<*pdf-|lua-|letterspace> \def\MT@ls@outer@k{% \ifhmode \ifdim\lastkern=-3sp \unkern @@ -8092,7 +9542,7 @@ time will almost certainly lead to undesired results. Have your choice!}% {\kern\MT@outer@kern\kern3sp\kern-3sp\relax}% \fi } -%</pdftex-def|luatex-def|letterspace> +%</pdf-|lua-|letterspace> % \end{macrocode} %\end{macro} % @@ -8103,8 +9553,8 @@ time will almost certainly lead to undesired results. Have your choice!}% % also works with \luatex. %\changes{v2.3}{2007/10/23}{fix: set evaluation didn't work (bug introduced in v2.2)} % \begin{macrocode} -%<*pdftex-def|luatex-def> -%<pdftex-def>\MT@requires@pdftex5{ +%<*pdf-|lua-> +%<pdf->\MT@requires@pdftex5{ \def\MT@noligatures{% \MT@dotrue \let\@tempa\MT@nl@setname @@ -8122,7 +9572,7 @@ time will almost certainly lead to undesired results. Have your choice!}% %\begin{macro}{\MT@noligatures@} % This is also used by \cs{MT@set@tr@codes}. % \begin{macrocode} -%<luatex-def>\MT@requires@luatex4{\let\pdfnoligatures\ignoreligaturesinfont}\relax +%<lua->\MT@requires@luatex4{\let\pdfnoligatures\ignoreligaturesinfont}\relax \def\MT@noligatures@#1#2{% \MT@ifdefined@c@TF#2{% % \end{macrocode} @@ -8144,8 +9594,8 @@ time will almost certainly lead to undesired results. Have your choice!}% % in a table (used by the \pkg{luaotfload} function |keepligature|). %\changes{v2.6}{2016/04/20}{use \pkg{luaotfload} function to keep\slash inhibit ligatures} % \begin{macrocode} -%<luatex-def> \MT@if@luaotf@font -%<luatex-def> {\MT@lua{microtype.noligatures([[#1]],[[\MT@char]])}}\relax +%<lua-> \MT@if@luaotf@font +%<lua-> {\MT@lua{microtype.noligatures([[#1]],[[\MT@char]])}}\relax \fi }% \MT@vinfo{... Disabling ligatures for characters: #2}% @@ -8157,13 +9607,13 @@ time will almost certainly lead to undesired results. Have your choice!}% }% }{% \pdfnoligatures#1% -%<luatex-def> \MT@if@luaotf@font -%<luatex-def> {\MT@lua{microtype.noligatures([[#1]],"_all_")}}\relax +%<lua-> \MT@if@luaotf@font +%<lua-> {\MT@lua{microtype.noligatures([[#1]],"_all_")}}\relax \MT@vinfo{... Disabling all ligatures}% }% } -%<pdftex-def>}\relax -%</pdftex-def|luatex-def> +%<pdf->}\relax +%</pdf-|lua-> % \end{macrocode} %\end{macro} %\end{macro} @@ -8221,30 +9671,38 @@ end %</luafile> % \end{macrocode} % -%\subsubsection{Loading the configuration} +%\subsubsection{Loading the configuration}\label{ssub:setup-config} % %\begin{macro}{\MT@load@list} % Recurse through the lists to be loaded. %\changes{v1.3}{2004/10/27}{check whether list exists} %\todo{load more than one list} % \begin{macrocode} -%<*package> -\def\MT@load@list#1{% - \edef\@tempa{#1}% +%<*package|show> +%<package>\def\MT@load@list#1% +%<show>\def\MTS@load@list#1% + {\edef\@tempa{#1}% \MT@let@cn\@tempb{MT@\MT@feat @c@\@tempa @load}% \MT@ifstreq\@tempa\@tempb{% \MT@error{\@nameuse{MT@abbr@\MT@feat} list `\@tempa' cannot load itself}{}% }{% - \ifx\@tempb\relax \else + \ifx\@tempb\relax +%<show> :\par\medskip\leavevmode + \else \MT@ifdefined@n@TF{MT@\MT@feat @c@\@tempb}{% +%<show> \MTS@printtext{, loading \texttt{\@tempb}}% \MT@vinfo{... : First loading \@nameuse{MT@abbr@\MT@feat} list `\@tempb'}% \begingroup \MT@load@list\@tempb \endgroup - \edef\MT@curr@list@name{\@nameuse{MT@abbr@\MT@feat} list - \noexpand\MessageBreak`\@tempb'}% + \edef\MT@curr@list@name{% +%<package> \@nameuse{MT@abbr@\MT@feat} list \noexpand\MessageBreak + `\@tempb'}% \MT@let@cn\@tempc{MT@\MT@feat @c@\@tempb}% \expandafter\MT@set@codes\@tempc,\relax,% +%<show> \vrule width 4cm height .5pt \\ +%<show> \MTS@printtext{End of list \texttt{\MT@curr@list@name}}% +%<show> \par\medskip\leavevmode }{% \MT@error{\@nameuse{MT@abbr@\MT@feat} list `\@tempb' undefined.\MessageBreak Cannot load it from list `\@tempa'}{}% @@ -8252,6 +9710,7 @@ end \fi }% } +%</package|show> % \end{macrocode} %\end{macro} %\changes{v1.1}{2004/09/13}{configuration file names in lowercase @@ -8265,6 +9724,7 @@ end %\begin{macro}{\MT@file@list} % We must also record whether we've already loaded the file. % \begin{macrocode} +%<*package> \let\MT@file@list\@empty \def\MT@find@file#1{% % \end{macrocode} @@ -8528,7 +9988,7 @@ end % \end{macrocode} %\end{macro} %\begin{macro}{\MT@if@list@exists} -%\changes{v1.7}{2005/02/06}{don't define \cs{MT@\#1@c@name} \cmd\global ly, +%\changes{v1.7}{2005/02/06}{don't define \cs{MT@pr@c@name} etc. \cmd\global ly, % here and elsewhere} %\begin{macro}{\MT@context} % \begin{macrocode} @@ -8633,7 +10093,7 @@ end % %\begin{macro}{\MT@char} %\begin{macro}{\MT@char@} -% The character is in \cs{@tempa}, we want its slot number in \cs{MT@char}. +% The character is in \cmd\@tempa, we want its slot number in \cs{MT@char}. % \begin{macrocode} \def\MT@get@slot{% \escapechar`\\ @@ -8665,8 +10125,8 @@ end % % If |\|\meta{encoding}|\|\meta{command} (that's \emph{one} command) is % defined, we try to extract the slot number. -%\changes{v1.7}{2005/02/27}{test whether \cs{}\meta{encoding}\cs{}\meta{...} is defined} -%\changes{v1.8}{2005/04/04}{test whether \cs{}\meta{encoding}\cs{}\meta{...} is defined +%\changes{v1.7}{2005/02/27}{test whether \texttt{\string\bslash}\meta{encoding}\texttt{\string\bslash}\meta{...} is defined} +%\changes{v1.8}{2005/04/04}{test whether \texttt{\string\bslash}\meta{encoding}\texttt{\string\bslash}\meta{...} is defined % made more robust} % % We must be cautious not to stumble over accented characters consisting @@ -8703,12 +10163,12 @@ end %\begin{macro}{\MT@get@slot@} %\changes{v2.5}{2010/05/18}{adapt for \xetex} % \begin{macrocode} -%<*pdftex-def|luatex-def|xetex-def> +%<*pdf-|lua-|xe-> \def\MT@get@slot@{% % \end{macrocode} % If it's a legacy (\ie, <TFM>) font, proceed as usual. % \begin{macrocode} -%<xetex-def> \ifnum\XeTeXfonttype\MT@font=\z@ +%<xe-> \ifnum\XeTeXfonttype\MT@font=\z@ \ifnum\MT@char > \m@ne % \end{macrocode} % In \luatex, it may also be a glyph name, prefixed with `|/|'. @@ -8716,7 +10176,7 @@ end % ^^A private mail, 2012/07/17 % ^^A (beta:10) % \begin{macrocode} -%<*luatex-def> +%<*lua-> \ifnum\MT@char=47\relax \ifMT@norest \else \@tempcnta=\MT@lua{ @@ -8734,7 +10194,7 @@ end \fi \fi \else -%</luatex-def> +%</lua-> % \end{macrocode} % If the user has specified something like `|fi|', or wanted to define a number % but forgot to use three digits, we'll have something left of the string. In @@ -8745,20 +10205,22 @@ end % \begin{macrocode} \ifMT@norest \else \MT@warn@rest -%<pdftex-def|luatex-def> \let\MT@char\m@ne -%<xetex-def> \let\MT@char\@empty +%<pdf-|lua-> \let\MT@char\m@ne +%<xe-> \let\MT@char\@empty \fi -%<luatex-def> \fi +%<lua-> \fi \else \MT@warn@unknown -%<xetex-def> \let\MT@char\@empty +%<xe-> \let\MT@char\@empty \fi -%<*xetex-def> +%<*xe-> \else % \end{macrocode} % There are more possibilities for \xetex: -% It may also be a glyph name (prefixed with~`|/|'). We indicate this to -% \cs{MT@get@charwd} by reversing the sign of \cs{MT@char@}. +% It may be a Unicode codepoint (prefixed with `|U|') or a glyph name (prefixed with~`|/|').\footnote{ +% This doesn't seem to be documented anywhere, but it has been announced here: +% \url{https://tug.org/pipermail/xetex/2010-May/016531.html}} +% We indicate glyph names to \cs{MT@get@charwd} by reversing the sign of \cs{MT@char@}. % \begin{macrocode} \ifnum\MT@char=47\relax \ifMT@norest \edef\MT@char{U47}% @@ -8778,7 +10240,7 @@ end \ifMT@norest % \end{macrocode} % Or, it's a Unicode number, which we mustn't translate into a glyph number, -% since the latter is font-specific. +% since the latter is font-specific. But we add the `|U|' prefix. % \begin{macrocode} \@tempcnta=\XeTeXcharglyph\MT@char\relax \ifnum\@tempcnta=\z@ @@ -8799,23 +10261,35 @@ end \fi \fi \fi -%</xetex-def> +%</xe-> } -%</pdftex-def|luatex-def|xetex-def> +%</pdf-|lua-|xe-> % \end{macrocode} % This is the lua function to translate glyph name into slot number. -% Beginning with v2.2, \pkg{luaotfload} provides this function in an <API>, which +% Beginning with v2.2, \pkg{luaotfload} provides this function in its <API>, which % we use if available, but (for now, at least) keep the old code for backward % compatibility. %\changes{v2.5a}{2013/04/19}{adapt to \pkg{luaotfload} v2.2 % (contributed by \contributor \'Elie Roux <elie.roux\at telecom-bretagne.eu>)} % ^^A MID: <516AAF6B.8040605@telecom-bretagne.eu> +% With HarfBuzz, the return value is not guaranteed to be inside the +% Unicode range, so we have to guard against this case as well (same as in +% |do_font|). +% ^^A cf. https://github.com/latex3/luaotfload/issues/198 +%\changes{v3.0}{2021/10/26}{guard against return values outside Unicode range (for HarfBuzz)} +% Also, older versions of \pkg{luaotfload} (until v3.18) returned the numbers as floats. +%^^A fixed here: https://github.com/latex3/luaotfload/commit/53b70cbdb60101e2869d879e9d8daf576b0c8f82 +%\changes{v3.0}{2021/10/30}{convert floats to integers +% (reported by \contributor azur <@\at @>)} +% ^^A https://tex.stackexchange.com/questions/616329/using-polyglossia-microtype-and-newcomputermodern-with-lualatex-results-in-0-0 % \begin{macrocode} %<*luafile> if luaotfload and luaotfload.aux and luaotfload.aux.slot_of_name then local slot_of_name = luaotfload.aux.slot_of_name microtype.name_to_slot = function(name, unsafe) - return slot_of_name(font.current(), name, unsafe) + local n = math.tointeger(slot_of_name(font.current(), name, unsafe)) + if n and n > 1114111 then n = -1 end + return n end else -- we dig into internal structure (should be avoided) @@ -8852,14 +10326,14 @@ end %\begin{macro}{\MT@max@slot} % Warning if resulting character or slot number is too large. % \begin{macrocode} -%<*pdftex-def|luatex-def|xetex-def> +%<*pdf-|lua-|xe-> \def\MT@max@char -%<pdftex-def> {127 } -%<luatex-def|xetex-def> {1114111 } +%<pdf-> {127 } +%<lua-|xe-> {1114111 } \def\MT@max@slot -%<pdftex-def> {255 } -%<luatex-def|xetex-def> {1114111 } -%</pdftex-def|luatex-def|xetex-def> +%<pdf-> {255 } +%<lua-|xe-> {1114111 } +%</pdf-|lua-|xe-> % \end{macrocode} %\end{macro} %\end{macro} @@ -9048,7 +10522,7 @@ end % Instead of simply expanding |\|\meta{command}, we construct the command % |\|\meta{encoding}|\|\meta{command} and see whether its meaning is % \cmd\char|"|\meta{hex number}, which is the case for everything that has -% been defined with \cs{DeclareTextSymbol} in the encoding definition files. +% been defined with \cmd\DeclareTextSymbol in the encoding definition files. %\changes{v2.0}{2006/09/15}{made even more robust} % \begin{macrocode} \def\MT@is@symbol{% @@ -9064,7 +10538,7 @@ end \meaning\expandafter\MT@char\MT@charstring\relax\relax\relax \ifnum\MT@char@ < \z@ % \end{macrocode} -%\changes{v2.7c}{2019/08/13}{take care of \cs{remove@tlig}} +%\changes{v2.7c}{2019/08/13}{take care of \cmd\remove@tlig} % In <TU> encoding, some commands (currently, \cmd\textquotesingle, \cmd\textasciigrave\ % and \cmd\textquotedbl) are defined by means of the auxiliary macro % \cmd\remove@tlig, which we take care of here. @@ -9073,7 +10547,7 @@ end \ifnum\MT@char@ < \z@ % \end{macrocode} %\changes{v2.2}{2007/03/07}{expand once more (for \pkg{frenchpro})} -% Finally, if it hasn't been defined by \cs{DeclareTextSymbol}, it could be a letter +% Finally, if it hasn't been defined by \cmd\DeclareTextSymbol, it could be a letter % (\eg, \cmd\i, when using \pkg{frenchpro}). ^^A as noted by Bernard Gaulle % ^^A private mail, 2005/01/28 % \begin{macrocode} @@ -9090,14 +10564,17 @@ end % (reported by \contributor Frank Mittelbach <frank.mittelbach\at latex-project.org>)} % ^^A private mail, 2021/03/02 % ^^A also: https://github.com/latex3/latex2e/issues/525 +%\changes{v3.0}{2021/10/18}{fix for incompatibility with \pkg{syntax} +% (reported by \contributor Safron <@\at @>)} +% ^^A https://tex.stackexchange.com/questions/619410/conflict-between-microtype-and-syntax-packages/ % \begin{macrocode} \def\MT@is@opt@char#1\iffontchar#2\char#3\else#4\fi\relax{% - \ifx\\#1\\% + \MT@ifempty{#1}{% \iffontchar#2% \expandafter\chardef \csname\MT@encoding\MT@detokenize@c\@tempa\endcsname=#3\relax \fi - \fi + }\relax } % \end{macrocode} %\end{macro} @@ -9209,7 +10686,7 @@ end % Again, we construct a control sequence, this time of the form: % |\\|\meta{encoding}\allowbreak|\|\meta{accent}|-|\meta{character}, \eg, % |\\T1\"-a|, which we then expand once to see if it is a letter (if it has -% been defined by \cs{DeclareTextComposite}). This should be robust, finally, +% been defined by \cmd\DeclareTextComposite). This should be robust, finally, % especially, since we also \cmd\detokenize\ the input instead of only % \cmd\string ifying it. Thus, we will die gracefully even on wrong Unicode % input without |utf8|. @@ -9219,9 +10696,9 @@ end \MT@detokenize@n{#1}-\MT@detokenize@n{#2}\endcsname}% % \end{macrocode} % In 2017, \LaTeX\ introduced a new way of declaring accented -% Unicode commands (\cs{DeclareUnicodeComposite}), which we take care of here -% (\cs{UnicodeEncodingName} has been introduced at the same time): -%\changes{v2.7}{2017/04/29}{compatibility with \LaTeX\ 2017/01/01 (\cs{DeclareUnicodeComposite}) +% Unicode commands (\cmd\DeclareUnicodeComposite), which we take care of here +% (\cmd\UnicodeEncodingName\ has been introduced at the same time): +%\changes{v2.7}{2017/04/29}{compatibility with \LaTeX\ 2017/01/01 (\cmd\DeclareUnicodeComposite) % (reported by \contributor Ulrike Fischer <news3\at nililand.de> and % `\contributor jcr <@\at @>')} % ^^A (1) private mail, 2017/04/25 @@ -9247,7 +10724,7 @@ end % \end{macrocode} %\end{macro} %\begin{macro}{\MT@is@uni@comp} -% Helper for \cs{DeclareUnicodeComposite}. +% Helper for \cmd\DeclareUnicodeComposite. % \begin{macrocode} \def\MT@is@uni@comp#1\iffontchar#2\else#3\fi\relax{% \ifx\\#1\\\edef\MT@char{\iffontchar#2\fi}\fi @@ -9278,7 +10755,7 @@ end % Some warning messages, for performance reasons separated here. %\begin{macro}{\MT@curr@list@name} %\changes{v1.8}{2005/06/08}{new macro: current list type and name} -%\changes{v1.9f}{2006/08/03}{fix: \cs{MessageBreak} must not be expanded} +%\changes{v1.9f}{2006/08/03}{fix: \cmd\MessageBreak\ must not be expanded} %\begin{macro}{\MT@set@listname} % The type and name of the current list, defined at various places. % \begin{macrocode} @@ -9352,7 +10829,7 @@ end \MT@warning@nl{One or more slots in the configuration are unknown.\MessageBreak Make sure that no text commands are used.\MessageBreak See the documentation for details (the note\MessageBreak - on `#1' in section 9: `Hints and caveats')}% + on `#1' in section 11: `Hints and caveats')}% \MT@glet\MT@warn@unknown\relax}% } % @@ -9925,16 +11402,16 @@ end % \begin{macrocode} \newcommand\MT@DeclareSet[3][]{% \MT@ifempty{#1}{% - \MT@map@clist@c\MT@features{{\MT@declare@sets{##1}{#2}{#3}}}% + \MT@map@clist@c\MT@features{\begingroup\MT@declare@sets{##1}{#2}{#3}\endgroup}% }{% - \MT@map@clist@n{#1}{{% + \MT@map@clist@n{#1}{\begingroup \MT@ifempty{##1}\relax{% \MT@is@feature{##1}{set declaration `#2'}{% \MT@exp@one@n\MT@declare@sets {\csname MT@rbba@##1\endcsname}{#2}{#3}% }% }% - }}% + \endgroup}% }% \MT@end@catcodes } @@ -10019,7 +11496,7 @@ end \MT@ifempty\@tempa{\def\@tempa{#1}}\relax % \end{macrocode} % Test whether the command is actually defined. -%\changes{v2.7a}{2017/11/17}{test whether \cs{\dots default} is defined} +%\changes{v2.7a}{2017/11/17}{test whether \cmd{\...default} is defined} % \begin{macrocode} \MT@ifdefined@n@TF{\@tempa default}% {\edef\MT@val{\expandafter\noexpand\csname \@tempa default\endcsname}}% @@ -10153,7 +11630,7 @@ end % \begin{macrocode} \def\MT@get@size{% % \end{macrocode} -% A single star would mean \cs{sizedefault}, which doesn't exist, so we define +% A single star would mean \cmd\sizedefault, which doesn't exist, so we define % it to be \cmd\normalsize. % \begin{macrocode} \if*\MT@val\relax @@ -10323,16 +11800,16 @@ end % \begin{macrocode} \newcommand*\MT@UseMicrotypeSet[2][]{% \MT@ifempty{#1}{% - \MT@map@clist@c\MT@features{{\MT@use@set{##1}{#2}}}% + \MT@map@clist@c\MT@features{\begingroup\MT@use@set{##1}{#2}\endgroup}% }{% - \MT@map@clist@n{#1}{{% + \MT@map@clist@n{#1}{\begingroup \MT@ifempty{##1}\relax{% \MT@is@feature{##1}{activation of set `#2'}{% \MT@exp@one@n\MT@use@set {\csname MT@rbba@##1\endcsname}{#2}% }% }% - }}% + \endgroup}% }% \MT@end@catcodes } @@ -10385,16 +11862,16 @@ end % \begin{macrocode} \newcommand*\MT@DeclareMicrotypeSetDefault[2][]{% \MT@ifempty{#1}{% - \MT@map@clist@c\MT@features{{\MT@set@default@set{##1}{#2}}}% + \MT@map@clist@c\MT@features{\begingroup\MT@set@default@set{##1}{#2}\endgroup}% }{% - \MT@map@clist@n{#1}{{% + \MT@map@clist@n{#1}{\begingroup \MT@ifempty{##1}\relax{% \MT@is@feature{##1}{declaration of default set `#2'}{% \MT@exp@one@n\MT@set@default@set {\csname MT@rbba@##1\endcsname}{#2}% }% }% - }}% + \endgroup}% }% \MT@end@catcodes } @@ -10540,8 +12017,8 @@ end % % The optional argument may be used to disable selected ligatures only. % \begin{macrocode} -%<*pdftex-def|luatex-def> -%<pdftex-def>\MT@requires@pdftex5{ +%<*pdf-|lua-> +%<pdf->\MT@requires@pdftex5{ \def\DisableLigatures{% \MT@begin@catcodes \MT@DisableLigatures @@ -10554,25 +12031,25 @@ end \gdef\MT@nl@setname{no ligatures}% \MT@end@catcodes } -%<pdftex-def>}{ -%</pdftex-def|luatex-def> +%<pdf->}{ +%</pdf-|lua-> % \end{macrocode} %\end{macro} %\end{macro} %\end{macro} % If \pdftex\ is too old, we throw an error. % \begin{macrocode} -%<*pdftex-def|xetex-def> +%<*pdf-|xe-> \renewcommand*\DisableLigatures[2][]{% \MT@error{Disabling ligatures of a font is only possible\MessageBreak with pdftex version 1.30 or newer.\MessageBreak Ignoring \string\DisableLigatures}{% -%<pdftex-def> Upgrade -%<xetex-def> Use +%<pdf-> Upgrade +%<xe-> Use pdftex.}% } -%<pdftex-def>} -%</pdftex-def|xetex-def> +%<pdf->} +%</pdf-|xe-> % \end{macrocode} %\end{macro} % @@ -10613,7 +12090,7 @@ end % A new macro called |\MT@pr@c@|\meta{name} will be defined to be \meta{\#3} % (\ie, the list of characters, not expanded). % \begin{macrocode} -%<*pdftex-def|xetex-def|luatex-def> +%<*pdf-|lua-|xe-> \def\SetProtrusion{% \MT@begin@catcodes \MT@SetProtrusion @@ -10649,7 +12126,7 @@ end \MT@gdef@n{MT@pr@c@\MT@pr@c@name}{#3}% \MT@end@catcodes } -%</pdftex-def|xetex-def|luatex-def> +%</pdf-|lua-|xe-> % \end{macrocode} %\end{macro} %\end{macro} @@ -10662,7 +12139,7 @@ end % \cs{SetExpansion} only differs in that it allows some extra options % (|stretch|, |shrink|, |step|, |auto|). % \begin{macrocode} -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \def\SetExpansion{% \MT@begin@catcodes \MT@SetExpansion @@ -10732,13 +12209,13 @@ end tracking set `\MT@curr@set@name'}}}% \MT@end@catcodes } -%</pdftex-def|luatex-def> +%</pdf-|lua-> % \end{macrocode} %\end{macro} %\begin{macro}{\SetExtraSpacing} %\changes{v2.0}{2005/09/28}{new command: adjustment of interword spacing} ^^A (beta:1) % \begin{macrocode} -%<*pdftex-def> +%<*pdf-> \def\SetExtraSpacing{% \MT@begin@catcodes \MT@SetExtraSpacing @@ -10789,7 +12266,7 @@ end \MT@gdef@n{MT@kn@c@\MT@kn@c@name}{#3}% \MT@end@catcodes } -%</pdftex-def> +%</pdf-> % \end{macrocode} %\end{macro} %\end{macro} @@ -10986,8 +12463,8 @@ end %\changes{v2.5}{2010/02/27}{allow contexts for \luatex} % It also works with \luatex\ 0.30 or newer. % \begin{macrocode} -%<*pdftex-def|luatex-def> -%<pdftex-def>\MT@requires@pdftex7{ +%<*pdf-|lua-> +%<pdf->\MT@requires@pdftex7{ \define@key{MT@ex@c}{context}[]{% \MT@ifempty{#1}\relax{% \MT@glet\MT@copy@font\MT@copy@font@ @@ -11029,26 +12506,26 @@ end \fi }% } -%</pdftex-def|luatex-def> -%<*pdftex-def> +%</pdf-|lua-> +%<*pdf-> }{ \define@key{MT@ex@c}{context}[]{% \MT@error{Expansion contexts only work with pdftex 1.40.4\MessageBreak or later. Ignoring `context' key\on@line}% {Upgrade pdftex.}% } -%</pdftex-def> -%<*pdftex-def|xetex-def> +%</pdf-> +%<*pdf-|xe-> \define@key{MT@pr@c}{context}[]{% \MT@error{Protrusion contexts only work with pdftex -%<pdftex-def> 1.40.4\MessageBreak or later. -%<xetex-def> \MessageBreak or luatex. +%<pdf-> 1.40.4\MessageBreak or later. +%<xe-> \MessageBreak or luatex. Ignoring `context' key\on@line}% -%<pdftex-def> {Upgrade pdftex.}% -%<xetex-def> {Use pdftex or luatex.}% +%<pdf-> {Upgrade pdftex.}% +%<xe-> {Use pdftex or luatex.}% } -%</pdftex-def|xetex-def> -%<pdftex-def>} +%</pdf-|xe-> +%<pdf->} % \end{macrocode} %\begin{macro}{\MT@warn@nodim} % \begin{macrocode} @@ -11068,7 +12545,7 @@ end %\todo{new key for unit: \texttt{dimen} (for \texttt{kerning}, especially)} % Protrusion codes may be relative to character width, or to any dimension. % \begin{macrocode} -%<*pdftex-def|xetex-def|luatex-def> +%<*pdf-|lua-|xe-> \define@key{MT@pr@c}{unit}[character]{% \MT@glet@nc{MT@pr@c@\MT@curr@set@name @unit}\@empty \def\@tempa{#1}% @@ -11082,11 +12559,11 @@ end {\MT@warn@nodim{character widths}}% }% } -%</pdftex-def|xetex-def|luatex-def> +%</pdf-|lua-|xe-> % \end{macrocode} % Tracking may only be relative to a dimension. % \begin{macrocode} -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \define@key{MT@tr@c}{unit}[1em]{% \MT@glet@nc{MT@tr@c@\MT@curr@set@name @unit}\@empty \def\@tempa{#1}% @@ -11095,11 +12572,11 @@ end {\MT@warn@nodim{1em}% \MT@gdef@n{MT@tr@c@\MT@curr@set@name @unit}{1em}}% } -%</pdftex-def|luatex-def> +%</pdf-|lua-> % \end{macrocode} % Spacing and kerning codes may additionally be relative to space dimensions. % \begin{macrocode} -%<*pdftex-def> +%<*pdf-> \MT@map@clist@n{sp,kn}{% \define@key{MT@#1@c}{unit}[space]{% \MT@glet@nc{MT@#1@c@\MT@curr@set@name @unit}\@empty @@ -11114,11 +12591,11 @@ end }% }% } -%</pdftex-def> +%</pdf-> % \end{macrocode} % The first argument to \cs{SetExpansion} accepts some more options. % \begin{macrocode} -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \MT@map@clist@n{stretch,shrink,step}{% \define@key{MT@ex@c}{#1}[]{% \MT@ifempty{##1}\relax{% @@ -11144,19 +12621,19 @@ end %\changes{v1.7}{2005/03/07}{disallow automatic expansion if \pdftex\ too old} %\changes{v2.7a}{2017/08/08}{disallow non-automatic expansion with \luatex} % \begin{macrocode} -%<pdftex-def> \MT@requires@pdftex4% -%<luatex-def> \MT@requires@luatex3\relax +%<pdf-> \MT@requires@pdftex4% +%<lua-> \MT@requires@luatex3\relax {\MT@gdef@n{MT@ex@c@\MT@curr@set@name @auto}{autoexpand}}% -%<pdftex-def> {\MT@warning{pdftex too old for automatic font expansion}}% +%<pdf-> {\MT@warning{pdftex too old for automatic font expansion}}% \else -%<pdftex-def> \MT@requires@pdftex4% -%<*luatex-def> +%<pdf-> \MT@requires@pdftex4% +%<*lua-> \MT@requires@luatex3{% \MT@warning{Non-automatic font expansion doesn't work with\MessageBreak luatex}}% -%</luatex-def> +%</lua-> {\MT@glet@nc{MT@ex@c@\MT@curr@set@name @auto}\@empty}% -%<pdftex-def> \relax +%<pdf-> \relax \fi } % \end{macrocode} @@ -11175,7 +12652,7 @@ end \define@key{MT@tr@c}{outer spacing}[]{\setkeys{MT@tr@c}{outerspacing={#1}}} \define@key{MT@tr@c}{outer kerning}[]{\setkeys{MT@tr@c}{outerkerning={#1}}} \define@key{MT@tr@c}{no ligatures}[]{\setkeys{MT@tr@c}{noligatures={#1}}} -%</pdftex-def|luatex-def> +%</pdf-|lua-> % \end{macrocode} % %\subsubsection{Character inheritance} @@ -11214,20 +12691,23 @@ end %\end{macro} %\begin{macro}{\MT@set@inh@list} % No need to create an inheritance list for tracking. +%\changes{v3.0}{2021/03/27}{fix: grouping with \cmd\begingroup~\dots~\cmd\endgroup\ instead of \texttt{\{}\dots\texttt{\}} +% (reported by \contributor chsk <@\at @>)} +% ^^A https://tex.stackexchange.com/questions/590265/improper-halign-inside-s-with-lmodern-microtype-fontspec % \begin{macrocode} \def\MT@set@inh@list#1#2{% \MT@ifempty\MT@inh@feat{% - \MT@map@clist@c\MT@features{{% + \MT@map@clist@c\MT@features{\begingroup \MT@ifstreq{##1}{tr}\relax{\MT@declare@char@inh{##1}{#1}{#2}}% - }}% + \endgroup}% }{% - \MT@map@clist@c\MT@inh@feat{{% + \MT@map@clist@c\MT@inh@feat{\begingroup \KV@@sp@def\@tempa{##1}% \MT@ifempty\@tempa\relax{% \edef\@tempa{\csname MT@rbba@\@tempa\endcsname}% \MT@ifstreq\@tempa{tr}\relax{% \MT@exp@one@n\MT@declare@char@inh{\@tempa}{#1}{#2}}}% - }}% + \endgroup}% }% \MT@end@catcodes } @@ -11290,32 +12770,74 @@ end % in |\MT@set@|\meta{feature}|@codes|. % \begin{macrocode} %</package> -%<*pdftex-def|xetex-def|luatex-def> +%<*pdf-|lua-|xe-> \def\MT@inh@split#1=#2=#3\relax{% \def\@tempa{#1}% \ifx\@tempa\@empty \else + \expandafter\MT@has@inh@prefix\@tempa()\relax\@nil \MT@get@slot -%<pdftex-def|luatex-def> \ifnum\MT@char > \m@ne -%<xetex-def> \ifx\MT@char\@empty\else +%<pdf-|lua-> \ifnum\MT@char > \m@ne +%<xe-> \ifx\MT@char\@empty\else \let\MT@val\MT@char \MT@map@clist@n{#2}{% \def\@tempa{##1}% \ifx\@tempa\@empty \else \MT@get@slot -%<pdftex-def|luatex-def> \ifnum\MT@char > \m@ne -%<xetex-def> \ifx\MT@char\@empty\else - \MT@exp@cs\MT@xadd{MT@inh@\MT@listname @\MT@val @}{{\MT@char}}% +%<pdf-|lua-> \ifnum\MT@char > \m@ne +%<xe-> \ifx\MT@char\@empty\else + \ifx\MT@inh@prefix\@empty + \MT@exp@cs\MT@xadd{MT@inh@\MT@listname @\MT@val @}{{\MT@char}}% + \else + \MT@exp@cs\MT@xadd{MT@inh@\MT@listname @prefixes}% + {{{\MT@val}{\MT@char}\MT@inh@prefix@}}% + \fi \fi \fi }% %<debug>\MT@dinfo@nl{2}{children of #1 (\MT@val): -%<debug> \@nameuse{MT@inh@\MT@listname @\MT@val @}}% +%<debug> \@nameuse{MT@inh@\MT@listname @\ifx\MT@inh@prefix\@empty\MT@val @\else prefixes\fi}}% \fi \fi } -%</pdftex-def|xetex-def|luatex-def> % \end{macrocode} %\end{macro} +%\begin{macro}{\MT@inh@prefix} +%\begin{macro}{\MT@has@inh@prefix} +% If the inheriting character is preceded by |(|\meta{prefix}|)|, where +% \meta{prefix} is one of |l|, |r| or |lr|, this has a special meaning +% for protrusion. For the other features, we ignore these settings. +%\changes{v3.0}{2021/03/27}{new: automatical protrusion based on char widths difference +% (suggested by \contributor Daniel Benjamin Miller <dbmiller\at dbmiller.org>)} +% ^^A private mail, 2020/12/24 +% \begin{macrocode} +\def\MT@has@inh@prefix#1(#2)#3#4\@nil{% + \let\MT@temp\relax + \ifx\relax#3% + \def\@tempa{#1#2}% + \let\MT@inh@prefix\@empty + \else + \MT@ifstreq{\MT@feat}{pr}{% + \MT@ifstreq{#2}{l}{\def\MT@inh@prefix@{{1000}{0}}\@firstoftwo}{% + \MT@ifstreq{#2}{r}{\def\MT@inh@prefix@{{0}{1000}}\@firstoftwo}{% + \MT@ifstreq{#2}{lr}{\def\MT@inh@prefix@{{500}{500}}\@firstoftwo}{% + \MT@warning@nl{`#2' is not a valid prefix in inheritance list% + \MessageBreak\MT@listname. Ignoring it}% + \@secondoftwo}}}% + {\def\@tempa{#3}% + \def\MT@inh@prefix{#2}% + \@gobble}% + {\@firstofone}% + }{\@firstofone}% + {\let\MT@char\m@ne + \let\MT@temp\@gobble + }% + \fi + \MT@temp +} +%</pdf-|lua-|xe-> +% \end{macrocode} +%\end{macro} +%\end{macro} % %\subsubsection{Permutation}\label{ssub:permutation} % @@ -11727,7 +13249,7 @@ end % ^^A (beta:1) %\begin{macro}{\MT@def@bool@opt} % The |true|/|false| options: -% \opt{draft}, \opt{final} (may be inherited from the class options), +% \opt{draft} (may be inherited from the class options), % \opt{auto}, % \opt{selected}, % \opt{babel}, @@ -11760,21 +13282,21 @@ end %\changes{v2.5}{2010/09/17}{disable `\opt{DVIoutput}' option for \xetex} ^^A (beta:03) % \begin{macrocode} %</package> -%<*pdftex-def|luatex-def|xetex-def> -%<luatex-def>\MT@requires@luatex4{\let\pdfoutput\outputmode}\relax +%<*pdf-|lua-|xe-> +%<lua->\MT@requires@luatex4{\let\pdfoutput\outputmode}\relax \MT@def@bool@opt{DVIoutput}{% \csname if\@tempa\endcsname -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \ifnum\pdfoutput>\z@ \MT@opt@DVItrue \fi \pdfoutput\z@ \else \ifnum\pdfoutput<\@ne \MT@opt@DVItrue \fi \pdfoutput\@ne -%</pdftex-def|luatex-def> -%<xetex-def> \MT@warning@nl{Ignoring `DVIoutput' option}% +%</pdf-|lua-> +%<xe-> \MT@warning@nl{Ignoring `DVIoutput' option}% \fi } -%</pdftex-def|luatex-def|xetex-def> +%</pdf-|lua-|xe-> % \end{macrocode} %\changes{v1.9a}{2005/11/21}{new option: \opt{defersetup}, by default true} % Setting the \opt{defersetup} option to false will restore the old behaviour, @@ -11805,8 +13327,8 @@ end % out automatically whether it's required. % It also works with \luatex\ 0.30 or newer. % \begin{macrocode} -%<*pdftex-def|luatex-def> -%<pdftex-def>\MT@requires@pdftex7{ +%<*pdf-|lua-> +%<pdf->\MT@requires@pdftex7{ \MT@def@bool@opt{copyfonts}{% \csname if\@tempa\endcsname \MT@glet\MT@copy@font\MT@copy@font@ @@ -11814,31 +13336,45 @@ end \MT@glet\MT@copy@font\relax \fi } -%<pdftex-def>}{ -%</pdftex-def|luatex-def> -%<*pdftex-def|xetex-def> +%<pdf->}{ +%</pdf-|lua-> +%<*pdf-|xe-> \MT@def@bool@opt{copyfonts}{% \csname if\@tempa\endcsname \MT@error -%<pdftex-def> {The pdftex version you are using is too old\MessageBreak -%<pdftex-def> to use the `copyfonts' option}{Upgrade pdftex.}% -%<xetex-def> {The `copyfonts' option does not work with xetex} -%<xetex-def> {Use pdftex or luatex instead.}% +%<pdf-> {The pdftex version you are using is too old\MessageBreak +%<pdf-> to use the `copyfonts' option}{Upgrade pdftex.}% +%<xe-> {The `copyfonts' option does not work with xetex} +%<xe-> {Use pdftex or luatex instead.}% \fi } -%<pdftex-def>} -%</pdftex-def|xetex-def> +%<pdf->} +%</pdf-|xe-> % \end{macrocode} % \opt{final} is the opposite to \opt{draft}. %\changes{v1.4a}{2004/11/16}{new option: \opt{final}} +% It's only kept for backwards compatibility. +%\changes{v3.0}{2021/08/13}{remove option \opt{final}} % \begin{macrocode} %<*package> -\MT@def@bool@opt{final}{% - \csname if\@tempa\endcsname - \MT@draftfalse - \else - \MT@drafttrue - \fi +\MT@def@bool@opt{final}{} +% \end{macrocode} +% The \opt{disable} option replaces the \opt{draft} option, +% which could be inherited from the class options. +% The third value |ifdraft| mimicks this behaviour. +%\changes{v3.0}{2021/08/13}{new option: \opt{disable}, replacing the \texttt{draft} option +% (suggested by \contributor Frank Mittelbach <frank.mittelbach\at latex-project.org>)} +% ^^A private mail, 2018/07/04 +% \begin{macrocode} +\define@key{MT}{disable}[true]{% + \def\@tempa{#1}% + \MT@ifstreq\@tempa{true}\MT@disabletrue{% + \MT@ifstreq\@tempa{ifdraft}{\ifMT@draft\MT@disabletrue\fi}{% + \MT@ifstreq\@tempa{false}\relax{% + \MT@optwarn@admissible{#1}{disable}% + }% + }% + }% } % \end{macrocode} % For \opt{verbose} output, we redefine \cs{MT@vinfo}. @@ -11932,6 +13468,55 @@ end }% } % \end{macrocode} +%\changes{v3.0}{2021/05/22}{new options: \opt{patch} and \opt{nopatch}} +%\begin{macro}{\MT@patches@list} +%\begin{macro}{\MT@nopatches@list} +% The \opt{patch} and \opt{nopatch} options. +% Remember chosen option for later (\cmd\relax\ means `all', +% \cmd\@empty\ means `none'). +% \begin{macrocode} +\let\MT@patches@list\relax +\let\MT@nopatches@list\@empty +% \end{macrocode} +%\end{macro} +%\end{macro} +% \begin{macrocode} +\define@key{MT}{patch}[all]{% + \def\@tempa{#1}% + \MT@ifstreq\@tempa{all} + \relax + {\MT@ifstreq\@tempa{none} + {\let\MT@patches@list\@empty} + {\def\MT@patches@list{#1}}}% +} +\define@key{MT}{nopatch}[all]{% + \def\@tempa{#1}% + \MT@ifstreq\@tempa{all} + {\let\MT@nopatches@list\relax} + {\MT@ifstreq\@tempa{none} + \relax + {\def\MT@nopatches@list{#1}}}% +} +% \end{macrocode} +% We can only apply the patches AtBeginDocument. +% \begin{macrocode} +\MT@addto@setup{% + \ifx\MT@patches@list\relax + \let\MT@patches@list\MT@patches@def + \fi + \ifx\MT@nopatches@list\@empty\else + \ifx\MT@nopatches@list\relax + \let\MT@nopatches@list\MT@patches@def + \fi + \MT@map@clist@c\MT@nopatches@list{% + \MT@rem@from@clist{#1}\MT@patches@list}% + \fi + \ifx\MT@patches@list\@empty\else +^^X \MT@map@clist@c\MT@patches@list{\MT@apply@patch{#1}}% +^^Q \MT@warning@nl{Patches require the etex extensions. Ignoring them}% + \fi +} +% \end{macrocode} % %\subsubsection{Loading the definition file} % @@ -11967,20 +13552,20 @@ end % \begin{macrocode} \MT@protrusiontrue %</package> -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \ifnum\pdfoutput<\@ne \else % \end{macrocode} % Also, we only enable expansion by default if \pdftex\ can expand the fonts % automatically. %\changes{v1.6}{2004/12/23}{defaults: turn off expansion for old \pdftex\ versions} % \begin{macrocode} -%<pdftex-def> \MT@requires@pdftex4{ +%<pdf-> \MT@requires@pdftex4{ \MT@expansiontrue -%<pdftex-def> \MT@autotrue -%<pdftex-def> }\relax +%<pdf-> \MT@autotrue +%<pdf-> }\relax \fi -%<luatex-def>\MT@autotrue -%</pdftex-def|luatex-def> +%<lua->\MT@autotrue +%</pdf-|lua-> % \end{macrocode} % The main configuration file will be loaded before processing the package % options. @@ -12052,7 +13637,7 @@ end % %\subsubsection{Hook for other packages}\label{sub:hook} % -% {\let\special@index\index\SpecialIndex@{\Microtype@Hook}{\encapchar usage}} +% {\let\special@index\index\SpecialIndex@{\Microtype@Hook}{\encapchar hyperpage}} %\begin{macro}{\Microtype@Hook} %\changes{v1.7}{2005/03/22}{new command for font package authors} % This hook may be used by font package authors, \eg, to declare alias fonts. If @@ -12079,13 +13664,13 @@ end % {\let\Microtype@Hook\MinionPro@MT@Hook} % {\g@addto@macro\Microtype@Hook{\MinionPro@MT@Hook}}} %\end{verbatim} -% \cs{MicroType@Hook} with a capital |T| (which only existed in version 1.7) is -% provided for compatibility reasons. At some point in the future, it will no -% longer be available, hence it should not be used. +% \orig@cs{MicroType@Hook} with a capital |T| (which only existed in version 1.7) +% is now officially deprecated. % \begin{macrocode} -\MT@ifdefined@c@T\MicroType@Hook{\MT@warning{% +\MT@ifdefined@c@T\MicroType@Hook{\MT@error{% Command \string\MicroType@Hook\space is deprecated.\MessageBreak - Use \string\Microtype@Hook\space instead}\MicroType@Hook} + Use \string\Microtype@Hook\space instead} + {You might want to inform the font package authors.}\MicroType@Hook} \MT@ifdefined@c@T\Microtype@Hook\Microtype@Hook % \end{macrocode} %\end{macro} @@ -12102,13 +13687,13 @@ end % Inside the preamble, \cs{microtypesetup} accepts the same options as the % package (unless \opt{defersetup}|=false|). % In the document body, it accepts the options: -% |protrusion|, |expansion|, |activate|, |tracking|, |spacing| and |kerning|. -% Specifying font sets is not allowed. +% |protrusion|, |expansion|, |activate|, |tracking|, |spacing| and |kerning| +% (but specifying font sets is not allowed), and |patch| and |nopatch|. % \begin{macrocode} \def\microtypesetup{\setkeys{MT}} \MT@addto@setup{\def\microtypesetup#1{\setkeys{MTX}{#1}\selectfont}} %</package> -%<*pdftex-def|luatex-def|xetex-def> +%<*pdf-|lua-|xe-> \def\MT@define@optionX#1#2{% \define@key{MTX}{#1}[true]{% \edef\@tempb{\csname MT@rbba@#1\endcsname}% @@ -12178,26 +13763,26 @@ end %\end{macro} % \begin{macrocode} \MT@define@optionX{protrusion}\MT@protrudechars -%</pdftex-def|luatex-def|xetex-def> -%<*pdftex-def|luatex-def> +%</pdf-|lua-|xe-> +%<*pdf-|lua-> \MT@define@optionX{expansion}\MT@adjustspacing % \end{macrocode} %\begin{macro}{\MT@protrudechars} %\begin{macro}{\MT@adjustspacing} % \begin{macrocode} -%<*luatex-def> +%<*lua-> \MT@requires@luatex4{ \let\pdfprotrudechars\protrudechars \let\pdfadjustspacing\adjustspacing }\relax -%</luatex-def> +%</lua-> \let\MT@protrudechars\pdfprotrudechars \let\MT@adjustspacing\pdfadjustspacing -%</pdftex-def|luatex-def> -%<*xetex-def> +%</pdf-|lua-> +%<*xe-> \let\MT@protrudechars\XeTeXprotrudechars \define@key{MTX}{expansion}[true]{\MT@warning{Ignoring expansion setup}} -%</xetex-def> +%</xe-> % \end{macrocode} %\end{macro} %\end{macro} @@ -12205,9 +13790,9 @@ end % The same for |tracking|, |spacing| and |kerning|, which do not have a % |compatibility| level. % \begin{macrocode} -%<*pdftex-def|luatex-def> -%<pdftex-def>\MT@requires@pdftex6{ -%<luatex-def>\MT@requires@luatex3{ +%<*pdf-|lua-> +%<pdf->\MT@requires@pdftex6{ +%<lua->\MT@requires@luatex3{ \def\MT@define@optionX@#1#2{% \define@key{MTX}{#1}[true]{% \MT@map@clist@n{##1}{% @@ -12241,45 +13826,71 @@ end % \begin{macrocode} \MT@define@optionX@{tracking}{\ifnum\@tempcnta=\z@ \let\MT@tracking\MT@set@tr@zero \else \let\MT@tracking\MT@tracking@ \fi} -%<pdftex-def> \MT@define@optionX@{spacing}{\pdfadjustinterwordglue\@tempcnta} -%<pdftex-def> \MT@define@optionX@{kerning}{\pdfprependkern\@tempcnta -%<pdftex-def> \pdfappendkern\@tempcnta} +%<pdf-> \MT@define@optionX@{spacing}{\pdfadjustinterwordglue\@tempcnta} +%<pdf-> \MT@define@optionX@{kerning}{\pdfprependkern\@tempcnta +%<pdf-> \pdfappendkern\@tempcnta} }{ -%</pdftex-def|luatex-def> -%<*pdftex-def|luatex-def|xetex-def> +%</pdf-|lua-> +%<*pdf-|lua-|xe-> % \end{macrocode} % Disable for older \pdftex\ versions and for \xetex\ and \luatex. % \begin{macrocode} \define@key{MTX}{tracking}[true]{\MT@warning{Ignoring tracking setup}} -%<luatex-def>} +%<lua->} \define@key{MTX}{kerning}[true]{\MT@warning{Ignoring kerning setup}} \define@key{MTX}{spacing}[true]{\MT@warning{Ignoring spacing setup}} -%<pdftex-def>} +%<pdf->} \define@key{MTX}{activate}[true]{% \setkeys{MTX}{protrusion={#1}}% -%<pdftex-def|luatex-def> \setkeys{MTX}{expansion={#1}}% +%<pdf-|lua-> \setkeys{MTX}{expansion={#1}}% } -%</pdftex-def|luatex-def|xetex-def> +%</pdf-|lua-|xe-> % \end{macrocode} %\begin{macro}{\MT@saved@setupfont} % Disable everything -- may be used as a temporary work-around in case % setting up fonts doesn't work under certain circumstances, but only until -% that specific problem is fixed. This is \emph{undocumented}, as it completely -% deprives us of the possibility to act -- we're blind and paralysed. +% that specific problem is fixed. These options are \emph{undocumented}, as they +% completely deprive us of the possibility to act -- we're blind and paralysed. % \begin{macrocode} %<*package> \let\MT@saved@setupfont\MT@setupfont % \end{macrocode} %\end{macro} % \begin{macrocode} -\define@key{MTX}{disable}[]{% - \MT@info{Inactivate `\MT@MT' package}% +\define@key{MTX}{deactivate}[]{% + \MT@info{Deactivate `\MT@MT' package}% \let\MT@setupfont\relax } -\define@key{MTX}{enable}[]{% +\define@key{MTX}{reactivate}[]{% \MT@info{Reactivate `\MT@MT' package}% \let\MT@setupfont\MT@saved@setupfont } +% \end{macrocode} +% Apply or revert patches. +% \begin{macrocode} +\define@key{MTX}{patch}[all]{% + \def\@tempa{#1}% + \MT@ifstreq\@tempa{all} + \relax + {\MT@ifstreq\@tempa{none} + {\let\@tempa\@empty} + \relax}% + \ifx\@tempa\@empty\else +^^X \MT@map@clist@c\@tempa{\MT@apply@patch{##1}}% +^^Q \MT@warning@nl{Patches require the etex extensions. Ignoring them}% + \fi +} +\define@key{MTX}{nopatch}[all]{% + \def\@tempa{#1}% + \MT@ifstreq\@tempa{all} + \relax + {\MT@ifstreq\@tempa{none} + {\let\@tempa\@empty} + \relax}% + \ifx\@tempa\@empty\else +^^X \MT@map@clist@c\@tempa{\MT@undo@patch{##1}}% + \fi +} %</package> % \end{macrocode} % @@ -12333,13 +13944,13 @@ end % options the user has chosen (in case it's interested). % \begin{macrocode} \MT@addto@setup{% -\ifMT@draft +\ifMT@disable % \end{macrocode} % We disable most of what we've just defined in the \arabic{CodelineNo} lines -% above if we are running in draft mode. +% above if we are running in disable (aka. draft) mode. %\changes{v1.7}{2005/02/06}{warning when running in draft mode} % \begin{macrocode} - \MT@warning@nl{`draft' option active.\MessageBreak + \MT@warning@nl{The `disable' option is in effect.\MessageBreak Disabling all micro-typographic extensions.\MessageBreak This might lead to different line and page breaks}% \let\MT@setupfont\relax @@ -12377,7 +13988,7 @@ end % for each package (that's not our job), we only say that it was \microtype\ % that changed it. This must be sufficient! % \begin{macrocode} -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \def\MT@setup@PDF{% \MT@info@nl{Generating \ifnum\pdfoutput<\@ne DVI \else PDF \fi output% \ifMT@opt@DVI\space (changed by \MT@MT)\fi}% @@ -12390,17 +14001,17 @@ end \def\MT@setup@copies{% \ifx\MT@copy@font\relax\else \MT@info@nl{Using font copies for contexts}\fi } -%</pdftex-def|luatex-def> -%<*xetex-def> +%</pdf-|lua-> +%<*xe-> \let\MT@setup@PDF\relax \let\MT@setup@copies\relax -%</xetex-def> +%</xe-> % \end{macrocode} %\end{macro} %\begin{macro}{\MT@setup@protrusion} % Protrusion. % \begin{macrocode} -%<*pdftex-def|xetex-def|luatex-def> +%<*pdf-|lua-|xe-> \def\MT@setup@protrusion{% \ifMT@protrusion \edef\MT@active@features{\MT@active@features,pr}% @@ -12415,7 +14026,7 @@ end \MT@info@nl{No character protrusion}% \fi } -%</pdftex-def|xetex-def|luatex-def> +%</pdf-|lua-|xe-> % \end{macrocode} %\end{macro} %\begin{macro}{\MT@setup@expansion} @@ -12430,11 +14041,11 @@ end % (reported by \contributor Daniel Benjamin Miller <dbmiller\at dbmiller.org>)} ^^A aka `d909' % ^^A https://tex.stackexchange.com/questions/531413/dvipdfmx-and-dvips-do-not-expand-fonts-properly-with-lualatex-in-dvi-mode % \begin{macrocode} -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \def\MT@setup@expansion{% \ifnum\pdfoutput<\@ne \ifMT@opt@expansion -%<*luatex-def> +%<*lua-> \ifMT@expansion \MT@requires@luatex3{% \MT@warning@nl{Font expansion doesn't work properly with luatex in\MessageBreak @@ -12444,7 +14055,7 @@ end %\MT@expansionfalse }\relax \fi -%</luatex-def> +%</lua-> \else \MT@expansionfalse \fi @@ -12476,9 +14087,9 @@ end %\changes{v1.9}{2005/07/08}{warning if user requested zero \opt{step}} % \begin{macrocode} \ifnum\MT@step=\m@ne -%<pdftex-def> \MT@requires@pdftex6{% +%<pdf-> \MT@requires@pdftex6{% \def\MT@step{1 }% -%<*pdftex-def> +%<*pdf-> }{% \ifnum\MT@stretch>\MT@shrink \ifnum\MT@shrink=\z@ @@ -12497,7 +14108,7 @@ end \ifnum\@tempcnta=\z@ \@tempcnta=\@ne \fi \edef\MT@step{\number\@tempcnta\space}% }% -%</pdftex-def> +%</pdf-> \fi \ifnum\MT@step=\z@ \MT@warning@nl{The expansion step cannot be set to zero.\MessageBreak @@ -12529,7 +14140,7 @@ end %\changes{v1.5}{2004/12/02}{disable automatic expansion for <DVI> output} %\changes{v2.7}{2017/07/02}{don't disable automatic expansion for <DVI> output with \luatex} % \begin{macrocode} -%<*pdftex-def> +%<*pdf-> \MT@requires@pdftex4{% \ifnum\pdfoutput<\@ne \ifMT@opt@auto @@ -12560,18 +14171,18 @@ end \MT@autofalse \def\MT@auto{1000 }% }% -%</pdftex-def> -%<luatex-def> \MT@requires@luatex3\relax{\def\MT@auto{autoexpand}}% +%</pdf-> +%<lua-> \MT@requires@luatex3\relax{\def\MT@auto{autoexpand}}% \else -%<*pdftex-def> +%<*pdf-> % \end{macrocode} % No automatic expansion. % \begin{macrocode} \MT@requires@pdftex4\relax{% \def\MT@auto{1000 }% }% -%</pdftex-def> -%<*luatex-def> +%</pdf-> +%<*lua-> \MT@requires@luatex3{% \ifMT@opt@auto \MT@error{Non-automatic font expansion does not work with\MessageBreak @@ -12579,7 +14190,7 @@ end \MT@autotrue \fi }\relax -%</luatex-def> +%</lua-> \fi % \end{macrocode} % Choose the appropriate macro for selected expansion. @@ -12668,8 +14279,8 @@ end \MT@info@nl{No font expansion}% \fi } -%</pdftex-def|luatex-def> -%<*xetex-def> +%</pdf-|lua-> +%<*xe-> \def\MT@setup@expansion{% \ifMT@expansion \ifMT@opt@expansion @@ -12678,15 +14289,15 @@ end \fi \fi } -%</xetex-def> +%</xe-> % \end{macrocode} %\end{macro} %\begin{macro}{\MT@setup@tracking} % Tracking, spacing and kerning. % \begin{macrocode} -%<*pdftex-def|luatex-def> -%<pdftex-def>\MT@requires@pdftex6{% -%<luatex-def>\MT@requires@luatex3{% +%<*pdf-|lua-> +%<pdf->\MT@requires@pdftex6{% +%<lua->\MT@requires@luatex3{% \def\MT@setup@tracking{% \ifMT@tracking \edef\MT@active@features{\MT@active@features,tr}% @@ -12702,12 +14313,12 @@ end \MT@info@nl{No adjustment of tracking}% \fi } -%</pdftex-def|luatex-def> +%</pdf-|lua-> % \end{macrocode} %\end{macro} %\begin{macro}{\MT@setup@spacing} % \begin{macrocode} -%<*pdftex-def> +%<*pdf-> \def\MT@setup@spacing{% \ifMT@spacing \edef\MT@active@features{\MT@active@features,sp}% @@ -12775,7 +14386,7 @@ end \MT@info@nl{No adjustment of character kerning}% \fi } -%</pdftex-def> +%</pdf-> % \end{macrocode} %\end{macro} %\begin{macro}{\MT@error@doesnt@work} @@ -12784,8 +14395,8 @@ end % and throw an error message. % We also switch the features off for \luatex\ and \xetex. % \begin{macrocode} -%<pdftex-def|luatex-def>}{ -%<*luatex-def> +%<pdf-|lua->}{ +%<*lua-> \def\MT@setup@tracking{% \ifMT@tracking \MT@error{The tracking feature only works with luatex 0.62\MessageBreak @@ -12797,33 +14408,33 @@ end \fi } } -%</luatex-def> -%<*pdftex-def|xetex-def|luatex-def> +%</lua-> +%<*pdf-|lua-|xe-> \def\MT@error@doesnt@work#1{% \csname ifMT@#1\endcsname \MT@error{The #1 feature only works with pdftex 1.40\MessageBreak or newer. Switching it off} -%<pdftex-def> {Upgrade pdftex.}% -%<luatex-def|xetex-def> {Use pdftex instead.}% +%<pdf-> {Upgrade pdftex.}% +%<lua-|xe-> {Use pdftex instead.}% \csname MT@#1false\endcsname \MT@let@nc{MT@#1}\relax \else \MT@info@nl{No adjustment of #1% -%<pdftex-def> \space(pdftex too old)% +%<pdf-> \space(pdftex too old)% }% \fi } -%<pdftex-def|xetex-def> \def\MT@setup@tracking{\MT@error@doesnt@work{tracking}} +%<pdf-|xe-> \def\MT@setup@tracking{\MT@error@doesnt@work{tracking}} \def\MT@setup@kerning {\MT@error@doesnt@work{kerning}} \def\MT@setup@spacing {\MT@error@doesnt@work{spacing}} -%<pdftex-def>} -%</pdftex-def|xetex-def|luatex-def> +%<pdf->} +%</pdf-|lua-|xe-> % \end{macrocode} %\end{macro} %\begin{macro}{\MT@setup@warntracking} % \begin{macrocode} %<letterspace>\MT@addto@setup -%<pdftex-def|luatex-def>\def\MT@setup@warntracking +%<pdf-|lua->\def\MT@setup@warntracking % \end{macrocode} %\begin{macro}{\MT@warn@tracking@DVI} %\changes{v2.2}{2007/02/11}{warning when letterspacing in <DVI> mode} @@ -12832,9 +14443,9 @@ end % not work. We also switch on protrusion if it isn't already, to compensate for % the letterspacing kerns. % \begin{macrocode} -%<*pdftex-def|luatex-def|letterspace> +%<*pdf-|lua-|letterspace> {% -%<*pdftex-def|letterspace> +%<*pdf-|letterspace> \ifnum\pdfoutput<\@ne \def\MT@warn@tracking@DVI{% %<letterspace> \MT@pdf@or@lua{% @@ -12847,12 +14458,12 @@ end \MT@glet\MT@warn@tracking@DVI\relax }% \else -%</pdftex-def|letterspace> +%</pdf-|letterspace> \def\MT@warn@tracking@DVI{% \ifnum\pdfprotrudechars<\@ne \global\pdfprotrudechars\@ne \fi \MT@glet\MT@warn@tracking@DVI\relax }% -%<pdftex-def|letterspace> \fi +%<pdf-|letterspace> \fi % \end{macrocode} %\end{macro} % \begin{macrocode} @@ -12862,8 +14473,8 @@ end \MT@ls@too@large\MT@letterspace \fi } -%</pdftex-def|luatex-def|letterspace> -%<xetex-def>\let\MT@setup@warntracking\relax +%</pdf-|lua-|letterspace> +%<xe->\let\MT@setup@warntracking\relax % \end{macrocode} %\end{macro} %\begin{macro}{\MT@setup@noligatures} @@ -12871,16 +14482,16 @@ end % now disable the corresponding macro, if it was never called. %\changes{v2.0}{2006/12/14}{maybe disable \cs{MT@noligatures} after the preamble} % \begin{macrocode} -%<*pdftex-def|luatex-def> +%<*pdf-|lua-> \def\MT@setup@noligatures{% -%<pdftex-def> \MT@requires@pdftex5{% +%<pdf-> \MT@requires@pdftex5{% \ifMT@noligatures \else \let\MT@noligatures\relax \fi -%<pdftex-def> }\relax +%<pdf-> }\relax } -%</pdftex-def|luatex-def> -%<xetex-def>\let\MT@setup@noligatures\relax +%</pdf-|lua-> +%<xe->\let\MT@setup@noligatures\relax % \end{macrocode} %\end{macro} % Remove the leading comma in \cs{MT@active@features}, and set the @@ -12977,7 +14588,7 @@ end \fi } % \end{macrocode} -% Now we close the \cs{fi} from \cs{ifMT@draft}. +% Now we close the \orig@cs{fi} from \cs{ifMT@disable}. % \begin{macrocode} \MT@addto@setup{\fi % \end{macrocode} @@ -13126,7 +14737,9 @@ end % \end{macrocode} % The default sets. %\changes{v2.2}{2007/04/15}{default set for tracking: \texttt{smallcaps}} -%\changes{v2.8}{2019/12/04}{default set for expansion: \texttt{alltext-nott}} +%\changes{v2.8}{2019/12/04}{default set for expansion: \texttt{alltext-nott} +% (suggested by \contributor Aman Mehra <reportaman\at gmail.com>)} +% ^^A https://tex.stackexchange.com/questions/519166/microtype-expansion-gets-disabled-when-fontsize-is-changed-lualatex %\changes{v2.8}{2019/12/04}{default set for spacing: \texttt{alltext-nott}} % \begin{macrocode} %%% ----------------------------------------------------------------------- @@ -13218,10 +14831,10 @@ end %\changes{v2.8a}{2021/01/09}{reference New Computer Modern also by file name % (reported by \contributor Canageek <@\at @>)} % ^^A https://tex.stackexchange.com/questions/578121/how-do-i-properly-tell-microtype-that-newcomputermodern-is-the-same-as-comput +%\changes{v3.0}{2021/08/08}{New Computer Modern has its own settings} % \begin{macrocode} -\DeclareMicrotypeAlias{New Computer Modern}{Latin Modern Roman} -\DeclareMicrotypeAlias{NewCM10-Book.otf} {Latin Modern Roman} -\DeclareMicrotypeAlias{NewCM10-Regular.otf}{Latin Modern Roman} +\DeclareMicrotypeAlias{NewCM10-Book.otf} {New Computer Modern} +\DeclareMicrotypeAlias{NewCM10-Regular.otf}{New Computer Modern} % \end{macrocode} % The packages \pkg{pxfonts} and \pkg{txfonts} fonts inherit Palatino and Times % settings respectively, @@ -13359,6 +14972,29 @@ end % \begin{macrocode} \DeclareMicrotypeAlias{zpeus} {zpeu} % Adobe Euro sans -> serif \DeclareMicrotypeAlias{eurosans}{zpeu} % Adobe Euro sans -> serif +% \end{macrocode} +% The Lato and Fontin fonts (and many, many more\dots) only contain a +% basic set of glyphs. We alias them here to the basic settings +% (see \ref{subsub:OT-inh-basic}) to prevent lots of warning +% messages from the inheritance settings; they will still receive +% protrusion settings from the default (<T1>) configuration. +%\changes{v3.0}{2021/06/22}{declare \texttt{basic} aliases for the Fontin font} +%\changes{v3.0}{2021/06/25}{declare \texttt{basic} alias for Bergamo Std} +% \begin{macrocode} +\DeclareMicrotypeAlias{Lato} {TU-basic} +\DeclareMicrotypeAlias{Lato-Regular} {TU-basic} +\DeclareMicrotypeAlias{Fontin} {TU-basic} +\DeclareMicrotypeAlias{Fontin-Regular} {TU-basic} +\DeclareMicrotypeAlias{Bergamo Std} {TU-basic} +% \end{macrocode} +% The \pkg{fontawesome} and \pkg{fontawesome5} packages are aliased +% to empty settings (see \ref{subsub:OT-inh-empty} and \ref{subsub:OT-prot-empty}). +%\changes{v3.0}{2021/03/15}{declare \texttt{empty} aliases for \pkg{fontawesome5}} +% \begin{macrocode} +\DeclareMicrotypeAlias{FontAwesome} {TU-empty} % fontawesome +\DeclareMicrotypeAlias{fontawesomefree} {TU-empty} % fontawesome5 +\DeclareMicrotypeAlias{fontawesomepro} {TU-empty} +\DeclareMicrotypeAlias{fontawesomebrands}{TU-empty} % \end{macrocode} % @@ -13429,11 +15065,11 @@ end % that are the same on \emph{both} sides, \ie, not \OE\ for O. % \begin{macrocode} %</m-t> -%<*m-t|zpeu|mvs> +%<*m-t|ebg|zpeu|mvs> %%% ----------------------------------------------------------------------- %%% CHARACTER INHERITANCE -%</m-t|zpeu|mvs> +%</m-t|ebg|zpeu|mvs> %<*m-t> % \end{macrocode} % @@ -13718,6 +15354,45 @@ end %</m-t> % \end{macrocode} +%\subsubsection{<LGR>} +%\changes{v3.0}{2021/06/24}{add settings for <LGR>} +% The Greek <LGR> encoding. <EB> Garamond contains some more glyphs. +% \begin{macrocode} +%<*m-t|ebg> +\DeclareCharacterInheritance + { encoding = LGR, +%<ebg> family = {EBGaramond-OsF,EBGaramond-TOsF,EBGaramond-LF,EBGaramond-TLF} + } + { +%<m-t> A = {012}, +%<ebg> A = {009,012,253}, +%<ebg> (l)E = {199}, +%<ebg> H = {010}, +%<ebg> (l)H = {159}, + I = {219}, +%<ebg> (l)I = {155}, + O = J, +%<ebg> (l)O = {151}, + U = {013,223}, + W = {011}, + a = {014,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,148,149,150,248}, + e = {224,225,226,227,232,233,234,235}, + h = {152,153,154,156,157,158,160,161,162,163,164,165,166,167,168,169,170, + 171,172,173,174,175,249}, +%<m-t> i = {200,201,202,203,208,209,210,211,216,217,218,240,241,242,243}, +%<ebg> i = {008,200,201,202,203,208,209,210,211,216,217,218,240,241,242,243}, + o = {228,229,230,231,236,237,238,239}, + r = {251,252}, + u = {015,204,205,206,207,212,213,214,215,220,221,222,244,245,246,247}, + w = {176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192, + 193,194,196,197,198,250}, +%<ebg> \textstigma = \textvarstigma, + . = {059} % ano teleia + } + +%</m-t|ebg> +% \end{macrocode} % %\subsubsection{Euro symbols} % Make Euro symbols settings simpler. @@ -14013,12 +15688,11 @@ end %\end{itemize} % \begin{macrocode} %<ugm> [ name = ugm-default ] -%<m-t|cmr|pmn> { } -%<bch|blg|ebg|ugm> { encoding = OT1, +%<m-t|cmr|pmn|ebg> { } +%<bch|blg|ugm> { encoding = OT1, %<ppl|ptm> { encoding = {OT1,OT4}, %<bch> family = bch } %<blg> family = blg } -%<ebg> family = {EBGaramond-LF,EBGaramond-OsF,EBGaramond-TLF,EBGaramond-TOsF} } %<ppl> family = {ppl,pplx,pplj} } %<ptm> family = {ptm,ptmx,ptmj} } %<ugm> family = ugm } @@ -14053,10 +15727,10 @@ end %<bch|ebg|pmn> Q = {50,70}, %<ugm> Q = {50,50}, %<bch> R = { ,50}, -%<ugm> R = { ,70}, -%<m-t|bch|cmr|ebg|pmn|ppl|ptm> T = {50,50}, +%<ugm|ebg> R = { ,70}, +%<m-t|bch|cmr|pmn|ppl|ptm> T = {50,50}, %<blg> T = {100,100}, -%<ugm> T = {70,70}, +%<ebg|ugm> T = {70,70}, %<m-t|bch|cmr|ebg|pmn|ppl|ptm> V = {50,50}, %<blg|ugm> V = {70,70}, %<m-t|bch|cmr|ebg|pmn|ppl|ptm> W = {50,50}, @@ -14073,8 +15747,8 @@ end %<ugm> k = { ,70}, %<blg> l = {150,150}, %<pmn> l = { ,-50}, -%<ebg|ppl> p = {50,50}, -%<ugm> p = { ,50}, +%<ppl> p = {50,50}, +%<ebg|ugm> p = { ,50}, %<ebg|ppl> q = {50, }, %<!blg> r = { ,50}, %<blg> r = {100, 80}, @@ -14100,41 +15774,39 @@ end % \begin{macrocode} %<cmr> 0 = { ,50}, %<m-t> 1 = {50,50}, -%<bch|blg|ebg|ptm|ugm> 1 = {150,150}, +%<bch|blg|ptm|ugm> 1 = {150,150}, %<cmr> 1 = {100,200}, %<pmn> 1 = { ,50}, %<ppl> 1 = {100,100}, -%<bch|cmr|ebg|ugm> 2 = {50,50}, +%<bch|cmr|ugm> 2 = {50,50}, %<blg> 2 = { ,100}, %<bch|pmn> 3 = {50, }, -%<cmr|ebg|ugm> 3 = {50,50}, +%<cmr|ugm> 3 = {50,50}, %<blg> 3 = {100, }, -%<m-t|ebg> 4 = {50,50}, +%<m-t> 4 = {50,50}, %<bch> 4 = {100,50}, %<blg> 4 = {100, }, %<cmr|ugm> 4 = {70,70}, %<pmn> 4 = {50, }, %<ptm> 4 = {70, }, %<cmr> 5 = { ,50}, -%<ebg> 5 = {50,50}, %<bch> 6 = {50, }, %<cmr> 6 = { ,50}, -%<ebg> 6 = {50,50}, %<m-t> 7 = {50,50}, -%<bch|ebg|pmn|ugm> 7 = {50,80}, +%<bch|pmn|ugm> 7 = {50,80}, %<blg> 7 = {100,100}, %<cmr|ptm> 7 = {50,100}, %<ppl> 7 = { ,50}, %<cmr> 8 = { ,50}, -%<bch|ebg> 9 = {50,50}, +%<bch> 9 = {50,50}, %<cmr> 9 = { ,50}, -%<m-t|cmr|ebg|pmn|ppl|ptm|ugm> . = { ,700}, -%<bch> . = { ,600}, +%<m-t|cmr|pmn|ppl|ptm|ugm> . = { ,700}, +%<bch|ebg> . = { ,600}, %<blg> . = {400,500}, %<!blg> {,}= { ,500}, %<blg> {,}= {300,400}, -%<m-t|cmr|ebg|pmn|ppl|ptm|ugm> : = { ,500}, -%<bch> : = { ,400}, +%<m-t|cmr|pmn|ppl|ptm|ugm> : = { ,500}, +%<bch|ebg> : = { ,400}, %<blg> : = {300,400}, %<m-t|bch|ebg|pmn|ptm> ; = { ,300}, %<blg> ; = {200,300}, @@ -14161,9 +15833,8 @@ end %<bch|pmn> * = {200,300}, %<blg> * = {150,200}, %<cmr|ebg> * = {300,300}, -%<m-t|cmr|ppl|ptm> + = {250,250}, +%<m-t|cmr|ebg|ppl|ptm> + = {250,250}, %<bch> + = {150,250}, -%<ebg> + = {300,300}, %<blg|pmn> + = {150,200}, %<ugm> + = {250,300}, %<blg|ugm> {=}= {200,200}, @@ -14203,13 +15874,14 @@ end %<m-t|bch|pmn> \textquoteleft = {300,400}, \textquoteright = {300,400}, %<blg> \textquoteleft = {400,600}, \textquoteright = {400,600}, %<cmr> \textquoteleft = {500,700}, \textquoteright = {500,600}, -%<ebg|ppl> \textquoteleft = {500,700}, \textquoteright = {500,700}, +%<ebg> \textquoteleft = {300,500}, \textquoteright = {400,400}, +%<ppl> \textquoteleft = {500,700}, \textquoteright = {500,700}, %<ptm> \textquoteleft = {500,500}, \textquoteright = {300,500}, %<ugm> \textquoteleft = {300,600}, \textquoteright = {300,600}, -%<m-t|bch|pmn> \textquotedblleft = {300,300}, \textquotedblright = {300,300} +%<m-t|ebg|bch|pmn> \textquotedblleft = {300,300}, \textquotedblright = {300,300} %<blg> \textquotedblright = {300,400} %<cmr> \textquotedblleft = {500,300}, \textquotedblright = {200,600} -%<ebg|ppl|ptm> \textquotedblleft = {300,400}, \textquotedblright = {300,400} +%<ppl|ptm> \textquotedblleft = {300,400}, \textquotedblright = {300,400} %<ugm> \textquotedblleft = {400,400}, \textquotedblright = {400,400} } @@ -14217,43 +15889,82 @@ end % Greek uppercase letters are in <OT1> encoding only. %\changes{v1.9}{2005/07/10}{fix: remove uppercase Greek letters from <T1> encoded <CMR>} % \begin{macrocode} -%<*m-t|cmr|pmn> +%<*m-t|cmr|ebg|pmn> \SetProtrusion %<m-t> [ name = OT1-default, %<cmr> [ name = cmr-OT1, +%<ebg> [ name = EBGaramond-OT1, %<pmn> [ name = pmnj-OT1, %<m-t> load = default ] %<cmr> load = cmr-default ] +%<ebg> load = EBGaramond-default ] %<pmn> load = pmnj-default ] %<m-t> { encoding = OT1 } %<cmr> { encoding = {OT1,OT4}, %<pmn> { encoding = OT1, %<cmr> family = cmr } %<pmn> family = pmnj } +%<ebg> { } { %<m-t|cmr> \AE = {50, }, %<pmn> \OE = {50, } -%<*cmr> +%<*cmr|ebg> "00 = { ,150}, % \Gamma "01 = {100,100}, % \Delta "02 = { 50, 50}, % \Theta "03 = {100,100}, % \Lambda - "06 = { 50, 50}, % \Sigma +%<ebg> "04 = { 50, 50}, % \Xi +%<cmr> "06 = { 50, 50}, % \Sigma "07 = {100,100}, % \Upsilon "08 = { 50, 50}, % \Phi - "09 = { 50, 50} % \Psi + "09 = { 50, 50}, % \Psi +%<ebg> "0A = { 50, 50}, % \Omega +%<ebg> 138 = { , 50}, % \L % \end{macrocode} % Remaining slots can be found in the source file. %\iffalse ^^A ... namely, here: -% "04 = { , }, % \Xi % "05 = { , }, % \Pi -% "0A = { , }, % \Omega %\fi % \begin{macrocode} -%</cmr> +%</cmr|ebg> } -%</m-t|cmr|pmn> +% \end{macrocode} +% Settings for figure variants. +%\changes{v3.0}{2021/06/10}{settings for <EB> Garamond figure variants} +% \begin{macrocode} +%<*ebg> +\SetProtrusion + [ name = EBGaramond-OT1-LF, + load = EBGaramond-OT1 ] + { encoding = OT1, + family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF} } + { + 1 = {50,50}, + 2 = {50,50}, + 4 = {50,50}, + 7 = {50,50}, + } + +\SetProtrusion + [ name = EBGaramond-OT1-TOsF, + load = EBGaramond-OT1 ] + { encoding = OT1, + family = {EBGaramond-TOsF} } + { + 1 = {150,150}, + 2 = {50,50}, + 3 = {50,50}, + 4 = {50,50}, + 5 = {50,50}, + 6 = {50,50}, + 7 = {50,80}, + 8 = {50,50}, + 9 = {50,50}, + } + +%</ebg> +%</m-t|cmr|ebg|pmn> % \end{macrocode} % <T1> and <LY1> encodings contain some more characters. The default list % will be loaded first. @@ -14283,8 +15994,9 @@ end %<ptm> load = ptm-default ] %<ugm> load = ugm-default ] %<m-t> { encoding = {T1,LY1,EU1,EU2,TU} } -%<bch|cmr|ebg|pmn|ppl> { encoding = {T1,LY1}, +%<bch|cmr|pmn|ppl> { encoding = {T1,LY1}, %<blg|ptm|ugm> { encoding = {T1}, +%<ebg> { encoding = {LY1}, %<bch> family = bch } %<blg> family = blg } %<cmr> family = cmr } @@ -14332,7 +16044,8 @@ end %<m-t> \guillemotleft = {200,200}, \guillemotright = {200,200}, %<cmr> \guillemotleft = {300,200}, \guillemotright = {100,400}, %<bch|pmn> \guillemotleft = {200,200}, \guillemotright = {150,300}, -%<blg|ebg|ppl|ptm> \guillemotleft = {300,300}, \guillemotright = {200,400}, +%<blg|ppl|ptm> \guillemotleft = {300,300}, \guillemotright = {200,400}, +%<ebg> \guillemotleft = {300,300}, \guillemotright = {200,300}, %<ugm> \guillemotleft = {300,400}, \guillemotright = {300,400}, %<m-t|bch|cmr|ebg|pmn|ppl|ugm> \textexclamdown = {100, }, \textquestiondown = {100, }, %<blg> \textexclamdown = {200, }, \textquestiondown = {100, }, @@ -14371,6 +16084,37 @@ end } %</cmr> +%<*ebg> +\SetProtrusion + [ name = EBGaramond-T1-LF, + load = EBGaramond-T1 ] + { encoding = T1, + family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF} } + { + 1 = {50,50}, + 2 = {50,50}, + 4 = {50,50}, + 7 = {50,50}, + } + +\SetProtrusion + [ name = EBGaramond-T1-TOsF, + load = EBGaramond-T1 ] + { encoding = T1, + family = {EBGaramond-TOsF} } + { + 1 = {150,150}, + 2 = {50,50}, + 3 = {50,50}, + 4 = {50,50}, + 5 = {50,50}, + 6 = {50,50}, + 7 = {50,80}, + 8 = {50,50}, + 9 = {50,50}, + } + +%</ebg> % \end{macrocode} % Settings for the <T2A> encoding (generic, Computer Modern Roman, and Minion).\footnote{Contributed by % \contributor Karl Karlsson <karl-karlsson\at yandex.ru>.} @@ -14587,6 +16331,76 @@ end %</ptm> % \end{macrocode} +%\changes{v3.0}{2021/06/25}{<LGR> settings for <EB> Garamond} +% For the Greek <LGR> encoding. +% \begin{macrocode} +%<*ebg> +\SetProtrusion + [ name = EBGaramond-LGR ] + { } + { + A = {50,50}, + D = {100,100}, + F = {50,50}, + G = { ,150}, + K = { ,50}, + L = {100,100}, + O = {50,50}, + U = {100,100}, + T = {50,50}, + W = { ,50}, + Y = {50,50}, + . = { ,600}, + {,}= { ,500}, + : = { ,400}, + ; = { ,300}, + ! = { ,100}, + ? = { ,100}, + ~ = {200,250}, + \% = {50,50}, + * = {300,300}, + + = {250,250}, + {=}= { 50, 50}, + ( = {100, }, ) = { ,200}, + / = {100,200}, + - = {300,500}, + \texteuro = { 50,100}, + \textendash = {300,300}, \textemdash = {200,200}, + \textquoteleft = {300,500}, \textquoteright = {400,400}, + \guillemotleft = {300,300}, \guillemotright = {200,400}, + } + +\SetProtrusion + [ name = EBGaramond-LGR-LF, + load = EBGaramond-LGR ] + { encoding = LGR, + family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF} } + { + 1 = {50,50}, + 2 = {50,50}, + 4 = {50,50}, + 7 = {50,50}, + } + +\SetProtrusion + [ name = EBGaramond-LGR-TOsF, + load = EBGaramond-LGR ] + { encoding = LGR, + family = {EBGaramond-TOsF} } + { + 1 = {150,150}, + 2 = {50,50}, + 3 = {50,50}, + 4 = {50,50}, + 5 = {50,50}, + 6 = {50,50}, + 7 = {50,80}, + 8 = {50,50}, + 9 = {50,50}, + } + +%</ebg> +% \end{macrocode} % %\subsubsection{Italics} % @@ -14618,17 +16432,16 @@ end %<ppl> [ name = ppl-it ] %<ptm> [ name = ptm-it ] %<ugm> [ name = ugm-it ] -%<m-t|bch|blg|ebg|ugm> { encoding = OT1, +%<m-t|bch|blg|ugm> { encoding = OT1, %<ppl|ptm> { encoding = {OT1,OT4}, %<bch> family = bch, %<blg> family = blg, -%<ebg> family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF,EBGaramond-TOsF}, %<ppl> family = {ppl,pplx,pplj}, %<ptm> family = {ptm,ptmx,ptmj}, %<ugm> family = ugm, -%<m-t|bch|ebg|ppl|ptm> shape = {it,sl} } +%<m-t|bch|ppl|ptm> shape = {it,sl} } %<blg|ugm> shape = it } -%<cmr|pmn> { } +%<cmr|ebg|pmn> { } { %<cmr> A = {100,100}, %<ptm> A = {100,50}, @@ -14870,11 +16683,13 @@ end %<ugm> \textquotedblleft = {600,200}, \textquotedblright = {600,200} } -%<*cmr|pmn> +%<*cmr|ebg|pmn> \SetProtrusion %<cmr> [ name = cmr-it-OT1, +%<ebg> [ name = EBGaramond-it-OT1, %<pmn> [ name = pmnj-it-OT1, %<cmr> load = cmr-it ] +%<ebg> load = EBGaramond-it ] %<pmn> load = pmnj-it ] %<cmr> { encoding = {OT1,OT4}, %<pmn> { encoding = OT1, @@ -14882,27 +16697,90 @@ end %<pmn> family = pmnj, %<cmr> shape = it } %<pmn> shape = {it,sl} } +%<ebg> { } { %<cmr> \AE = {100, }, %<pmn> \AE = { ,-50}, %<cmr> \OE = {100, }, %<pmn> \OE = {50, } -%<*cmr> - "00 = {200,150}, % \Gamma - "01 = {150,100}, % \Delta - "02 = {150, 50}, % \Theta - "03 = {150, 50}, % \Lambda - "04 = {100,100}, % \Xi - "05 = {100,100}, % \Pi - "06 = {100, 50}, % \Sigma - "07 = {200,150}, % \Upsilon - "08 = {150, 50}, % \Phi - "09 = {150,100}, % \Psi - "0A = { 50, 50} % \Omega -%</cmr> +%<*cmr|ebg> +%<cmr> "00 = {200,150}, % \Gamma +%<ebg> "00 = { ,150}, % \Gamma +%<cmr> "01 = {150,100}, % \Delta +%<ebg> "01 = {100,100}, % \Delta +%<cmr> "02 = {150, 50}, % \Theta +%<ebg> "02 = { 50, 50}, % \Theta +%<cmr> "03 = {150, 50}, % \Lambda +%<ebg> "03 = {100,100}, % \Lambda +%<cmr> "04 = {100,100}, % \Xi +%<ebg> "04 = { 50, 50}, % \Xi +%<cmr> "05 = {100,100}, % \Pi +%<cmr> "06 = {100, 50}, % \Sigma +%<cmr> "07 = {200,150}, % \Upsilon +%<ebg> "07 = {100,100}, % \Upsilon +%<cmr> "08 = {150, 50}, % \Phi +%<ebg> "08 = { 50, 50}, % \Phi +%<cmr> "09 = {150,100}, % \Psi +%<ebg> "09 = { 50, 50}, % \Psi + "0A = { 50, 50}, % \Omega +%<ebg> 138 = { , 50}, % \L +%</cmr|ebg> + } + +%</cmr|ebg|pmn> +%<*ebg> +\SetProtrusion + [ name = EBGaramond-it-OT1-LF, + load = EBGaramond-it-OT1 ] + { encoding = OT1, + family = {EBGaramond-LF,EBGaramond-TLF}, + shape = it } + { + 1 = {50,50}, + 2 = {50,50}, + 3 = {80,50}, + 4 = {50,50}, + 5 = {50,50}, + 6 = {50,50}, + 7 = {50,50}, + 8 = {50,50}, + 9 = {50, }, } -%</cmr|pmn> +\SetProtrusion + [ name = EBGaramond-it-OT1-OsF, + load = EBGaramond-it-OT1 ] + { encoding = OT1, + family = {EBGaramond-OsF}, + shape = it } + { + 1 = {50,50}, + 2 = {50,50}, + 3 = { ,80}, + 4 = {50,50}, + 7 = {50,50}, + } + +\SetProtrusion + [ name = EBGaramond-it-OT1-TOsF, + load = EBGaramond-it-OT1 ] + { encoding = OT1, + family = {EBGaramond-TOsF}, + shape = it } + { + 0 = {150,150}, + 1 = {150,150}, + 2 = {80,80}, + 3 = {50,80}, + 4 = {50,80}, + 5 = {50,80}, + 6 = {50,50}, + 7 = {50,100}, + 8 = {50,50}, + 9 = {50,80}, + } + +%</ebg> \SetProtrusion %<m-t> [ name = T1-it-default, %<bch> [ name = bch-it-T1, @@ -14922,7 +16800,8 @@ end %<ppl> load = ppl-it ] %<ptm> load = ptm-it ] %<ugm> load = ugm-it ] -%<m-t|bch|cmr|ebg|pmn|ppl> { encoding = {T1,LY1}, +%<m-t|bch|cmr|pmn|ppl> { encoding = {T1,LY1}, +%<ebg> { encoding = {LY1}, %<blg|ptm|ugm> { encoding = T1, %<bch> family = bch, %<blg> family = blg, @@ -14932,8 +16811,8 @@ end %<ppl> family = {ppl,pplx,pplj}, %<ptm> family = {ptm,ptmx,ptmj}, %<ugm> family = ugm, -%<m-t|bch|ebg|pmn|ppl|ptm> shape = {it,sl} } -%<blg|cmr|ugm> shape = it } +%<m-t|bch|pmn|ppl|ptm> shape = {it,sl} } +%<blg|cmr|ebg|ugm> shape = it } { %<m-t|bch|pmn> _ = { ,100}, %<blg> _ = {0,300}, @@ -14987,6 +16866,59 @@ end %<pmn> \textvisiblespace = {100,100} } +%<*ebg> +\SetProtrusion + [ name = EBGaramond-it-T1-LF, + load = EBGaramond-it-T1 ] + { encoding = T1, + family = {EBGaramond-LF,EBGaramond-TLF}, + shape = it } + { + 1 = {50,50}, + 2 = {50,50}, + 3 = {80,50}, + 4 = {50,50}, + 5 = {50,50}, + 6 = {50,50}, + 7 = {50,50}, + 8 = {50,50}, + 9 = {50, }, + } + +\SetProtrusion + [ name = EBGaramond-it-T1-OsF, + load = EBGaramond-it-T1 ] + { encoding = T1, + family = {EBGaramond-OsF}, + shape = it } + { + 1 = {50,50}, + 2 = {50,50}, + 3 = { ,80}, + 4 = {50,50}, + 7 = {50,50}, + } + +\SetProtrusion + [ name = EBGaramond-it-T1-TOsF, + load = EBGaramond-it-T1 ] + { encoding = T1, + family = {EBGaramond-TOsF}, + shape = it } + { + 0 = {150,150}, + 1 = {150,150}, + 2 = {80,80}, + 3 = {50,80}, + 4 = {50,80}, + 5 = {50,80}, + 6 = {50,50}, + 7 = {50,100}, + 8 = {50,50}, + 9 = {50,80}, + } + +%</ebg> %<*m-t|cmr|pmn> \SetProtrusion %<m-t> [ name = T2A-it-default, @@ -15303,14 +17235,14 @@ end %<m-t> [ name = OT1-sc, %<bch> [ name = bch-sc, %<cmr> [ name = cmr-sc-OT1, -%<ebg> [ name = EBGaramond-sc, +%<ebg> [ name = EBGaramond-sc-OT1-Prop, %<pmn> [ name = pmnj-sc, %<ppl> [ name = ppl-sc, %<ptm> [ name = ptm-sc, %<m-t> load = default ] %<bch> load = bch-default ] %<cmr> load = cmr-OT1 ] -%<ebg> load = EBGaramond-default ] +%<ebg> load = EBGaramond-OT1-LF ] %<pmn> load = pmnj-default ] %<ppl> load = ppl-default ] %<ptm> load = ptm-default ] @@ -15318,7 +17250,7 @@ end %<cmr|ppl|ptm> { encoding = {OT1,OT4}, %<bch> family = bch, %<cmr> family = cmr, -%<ebg> family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF,EBGaramond-TOsF}, +%<ebg> family = {EBGaramond-LF,EBGaramond-OsF}, %<pmn> family = pmnj, %<ppl> family = {ppl,pplx,pplj}, %<ptm> family = {ptm,ptmx,ptmj}, @@ -15334,7 +17266,7 @@ end %<bch> j = {100, }, %<m-t|bch|cmr|ebg|pmn|ppl> l = { ,50}, %<ptm> l = { ,80}, -%<m-t|bch|cmr|ebg|pmn|ppl> 013 = { ,50}, % fl +%<m-t|bch|cmr|pmn|ppl> 013 = { ,50}, % fl %<ptm> 013 = { ,80}, % fl %<bch|ebg|pmn> o = {50,50}, %<ebg|pmn> \oe = {50, }, @@ -15347,6 +17279,30 @@ end %<ptm> y = {80,80} } +%<*ebg> +\SetProtrusion + [ name = EBGaramond-sc-OT1-Tab, + load = EBGaramond-OT1-TOsF ] + { encoding = OT1, + family = {EBGaramond-TLF,EBGaramond-TOsF}, + shape = sc } + { + a = {50,50}, + \ae = {50, }, + d = { ,50}, + f = { ,50}, + g = {50, }, + j = {50, }, + l = { ,50}, + o = {50,50}, + \oe = {50, }, + q = {50,70}, + r = { , 0}, + t = {50,50}, + y = {50,50} + } + +%</ebg> \SetProtrusion %<m-t> [ name = T1-sc, %<bch> [ name = bch-sc-T1, @@ -15362,7 +17318,8 @@ end %<pmn> load = pmnj-T1 ] %<ppl> load = ppl-T1 ] %<ptm> load = ptm-T1 ] - { encoding = {T1,LY1}, +%<!ebg> { encoding = {T1,LY1}, +%<ebg> { encoding = {LY1}, %<bch> family = bch, %<cmr> family = cmr, %<ebg> family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF,EBGaramond-TOsF}, @@ -15381,7 +17338,7 @@ end %<bch> j = {100, }, %<m-t|bch|cmr|ebg|pmn|ppl> l = { ,50}, %<ptm> l = { ,80}, -%<m-t|bch|cmr|ebg|pmn|ppl> 029 = { ,50}, % fl +%<m-t|bch|cmr|pmn|ppl> 029 = { ,50}, % fl %<ptm> 029 = { ,80}, % fl %<bch|ebg|pmn> o = {50,50}, %<bch|ebg|pmn> \oe = {50, }, @@ -15457,6 +17414,52 @@ end } %</cmr|bch> +%<*ebg> +\SetProtrusion + [ name = EBGaramond-sc-T1-Prop, + load = EBGaramond-T1-LF ] + { encoding = T1, + family = {EBGaramond-LF,EBGaramond-OsF}, + shape = sc } + { + a = {50,50}, + \ae = {50, }, + d = { ,50}, + f = { ,50}, + g = {50, }, + j = {50, }, + l = { ,50}, + o = {50,50}, + \oe = {50, }, + q = {50,70}, + r = { , 0}, + t = {50,50}, + y = {50,50} + } + +\SetProtrusion + [ name = EBGaramond-sc-T1-Tab, + load = EBGaramond-T1-TOsF ] + { encoding = T1, + family = {EBGaramond-TLF,EBGaramond-TOsF}, + shape = sc } + { + a = {50,50}, + \ae = {50, }, + d = { ,50}, + f = { ,50}, + g = {50, }, + j = {50, }, + l = { ,50}, + o = {50,50}, + \oe = {50, }, + q = {50,70}, + r = { , 0}, + t = {50,50}, + y = {50,50} + } + +%</ebg> %<*pmn> \SetProtrusion [ name = pmnx-sc, @@ -15585,6 +17588,101 @@ end } %</pmn> +%<*ebg> +% \end{macrocode} +% For small caps italics, we copy the definitions from the small caps settings, +% except that we first load the italics settings. +%\changes{v3.0}{2021/06/23}{settings for <EB> Garamond small caps italics} +% \begin{macrocode} +\SetProtrusion + [ name = EBGaramond-scit-OT1-Prop, + load = EBGaramond-it-OT1-LF ] + { encoding = OT1, + family = {EBGaramond-LF,EBGaramond-OsF}, + shape = scit } + { + a = {50,50}, + \ae = {50, }, + d = { ,50}, + f = { ,50}, + g = {50, }, + j = {50, }, + l = { ,50}, + o = {50,50}, + \oe = {50, }, + q = {50,70}, + r = { , 0}, + t = {50,50}, + y = {50,50} + } + +\SetProtrusion + [ name = EBGaramond-scit-OT1-Tab, + load = EBGaramond-it-OT1-TOsF ] + { encoding = OT1, + family = {EBGaramond-TLF,EBGaramond-TOsF}, + shape = scit } + { + a = {50,50}, + \ae = {50, }, + d = { ,50}, + f = { ,50}, + g = {50, }, + j = {50, }, + l = { ,50}, + o = {50,50}, + \oe = {50, }, + q = {50,70}, + r = { , 0}, + t = {50,50}, + y = {50,50} + } + +\SetProtrusion + [ name = EBGaramond-scit-T1-Prop, + load = EBGaramond-it-T1-LF ] + { encoding = T1, + family = {EBGaramond-LF,EBGaramond-OsF}, + shape = scit } + { + a = {50,50}, + \ae = {50, }, + d = { ,50}, + f = { ,50}, + g = {50, }, + j = {50, }, + l = { ,50}, + o = {50,50}, + \oe = {50, }, + q = {50,70}, + r = { , 0}, + t = {50,50}, + y = {50,50} + } + +\SetProtrusion + [ name = EBGaramond-scit-T1-Tab, + load = EBGaramond-it-T1-TOsF ] + { encoding = T1, + family = {EBGaramond-TLF,EBGaramond-TOsF}, + shape = scit } + { + a = {50,50}, + \ae = {50, }, + d = { ,50}, + f = { ,50}, + g = {50, }, + j = {50, }, + l = { ,50}, + o = {50,50}, + \oe = {50, }, + q = {50,70}, + r = { , 0}, + t = {50,50}, + y = {50,50} + } + +%</ebg> % \end{macrocode} % %\subsubsection{Text companion} @@ -15815,8 +17913,8 @@ end %<ebg> family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF,EBGaramond-TOsF}, %<pmn> family = {pmnx,pmnj}, %<ugm> family = ugm, -%<!ugm> shape = {it,sl} } -%<ugm> shape = it } +%<cmr|pmn> shape = {it,sl} } +%<ebg|ugm> shape = it } { %<cmr> \textquotestraightbase = {300,600}, %<ebg|pmn> \textquotestraightbase = {400,400}, @@ -17231,24 +19329,28 @@ end %\ifpdf %\GeneralChanges{Documentation} %^^A The OpenType configuration files are outsourced to an external file, -%^^A since they are typeset with \luatex. +%^^A since they have to be typeset with \luatex. % -%\newwrite \utftmp -%\immediate\openout \utftmp=microtype-utf.tmp -%\immediate\write \utftmp{\string\setcounter{section}{\the\c@section}} -%\immediate\write \utftmp{\string\setcounter{CodelineNo}{\the\c@CodelineNo}} -%\immediate\write \utftmp{\string\setcounter{page}{\the\c@page}} -%\immediate\write \utftmp{\string\setcounter{footnote}{\the\c@footnote}} -%\immediate\closeout\utftmp +%\begingroup +%\def\setcounter#1#2{\expandafter\ifnum\csname c@#1\endcsname=#2 \else\@tempswatrue\fi} +%\InputIfFileExists{microtype-code.tmp}\@tempswafalse\@tempswatrue +%\if@tempswa +%\newwrite \codetmp +%\immediate\openout \codetmp=microtype-code.tmp +%\immediate\write \codetmp{\string\setcounter{section}{\the\c@section}} +%\immediate\write \codetmp{\string\setcounter{CodelineNo}{\the\c@CodelineNo}} +%\immediate\write \codetmp{\string\setcounter{page}{\the\c@page}} +%\immediate\write \codetmp{\string\setcounter{footnote}{\the\c@footnote}} +%\immediate\closeout\codetmp +%\fi +%\endgroup % -%\InputIfFileExists{microtype.tmp}\relax{\def\utfsectioni{1}\def\utfsectionii{1}} +%\InputIfFileExists{microtype-utf.tmp} +% {\def\UTF@setbookmarks##1{\def\UTFBookmarks{##1}}} +% {\let\UTFBookmarks\@empty} % %\IfFileExists{microtype-utf.pdf} -% {\includepdf[pages=-, -% addtotoc={1,section,1,OpenType configuration files,sec:OpenType, -% \utfsectioni,subsection,2,Character inheritance,sub:OT-inheritance, -% \utfsectionii,subsection,2,Character protrusion,sub:OT-protrusion}] -% {microtype-utf.pdf}} +% {\edef\x{\noexpand\includepdf[pages=-,addtotoc={\UTFBookmarks}]{microtype-utf.pdf}}\x} % {\section{OpenType configuration settings} % To view the OpenType configuration settings, first typeset % \file{microtype-utf.dtx} with \luatex.} @@ -17262,119 +19364,65 @@ end % %\section{Auxiliary file for micro fine tuning} % -% This file can be used to test protrusion and expansion settings. +% This file may be used to test protrusion and (less so) expansion settings. % \begin{macrocode} %<*test> \documentclass{article} +%% options are passed through to microtype +\usepackage[stretch=50]{microtype-show} -%% Here you can specify the font you want to test, using -%% the commands \fontfamily, \fontseries and \fontshape. -%% Make sure to end all lines with a comment character! -\newcommand*\TestFont{% - \fontfamily{ppl}% -%% \fontseries{b}% -%% \fontshape{it}% sc, sl -} +%% options for microtype-show +\ShowGlyphIndextrue +\ShowMissingGlyphstrue +\def\GlyphScaleFactor{2} -\usepackage{ifthen} -\usepackage[T1]{fontenc} -\usepackage[latin1]{inputenc} -\usepackage[verbose,expansion=alltext,stretch=50]{microtype} +%% load any required font packages: +\ifpdftex + \usepackage[T1]{fontenc} +\else + \usepackage{fontspec} +\fi -\pagestyle{empty} -\setlength{\parindent}{0pt} -\newcommand*\crulefill{\cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill} -\newcommand*\testprotrusion[2][]{% - \ifthenelse{\equal{#1}{r}}{}{#2}% - lorem ipsum dolor sit amet, - \ifthenelse{\equal{#1}{r}}{\crulefill}{\leftarrowfill} #2 - \ifthenelse{\equal{#1}{l}}{\crulefill}{\rightarrowfill} - you know the rest% - \ifthenelse{\equal{#1}{l}}{}{#2}% - \linebreak - {\fontencoding{\encodingdefault}% - \fontseries{\seriesdefault}% - \fontshape{\shapedefault}% - \selectfont - Here is the beginning of a line, \dotfill and here is its end}\linebreak -} -\newcommand*\showTestFont{\expandafter\stripprefix\meaning\TestFont} -\def\stripprefix#1>{} -\newcount\charcount \begin{document} - \microtypesetup{expansion=false} -{\centering The font in this document is called by:\\ - \texttt{\showTestFont}\par}\bigskip +%% load your font here: -\TestFont\selectfont - This line intentionally left empty\linebreak -%% A -- Z -\charcount=65 -\loop - \testprotrusion{\char\charcount} - \advance\charcount 1 - \ifnum\charcount < 91 \repeat -%% a -- z -\charcount=97 -\loop - \testprotrusion{\char\charcount} - \advance\charcount 1 - \ifnum\charcount < 123 \repeat -%% 0 -- 9 -\charcount=48 -\loop - \testprotrusion{\char\charcount} - \advance\charcount 1 - \ifnum\charcount < 58 \repeat -%% - \testprotrusion[r]{,} - \testprotrusion[r]{.} - \testprotrusion[r]{;} - \testprotrusion[r]{:} - \testprotrusion[r]{?} - \testprotrusion[r]{!} - \testprotrusion[l]{\textexclamdown} - \testprotrusion[l]{\textquestiondown} - \testprotrusion[r]{)} - \testprotrusion[l]{(} - \testprotrusion{/} - \testprotrusion{\char`\\} - \testprotrusion{-} - \testprotrusion{\textendash} - \testprotrusion{\textemdash} - \testprotrusion{\textquoteleft} - \testprotrusion{\textquoteright} - \testprotrusion{\textquotedblleft} - \testprotrusion{\textquotedblright} - \testprotrusion{\quotesinglbase} - \testprotrusion{\quotedblbase} - \testprotrusion{\guilsinglleft} - \testprotrusion{\guilsinglright} - \testprotrusion{\guillemotleft} - \testprotrusion{\guillemotright} +\ShowCharacterInheritance \newpage -The following displays the current font stretched by 5\%, -normal, and shrunk by 5\%: +\ShowProtrusion + +\newpage +%% show single glyphs + %\ShowDummyLine + %\ShowProtrusionLineGlyph{A} + %\ShowProtrusionLineIndex{27} + +%% loop through all glyphs of the font; +%% protrusion values are shown in 1000th of 1em + \ShowProtrusionDefined + + %\ShowProtrusionMissing + + %\ShowProtrusionAll + +\newpage %% ------------------------------------------------------------------- +This is the current font stretched by 5\%, normal, and shrunk by 5\%: -\bigskip \newlength{\MTln} \newcommand*\teststring - {ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789} + {ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz} \settowidth{\MTln}{\teststring} \microtypesetup{expansion=true} -\parbox{1.05\MTln}{\teststring\linebreak\\ - \teststring}\par\bigskip -\parbox{0.95\MTln}{\teststring} - +\bigskip\noindent\parbox{1.05\MTln}{\teststring\linebreak\\\teststring}\par +\bigskip\noindent\parbox{0.95\MTln}{\teststring} \end{document} %</test> % \end{macrocode} % Needless to say that things may always be improved. For suggestions, mail to -% \mailtoRS. +% \mailtoRS\ or file an issue at \url{\githuburl/issues}. % % ^^A ------------------------------------------------------------------------- % @@ -17408,33 +19456,34 @@ normal, and shrunk by 5\%: % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% \CheckSum{10847} +% \CheckSum{12274} % % \Finale % +% \InputIfFileExists{lppl.tex}\LPPLSettings\relax +% \endinput % % ----------------------------------------------------------------------------- *** Typesetting the documentation *** - The documentation of this package (microtype.pdf) can be found on CTAN, - if it isn't already installed in your TeX system, so there should be no - need to re-typeset it. + The documentation of this package (microtype.pdf and microtype-code.pdf) + can be found on CTAN, if it isn't already installed in your TeX system, + so there should be no need to re-typeset it. If you still want to do this, there are some requirements to consider and some steps to follow: -# (1) In microtype.ins, uncomment the lines: +# (1) In microtype.ins, uncomment the lines %\generate{\makefile{microtype-gind.ist}{docist}} # and %\generate{\makefile{microtype-doc.sty}{docsty}} -# (2) Install the package by running: +# (2) Install the package by running pdflatex microtype.ins # (3) Extract microtype-lssample.dtx and microtype-logo.dtx from # microtype.pdf (ie., from the file you are about to recreate ...). # This can be done, eg., with Adobe Reader or with the pdftk tool. -# (4) Run -pdflatex microtype.dtx +# (4) To typeset the user documentation (microtype.pdf) run pdflatex microtype.dtx # [ The following fonts are required: # - Bitstream Charter @@ -17444,11 +19493,11 @@ pdflatex microtype.dtx # - Adobe Zapf Chancery (alternatively URW Zapf Chancery) # - Adobe Kepler MM (for microtype-logo.dtx, input by microtype.dtx) # - Adobe Caslon (for microtype-lssample.dtx, input by microtype.dtx) ] -# (5) Run +# (5) To create the index run makeindex -s microtype-gind.ist microtype -# (6) Run -makeindex -s gglo.ist -o microtype.gls microtype.glo microtype-utf.glo -# (7) Run +# (6) To typeset the implementation documentation (microtype-code.pdf) run +pdflatex --jobname=microtype-code microtype.dtx +# (7) To typeset the OpenType configuration (to be included in microtype-code.pdf) run lualatex microtype-utf.dtx # [ The following fonts are required: # - Bitstream Charter (Type 1) @@ -17456,15 +19505,15 @@ lualatex microtype-utf.dtx # - Adobe Source Sans Pro (Type 1) # - Latin Modern Roman (OpenType) # - Charis SIL (OpenType) +# - EB Garamond (OpenType) # - TeX Gyre Pagella (OpenType) ] -# (8) Run -pdflatex microtype.dtx -# (9) Run -makeindex -s microtype-gind.ist microtype -# (10) Run -makeindex -s gglo.ist -o microtype.gls microtype.glo microtype-utf.glo -# (11) Run -pdflatex microtype.dtx +# (8) To create the code index and history run +makeindex -r -s microtype-gind.ist -t microtype-code.ilg -o microtype-code.ind microtype.idx microtype-code.idx +makeindex -s gglo.ist -t microtype-code.glg -o microtype-code.gls microtype.glo microtype-code.glo microtype-utf.glo +# +# All three output files (microtype.pdf, microtype-code.pdf, microtype-utf.pdf) +# are interdependent, so you need to repeat steps 4 to 8 until all Rerun +# warnings have been resolved. # # That's it, although I still may have forgotten some things ... % @@ -17472,4 +19521,5 @@ pdflatex microtype.dtx % ----------------------------------------------------------------------------- % % vim: ts=2:sw=2:et: + % diff --git a/macros/latex/contrib/microtype/microtype.ins b/macros/latex/contrib/microtype/microtype.ins index b0cc569700..13f8092749 100644 --- a/macros/latex/contrib/microtype/microtype.ins +++ b/macros/latex/contrib/microtype/microtype.ins @@ -1,4 +1,4 @@ -% !Mode:: "TeX:STY:UK" +% % ------------------------------------------------------------------------ \input docstrip \keepsilent @@ -18,11 +18,12 @@ your option) any later version. The latest version of this license is in: http://www.latex-project.org/lppl.txt, and version 1.3c or later is part of all distributions of LaTeX version 2005/12/01 or later. -This work has the LPPL maintenance status `author-maintained'. +This work has the LPPL maintenance status `maintained'. -This work consists of the files microtype.dtx and microtype.ins and the -derived files microtype.sty, microtype-pdftex.def, microtype-luatex.def, -microtype-xetex.def, microtype.lua and letterspace.sty. +This work consists of the files microtype.dtx, microtype-utf.dtx and +microtype.ins and the derived files microtype.sty, microtype-pdftex.def, +microtype-luatex.def, microtype-xetex.def, microtype.lua, letterspace.sty +and microtype-show.sty. % Modified versions of the configuration files (*.cfg) may be distributed % provided that: (1) the original copyright statement is not removed, and @@ -74,9 +75,14 @@ microtype-xetex.def, microtype.lua and letterspace.sty. let me know.^^M When modifying this file, also change the identification line below. \endpreamble +\declarepreamble\showpreamble + This companion package offers various commands that might be helpful + when creating protrusion settings. See the documentation in microtype's + User manual, section 10, and the examples in test-microtype.tex. +\endpreamble \declarepreamble\testpreamble This file might be useful to test protrusion settings for a font. - You can do whatever you want with it. + You may do with it whatever you want. \endpreamble \let\firstpreamblepart\fontpreamble \let\lastpreamblepart \empty @@ -90,6 +96,9 @@ microtype-xetex.def, microtype.lua and letterspace.sty. Harald Harders <h.harders{at}tu-bs.de> and Karl Karlsson <karl-karlsson{at}yandex.ru>.^^M \endpreamble +\declarepreamble\antonispreamble^^M + Antonis Tsolomitis <antonis.tsolomitis{at}gmail.com>^^M +\endpreamble \declarepreamble\lorenpreamble^^M Loren B. Davis. (c) 2012 @@ -105,6 +114,9 @@ microtype-xetex.def, microtype.lua and letterspace.sty. \def\makefile#1#2{\file{#1}{\from{microtype.dtx}{#2}}} \def\makecfg#1#2{\makefile{mt-#2.cfg}{config,cfg-#1,#2}} \def\makeutfcfg#1{\file{mt-#1.cfg}{\from{microtype-utf.dtx}{#1}}} +\def\makemixedcfg#1#2{\file{mt-#1.cfg} + {\from{microtype.dtx}{config,cfg-t,#2} + \from{microtype-utf.dtx}{#1}}} \usedir{tex/latex/microtype} \let\MetaPrefix\DoubleperCent @@ -114,9 +126,9 @@ microtype-xetex.def, microtype.lua and letterspace.sty. \generate{ \makefile{microtype.sty}{package\DEBUG} \usepreamble\defpreamble - \makefile{microtype-pdftex.def}{pdftex-def\DEBUG} - \makefile{microtype-luatex.def}{luatex-def\DEBUG} - \makefile{microtype-xetex.def} {xetex-def\DEBUG} + \makefile{microtype-pdftex.def}{pdf-\DEBUG} + \makefile{microtype-luatex.def}{lua-\DEBUG} + \makefile{microtype-xetex.def} {xe-\DEBUG} \usepreamble\lsppreamble \makefile{letterspace.sty}{letterspace,plain} \usepreamble\cfgpreamble @@ -125,7 +137,6 @@ microtype-xetex.def, microtype.lua and letterspace.sty. \makecfg{t}{bch} \makecfg{t}{blg} \makecfg{t}{cmr} - \makefile{mt-EBGaramond.cfg}{config,cfg-t,ebg} \makecfg{t}{ppl} \makecfg{t}{ptm} \makecfg{t}{ugm} @@ -138,12 +149,17 @@ microtype-xetex.def, microtype.lua and letterspace.sty. \makecfg{e}{mvs} \makeutfcfg{LatinModernRoman} \makeutfcfg{CharisSIL} - \makeutfcfg{Lato} - \makeutfcfg{FontAwesome} + \makeutfcfg{TU-basic} + \makeutfcfg{TU-empty} + \makemixedcfg{EBGaramond}{ebg} \usepreamble\haraldandkarlpreamble \makecfg{t}{pmn} \usepreamble\lorenpreamble \makeutfcfg{Palatino} + \usepreamble\antonispreamble + \makeutfcfg{NewComputerModern} + \usepreamble\showpreamble + \makefile{microtype-show.sty}{show\DEBUG} \usepreamble\testpreamble \makefile{test-microtype.tex}{test} } diff --git a/macros/latex/contrib/microtype/microtype.pdf b/macros/latex/contrib/microtype/microtype.pdf Binary files differindex f88c167627..664a1fc63a 100644 --- a/macros/latex/contrib/microtype/microtype.pdf +++ b/macros/latex/contrib/microtype/microtype.pdf diff --git a/macros/latex/contrib/minimalist/minimalist-doc.pdf b/macros/latex/contrib/minimalist/minimalist-doc.pdf Binary files differindex 3f494eeb60..51bf79ba53 100644 --- a/macros/latex/contrib/minimalist/minimalist-doc.pdf +++ b/macros/latex/contrib/minimalist/minimalist-doc.pdf diff --git a/macros/latex/contrib/minimalist/minimalist-doc.tex b/macros/latex/contrib/minimalist/minimalist-doc.tex index 594fc99d4e..51c7a90585 100644 --- a/macros/latex/contrib/minimalist/minimalist-doc.tex +++ b/macros/latex/contrib/minimalist/minimalist-doc.tex @@ -98,9 +98,9 @@ \title{\minimalist{}, write your articles or books in a simple and clear way} \author{Jinwen XU} -\thanks{Corresponding to: \texttt{\minimalist{} 2021/10/23}} +\thanks{Corresponding to: \texttt{\minimalist{} 2021/10/30}} \email{\href{mailto:ProjLib@outlook.com}{ProjLib@outlook.com}} -\date{October 2021, Paris} +\date{October 2021, in Paris} \maketitle diff --git a/macros/latex/contrib/minimalist/minimalist.sty b/macros/latex/contrib/minimalist/minimalist.sty index 953342a21c..291d5f836d 100644 --- a/macros/latex/contrib/minimalist/minimalist.sty +++ b/macros/latex/contrib/minimalist/minimalist.sty @@ -17,7 +17,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2020-10-01] \ProvidesPackage{minimalist} - [2021/10/23 A simple and clear style for articles and books] + [2021/10/30 A simple and clear style for articles and books] \RequirePackage{kvoptions} \RequirePackage{etoolbox} \SetupKeyvalOptions{% @@ -567,7 +567,7 @@ \RequirePackage{hyperref} \fi -\PassOptionsToPackage{nothms}{PJLthm} +\PassOptionsToPackage{nothms,simplename}{PJLthm} \RequirePackage{PJLthm} \pretocmd{\theoremnameEN}{\textsc}{}{\FAIL} diff --git a/macros/latex/contrib/minimalist/minimart.cls b/macros/latex/contrib/minimalist/minimart.cls index 11e5e07d42..aea2ab05ff 100644 --- a/macros/latex/contrib/minimalist/minimart.cls +++ b/macros/latex/contrib/minimalist/minimart.cls @@ -17,7 +17,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2020-10-01] \ProvidesClass{minimart} - [2021/10/23 A simple and clear article style] + [2021/10/30 A simple and clear article style] \def\minimclass@baseclass{article} \RequirePackage{kvoptions} \RequirePackage{etoolbox} @@ -213,6 +213,7 @@ \PassOptionsToPackage{verbose=silent}{microtype} \RequirePackage{microtype} +\AtEndPreamble{\AtBeginDocument{\microtypesetup{disable}{\scshape}\microtypesetup{enable}}} \PassOptionsToPackage{all}{nowidow} \RequirePackage{nowidow} \RequirePackage{embrac} diff --git a/macros/latex/contrib/minimalist/minimbook.cls b/macros/latex/contrib/minimalist/minimbook.cls index e7bb0d8bb8..b93a06e93b 100644 --- a/macros/latex/contrib/minimalist/minimbook.cls +++ b/macros/latex/contrib/minimalist/minimbook.cls @@ -17,7 +17,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2020-10-01] \ProvidesClass{minimbook} - [2021/10/23 A simple and clear book style] + [2021/10/30 A simple and clear book style] \def\minimclass@baseclass{book} \RequirePackage{kvoptions} \RequirePackage{etoolbox} @@ -213,6 +213,7 @@ \PassOptionsToPackage{verbose=silent}{microtype} \RequirePackage{microtype} +\AtEndPreamble{\AtBeginDocument{\microtypesetup{disable}{\scshape}\microtypesetup{enable}}} \PassOptionsToPackage{all}{nowidow} \RequirePackage{nowidow} \RequirePackage{embrac} diff --git a/macros/latex/contrib/projlib/ProjLib-doc-cn.pdf b/macros/latex/contrib/projlib/ProjLib-doc-cn.pdf Binary files differindex 20cd5582ec..1315d0775e 100644 --- a/macros/latex/contrib/projlib/ProjLib-doc-cn.pdf +++ b/macros/latex/contrib/projlib/ProjLib-doc-cn.pdf diff --git a/macros/latex/contrib/projlib/ProjLib-doc-en.pdf b/macros/latex/contrib/projlib/ProjLib-doc-en.pdf Binary files differindex 0e28bd0987..3ed86cb188 100644 --- a/macros/latex/contrib/projlib/ProjLib-doc-en.pdf +++ b/macros/latex/contrib/projlib/ProjLib-doc-en.pdf diff --git a/macros/latex/contrib/projlib/ProjLib-doc-fr.pdf b/macros/latex/contrib/projlib/ProjLib-doc-fr.pdf Binary files differindex 969e963359..68b4d8ac50 100644 --- a/macros/latex/contrib/projlib/ProjLib-doc-fr.pdf +++ b/macros/latex/contrib/projlib/ProjLib-doc-fr.pdf diff --git a/macros/latex/contrib/projlib/ProjLib-doc.dtx b/macros/latex/contrib/projlib/ProjLib-doc.dtx index 56c34a01a1..75452ab92c 100644 --- a/macros/latex/contrib/projlib/ProjLib-doc.dtx +++ b/macros/latex/contrib/projlib/ProjLib-doc.dtx @@ -107,7 +107,7 @@ %<*ProjLib-doc-cn> \title{\ProjLib{} 工具集\\[.3\baselineskip]\normalsize 使用指南} \author{许锦文} -\thanks{对应版本.~~\texttt{\ProjLib{}~2021/10/24}} +\thanks{对应版本.~~\texttt{\ProjLib{}~2021/10/30}} \email{\href{mailto:ProjLib@outlook.com}{ProjLib@outlook.com}} \date{2021年10月,巴黎} %</ProjLib-doc-cn> @@ -115,15 +115,15 @@ %<*ProjLib-doc-en> \title{\ProjLib{}~\,Toolkit\\[.3\baselineskip]\normalsize User Manual} \author{Jinwen XU} -\thanks{Corresponding to: \texttt{\ProjLib{}~2021/10/24}} +\thanks{Corresponding to: \texttt{\ProjLib{}~2021/10/30}} \email{\href{mailto:ProjLib@outlook.com}{ProjLib@outlook.com}} -\date{October 2021, Paris} +\date{October 2021, in Paris} %</ProjLib-doc-en> % %<*ProjLib-doc-fr> \title{La boîte à outils~\,\ProjLib{}\\[.3\baselineskip]\normalsize Manuel d'utilisation} \author{Jinwen XU} -\thanks{Correspondant à : \texttt{\ProjLib{}~2021/10/24}} +\thanks{Correspondant à : \texttt{\ProjLib{}~2021/10/30}} \email{\href{mailto:ProjLib@outlook.com}{ProjLib@outlook.com}} \date{Octobre 2021, à Paris} %</ProjLib-doc-fr> @@ -585,6 +585,7 @@ Référence du théorème: \cref{thm:abc} Les environnements de type théorème couramment utilisés ont été prédéfinis. De plus, lors du référencement d'un environnement de type théorème, il est recommandé d'utiliser \lstinline|\cref{|\meta{label}\texttt{\}} --- de cette manière, il ne serait pas nécessaire d'écrire explicitement le nom de l'environnement correspondant à chaque fois. %</ProjLib-doc-fr> +\clearpage %<*ProjLib-doc-cn> \section{主宏包的选项} @@ -599,7 +600,7 @@ Les environnements de type théorème couramment utilisés ont été prédéfini \item 字体选项。顾名思义,会加载相应名称的字体。 \item \texttt{useosf} 选项用来启用“旧式”数字。 \end{itemize} - \item \texttt{nothms}、\texttt{delaythms}、\texttt{nothmnum}、\texttt{thmnum} 或 \texttt{thmnum=}\meta{counter}、\texttt{regionalref}、\texttt{originalref} + \item \texttt{nothms}、\texttt{delaythms}、\texttt{nothmnum}、\texttt{thmnum} 或 \texttt{thmnum=}\meta{counter}、\texttt{complexname}、\texttt{simplename}、\texttt{regionalref}、\texttt{originalref} \begin{itemize} \item 来自用于设置定理类环境的组件 \PJLthm{} 的选项,详细信息请参阅有关这一宏包的小节。 \end{itemize} @@ -629,7 +630,7 @@ Les environnements de type théorème couramment utilisés ont été prédéfini \item Font options. As the names suggest, font with corresponding name will be loaded. \item The \texttt{useosf} option is used to enable the old-style figures. \end{itemize} - \item \texttt{nothms}, \texttt{delaythms}, \texttt{nothmnum}, \texttt{thmnum} or \texttt{thmnum=}\meta{counter}, \texttt{regionalref}, \texttt{originalref} + \item \texttt{nothms}, \texttt{delaythms}, \texttt{nothmnum}, \texttt{thmnum} or \texttt{thmnum=}\meta{counter}, \texttt{complexname}, \texttt{simplename}, \texttt{regionalref}, \texttt{originalref} \begin{itemize} \item Options from the component \PJLthm{} used for setting theorem-like environments, please refer to the section on this package for details. \end{itemize} @@ -659,7 +660,7 @@ In addition, there are also some options of the components that should be passed \item Options de police. Comme les noms l'indiquent, la police avec le nom correspondant sera utilisée. \item L'option \texttt{useosf} est pour activer les chiffres à l'ancienne. \end{itemize} - \item \texttt{nothms}, \texttt{delaythms}, \texttt{nothmnum}, \texttt{thmnum} ou \texttt{thmnum=}\meta{counter}, \texttt{regionalref}, \texttt{originalref} + \item \texttt{nothms}, \texttt{delaythms}, \texttt{nothmnum}, \texttt{thmnum} ou \texttt{thmnum=}\meta{counter}, \texttt{complexname}, \texttt{simplename}, \texttt{regionalref}, \texttt{originalref} \begin{itemize} \item Options du composant \PJLthm{} utilisé pour définir des environnements de type théorème, veuillez vous référer à la section sur ce package pour plus de détails. \end{itemize} @@ -704,91 +705,6 @@ De plus, il existe également certaines options des composants qui doivent être %</ProjLib-doc-fr> %<*ProjLib-doc-cn> -\subsubsection{PJLauthor:增强的作者信息块} - -\PJLauthor{} 提供了 \lstinline|\address|、\lstinline|\curraddr|、\lstinline|\email| 命令,并且允许输入多组用户信息。标准的输入方式是这样的: -\begin{code} -\author{(*\meta{author 1}*)} -\address{(*\meta{address 1}*)} -\email{(*\meta{email 1}*)} -\author{(*\meta{author 2}*)} -\address{(*\meta{address 2}*)} -\email{(*\meta{email 2}*)} -... -\end{code} -其中 \lstinline|\address|、\lstinline|\curraddr|、\lstinline|\email| 的相互顺序是不重要的。 - -\medskip -另外,你可以通过选项 \texttt{amsfashion} 以使用 \AmS{} 方式写作。具体来说,效果为: -\begin{itemize} - \item 提供 \lstinline|\dedicatory|、\lstinline|\keywords| 及 \lstinline|\subjclass| 命令 - \item \lstinline|\thanks| 可以写在 \lstinline|\author| 之外 - \item \lstinline|abstract| 环境可以放在 \lstinline|\maketitle| 的前面 -\end{itemize} - -\begin{tip}[注意] - 这些功能只在标准文档类中启用。在 \AmS{} 文档类中,\PJLauthor{} 不会起到任何效果。 -\end{tip} -%</ProjLib-doc-cn> -% -%<*ProjLib-doc-en> -\subsubsection{PJLauthor: enhanced author block} - -\PJLauthor{} offers \lstinline|\address|, \lstinline|\curraddr| and \lstinline|\email|, and allows you to enter multiple groups of author information. The standard usage is like this: -\begin{code} -\author{(*\meta{author 1}*)} -\address{(*\meta{address 1}*)} -\email{(*\meta{email 1}*)} -\author{(*\meta{author 2}*)} -\address{(*\meta{address 2}*)} -\email{(*\meta{email 2}*)} -... -\end{code} -The mutual order of \lstinline|\address|, \lstinline|\curraddr| and \lstinline|\email| is not important. - -\medskip -In addition, you can use the option \texttt{amsfashion} to enable the \AmS{} fashion. More specifically, the effect is: -\begin{itemize} - \item Provides the macros \lstinline|\dedicatory|, \lstinline|\keywords| and \lstinline|\subjclass|; - \item \lstinline|\thanks| can be written outside \lstinline|\author|; - \item The \lstinline|abstract| environment can be placed before \lstinline|\maketitle|. -\end{itemize} - -\begin{tip}[Attention] - These modifications would only take place in standard classes. In the \AmS{} classes, \PJLauthor{} does not have any effect. -\end{tip} -%</ProjLib-doc-en> -% -%<*ProjLib-doc-fr> -\subsubsection{PJLauthor : bloc auteur amélioré} - -\PJLauthor{} propose les macros \lstinline|\address|, \lstinline|\curraddr| et \lstinline|\email|, et vous permet de saisir plusieurs groupes d'informations sur l'auteur. L'utilisation standard est comme ceci : -\begin{code} -\author{(*\meta{author 1}*)} -\address{(*\meta{address 1}*)} -\email{(*\meta{email 1}*)} -\author{(*\meta{author 2}*)} -\address{(*\meta{address 2}*)} -\email{(*\meta{email 2}*)} -... -\end{code} -L'ordre mutuel de \lstinline|\address|, \lstinline|\curraddr| et \lstinline|\email| n'est pas important. - -\medskip -De plus, vous pouvez utiliser l'option \texttt{amsfashion} pour écrire à la manière \AmS{}. Plus précisément, l'effet est : -\begin{itemize} - \item Fournit les macros \lstinline|\dedicatory|, \lstinline|\keywords| et \lstinline|\subjclass|; - \item \lstinline|\thanks| peut être écrit en dehors de la macro \lstinline|\author|; - \item La environnement \lstinline|abstract| peut être placé avant \lstinline|\maketitle|. -\end{itemize} - -\begin{tip}[Attention] - Ces modifications n'auraient lieu que dans les classes standard. Dans les classes \AmS{}, \PJLauthor{} n'a aucun effet. -\end{tip} -%</ProjLib-doc-fr> - - -%<*ProjLib-doc-cn> \subsubsection{PJLlang:多语言支持} \PJLlang{} 提供了多语言支持,包括简体中文、繁体中文、英文、法文、德文、日文、俄文 (其中中文、日文、俄文需要相应的 \TeX{} 引擎与字体支持)。 @@ -813,8 +729,7 @@ De plus, vous pouvez utiliser l'option \texttt{amsfashion} pour écrire à la ma \end{itemize} \end{itemize} -% \medskip -\clearpage +\medskip \meta{language name} 有下列选择 (不区分大小写,如 \texttt{French} 或 \texttt{french} 均可): \begin{itemize}\setstretch{1.15} \item 简体中文:\texttt{CN}、\texttt{Chinese}、\texttt{SChinese} 或 \texttt{SimplifiedChinese} @@ -965,6 +880,10 @@ Par exemple, \lstinline|\AddLanguageSetting(German){\color{orange}}| peut rendre \begin{itemize} \item 使定理类环境均不编号 / 按照 1、2、3 顺序编号 / 在 \meta{counter} 内编号。其中 \meta{counter} 应该是自带的计数器 (如 \texttt{subsection}) 或在导言部分自定义的计数器 (在启用 \texttt{delaythms} 选项的情况下)。在没有使用任何选项的情况下将按照 \texttt{chapter} (书) 或 \texttt{section} (文章) 编号。 \end{itemize} + \item \texttt{complexname}、\texttt{simplename} + \begin{itemize} + \item 对于预设的定理名称,使用详细版本(默认)或简易版本。详细版本包含单复数的差别,并且在可能的情况下加入了定冠词;简易版本则统一采用单个单词的名称,不区分单复数。 + \end{itemize} \item \texttt{regionalref}、\texttt{originalref} \begin{itemize} \item 在智能引用时,定理类环境的名称是否随当前语言而变化。默认为 \texttt{regionalref},即引用时采用当前语言对应的名称;例如,在中文语境中引用定理类环境时,无论原环境处在什么语境中,都将使用名称“定理、定义……”。若启用 \texttt{originalref},则引用时会始终采用定理类环境所处语境下的名称;例如,在英文语境中书写的定理,即使稍后在中文语境下引用时,仍将显示为 Theorem。 @@ -1017,8 +936,7 @@ Par exemple, \lstinline|\AddLanguageSetting(German){\color{orange}}| peut rendre 除此以外,你也可以在定义相应的定理类环境时为之命名,可以参见后文对 \lstinline|\CreateTheorem| 的说明。 \end{tip} -\clearpage -% \bigskip +\bigskip 然后,用下面五种方式之一定义这一环境: \begin{itemize} \item \lstinline|\CreateTheorem*{|\meta{name of environment}\lstinline|}| @@ -1135,6 +1053,10 @@ Par exemple, \lstinline|\AddLanguageSetting(German){\color{orange}}| peut rendre \begin{itemize} \item Theorem-like environments will not be numbered / numbered in order 1, 2, 3... / numbered within \meta{counter}. Here, \meta{counter} should be a built-in counter (such as \texttt{subsection}) or a custom counter defined in the preamble (with the option \texttt{delaythms} enabled). If no option is used, they will be numbered within \texttt{chapter} (book) or \texttt{section} (article). \end{itemize} + \item \texttt{complexname}, \texttt{simplename} + \begin{itemize} + \item Enabled the detailed preset (default) or the simple preset for names of theorem-like environments. The detailed version includes singular and plural forms, and, where possible, the definite articles; the simple version uses always the same word, without distinction between singular and plural forms. + \end{itemize} \item \texttt{regionalref}, \texttt{originalref} \begin{itemize} \item When referencing, whether the name of the theorem-like environment changes with the current language. The default is \texttt{regionalref}, \emph{i.e.}, the name corresponding to the current language is used; for example, when referencing a theorem-like environment in English context, the names "Theorem, Definition..." will be used no matter which language context the original environment is in. If \texttt{originalref} is enabled, then the name will always remain the same as the original place; for example, when referencing a theorem written in the French context, even if one is currently in the English context, it will still be displayed as ``Théorème''. @@ -1304,6 +1226,10 @@ or set the names while defining them (for \lstinline|proofidea*| and \lstinline| \begin{itemize} \item Les environnements de type théorème ne seront pas numérotés / numérotés dans l'ordre 1, 2, 3... / numérotés dans \meta{counter}. Ici, \meta{counter} doit être un compteur intégré (tel que \texttt{subsection}) ou un compteur défini dans le préambule (avec l'option \texttt{delaythms} activée). Si aucune option n'est utilisée, ils seront numérotés dans \texttt{chapter} (livre) ou \texttt{section} (article). \end{itemize} + \item \texttt{complexname}, \texttt{simplename} + \begin{itemize} + \item Utilisez le preset détaillé (par défaut) ou le preset simple pour les noms des environnements de type théorème. La version détaillée inclut les formes singulières et plurielles, et, où possible, les articles définis ; la version simple utilise toujours le même mot, sans distinction entre les formes singulières ou plurielles. + \end{itemize} \item \texttt{regionalref}, \texttt{originalref} \begin{itemize} \item Lors du référencement, si le nom de l'environnement de type théorème change avec la langue actuelle. Par défaut \texttt{regionalref} est activé, c'est-à-dire que le nom correspondant à la langue courante est utilisé ; par exemple, lors du référencement d'un environnement de type théorème dans un contexte français, les noms «~Théorème, Définition ...~» seront utilisés quel que soit le contexte linguistique dans lequel se trouve l'environnement d'origine. Si \texttt{originalref} est activé, alors le nom restera toujours le même que l'environnement d'origine ; par exemple, lors du référencement d'un théorème écrit dans le contexte français, même si l'on est actuellement dans le contexte anglais, il sera toujours affiché comme «~Théorème~». @@ -1456,7 +1382,7 @@ ou définissez les noms en les définissant (pour \lstinline|proofidea*| et \lst -\clearpage +% \clearpage %<*ProjLib-doc-cn> \subsection{次要功能} @@ -1471,6 +1397,90 @@ ou définissez les noms en les définissant (pour \lstinline|proofidea*| et \lst %</ProjLib-doc-fr> %<*ProjLib-doc-cn> +\subsubsection{PJLauthor:增强的作者信息块} + +\PJLauthor{} 提供了 \lstinline|\address|、\lstinline|\curraddr|、\lstinline|\email| 命令,并且允许输入多组用户信息。标准的输入方式是这样的: +\begin{code} +\author{(*\meta{author 1}*)} +\address{(*\meta{address 1}*)} +\email{(*\meta{email 1}*)} +\author{(*\meta{author 2}*)} +\address{(*\meta{address 2}*)} +\email{(*\meta{email 2}*)} +... +\end{code} +其中 \lstinline|\address|、\lstinline|\curraddr|、\lstinline|\email| 的相互顺序是不重要的。 + +\medskip +另外,你可以通过选项 \texttt{amsfashion} 以使用 \AmS{} 方式写作。具体来说,效果为: +\begin{itemize} + \item 提供 \lstinline|\dedicatory|、\lstinline|\keywords| 及 \lstinline|\subjclass| 命令 + \item \lstinline|\thanks| 可以写在 \lstinline|\author| 之外 + \item \lstinline|abstract| 环境可以放在 \lstinline|\maketitle| 的前面 +\end{itemize} + +\begin{tip}[注意] + 这些功能只在标准文档类中启用。在 \AmS{} 文档类中,\PJLauthor{} 不会起到任何效果。 +\end{tip} +%</ProjLib-doc-cn> +% +%<*ProjLib-doc-en> +\subsubsection{PJLauthor: enhanced author block} + +\PJLauthor{} offers \lstinline|\address|, \lstinline|\curraddr| and \lstinline|\email|, and allows you to enter multiple groups of author information. The standard usage is like this: +\begin{code} +\author{(*\meta{author 1}*)} +\address{(*\meta{address 1}*)} +\email{(*\meta{email 1}*)} +\author{(*\meta{author 2}*)} +\address{(*\meta{address 2}*)} +\email{(*\meta{email 2}*)} +... +\end{code} +The mutual order of \lstinline|\address|, \lstinline|\curraddr| and \lstinline|\email| is not important. + +\medskip +In addition, you can use the option \texttt{amsfashion} to enable the \AmS{} fashion. More specifically, the effect is: +\begin{itemize} + \item Provides the macros \lstinline|\dedicatory|, \lstinline|\keywords| and \lstinline|\subjclass|; + \item \lstinline|\thanks| can be written outside \lstinline|\author|; + \item The \lstinline|abstract| environment can be placed before \lstinline|\maketitle|. +\end{itemize} + +\begin{tip}[Attention] + These modifications would only take place in standard classes. In the \AmS{} classes, \PJLauthor{} does not have any effect. +\end{tip} +%</ProjLib-doc-en> +% +%<*ProjLib-doc-fr> +\subsubsection{PJLauthor : bloc auteur amélioré} + +\PJLauthor{} propose les macros \lstinline|\address|, \lstinline|\curraddr| et \lstinline|\email|, et vous permet de saisir plusieurs groupes d'informations sur l'auteur. L'utilisation standard est comme ceci : +\begin{code} +\author{(*\meta{author 1}*)} +\address{(*\meta{address 1}*)} +\email{(*\meta{email 1}*)} +\author{(*\meta{author 2}*)} +\address{(*\meta{address 2}*)} +\email{(*\meta{email 2}*)} +... +\end{code} +L'ordre mutuel de \lstinline|\address|, \lstinline|\curraddr| et \lstinline|\email| n'est pas important. + +\medskip +De plus, vous pouvez utiliser l'option \texttt{amsfashion} pour écrire à la manière \AmS{}. Plus précisément, l'effet est : +\begin{itemize} + \item Fournit les macros \lstinline|\dedicatory|, \lstinline|\keywords| et \lstinline|\subjclass|; + \item \lstinline|\thanks| peut être écrit en dehors de la macro \lstinline|\author|; + \item La environnement \lstinline|abstract| peut être placé avant \lstinline|\maketitle|. +\end{itemize} + +\begin{tip}[Attention] + Ces modifications n'auraient lieu que dans les classes standard. Dans les classes \AmS{}, \PJLauthor{} n'a aucun effet. +\end{tip} +%</ProjLib-doc-fr> + +%<*ProjLib-doc-cn> \subsubsection{PJLdate:智能日期处理} \PJLdatePackage{} 提供了 \lstinline|\PLdate|\meta{yyyy-mm-dd} (或 \lstinline|\PJLdate|\meta{yyyy-mm-dd}) 命令,以将 \meta{yyyy-mm-dd} 转换为当前语言的日期格式显示。例如,在当前的中文语境下,\lstinline|\PLdate{2022-04-01}| 会被显示为“\PJLdate{2022-04-01}”,而在英文语境下则会被显示为“\UseOtherLanguage{English}{\PJLdate{2022-04-01}}”。 diff --git a/macros/latex/contrib/projlib/ProjLib.dtx b/macros/latex/contrib/projlib/ProjLib.dtx index 27f8619edb..acc6da6308 100644 --- a/macros/latex/contrib/projlib/ProjLib.dtx +++ b/macros/latex/contrib/projlib/ProjLib.dtx @@ -18,47 +18,47 @@ % %<*ProjLib> \ProvidesPackage{ProjLib} - [2021/10/24 The collective interface of ProjLib toolkit] + [2021/10/30 The collective interface of ProjLib toolkit] %</ProjLib> % %<*PJLauthor> \ProvidesPackage{PJLauthor} - [2021/10/24 Enhanced author information block] + [2021/10/30 Enhanced author information block] %</PJLauthor> % %<*PJLdate> \ProvidesPackage{PJLdate} - [2021/10/24 Convert yyyy-mm-dd to normal datetime format] + [2021/10/30 Convert yyyy-mm-dd to normal datetime format] %</PJLdate> % %<*PJLdraft> \ProvidesPackage{PJLdraft} - [2021/10/24 Some useful macros for the draft stage] + [2021/10/30 Some useful macros for the draft stage] %</PJLdraft> % %<*PJLlang> \ProvidesPackage{PJLlang} - [2021/10/24 Multi-language configuration] + [2021/10/30 Multi-language configuration] %</PJLlang> % %<*PJLlogo> \ProvidesPackage{PJLlogo} - [2021/10/24 The ProjLib logo] + [2021/10/30 The ProjLib logo] %</PJLlogo> % %<*PJLmath> \ProvidesPackage{PJLmath} - [2021/10/24 Useful math macros and shortcuts] + [2021/10/30 Useful math macros and shortcuts] %</PJLmath> % %<*PJLpaper> \ProvidesPackage{PJLpaper} - [2021/10/24 Paper style configuration] + [2021/10/30 Paper style configuration] %</PJLpaper> % %<*PJLthm> \ProvidesPackage{PJLthm} - [2021/10/24 Theorem setup and configuration] + [2021/10/30 Theorem setup and configuration] %</PJLthm> % %# 下面两行引入宏包的代码是所有文件共用的。 @@ -1405,6 +1405,10 @@ %# Reference name will change with the current language \DeclareBoolOption[true]{regionalref} \DeclareBoolOption[false]{originalref} +%# 名称采用详尽设置或简易设置 +%# Detailed or simple settings for the name of theorem-like environments +\DeclareBoolOption[true]{complexname} +\DeclareBoolOption[false]{simplename} %# 处理选项 %# Process options \ProcessKeyvalOptions*\relax @@ -1413,6 +1417,9 @@ \if@PJLthm@originalref \@PJLthm@regionalreffalse \fi +\if@PJLthm@simplename + \@PJLthm@complexnamefalse +\fi \if@PJLthm@draft \@PJLthm@fasttrue \fi @@ -1423,16 +1430,27 @@ \@ifclassloaded{beamer}{% \RequirePackage{silence} \WarningFilter{cleveref}{hyperref package loaded with implicit=false option} + \@PJLthm@nothmnumtrue% + \if@PJLthm@nothms\else% + \let\theorem\relax + \let\lemma\relax + \let\corollary\relax + \let\definition\relax + \let\fact\relax + \let\example\relax + \let\problem\relax + \fi }{} \RequirePackage{PJLlang} \RequirePackage{amsmath,amsthm} \RequirePackage{aliascnt} \PassOptionsToPackage{nameinlink}{cleveref} -\RequirePackage{cleveref} +\RequirePackage{ccref} %# 用于命名定理类环境的用户命令 %# Macro for naming theorems +\RequirePackage{xparse} \RequirePackage{xstring} \NewDocumentCommand{\NameTheorem}{omm}{% \protected@edef\PJLthm@temp{#2}% @@ -1523,18 +1541,22 @@ \newaliascnt{#2#3}{PJL#2#3}% }{% \IfValueTF{#4}{% - \newtheorem{PJL#2#3}[#4]{\csname#2name\csname\languagename ABBR\endcsname\endcsname} + \newtheorem{PJL#2#3}[#4]{\csname#2name\csname\languagename ABBR\endcsname\endcsname}% }{% - \newtheorem{PJL#2#3}{\csname#2name\csname\languagename ABBR\endcsname\endcsname} + \newtheorem{PJL#2#3}{\csname#2name\csname\languagename ABBR\endcsname\endcsname}% \newaliascnt{#2#3}{PJL#2#3}% }% }% - \crefname{PJL#2#3}% - {\csname#2name\csname\languagename ABBR\endcsname\endcsname}% - {\csname#2name\csname\languagename ABBR\endcsname\endcsname}% - \Crefname{PJL#2#3}% - {\csname#2name\csname\languagename ABBR\endcsname\endcsname}% - {\csname#2name\csname\languagename ABBR\endcsname\endcsname}% + \ifcsname cref@PJL#2#3@name\endcsname\else% + \crefname{PJL#2#3}% + {\csname#2name\csname\languagename ABBR\endcsname\endcsname}% + {\csname#2name\csname\languagename ABBR\endcsname\endcsname}% + \fi% + \ifcsname Cref@PJL#2#3@name\endcsname\else% + \Crefname{PJL#2#3}% + {\csname#2name\csname\languagename ABBR\endcsname\endcsname}% + {\csname#2name\csname\languagename ABBR\endcsname\endcsname}% + \fi% \NewDocumentEnvironment{#2#3}{} {\begin{PJL#2#3}} {\end{PJL#2#3}} @@ -1542,7 +1564,7 @@ }% }% \IfValueTF{#7}{% - \CreateTheoremSetKeys{#2}{#7}% + \NameTheorem{#2}{#7}% }{}% }% \else @@ -1655,7 +1677,7 @@ }% }% \IfValueTF{#7}{% - \CreateTheoremSetKeys{#2}{#7}% + \NameTheorem{#2}{#7}% }{}% }% \NewDocumentCommand{\CreateTheoremNumberedLikeAliasCounter}{mmm}{% @@ -1669,16 +1691,20 @@ % \Crefname{#1#2#3}% % {\csname#1name#2\endcsname}% % {\csname#1name#2\endcsname}% - \expandafter\PassFirstToSecond\expandafter{\csname#1name#2\endcsname}% - {% + \ifcsname cref@#1#2#3@name\endcsname\else% \expandafter\PassFirstToSecond\expandafter{\csname#1name#2\endcsname}% - {\crefname{#1#2#3}}% - }% - \expandafter\PassFirstToSecond\expandafter{\csname#1name#2\endcsname}% - {% + {% + \expandafter\PassFirstToSecond\expandafter{\csname#1name#2\endcsname}% + {\crefname{#1#2#3}}% + }% + \fi% + \ifcsname Cref@#1#2#3@name\endcsname\else% \expandafter\PassFirstToSecond\expandafter{\csname#1name#2\endcsname}% - {\Crefname{#1#2#3}}% - }% + {% + \expandafter\PassFirstToSecond\expandafter{\csname#1name#2\endcsname}% + {\Crefname{#1#2#3}}% + }% + \fi% }% \fi @@ -1710,8 +1736,8 @@ % The keys for the inner level are defined via \keys_define:nn . \NewDocumentCommand \CreateTheoremSetKeys { mm } { - % #1 = name of counter - % #2 = keyval-list of language-specifications +% #1 = name of counter +% #2 = keyval-list of language-specifications \cs_set:Nn \__PJLthm_countername: {#1} \keyval_parse:nnn { \PJLthm_exchange_i_iii_ii:nnn { \PJLthm_setlanguagespecificparameters:nn } {} } { \PJLthm_setlanguagespecificparameters:nn } @@ -1719,29 +1745,35 @@ } \cs_new_protected:Nn \PJLthm_setlanguagespecificparameters:nn { - % #1 = language-prefix - % #2 = key-val-list for language whose prefix is language-prefix +% #1 = language-prefix +% #2 = key-val-list for language whose prefix is language-prefix \cs_set:Nx \__PJLthm_languageprefix: {\StrToABBR{#1}} \exp_args:No \tl_if_empty:nTF {\__PJLthm_languageprefix:} { \msg_error:nn { PJLthm } - { No language \exp_not:n{#1} defined } + { No~language~"\exp_not:n{#1}"~defined } }% {% - \ifcsname the\__PJLthm_countername:\endcsname\else - \newcounter{\__PJLthm_countername:}% - \fi - \newaliascnt {\__PJLthm_countername: \__PJLthm_languageprefix:} {\__PJLthm_countername:}% - \aliascntresetthe {\__PJLthm_countername: \__PJLthm_languageprefix:}% \keys_set:nn { PJLthm } { #2 } }% }% + \keys_define:nn { PJLthm } { crefname.code:n = \cs_if_exist:NTF \crefname { - \exp_args:Nx \crefname {\__PJLthm_countername: \__PJLthm_languageprefix: }#1 + \ifbool{@PJLthm@regionalref}{ + \exp_args:Nx \PJLthm@setcrefinnername{PJL\__PJLthm_countername: \__PJLthm_languageprefix: }#1 + \exp_args:Nx \PJLthm@setcrefname{PJL\__PJLthm_countername: } + }{ + \exp_args:Nx \crefname {\__PJLthm_countername: \__PJLthm_languageprefix: }#1 + } }{}, crefname.value_required:n = true, - Crefname.code:n = \cs_if_exist:NTF \Crefname { - \exp_args:Nx \Crefname {\__PJLthm_countername: \__PJLthm_languageprefix: }#1 + Crefname.code:n = \cs_if_exist:NTF \Crefname { + \ifbool{@PJLthm@regionalref}{ + \exp_args:Nx \PJLthm@setCrefinnername{PJL\__PJLthm_countername: \__PJLthm_languageprefix: }#1 + \exp_args:Nx \PJLthm@setCrefname{PJL\__PJLthm_countername: } + }{ + \exp_args:Nx \Crefname {\__PJLthm_countername: \__PJLthm_languageprefix: }#1 + } }{}, Crefname.value_required:n = true, name.code:n = \exp_args:Nx \cs_set:cpn {\__PJLthm_countername: name \__PJLthm_languageprefix:} {#1}, @@ -1763,267 +1795,1490 @@ \ExplSyntaxOff +% Some command for regionalref mode +\newcommand{\PJLthm@setcrefinnername}[3]{% + \expandafter\def\csname PJLthm@cref@#1@name\endcsname{#2}% + \expandafter\def\csname PJLthm@cref@#1@name@plural\endcsname{#3}% +} +\newcommand{\PJLthm@setCrefinnername}[3]{% + \expandafter\def\csname PJLthm@Cref@#1@name\endcsname{#2}% + \expandafter\def\csname PJLthm@Cref@#1@name@plural\endcsname{#3}% +} + +\newcommand{\PJLthm@setcrefname}[1]{% + \crefname{#1}% + {\csname PJLthm@cref@#1\csname\languagename ABBR\endcsname @name\endcsname}% + {\csname PJLthm@cref@#1\csname\languagename ABBR\endcsname @name@plural\endcsname}% +} +\newcommand{\PJLthm@setCrefname}[1]{% + \Crefname{#1}% + {\csname PJLthm@Cref@#1\csname\languagename ABBR\endcsname @name\endcsname}% + {\csname PJLthm@Cref@#1\csname\languagename ABBR\endcsname @name@plural\endcsname}% +} + +%# 设置定理类环境名称 +%# Set the names of theorem-like environments +\ifbool{@PJLthm@complexname}{ + \NameTheorem{theorem}{ + EN = { + name = {Theorem}, + crefname = {theorem}{theorems}, + Crefname = {Theorem}{Theorems}, + }, + FR = { + name = {Théorème}, + crefname = {\ccmarkart{le} théorème}{\ccmarkart{les} théorèmes}, + Crefname = {Le théorème}{Les théorèmes}, + }, + DE = { + name = {Satz}, + crefname = {Satz}{Sätze}, + Crefname = {Satz}{Sätze}, + }, + IT = { + name = {Teorema}, + crefname = {\ccmarkart{il} teorema}{\ccmarkart{i} teoremi}, + Crefname = {Il teorema}{I teoremi}, + }, + PT = { + name = {Teorema}, + crefname = {\ccmarkart{o} teorema}{\ccmarkart{os} teoremas}, + Crefname = {O teorema}{Os teoremas}, + }, + BR = { + name = {Teorema}, + crefname = {\ccmarkart{o} teorema}{\ccmarkart{os} teoremas}, + Crefname = {O teorema}{Os teoremas}, + }, + ES = { + name = {Teorema}, + crefname = {\ccmarkart{el} teorema}{los teoremas}, + Crefname = {El teorema}{Los teoremas}, + }, + CN = { + name = {定理}, + crefname = {定理}{定理}, + Crefname = {定理}{定理}, + }, + TC = { + name = {定理}, + crefname = {定理}{定理}, + Crefname = {定理}{定理}, + }, + JP = { + name = {定理}, + crefname = {定理}{定理}, + Crefname = {定理}{定理}, + }, + RU = { + name = {Теорема}, + crefname = {теорема}{теоремы}, + Crefname = {Теорема}{Теоремы}, + }, + } + \NameTheorem{lemma}{ + EN = { + name = {Lemma}, + crefname = {lemma}{Lemmas}, + Crefname = {Lemma}{Lemmas}, + }, + FR = { + name = {Lemme}, + crefname = {\ccmarkart{le} lemme}{\ccmarkart{les} lemmes}, + Crefname = {Le lemme}{Les lemmes}, + }, + DE = { + name = {Lemma}, + crefname = {Lemma}{Lemmata}, + Crefname = {Lemma}{Lemmata}, + }, + IT = { + name = {Lemma}, + crefname = {\ccmarkart{il} lemma}{\ccmarkart{i} lemmi}, + Crefname = {Il lemma}{I lemmi}, + }, + PT = { + name = {Lema}, + crefname = {\ccmarkart{o} lema}{\ccmarkart{os} lemas}, + Crefname = {O lema}{Os lemas}, + }, + BR = { + name = {Lema}, + crefname = {\ccmarkart{o} lema}{\ccmarkart{os} lemas}, + Crefname = {O lema}{Os lemas}, + }, + ES = { + name = {Lema}, + crefname = {\ccmarkart{el} lema}{las lemas}, + Crefname = {El lema}{Las lemas}, + }, + CN = { + name = {引理}, + crefname = {引理}{引理}, + Crefname = {引理}{引理}, + }, + TC = { + name = {引理}, + crefname = {引理}{引理}, + Crefname = {引理}{引理}, + }, + JP = { + name = {補題}, + crefname = {補題}{補題}, + Crefname = {補題}{補題}, + }, + RU = { + name = {Лемма}, + crefname = {лемма}{леммы}, + Crefname = {Лемма}{Леммы}, + }, + } + \NameTheorem{proposition}{ + EN = { + name = {Proposition}, + crefname = {proposition}{propositions}, + Crefname = {Proposition}{Propositions}, + }, + FR = { + name = {Proposition}, + crefname = {\ccmarkart{la} proposition}{\ccmarkart{les} propositions}, + Crefname = {La proposition}{Les propositions}, + }, + DE = { + name = {Proposition}, + crefname = {Proposition}{Propositionen}, + Crefname = {Proposition}{Propositionen}, + }, + IT = { + name = {Proposizione}, + crefname = {\ccmarkart{la} proposizione}{\ccmarkart{le} proposte}, + Crefname = {La proposizione}{Le proposte}, + }, + PT = { + name = {Proposição}, + crefname = {\ccmarkart{a} proposição}{\ccmarkart{as} proposições}, + Crefname = {A proposição}{As proposições}, + }, + BR = { + name = {Proposição}, + crefname = {\ccmarkart{a} proposição}{\ccmarkart{as} proposições}, + Crefname = {A proposição}{As proposições}, + }, + ES = { + name = {Proposición}, + crefname = {la proposición}{las proposiciones}, + Crefname = {La proposición}{Las proposiciones}, + }, + CN = { + name = {命题}, + crefname = {命题}{命题}, + Crefname = {命题}{命题}, + }, + TC = { + name = {命題}, + crefname = {命題}{命題}, + Crefname = {命題}{命題}, + }, + JP = { + name = {命題}, + crefname = {命題}{命題}, + Crefname = {命題}{命題}, + }, + RU = { + name = {Предложение}, + crefname = {предложение}{предложения}, + Crefname = {Предложение}{Предложения}, + }, + } + \NameTheorem{corollary}{ + EN = { + name = {Corollary}, + crefname = {corollary}{corollaries}, + Crefname = {Corollary}{Corollaries}, + }, + FR = { + name = {Corollaire}, + crefname = {\ccmarkart{le} corollaire}{\ccmarkart{les} corollaires}, + Crefname = {Le corollaire}{Les corollaires}, + }, + DE = { + name = {Korollar}, + crefname = {Korollar}{Korollare}, + Crefname = {Korollar}{Korollare}, + }, + IT = { + name = {Corollario}, + crefname = {\ccmarkart{il} corollario}{\ccmarkart{i} corollari}, + Crefname = {Il corollario}{I corollari}, + }, + PT = { + name = {Corolário}, + crefname = {\ccmarkart{o} corolário}{\ccmarkart{os} corolários}, + Crefname = {O corolário}{Os corolários}, + }, + BR = { + name = {Corolário}, + crefname = {\ccmarkart{o} corolário}{\ccmarkart{os} corolários}, + Crefname = {O corolário}{Os corolários}, + }, + ES = { + name = {Corolario}, + crefname = {\ccmarkart{el} corolario}{los corolarios}, + Crefname = {El corolario}{Los corolarios}, + }, + CN = { + name = {推论}, + crefname = {推论}{推论}, + Crefname = {推论}{推论}, + }, + TC = { + name = {推論}, + crefname = {推論}{推論}, + Crefname = {推論}{推論}, + }, + JP = { + name = {系}, + crefname = {系}{系}, + Crefname = {系}{系}, + }, + RU = { + name = {Следствие}, + crefname = {следствие}{следствия}, + Crefname = {Следствие}{Следствия}, + }, + } + \NameTheorem{property}{ + EN = { + name = {Property}, + crefname = {property}{properties}, + Crefname = {Property}{Properties}, + }, + FR = { + name = {Propriété}, + crefname = {\ccmarkart{la} propriété}{\ccmarkart{les} propriétés}, + Crefname = {La propriété}{Les propriétés}, + }, + DE = { + name = {Eigenschaft}, + crefname = {Eigenschaft}{Eigenschaften}, + Crefname = {Eigenschaft}{Eigenschaften}, + }, + IT = { + name = {Proprietà}, + crefname = {\ccmarkart{la} proprietà}{\ccmarkart{le} proprietà}, + Crefname = {La proprietà}{Le proprietà}, + }, + PT = { + name = {Propriedade}, + crefname = {\ccmarkart{a} propriedade}{\ccmarkart{as} propriedades}, + Crefname = {A propriedade}{As propriedades}, + }, + BR = { + name = {Propriedade}, + crefname = {\ccmarkart{a} propriedade}{\ccmarkart{as} propriedades}, + Crefname = {A propriedade}{As propriedades}, + }, + ES = { + name = {Propiedad}, + crefname = {la propiedad}{las propiedades}, + Crefname = {La propiedad}{Las propiedades}, + }, + CN = { + name = {性质}, + crefname = {性质}{性质}, + Crefname = {性质}{性质}, + }, + TC = { + name = {性質}, + crefname = {性質}{性質}, + Crefname = {性質}{性質}, + }, + JP = { + name = {性質}, + crefname = {性質}{性質}, + Crefname = {性質}{性質}, + }, + RU = { + name = {Имущество}, + crefname = {имущество}{имущества}, + Crefname = {Имущество}{Имущества}, + }, + } + \NameTheorem{fact}{ + EN = { + name = {Fact}, + crefname = {fact}{facts}, + Crefname = {Fact}{Facts}, + }, + FR = { + name = {Fait}, + crefname = {\ccmarkart{le} fait}{\ccmarkart{les} faits}, + Crefname = {Le fait}{Les faits}, + }, + DE = { + name = {Fakt}, + crefname = {Fakt}{Fakten}, + Crefname = {Fakt}{Fakten}, + }, + IT = { + name = {Fatto}, + crefname = {\ccmarkart{il} fatto}{\ccmarkart{i} fatti}, + Crefname = {Il fatto}{I fatti}, + }, + PT = { + name = {Facto}, + crefname = {\ccmarkart{o} facto}{\ccmarkart{os} factos}, + Crefname = {O facto}{Os factos}, + }, + BR = { + name = {Fato}, + crefname = {\ccmarkart{o} fato}{\ccmarkart{os} fatos}, + Crefname = {O fato}{Os fatos}, + }, + ES = { + name = {Hecho}, + crefname = {\ccmarkart{el} hecho}{los hechos}, + Crefname = {El hecho}{Los hechos}, + }, + CN = { + name = {事实}, + crefname = {事实}{事实}, + Crefname = {事实}{事实}, + }, + TC = { + name = {事實}, + crefname = {事實}{事實}, + Crefname = {事實}{事實}, + }, + JP = { + name = {事実}, + crefname = {事実}{事実}, + Crefname = {事実}{事実}, + }, + RU = { + name = {Факт}, + crefname = {факт}{факты}, + Crefname = {Факт}{Факты}, + }, + } + \NameTheorem{conjecture}{ + EN = { + name = {Conjecture}, + crefname = {conjecture}{conjectures}, + Crefname = {Conjecture}{Conjectures}, + }, + FR = { + name = {Conjecture}, + crefname = {\ccmarkart{la} conjecture}{\ccmarkart{les} conjectures}, + Crefname = {La conjecture}{Les conjectures}, + }, + DE = { + name = {Vermutung}, + crefname = {Vermutung}{Vermutungen}, + Crefname = {Vermutung}{Vermutungen}, + }, + IT = { + name = {Congettura}, + crefname = {\ccmarkart{la} congettura}{\ccmarkart{le} congetture}, + Crefname = {La congettura}{Le congetture}, + }, + PT = { + name = {Conjetura}, + crefname = {\ccmarkart{a} conjetura}{\ccmarkart{as} conjeturas}, + Crefname = {A conjetura}{As conjeturas}, + }, + BR = { + name = {Conjectura}, + crefname = {\ccmarkart{a} conjectura}{\ccmarkart{as} conjecturas}, + Crefname = {A conjectura}{As conjecturas}, + }, + ES = { + name = {Conjetura}, + crefname = {la conjetura}{las conjeturas}, + Crefname = {La conjetura}{Las conjeturas}, + }, + CN = { + name = {猜想}, + crefname = {猜想}{猜想}, + Crefname = {猜想}{猜想}, + }, + TC = { + name = {猜想}, + crefname = {猜想}{猜想}, + Crefname = {猜想}{猜想}, + }, + JP = { + name = {予想}, + crefname = {予想}{予想}, + Crefname = {予想}{予想}, + }, + RU = { + name = {Гипотеза}, + crefname = {гипотеза}{гипотезы}, + Crefname = {Гипотеза}{Гипотезы}, + }, + } + \NameTheorem{definition}{ + EN = { + name = {Definition}, + crefname = {definition}{definitions}, + Crefname = {Definition}{Definitions}, + }, + FR = { + name = {Définition}, + crefname = {\ccmarkart{la} définition}{\ccmarkart{les} définitions}, + Crefname = {La définition}{Les définitions}, + }, + DE = { + name = {Definition}, + crefname = {Definition}{Definitionen}, + Crefname = {Definition}{Definitionen}, + }, + IT = { + name = {Definizione}, + crefname = {\ccmarkart{la} definizione}{\ccmarkart{le} definizioni}, + Crefname = {La definizione}{Le definizioni}, + }, + PT = { + name = {Definição}, + crefname = {\ccmarkart{a} definição}{\ccmarkart{as} definições}, + Crefname = {A definição}{As definições}, + }, + BR = { + name = {Definição}, + crefname = {\ccmarkart{a} definição}{\ccmarkart{as} definições}, + Crefname = {A definição}{As definições}, + }, + ES = { + name = {Definición}, + crefname = {la definición}{las definiciones}, + Crefname = {La definición}{Las definiciones}, + }, + CN = { + name = {定义}, + crefname = {定义}{定义}, + Crefname = {定义}{定义}, + }, + TC = { + name = {定義}, + crefname = {定義}{定義}, + Crefname = {定義}{定義}, + }, + JP = { + name = {定義}, + crefname = {定義}{定義}, + Crefname = {定義}{定義}, + }, + RU = { + name = {Определение}, + crefname = {определение}{определения}, + Crefname = {Определение}{Определения}, + }, + } + \NameTheorem{axiom}{ + EN = { + name = {Axiom}, + crefname = {axiom}{axioms}, + Crefname = {Axiom}{Axioms}, + }, + FR = { + name = {Axiome}, + crefname = {\ccmarkart{l'}axiome}{\ccmarkart{les} axiomes}, + Crefname = {L'axiome}{Les axiomes}, + }, + DE = { + name = {Axiom}, + crefname = {Axiom}{Axiome}, + Crefname = {Axiom}{Axiome}, + }, + IT = { + name = {Assioma}, + crefname = {\ccmarkart{l'}assioma}{\ccmarkart{gli} assiomi}, + Crefname = {L'assioma}{Gli assiomi}, + }, + PT = { + name = {Axioma}, + crefname = {\ccmarkart{o} axioma}{\ccmarkart{os} axiomas}, + Crefname = {O axioma}{Os axiomas}, + }, + BR = { + name = {Axioma}, + crefname = {\ccmarkart{o} axioma}{\ccmarkart{os} axiomas}, + Crefname = {O axioma}{Os axiomas}, + }, + ES = { + name = {Axioma}, + crefname = {\ccmarkart{el} axioma}{los axiomas}, + Crefname = {El axioma}{Los axiomas}, + }, + CN = { + name = {公理}, + crefname = {公理}{公理}, + Crefname = {公理}{公理}, + }, + TC = { + name = {公理}, + crefname = {公理}{公理}, + Crefname = {公理}{公理}, + }, + JP = { + name = {公理}, + crefname = {公理}{公理}, + Crefname = {公理}{公理}, + }, + RU = { + name = {Аксиома}, + crefname = {аксиома}{аксиомы}, + Crefname = {Аксиома}{Аксиомы}, + }, + } + \NameTheorem{assumption}{ + EN = { + name = {Assumption}, + crefname = {assumption}{assumptions}, + Crefname = {Assumption}{Assumptions}, + }, + FR = { + name = {Supposition}, + crefname = {\ccmarkart{la} supposition}{\ccmarkart{les} suppositions}, + Crefname = {La supposition}{Les suppositions}, + }, + DE = { + name = {Annahme}, + crefname = {Annahme}{Annahmen}, + Crefname = {Annahme}{Annahmen}, + }, + IT = { + name = {Supposizione}, + crefname = {\ccmarkart{la} supposizione}{\ccmarkart{le} supposizioni}, + Crefname = {La supposizione}{Le supposizioni}, + }, + PT = { + name = {Suposição}, + crefname = {\ccmarkart{a} suposição}{\ccmarkart{as} suposições}, + Crefname = {A suposição}{As suposições}, + }, + BR = { + name = {Suposição}, + crefname = {\ccmarkart{a} suposição}{\ccmarkart{as} suposições}, + Crefname = {A suposição}{As suposições}, + }, + ES = { + name = {Suposición}, + crefname = {la suposición}{las suposiciones}, + Crefname = {La suposición}{Las suposiciones}, + }, + CN = { + name = {假定}, + crefname = {假定}{假定}, + Crefname = {假定}{假定}, + }, + TC = { + name = {假定}, + crefname = {假定}{假定}, + Crefname = {假定}{假定}, + }, + JP = { + name = {仮定}, + crefname = {仮定}{仮定}, + Crefname = {仮定}{仮定}, + }, + RU = { + name = {Предположение}, + crefname = {предположение}{предположения}, + Crefname = {Предположение}{Предположения}, + }, + } + \NameTheorem{convention}{ + EN = { + name = {Convention}, + crefname = {convention}{conventions}, + Crefname = {Convention}{Conventions}, + }, + FR = { + name = {Convention}, + crefname = {\ccmarkart{la} convention}{\ccmarkart{les} conventions}, + Crefname = {La convention}{Les conventions}, + }, + DE = { + name = {Konvention}, + crefname = {Konvention}{Konventionen}, + Crefname = {Konvention}{Konventionen}, + }, + IT = { + name = {Convenzione}, + crefname = {\ccmarkart{la} convenzione}{\ccmarkart{le} convenzioni}, + Crefname = {La convenzione}{Le convenzioni}, + }, + PT = { + name = {Convenção}, + crefname = {\ccmarkart{a} convenção}{\ccmarkart{as} convenções}, + Crefname = {A convenção}{As convenções}, + }, + BR = { + name = {Convenção}, + crefname = {\ccmarkart{a} convenção}{\ccmarkart{as} convenções}, + Crefname = {A convenção}{As convenções}, + }, + ES = { + name = {Convención}, + crefname = {la convención}{las convenciones}, + Crefname = {La convención}{Las convenciones}, + }, + CN = { + name = {约定}, + crefname = {约定}{约定}, + Crefname = {约定}{约定}, + }, + TC = { + name = {約定}, + crefname = {約定}{約定}, + Crefname = {約定}{約定}, + }, + JP = { + name = {慣例}, + crefname = {慣例}{慣例}, + Crefname = {慣例}{慣例}, + }, + RU = { + name = {Конвенция}, + crefname = {конвенция}{конвенции}, + Crefname = {Конвенция}{Конвенции}, + }, + } + \NameTheorem{hypothesis}{ + EN = { + name = {Hypothesis}, + crefname = {hypothesis}{hypotheses}, + Crefname = {Hypothesis}{Hypotheses}, + }, + FR = { + name = {Hypothèse}, + crefname = {\ccmarkart{l'}hypothèse}{\ccmarkart{les} hypothèses}, + Crefname = {L'hypothèse}{Les hypothèses}, + }, + DE = { + name = {Hypothese}, + crefname = {Hypothese}{Hypothesen}, + Crefname = {Hypothese}{Hypothesen}, + }, + IT = { + name = {Ipotesi}, + crefname = {\ccmarkart{l'}ipotesi}{\ccmarkart{le} ipotesi}, + Crefname = {L'ipotesi}{Le ipotesi}, + }, + PT = { + name = {Hipótese}, + crefname = {\ccmarkart{a} hipótese}{\ccmarkart{as} hipóteses}, + Crefname = {A hipótese}{As hipóteses}, + }, + BR = { + name = {Hipótese}, + crefname = {\ccmarkart{a} hipótese}{\ccmarkart{as} hipóteses}, + Crefname = {A hipótese}{As hipóteses}, + }, + ES = { + name = {Hipótesis}, + crefname = {la hipótesis}{las hipótesis}, + Crefname = {La hipótesis}{Las hipótesis}, + }, + CN = { + name = {假设}, + crefname = {假设}{假设}, + Crefname = {假设}{假设}, + }, + TC = { + name = {假設}, + crefname = {假設}{假設}, + Crefname = {假設}{假設}, + }, + JP = { + name = {仮設}, + crefname = {仮設}{仮設}, + Crefname = {仮設}{仮設}, + }, + RU = { + name = {Гипотеза}, + crefname = {гипотеза}{гипотезы}, + Crefname = {Гипотеза}{Гипотезы}, + }, + } + \NameTheorem{notation}{ + EN = { + name = {Notation}, + crefname = {notation}{notations}, + Crefname = {Notation}{Notations}, + }, + FR = { + name = {Notation}, + crefname = {\ccmarkart{la} notation}{\ccmarkart{les} notations}, + Crefname = {La notation}{Les notations}, + }, + DE = { + name = {Notation}, + crefname = {Notation}{Notationen}, + Crefname = {Notation}{Notationen}, + }, + IT = { + name = {Notazione}, + crefname = {\ccmarkart{la} notazione}{\ccmarkart{le} notazioni}, + Crefname = {La notazione}{Le notazioni}, + }, + PT = { + name = {Notação}, + crefname = {\ccmarkart{a} notação}{\ccmarkart{as} notações}, + Crefname = {A notação}{As notações}, + }, + BR = { + name = {Notação}, + crefname = {\ccmarkart{a} notação}{\ccmarkart{as} notações}, + Crefname = {A notação}{As notações}, + }, + ES = { + name = {Notación}, + crefname = {la notación}{las notaciones}, + Crefname = {La notación}{Las notaciones}, + }, + CN = { + name = {记号}, + crefname = {记号}{记号}, + Crefname = {记号}{记号}, + }, + TC = { + name = {記號}, + crefname = {記號}{記號}, + Crefname = {記號}{記號}, + }, + JP = { + name = {記法}, + crefname = {記法}{記法}, + Crefname = {記法}{記法}, + }, + RU = { + name = {Нотация}, + crefname = {нотация}{нотации}, + Crefname = {Нотация}{Нотации}, + }, + } + \NameTheorem{example}{ + EN = { + name = {Example}, + crefname = {example}{examples}, + Crefname = {Example}{Examples}, + }, + FR = { + name = {Exemple}, + crefname = {\ccmarkart{l'}example}{\ccmarkart{les} examples}, + Crefname = {L'example}{Les examples}, + }, + DE = { + name = {Beispiel}, + crefname = {Beispiel}{Beispiele}, + Crefname = {Beispiel}{Beispiele}, + }, + IT = { + name = {Esempio}, + crefname = {\ccmarkart{l'}esempio}{\ccmarkart{gli} esempi}, + Crefname = {L'esempio}{Gli esempi}, + }, + PT = { + name = {Exemplo}, + crefname = {\ccmarkart{o} exemplo}{\ccmarkart{os} exemplos}, + Crefname = {O exemplo}{Os exemplos}, + }, + BR = { + name = {Exemplo}, + crefname = {\ccmarkart{o} exemplo}{\ccmarkart{os} exemplos}, + Crefname = {O exemplo}{Os exemplos}, + }, + ES = { + name = {Ejemplo}, + crefname = {\ccmarkart{el} ejemplo}{los ejemplos}, + Crefname = {El ejemplo}{Los ejemplos}, + }, + CN = { + name = {例}, + crefname = {例}{例}, + Crefname = {例}{例}, + }, + TC = { + name = {例}, + crefname = {例}{例}, + Crefname = {例}{例}, + }, + JP = { + name = {例}, + crefname = {例}{例}, + Crefname = {例}{例}, + }, + RU = { + name = {Пример}, + crefname = {пример}{примеры}, + Crefname = {Пример}{Примеры}, + }, + } + \NameTheorem{problem}{ + EN = { + name = {Problem}, + crefname = {problem}{problems}, + Crefname = {Problem}{Problems}, + }, + FR = { + name = {Problème}, + crefname = {\ccmarkart{le} problème}{\ccmarkart{les} problèmes}, + Crefname = {Le problème}{Les problèmes}, + }, + DE = { + name = {Problem}, + crefname = {Problem}{Probleme}, + Crefname = {Problem}{Probleme}, + }, + IT = { + name = {Problema}, + crefname = {\ccmarkart{il} problema}{\ccmarkart{i} problemi}, + Crefname = {Il problema}{I problemi}, + }, + PT = { + name = {Problema}, + crefname = {\ccmarkart{o} problema}{\ccmarkart{os} problemas}, + Crefname = {O problema}{Os problemas}, + }, + BR = { + name = {Problema}, + crefname = {\ccmarkart{o} problema}{\ccmarkart{os} problemas}, + Crefname = {O problema}{Os problemas}, + }, + ES = { + name = {Problema}, + crefname = {\ccmarkart{el} problema}{los problemas}, + Crefname = {El problema}{Los problemas}, + }, + CN = { + name = {问题}, + crefname = {问题}{问题}, + Crefname = {问题}{问题}, + }, + TC = { + name = {問題}, + crefname = {問題}{問題}, + Crefname = {問題}{問題}, + }, + JP = { + name = {問題}, + crefname = {問題}{問題}, + Crefname = {問題}{問題}, + }, + RU = { + name = {Проблема}, + crefname = {проблема}{проблемы}, + Crefname = {Проблема}{Проблемы}, + }, + } + \NameTheorem{question}{ + EN = { + name = {Question}, + crefname = {question}{questions}, + Crefname = {Question}{Questions}, + }, + FR = { + name = {Question}, + crefname = {\ccmarkart{la} question}{\ccmarkart{les} questions}, + Crefname = {La question}{Les questions}, + }, + DE = { + name = {Frage}, + crefname = {Frage}{Fragen}, + Crefname = {Frage}{Fragen}, + }, + IT = { + name = {Domanda}, + crefname = {\ccmarkart{la} domanda}{\ccmarkart{le} domande}, + Crefname = {La domanda}{Le domande}, + }, + PT = { + name = {Pergunta}, + crefname = {\ccmarkart{a} pergunta}{\ccmarkart{as} perguntas}, + Crefname = {A pergunta}{As perguntas}, + }, + BR = { + name = {Pergunta}, + crefname = {\ccmarkart{a} pergunta}{\ccmarkart{as} perguntas}, + Crefname = {A pergunta}{As perguntas}, + }, + ES = { + name = {Pregunta}, + crefname = {la pregunta}{las preguntas}, + Crefname = {La pregunta}{Las preguntas}, + }, + CN = { + name = {问题}, + crefname = {问题}{问题}, + Crefname = {问题}{问题}, + }, + TC = { + name = {問題}, + crefname = {問題}{問題}, + Crefname = {問題}{問題}, + }, + JP = { + name = {問題}, + crefname = {問題}{問題}, + Crefname = {問題}{問題}, + }, + RU = { + name = {Вопрос}, + crefname = {вопрос}{вопросы}, + Crefname = {Вопрос}{Вопросы}, + }, + } + \NameTheorem{exercise}{ + EN = { + name = {Exercise}, + crefname = {exercise}{exercises}, + Crefname = {Exercise}{Exercises}, + }, + FR = { + name = {Exercice}, + crefname = {\ccmarkart{l'}exercice}{\ccmarkart{les} exercices}, + Crefname = {L'exercice}{Les exercices}, + }, + DE = { + name = {Übung}, + crefname = {Übung}{Übungen}, + Crefname = {Übung}{Übungen}, + }, + IT = { + name = {Esercizio}, + crefname = {\ccmarkart{l'}esercizio}{\ccmarkart{gli} esercizi}, + Crefname = {L'esercizio}{Gli esercizi}, + }, + PT = { + name = {Exercício}, + crefname = {\ccmarkart{o} exercício}{\ccmarkart{os} exercícios}, + Crefname = {O exercício}{Os exercícios}, + }, + BR = { + name = {Exercício}, + crefname = {\ccmarkart{o} exercício}{\ccmarkart{os} exercícios}, + Crefname = {O exercício}{Os exercícios}, + }, + ES = { + name = {Ejercicio}, + crefname = {\ccmarkart{el} ejercicio}{los ejercicios}, + Crefname = {El ejercicio}{Los ejercicios}, + }, + CN = { + name = {练习}, + crefname = {练习}{练习}, + Crefname = {练习}{练习}, + }, + TC = { + name = {練習}, + crefname = {練習}{練習}, + Crefname = {練習}{練習}, + }, + JP = { + name = {練習}, + crefname = {練習}{練習}, + Crefname = {練習}{練習}, + }, + RU = { + name = {Упражнение}, + crefname = {упражнение}{упражнения}, + Crefname = {Упражнение}{Упражнения}, + }, + } + \NameTheorem{remark}{ + EN = { + name = {Remark}, + crefname = {remark}{remarks}, + Crefname = {Remark}{Remarks}, + }, + FR = { + name = {Remarque}, + crefname = {\ccmarkart{la} remarque}{\ccmarkart{les} remarques}, + Crefname = {La remarque}{Les remarques}, + }, + DE = { + name = {Bemerkung}, + crefname = {Bemerkung}{Bemerkungen}, + Crefname = {Bemerkung}{Bemerkungen}, + }, + IT = { + name = {Commento}, + crefname = {\ccmarkart{il} commento}{\ccmarkart{i} commenti}, + Crefname = {Il commento}{I commenti}, + }, + PT = { + name = {Comentário}, + crefname = {\ccmarkart{o} comentário}{\ccmarkart{os} comentários}, + Crefname = {O comentário}{Os comentários}, + }, + BR = { + name = {Comentário}, + crefname = {\ccmarkart{o} comentário}{\ccmarkart{os} comentários}, + Crefname = {O comentário}{Os comentários}, + }, + ES = { + name = {Comentario}, + crefname = {\ccmarkart{el} comentario}{los comentarios}, + Crefname = {El comentario}{Los comentarios}, + }, + CN = { + name = {备注}, + crefname = {备注}{备注}, + Crefname = {备注}{备注}, + }, + TC = { + name = {備註}, + crefname = {備註}{備註}, + Crefname = {備註}{備註}, + }, + JP = { + name = {注釈}, + crefname = {注釈}{注釈}, + Crefname = {注釈}{注釈}, + }, + RU = { + name = {Замечание}, + crefname = {замечание}{замечания}, + Crefname = {Замечание}{Замечания}, + }, + } + \NameTheorem{observation}{ + EN = { + name = {Observation}, + crefname = {observation}{observations}, + Crefname = {Observation}{Observations}, + }, + FR = { + name = {Observation}, + crefname = {\ccmarkart{la} observation}{\ccmarkart{les} observations}, + Crefname = {La observation}{Les observations}, + }, + DE = { + name = {Beobachtung}, + crefname = {Beobachtung}{Beobachtungen}, + Crefname = {Beobachtung}{Beobachtungen}, + }, + IT = { + name = {Osservazione}, + crefname = {\ccmarkart{l'}osservazione}{\ccmarkart{le} osservazioni}, + Crefname = {L'osservazione}{Le osservazioni}, + }, + PT = { + name = {Observação}, + crefname = {\ccmarkart{a} observação}{\ccmarkart{as} observações}, + Crefname = {A observação}{As observações}, + }, + BR = { + name = {Observação}, + crefname = {\ccmarkart{a} observação}{\ccmarkart{as} observações}, + Crefname = {A observação}{As observações}, + }, + ES = { + name = {Observación}, + crefname = {la observación}{las observaciones}, + Crefname = {La observación}{Las observaciones}, + }, + CN = { + name = {观察}, + crefname = {观察}{观察}, + Crefname = {观察}{观察}, + }, + TC = { + name = {觀察}, + crefname = {觀察}{觀察}, + Crefname = {觀察}{觀察}, + }, + JP = { + name = {観察}, + crefname = {観察}{観察}, + Crefname = {観察}{観察}, + }, + RU = { + name = {Наблюдение}, + crefname = {наблюдение}{наблюдения}, + Crefname = {Наблюдение}{Наблюдения}, + }, + } + \NameTheorem{definition-proposition}{ + EN = { + name = {\definitionnameEN-\propositionnameEN}, + crefname = {definition-proposition}{definitions-propositions}, + Crefname = {Definition-proposition}{Definitions-propositions}, + }, + FR = { + name = {\definitionnameFR-\propositionnameFR}, + crefname = {\ccmarkart{la} définition-proposition}{\ccmarkart{les} définitions-propositions}, + Crefname = {La définition-proposition}{Les définitions-propositions}, + }, + DE = { + name = {\definitionnameDE-\propositionnameDE}, + crefname = {Definition-Proposition}{Definitionen-Propositionen}, + Crefname = {Definition-Proposition}{Definitionen-Propositionen}, + }, + IT = { + name = {\definitionnameIT-\propositionnameIT}, + crefname = {\ccmarkart{la} definizione-proposizione}{\ccmarkart{le} definizioni-proposte}, + Crefname = {La definizione-proposizione}{Le definizioni-proposte}, + }, + PT = { + name = {\definitionnamePT-\propositionnamePT}, + crefname = {\ccmarkart{a} definição-proposição}{\ccmarkart{as} definições-proposições}, + Crefname = {A definição-proposição}{As definições-proposições}, + }, + BR = { + name = {\definitionnameBR-\propositionnameBR}, + crefname = {\ccmarkart{a} definição-proposição}{\ccmarkart{as} definições-proposições}, + Crefname = {A definição-proposição}{As definições-proposições}, + }, + ES = { + name = {\definitionnameES-\propositionnameES}, + crefname = {la definición-proposición}{las definiciones-proposiciones}, + Crefname = {La definición-proposición}{Las definiciones-proposiciones}, + }, + CN = { + name = {\definitionnameCN-\propositionnameCN}, + crefname = {\definitionnameCN-\propositionnameCN}{\definitionnameCN-\propositionnameCN}, + Crefname = {\definitionnameCN-\propositionnameCN}{\definitionnameCN-\propositionnameCN}, + }, + TC = { + name = {\definitionnameTC-\propositionnameTC}, + crefname = {\definitionnameTC-\propositionnameTC}{\definitionnameTC-\propositionnameTC}, + Crefname = {\definitionnameTC-\propositionnameTC}{\definitionnameTC-\propositionnameTC}, + }, + JP = { + name = {\definitionnameJP-\propositionnameJP}, + crefname = {\definitionnameJP-\propositionnameJP}{\definitionnameJP-\propositionnameJP}, + Crefname = {\definitionnameJP-\propositionnameJP}{\definitionnameJP-\propositionnameJP}, + }, + RU = { + name = {\definitionnameRU-\propositionnameRU}, + crefname = {определение-предложение}{определения-предложения}, + Crefname = {Определение-предложение}{Определения-предложение}, + }, + } + \NameTheorem{definition-theorem}{ + EN = { + name = {\definitionnameEN-\theoremnameEN}, + crefname = {definition-theorem}{definitions-theorems}, + Crefname = {Definition-theorem}{Definitions-theorems}, + }, + FR = { + name = {\definitionnameFR-\theoremnameFR}, + crefname = {\ccmarkart{la} définition-théorème}{\ccmarkart{les} définitions-théorèmes}, + Crefname = {La définition-théorème}{Les définitions-théorèmes}, + }, + DE = { + name = {\definitionnameDE-\theoremnameDE}, + crefname = {Definition-Satz}{Definitionen-Sätze}, + Crefname = {Definition-Satz}{Definitionen-Sätze}, + }, + IT = { + name = {\definitionnameIT-\theoremnameIT}, + crefname = {\ccmarkart{la} definizione-teorema}{\ccmarkart{le} definizioni-teoremi}, + Crefname = {La definizione-teorema}{Le definizioni-teoremi}, + }, + PT = { + name = {\definitionnamePT-\theoremnamePT}, + crefname = {\ccmarkart{a} definição-teorema}{\ccmarkart{as} definições-teoremas}, + Crefname = {A definição-teorema}{As definições-teoremas}, + }, + BR = { + name = {\definitionnameBR-\theoremnameBR}, + crefname = {\ccmarkart{a} definição-teorema}{\ccmarkart{as} definições-teoremas}, + Crefname = {A definição-teorema}{As definições-teoremas}, + }, + ES = { + name = {\definitionnameES-\theoremnameES}, + crefname = {la definición-teorema}{las definiciones-teoremas}, + Crefname = {La definición-teorema}{Las definiciones-teoremas}, + }, + CN = { + name = {\definitionnameCN-\theoremnameCN}, + crefname = {\definitionnameCN-\theoremnameCN}{\definitionnameCN-\theoremnameCN}, + Crefname = {\definitionnameCN-\theoremnameCN}{\definitionnameCN-\theoremnameCN}, + }, + TC = { + name = {\definitionnameTC-\theoremnameTC}, + crefname = {\definitionnameTC-\theoremnameTC}{\definitionnameTC-\theoremnameTC}, + Crefname = {\definitionnameTC-\theoremnameTC}{\definitionnameTC-\theoremnameTC}, + }, + JP = { + name = {\definitionnameJP-\theoremnameJP}, + crefname = {\definitionnameJP-\theoremnameJP}{\definitionnameJP-\theoremnameJP}, + Crefname = {\definitionnameJP-\theoremnameJP}{\definitionnameJP-\theoremnameJP}, + }, + RU = { + name = {\definitionnameRU-\theoremnameRU}, + crefname = {определение-теорема}{определения-теоремы}, + Crefname = {Определение-теорема}{Определения-теорема}, + }, + } +}{ %# 英文定理名称 %# English theorems names -\def\theoremnameEN{{Theorem}} -\def\lemmanameEN{{Lemma}} -\def\propositionnameEN{{Proposition}} -\def\corollarynameEN{{Corollary}} -\def\propertynameEN{{Property}} -\def\factnameEN{{Fact}} -\def\conjecturenameEN{{Conjecture}} -\def\definitionnameEN{{Definition}} -\def\axiomnameEN{{Axiom}} -\def\assumptionnameEN{{Assumption}} -\def\conventionnameEN{{Convention}} -\def\hypothesisnameEN{{Hypothesis}} -\def\notationnameEN{{Notation}} -\def\examplenameEN{{Example}} -\def\problemnameEN{{Problem}} -\def\questionnameEN{{Question}} -\def\exercisenameEN{{Exercise}} -\def\remarknameEN{{Remark}} -\def\observationnameEN{{Observation}} -\expandafter\def\csname definition-propositionnameEN\endcsname{\definitionnameEN-\propositionnameEN} -\expandafter\def\csname definition-theoremnameEN\endcsname{\definitionnameEN-\theoremnameEN} + \def\theoremnameEN{{Theorem}} + \def\lemmanameEN{{Lemma}} + \def\propositionnameEN{{Proposition}} + \def\corollarynameEN{{Corollary}} + \def\propertynameEN{{Property}} + \def\factnameEN{{Fact}} + \def\conjecturenameEN{{Conjecture}} + \def\definitionnameEN{{Definition}} + \def\axiomnameEN{{Axiom}} + \def\assumptionnameEN{{Assumption}} + \def\conventionnameEN{{Convention}} + \def\hypothesisnameEN{{Hypothesis}} + \def\notationnameEN{{Notation}} + \def\examplenameEN{{Example}} + \def\problemnameEN{{Problem}} + \def\questionnameEN{{Question}} + \def\exercisenameEN{{Exercise}} + \def\remarknameEN{{Remark}} + \def\observationnameEN{{Observation}} + \expandafter\def\csname definition-propositionnameEN\endcsname{\definitionnameEN-\propositionnameEN} + \expandafter\def\csname definition-theoremnameEN\endcsname{\definitionnameEN-\theoremnameEN} %# 法语定理名称 %# French theorems names -\def\theoremnameFR{{Théorème}} -\def\lemmanameFR{{Lemme}} -\def\propositionnameFR{{Proposition}} -\def\corollarynameFR{{Corollaire}} -\def\propertynameFR{{Propriété}} -\def\factnameFR{{Fait}} -\def\conjecturenameFR{{Conjecture}} -\def\definitionnameFR{{Définition}} -\def\axiomnameFR{{Axiome}} -\def\assumptionnameFR{{Supposition}} -\def\conventionnameFR{{Convention}} -\def\hypothesisnameFR{{Hypothèse}} -\def\notationnameFR{{Notation}} -\def\examplenameFR{{Exemple}} -\def\problemnameFR{{Problème}} -\def\questionnameFR{{Question}} -\def\exercisenameFR{{Exercice}} -\def\remarknameFR{{Remarque}} -\def\observationnameFR{{Observation}} -\expandafter\def\csname definition-propositionnameFR\endcsname{\definitionnameFR-\propositionnameFR} -\expandafter\def\csname definition-theoremnameFR\endcsname{\definitionnameFR-\theoremnameFR} + \def\theoremnameFR{{Théorème}} + \def\lemmanameFR{{Lemme}} + \def\propositionnameFR{{Proposition}} + \def\corollarynameFR{{Corollaire}} + \def\propertynameFR{{Propriété}} + \def\factnameFR{{Fait}} + \def\conjecturenameFR{{Conjecture}} + \def\definitionnameFR{{Définition}} + \def\axiomnameFR{{Axiome}} + \def\assumptionnameFR{{Supposition}} + \def\conventionnameFR{{Convention}} + \def\hypothesisnameFR{{Hypothèse}} + \def\notationnameFR{{Notation}} + \def\examplenameFR{{Exemple}} + \def\problemnameFR{{Problème}} + \def\questionnameFR{{Question}} + \def\exercisenameFR{{Exercice}} + \def\remarknameFR{{Remarque}} + \def\observationnameFR{{Observation}} + \expandafter\def\csname definition-propositionnameFR\endcsname{\definitionnameFR-\propositionnameFR} + \expandafter\def\csname definition-theoremnameFR\endcsname{\definitionnameFR-\theoremnameFR} %# 德语定理名称 %# German theorems names -\def\theoremnameDE{{Satz}} -\def\lemmanameDE{{Lemma}} -\def\propositionnameDE{{Proposition}} -\def\corollarynameDE{{Korollar}} -\def\propertynameDE{{Eigenschaft}} -\def\factnameDE{{Fakt}} -\def\conjecturenameDE{{Vermutung}} -\def\definitionnameDE{{Definition}} -\def\axiomnameDE{{Axiom}} -\def\assumptionnameDE{{Annahme}} -\def\conventionnameDE{{Konvention}} -\def\hypothesisnameDE{{Hypothese}} -\def\notationnameDE{{Notation}} -\def\examplenameDE{{Beispiel}} -\def\problemnameDE{{Problem}} -\def\questionnameDE{{Frage}} -\def\exercisenameDE{{Übung}} -\def\remarknameDE{{Bemerkung}} -\def\observationnameDE{{Beobachtung}} -\expandafter\def\csname definition-propositionnameDE\endcsname{\definitionnameDE-\propositionnameDE} -\expandafter\def\csname definition-theoremnameDE\endcsname{\definitionnameDE-\theoremnameDE} + \def\theoremnameDE{{Satz}} + \def\lemmanameDE{{Lemma}} + \def\propositionnameDE{{Proposition}} + \def\corollarynameDE{{Korollar}} + \def\propertynameDE{{Eigenschaft}} + \def\factnameDE{{Fakt}} + \def\conjecturenameDE{{Vermutung}} + \def\definitionnameDE{{Definition}} + \def\axiomnameDE{{Axiom}} + \def\assumptionnameDE{{Annahme}} + \def\conventionnameDE{{Konvention}} + \def\hypothesisnameDE{{Hypothese}} + \def\notationnameDE{{Notation}} + \def\examplenameDE{{Beispiel}} + \def\problemnameDE{{Problem}} + \def\questionnameDE{{Frage}} + \def\exercisenameDE{{Übung}} + \def\remarknameDE{{Bemerkung}} + \def\observationnameDE{{Beobachtung}} + \expandafter\def\csname definition-propositionnameDE\endcsname{\definitionnameDE-\propositionnameDE} + \expandafter\def\csname definition-theoremnameDE\endcsname{\definitionnameDE-\theoremnameDE} %# 意大利语定理名称 %# Italian theorems names -\def\theoremnameIT{{Teorema}} -\def\lemmanameIT{{Lemma}} -\def\propositionnameIT{{Proposizione}} -\def\corollarynameIT{{Corollario}} -\def\propertynameIT{{Proprietà}} -\def\factnameIT{{Fatto}} -\def\conjecturenameIT{{Congettura}} -\def\definitionnameIT{{Definizione}} -\def\axiomnameIT{{Assioma}} -\def\assumptionnameIT{{Supposizione}} -\def\conventionnameIT{{Convenzione}} -\def\hypothesisnameIT{{Ipotesi}} -\def\notationnameIT{{Notazione}} -\def\examplenameIT{{Esempio}} -\def\problemnameIT{{Problema}} -\def\questionnameIT{{Domanda}} -\def\exercisenameIT{{Esercizio}} -\def\remarknameIT{{Nota}} -\def\observationnameIT{{Osservazione}} -\expandafter\def\csname definition-propositionnameIT\endcsname{\definitionnameIT-\propositionnameIT} -\expandafter\def\csname definition-theoremnameIT\endcsname{\definitionnameIT-\theoremnameIT} + \def\theoremnameIT{{Teorema}} + \def\lemmanameIT{{Lemma}} + \def\propositionnameIT{{Proposizione}} + \def\corollarynameIT{{Corollario}} + \def\propertynameIT{{Proprietà}} + \def\factnameIT{{Fatto}} + \def\conjecturenameIT{{Congettura}} + \def\definitionnameIT{{Definizione}} + \def\axiomnameIT{{Assioma}} + \def\assumptionnameIT{{Supposizione}} + \def\conventionnameIT{{Convenzione}} + \def\hypothesisnameIT{{Ipotesi}} + \def\notationnameIT{{Notazione}} + \def\examplenameIT{{Esempio}} + \def\problemnameIT{{Problema}} + \def\questionnameIT{{Domanda}} + \def\exercisenameIT{{Esercizio}} + \def\remarknameIT{{Commento}} + \def\observationnameIT{{Osservazione}} + \expandafter\def\csname definition-propositionnameIT\endcsname{\definitionnameIT-\propositionnameIT} + \expandafter\def\csname definition-theoremnameIT\endcsname{\definitionnameIT-\theoremnameIT} %# 葡萄牙语定理名称 %# Portuguese theorems names -\def\theoremnamePT{{Teorema}} -\def\lemmanamePT{{Lema}} -\def\propositionnamePT{{Proposição}} -\def\corollarynamePT{{Corolário}} -\def\propertynamePT{{Propriedade}} -\def\factnamePT{{Facto}} -\def\conjecturenamePT{{Conjetura}} -\def\definitionnamePT{{Definição}} -\def\axiomnamePT{{Axioma}} -\def\assumptionnamePT{{Suposição}} -\def\conventionnamePT{{Convenção}} -\def\hypothesisnamePT{{Hipótese}} -\def\notationnamePT{{Notação}} -\def\examplenamePT{{Exemplo}} -\def\problemnamePT{{Problema}} -\def\questionnamePT{{Pergunta}} -\def\exercisenamePT{{Exercício}} -\def\remarknamePT{{Comentário}} -\def\observationnamePT{{Observação}} -\expandafter\def\csname definition-propositionnamePT\endcsname{\definitionnamePT-\propositionnamePT} -\expandafter\def\csname definition-theoremnamePT\endcsname{\definitionnamePT-\theoremnamePT} + \def\theoremnamePT{{Teorema}} + \def\lemmanamePT{{Lema}} + \def\propositionnamePT{{Proposição}} + \def\corollarynamePT{{Corolário}} + \def\propertynamePT{{Propriedade}} + \def\factnamePT{{Facto}} + \def\conjecturenamePT{{Conjetura}} + \def\definitionnamePT{{Definição}} + \def\axiomnamePT{{Axioma}} + \def\assumptionnamePT{{Suposição}} + \def\conventionnamePT{{Convenção}} + \def\hypothesisnamePT{{Hipótese}} + \def\notationnamePT{{Notação}} + \def\examplenamePT{{Exemplo}} + \def\problemnamePT{{Problema}} + \def\questionnamePT{{Pergunta}} + \def\exercisenamePT{{Exercício}} + \def\remarknamePT{{Comentário}} + \def\observationnamePT{{Observação}} + \expandafter\def\csname definition-propositionnamePT\endcsname{\definitionnamePT-\propositionnamePT} + \expandafter\def\csname definition-theoremnamePT\endcsname{\definitionnamePT-\theoremnamePT} %# 巴西葡萄牙语定理名称 %# Brazilian theorems names -\def\theoremnameBR{{Teorema}} -\def\lemmanameBR{{Lema}} -\def\propositionnameBR{{Proposição}} -\def\corollarynameBR{{Corolário}} -\def\propertynameBR{{Propriedade}} -\def\factnameBR{{Facto}} -\def\conjecturenameBR{{Conjetura}} -\def\definitionnameBR{{Definição}} -\def\axiomnameBR{{Axioma}} -\def\assumptionnameBR{{Suposição}} -\def\conventionnameBR{{Convenção}} -\def\hypothesisnameBR{{Hipótese}} -\def\notationnameBR{{Notação}} -\def\examplenameBR{{Exemplo}} -\def\problemnameBR{{Problema}} -\def\questionnameBR{{Pergunta}} -\def\exercisenameBR{{Exercício}} -\def\remarknameBR{{Comentário}} -\def\observationnameBR{{Observação}} -\expandafter\def\csname definition-propositionnameBR\endcsname{\definitionnameBR-\propositionnameBR} -\expandafter\def\csname definition-theoremnameBR\endcsname{\definitionnameBR-\theoremnameBR} + \def\theoremnameBR{{Teorema}} + \def\lemmanameBR{{Lema}} + \def\propositionnameBR{{Proposição}} + \def\corollarynameBR{{Corolário}} + \def\propertynameBR{{Propriedade}} + \def\factnameBR{{Fato}} + \def\conjecturenameBR{{Conjectura}} + \def\definitionnameBR{{Definição}} + \def\axiomnameBR{{Axioma}} + \def\assumptionnameBR{{Suposição}} + \def\conventionnameBR{{Convenção}} + \def\hypothesisnameBR{{Hipótese}} + \def\notationnameBR{{Notação}} + \def\examplenameBR{{Exemplo}} + \def\problemnameBR{{Problema}} + \def\questionnameBR{{Pergunta}} + \def\exercisenameBR{{Exercício}} + \def\remarknameBR{{Comentário}} + \def\observationnameBR{{Observação}} + \expandafter\def\csname definition-propositionnameBR\endcsname{\definitionnameBR-\propositionnameBR} + \expandafter\def\csname definition-theoremnameBR\endcsname{\definitionnameBR-\theoremnameBR} %# 西班牙语定理名称 %# Spanish theorems names -\def\theoremnameES{{Teorema}} -\def\lemmanameES{{Lema}} -\def\propositionnameES{{Proposición}} -\def\corollarynameES{{Corolario}} -\def\propertynameES{{Propiedad}} -\def\factnameES{{Hecho}} -\def\conjecturenameES{{Conjetura}} -\def\definitionnameES{{Definición}} -\def\axiomnameES{{Axioma}} -\def\assumptionnameES{{Suposición}} -\def\conventionnameES{{Convención}} -\def\hypothesisnameES{{Hipótesis}} -\def\notationnameES{{Notación}} -\def\examplenameES{{Ejemplo}} -\def\problemnameES{{Problema}} -\def\questionnameES{{Pregunta}} -\def\exercisenameES{{Ejercicio}} -\def\remarknameES{{Comentario}} -\def\observationnameES{{Observación}} -\expandafter\def\csname definition-propositionnameES\endcsname{\definitionnameES-\propositionnameES} -\expandafter\def\csname definition-theoremnameES\endcsname{\definitionnameES-\theoremnameES} + \def\theoremnameES{{Teorema}} + \def\lemmanameES{{Lema}} + \def\propositionnameES{{Proposición}} + \def\corollarynameES{{Corolario}} + \def\propertynameES{{Propiedad}} + \def\factnameES{{Hecho}} + \def\conjecturenameES{{Conjetura}} + \def\definitionnameES{{Definición}} + \def\axiomnameES{{Axioma}} + \def\assumptionnameES{{Suposición}} + \def\conventionnameES{{Convención}} + \def\hypothesisnameES{{Hipótesis}} + \def\notationnameES{{Notación}} + \def\examplenameES{{Ejemplo}} + \def\problemnameES{{Problema}} + \def\questionnameES{{Pregunta}} + \def\exercisenameES{{Ejercicio}} + \def\remarknameES{{Comentario}} + \def\observationnameES{{Observación}} + \expandafter\def\csname definition-propositionnameES\endcsname{\definitionnameES-\propositionnameES} + \expandafter\def\csname definition-theoremnameES\endcsname{\definitionnameES-\theoremnameES} %# 中文定理名称 %# Chinese theorems names -\def\theoremnameCN{{定理}} -\def\lemmanameCN{{引理}} -\def\propositionnameCN{{命题}} -\def\corollarynameCN{{推论}} -\def\propertynameCN{{性质}} -\def\factnameCN{{事实}} -\def\conjecturenameCN{{猜想}} -\def\definitionnameCN{{定义}} -\def\axiomnameCN{{公理}} -\def\assumptionnameCN{{假设}} -\def\conventionnameCN{{约定}} -\def\hypothesisnameCN{{假设}} -\def\notationnameCN{{记号}} -\def\examplenameCN{{例}} -\def\problemnameCN{{问题}} -\def\questionnameCN{{问题}} -\def\exercisenameCN{{练习}} -\def\remarknameCN{{备注}} -\def\observationnameCN{{观察}} -\expandafter\def\csname definition-propositionnameCN\endcsname{\definitionnameCN-\propositionnameCN} -\expandafter\def\csname definition-theoremnameCN\endcsname{\definitionnameCN-\theoremnameCN} - -\def\theoremnameTC{{定理}} -\def\lemmanameTC{{引理}} -\def\propositionnameTC{{命題}} -\def\corollarynameTC{{推論}} -\def\propertynameTC{{性質}} -\def\factnameTC{{事實}} -\def\conjecturenameTC{{猜想}} -\def\definitionnameTC{{定義}} -\def\axiomnameTC{{公理}} -\def\assumptionnameTC{{假設}} -\def\conventionnameTC{{約定}} -\def\hypothesisnameTC{{假設}} -\def\notationnameTC{{記號}} -\def\examplenameTC{{例}} -\def\problemnameTC{{問題}} -\def\questionnameTC{{問題}} -\def\exercisenameTC{{練習}} -\def\remarknameTC{{備註}} -\def\observationnameTC{{觀察}} -\expandafter\def\csname definition-propositionnameTC\endcsname{\definitionnameTC-\propositionnameTC} -\expandafter\def\csname definition-theoremnameTC\endcsname{\definitionnameTC-\theoremnameTC} + \def\theoremnameCN{{定理}} + \def\lemmanameCN{{引理}} + \def\propositionnameCN{{命题}} + \def\corollarynameCN{{推论}} + \def\propertynameCN{{性质}} + \def\factnameCN{{事实}} + \def\conjecturenameCN{{猜想}} + \def\definitionnameCN{{定义}} + \def\axiomnameCN{{公理}} + \def\assumptionnameCN{{假定}} + \def\conventionnameCN{{约定}} + \def\hypothesisnameCN{{假设}} + \def\notationnameCN{{记号}} + \def\examplenameCN{{例}} + \def\problemnameCN{{问题}} + \def\questionnameCN{{问题}} + \def\exercisenameCN{{练习}} + \def\remarknameCN{{备注}} + \def\observationnameCN{{观察}} + \expandafter\def\csname definition-propositionnameCN\endcsname{\definitionnameCN-\propositionnameCN} + \expandafter\def\csname definition-theoremnameCN\endcsname{\definitionnameCN-\theoremnameCN} + + \def\theoremnameTC{{定理}} + \def\lemmanameTC{{引理}} + \def\propositionnameTC{{命題}} + \def\corollarynameTC{{推論}} + \def\propertynameTC{{性質}} + \def\factnameTC{{事實}} + \def\conjecturenameTC{{猜想}} + \def\definitionnameTC{{定義}} + \def\axiomnameTC{{公理}} + \def\assumptionnameTC{{假定}} + \def\conventionnameTC{{約定}} + \def\hypothesisnameTC{{假設}} + \def\notationnameTC{{記號}} + \def\examplenameTC{{例}} + \def\problemnameTC{{問題}} + \def\questionnameTC{{問題}} + \def\exercisenameTC{{練習}} + \def\remarknameTC{{備註}} + \def\observationnameTC{{觀察}} + \expandafter\def\csname definition-propositionnameTC\endcsname{\definitionnameTC-\propositionnameTC} + \expandafter\def\csname definition-theoremnameTC\endcsname{\definitionnameTC-\theoremnameTC} %# 日文定理名称 %# Japanese theorems names -\def\theoremnameJP{{定理}} -\def\lemmanameJP{{補題}} -\def\propositionnameJP{{命題}} -\def\corollarynameJP{{系}} -\def\propertynameJP{{性質}} -\def\factnameJP{{事実}} -\def\conjecturenameJP{{予想}} -\def\definitionnameJP{{定義}} -\def\axiomnameJP{{公理}} -\def\assumptionnameJP{{仮定}} -\def\conventionnameJP{{慣例}} -\def\hypothesisnameJP{{仮設}} -\def\notationnameJP{{記法}} -\def\examplenameJP{{例}} -\def\problemnameJP{{問題}} -\def\questionnameJP{{問題}} -\def\exercisenameJP{{練習}} -\def\remarknameJP{{注釈}} -\def\observationnameJP{{観察}} -\expandafter\def\csname definition-propositionnameJP\endcsname{\definitionnameJP-\propositionnameJP} -\expandafter\def\csname definition-theoremnameJP\endcsname{\definitionnameJP-\theoremnameJP} + \def\theoremnameJP{{定理}} + \def\lemmanameJP{{補題}} + \def\propositionnameJP{{命題}} + \def\corollarynameJP{{系}} + \def\propertynameJP{{性質}} + \def\factnameJP{{事実}} + \def\conjecturenameJP{{予想}} + \def\definitionnameJP{{定義}} + \def\axiomnameJP{{公理}} + \def\assumptionnameJP{{仮定}} + \def\conventionnameJP{{慣例}} + \def\hypothesisnameJP{{仮設}} + \def\notationnameJP{{記法}} + \def\examplenameJP{{例}} + \def\problemnameJP{{問題}} + \def\questionnameJP{{問題}} + \def\exercisenameJP{{練習}} + \def\remarknameJP{{注釈}} + \def\observationnameJP{{観察}} + \expandafter\def\csname definition-propositionnameJP\endcsname{\definitionnameJP-\propositionnameJP} + \expandafter\def\csname definition-theoremnameJP\endcsname{\definitionnameJP-\theoremnameJP} %# 俄文定理名称 %# Russian theorems names -\def\theoremnameRU{{Теорема}} % Теоре́ма -\def\lemmanameRU{{Лемма}} % Ле́мма -\def\propositionnameRU{{Предложение}} % Предложе́ние -\def\corollarynameRU{{Следствие}} % Сле́дствие -\def\propertynameRU{{Имущество}} % Иму́щество -\def\factnameRU{{Факт}} -\def\conjecturenameRU{{Гипотеза}} % Гипо́теза -\def\definitionnameRU{{Определение}} % Определе́ние -\def\axiomnameRU{{Аксиома}} % Аксио́ма -\def\assumptionnameRU{{Предположение}} % Предположе́ние -\def\conventionnameRU{{Конвенция}} % Конве́нция -\def\hypothesisnameRU{{Гипотеза}} % Гипо́теза -\def\notationnameRU{{Нотация}} % Нота́ция -\def\examplenameRU{{Пример}} % Приме́р -\def\problemnameRU{{Проблема}} % Пробле́ма -\def\questionnameRU{{Вопрос}} % Вопро́с -\def\exercisenameRU{{Упражнение}} % Упражне́ние -\def\remarknameRU{{Замечание}} % Замеча́ние -\def\observationnameRU{{Наблюдение}} % Наблюде́ние -\expandafter\def\csname definition-propositionnameRU\endcsname{\definitionnameRU-\propositionnameRU} -\expandafter\def\csname definition-theoremnameRU\endcsname{\definitionnameRU-\theoremnameRU} + \def\theoremnameRU{{Теорема}} % Теоре́ма + \def\lemmanameRU{{Лемма}} % Ле́мма + \def\propositionnameRU{{Предложение}} % Предложе́ние + \def\corollarynameRU{{Следствие}} % Сле́дствие + \def\propertynameRU{{Имущество}} % Иму́щество + \def\factnameRU{{Факт}} + \def\conjecturenameRU{{Гипотеза}} % Гипо́теза % Конъектура Конъекту́ра + \def\definitionnameRU{{Определение}} % Определе́ние + \def\axiomnameRU{{Аксиома}} % Аксио́ма + \def\assumptionnameRU{{Предположение}} % Предположе́ние + \def\conventionnameRU{{Конвенция}} % Конве́нция + \def\hypothesisnameRU{{Гипотеза}} % Гипо́теза + \def\notationnameRU{{Нотация}} % Нота́ция + \def\examplenameRU{{Пример}} % Приме́р + \def\problemnameRU{{Проблема}} % Пробле́ма + \def\questionnameRU{{Вопрос}} % Вопро́с + \def\exercisenameRU{{Упражнение}} % Упражне́ние + \def\remarknameRU{{Замечание}} % Замеча́ние + \def\observationnameRU{{Наблюдение}} % Наблюде́ние + \expandafter\def\csname definition-propositionnameRU\endcsname{\definitionnameRU-\propositionnameRU} + \expandafter\def\csname definition-theoremnameRU\endcsname{\definitionnameRU-\theoremnameRU} +} %# 判断最高级别的标题是 section 还是 chapter %# Detect the highest level of title: section or chapter? @@ -2170,7 +3425,7 @@ \def\creflastconjunction{~和~}% \def\crefpairgroupconjunction{~和~}% \def\crefmiddlegroupconjunction{、}% - \def\creflastgroupconjunction{~和~}% + \def\creflastgroupconjunction{~以及~}% \def\crefrangeconjunction{~}% } \gappto{\PJLlang@langconfig@TC}{% @@ -2187,7 +3442,7 @@ \def\creflastconjunction{~與~}% \def\crefpairgroupconjunction{~與~}% \def\crefmiddlegroupconjunction{、}% - \def\creflastgroupconjunction{~與~}% + \def\creflastgroupconjunction{~以及~}% \def\crefrangeconjunction{~}% } \gappto{\PJLlang@langconfig@JP}{% @@ -2204,8 +3459,8 @@ \def\creflastconjunction{~と~}% \def\crefpairgroupconjunction{~と~}% \def\crefmiddlegroupconjunction{~と~}% - \def\creflastgroupconjunction{~と~}% - \def\crefrangeconjunction{〜}% + \def\creflastgroupconjunction{~及び~}% + \def\crefrangeconjunction{~}% } \gappto{\PJLlang@langconfig@RU}{% \crefname{equation}{уравнение}{уравнения}% @@ -2260,6 +3515,8 @@ \DeclareStringOption{thmnum}[PJL@thmnum@default] \DeclareBoolOption[true]{regionalref} \DeclareBoolOption[false]{originalref} +\DeclareBoolOption[true]{complexname} +\DeclareBoolOption[false]{simplename} \DeclareBoolOption[false]{useosf} \DeclareBoolOption[false]{lmodern} \DeclareBoolOption[false]{palatino} @@ -2276,6 +3533,9 @@ \if@ProjLib@originalref \@ProjLib@regionalreffalse \fi +\if@ProjLib@simplename + \@ProjLib@complexnamefalse +\fi \if@ProjLib@draft \@ProjLib@fasttrue \fi @@ -2307,6 +3567,9 @@ \if@ProjLib@regionalref\else \PassOptionsToPackage{originalref}{PJLthm} \fi +\if@ProjLib@complexname\else + \PassOptionsToPackage{simplename}{PJLthm} +\fi %# 加载不默认载入的组件 %# Load those components not by default loaded @@ -2414,6 +3677,7 @@ %# 使用 microtype 优化排版细节 %# Use `microtype` to get details better \RequirePackage{microtype} +\AtEndPreamble{\AtBeginDocument{\microtypesetup{disable}{\scshape}\microtypesetup{enable}}} %</ProjLib> \endinput
\ No newline at end of file |