diff options
Diffstat (limited to 'macros')
65 files changed, 1618 insertions, 2010 deletions
diff --git a/macros/latex/contrib/changes/changes.drv b/macros/latex/contrib/changes/changes.drv index f10e708732..0ca29f10a1 100644 --- a/macros/latex/contrib/changes/changes.drv +++ b/macros/latex/contrib/changes/changes.drv @@ -260,11 +260,11 @@ % document title \ifENGLISH \title{The \chpackage{changes}-package} - \subtitle{Manual change markup --- version 3.2.0} + \subtitle{Manual change markup --- version 3.2.1} \fi \ifGERMAN \title{Das \chpackage{changes}-Paket} - \subtitle{Manuelle Änderungsmarkierung -- Version 3.2.0} + \subtitle{Manuelle Änderungsmarkierung -- Version 3.2.1} \fi \author{Ekkart Kleinod} diff --git a/macros/latex/contrib/changes/changes.dtx b/macros/latex/contrib/changes/changes.dtx index 8d6fa6e251..0604223858 100644 --- a/macros/latex/contrib/changes/changes.dtx +++ b/macros/latex/contrib/changes/changes.dtx @@ -1,4 +1,4 @@ -% \CheckSum{1510} +% \CheckSum{1509} % % \iffalse meta-comment % @@ -60,6 +60,7 @@ % \changes{v3.1.2}{2019/01/26}{bugfix: problems with amsart class} % \changes{v3.1.3}{2019/07/21}{bugfix: option clash for ulem and truncate; documentation of known problems and solutions} % \changes{v3.2.0}{2019/10/28}{Merge changes script (pyMergeChanges): Support nested brackets} +% \changes{v3.2.1}{2019/11/17}{removed obsolete package pdfcolmk} % \GetFileInfo{changes.dtx} % \RecordChanges % @@ -100,8 +101,8 @@ % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{changes} -[2019/10/28 v3.2.0 changes package] -\typeout{*** changes package 2019/10/28 v3.2.0 ***} +[2019/11/17 v3.2.1 changes package] +\typeout{*** changes package 2019/11/17 v3.2.1 ***} % \end{macrocode} % % Package \chpackage{xkeyval} provides options with key-value-pairs. @@ -533,12 +534,10 @@ % \end{macro} % % Package \chpackage{xcolor} provides colored text. -% Package \chpackage{pdfcolmk} solves the problem of colored text and page breaks (has to be loaded after \chpackage{xcolor}). % \begin{macrocode} \ifthenelse{\isColored} { \RequirePackage{xcolor} - \RequirePackage{pdfcolmk} } {} % \end{macrocode} diff --git a/macros/latex/contrib/changes/changes.english.pdf b/macros/latex/contrib/changes/changes.english.pdf Binary files differindex 12ca7fa7ca..d3033ecd1d 100644 --- a/macros/latex/contrib/changes/changes.english.pdf +++ b/macros/latex/contrib/changes/changes.english.pdf diff --git a/macros/latex/contrib/changes/changes.english.withcode.pdf b/macros/latex/contrib/changes/changes.english.withcode.pdf Binary files differindex d8bfff1dfc..38254d42a2 100644 --- a/macros/latex/contrib/changes/changes.english.withcode.pdf +++ b/macros/latex/contrib/changes/changes.english.withcode.pdf diff --git a/macros/latex/contrib/changes/changes.ins b/macros/latex/contrib/changes/changes.ins index 06da2e778c..acf9b77468 100644 --- a/macros/latex/contrib/changes/changes.ins +++ b/macros/latex/contrib/changes/changes.ins @@ -1,6 +1,6 @@ %% This file creates the needed files from changes.dtx %% -\def\filedate{2019/10/28} +\def\filedate{2019/11/17} \def\batchfile{changes.ins} \input docstrip diff --git a/macros/latex/contrib/changes/changes.ngerman.pdf b/macros/latex/contrib/changes/changes.ngerman.pdf Binary files differindex 497dad2b47..037fd7967f 100644 --- a/macros/latex/contrib/changes/changes.ngerman.pdf +++ b/macros/latex/contrib/changes/changes.ngerman.pdf diff --git a/macros/latex/contrib/chemmacros/README b/macros/latex/contrib/chemmacros/README index 2661b9f427..d97f1818e4 100644 --- a/macros/latex/contrib/chemmacros/README +++ b/macros/latex/contrib/chemmacros/README @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -the CHEMMACROS package v5.8e 2019/09/27 +the CHEMMACROS package v5.9 2019/11/17 comprehensive support for typesetting chemistry documents diff --git a/macros/latex/contrib/chemmacros/chemmacros.history b/macros/latex/contrib/chemmacros/chemmacros.history index 2b2429f9f8..ac061221f7 100644 --- a/macros/latex/contrib/chemmacros/chemmacros.history +++ b/macros/latex/contrib/chemmacros/chemmacros.history @@ -381,3 +381,7 @@ Version history 2019/09/23 - version 5.8d - add some Norwegian translations (reactions, scheme) 2019/09/27 - version 5.8e - change `O{}' argument of reactions into `!O{}' (reactions) +2019/09/30 - version 5.8f - fix bug introduced in the last version +2019/11/17 - version 5.9 - correction: torr -> Torr (units) + - define latin phrases on the go instead of at begin + document diff --git a/macros/latex/contrib/chemmacros/chemmacros.module.nomenclature.code.tex b/macros/latex/contrib/chemmacros/chemmacros.module.nomenclature.code.tex index 596d36f65a..9cb5969ed2 100644 --- a/macros/latex/contrib/chemmacros/chemmacros.module.nomenclature.code.tex +++ b/macros/latex/contrib/chemmacros/chemmacros.module.nomenclature.code.tex @@ -862,7 +862,9 @@ \chemmacros_latin:n {#2} \group_end: } +\EndChemCompatibility +\ChemCompatibilityBetween{5.7}{5.9} \AtBeginDocument { \AfterPackage* {chemstyle} { \cs_undefine:N \invacuo } @@ -870,7 +872,13 @@ \NewChemLatin \abinitio {ab~initio} \NewChemLatin \invacuo {in~vacuo} } +\EndChemCompatibility +\ChemCompatibilityFrom{5.9} +\cs_undefine:N \invacuo +\NewChemLatin \invacuo {in~vacuo} +\NewChemLatin \abinitio {ab~initio} +\NewChemLatin \insitu {in~situ} \EndChemCompatibility % -------------------------------------------------------------------------- diff --git a/macros/latex/contrib/chemmacros/chemmacros.module.units.code.tex b/macros/latex/contrib/chemmacros/chemmacros.module.units.code.tex index 18bf0e5b9e..4584c8a631 100644 --- a/macros/latex/contrib/chemmacros/chemmacros.module.units.code.tex +++ b/macros/latex/contrib/chemmacros/chemmacros.module.units.code.tex @@ -25,19 +25,21 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- -\ChemModule{units}{2015/09/28 chemical units} +\ChemModule{units}{2019/11/07 chemical units} \RequirePackage{siunitx} % -------------------------------------------------------------------------- -\DeclareSIUnit {\atm } {atm} -\DeclareSIUnit {\atmosphere} {atm} -\DeclareSIUnit {\calory } {cal} -\DeclareSIUnit {\cal } {cal} -\DeclareSIUnit {\moLar } {\mole\per\liter} -\DeclareSIUnit {\MolMass } {\gram\per\mole} -\DeclareSIUnit {\normal } {\textsc{n}} -\DeclareSIUnit {\torr } {torr} +\DeclareSIUnit \atm {atm} +\DeclareSIUnit \atmosphere {atm} +\DeclareSIUnit \calory {cal} +\DeclareSIUnit \cal {cal} +\DeclareSIUnit \moLar {\mole\per\liter} +\DeclareSIUnit \MolMass {\gram\per\mole} +\DeclareSIUnit \normal {\textsc{n}} +\chemmacros_if_compatibility:nnTF {<} {5.8g} + { \DeclareSIUnit \torr {torr} } + { \DeclareSIUnit \Torr {Torr} } \AtEndPreamble { @@ -53,4 +55,5 @@ \file_input_stop: 2015/09/28 - change \AtBeginDocument into \AtEndPreamble +2019/11/07 - correction torr -> Torr diff --git a/macros/latex/contrib/chemmacros/chemmacros.sty b/macros/latex/contrib/chemmacros/chemmacros.sty index bb1e94bd3f..3865e1a860 100644 --- a/macros/latex/contrib/chemmacros/chemmacros.sty +++ b/macros/latex/contrib/chemmacros/chemmacros.sty @@ -31,10 +31,10 @@ % -------------------------------------------------------------------------- % package information: -\tl_const:Nn \c_chemmacros_date_tl {2019/09/30} +\tl_const:Nn \c_chemmacros_date_tl {2019/11/17} \tl_const:Nn \c_chemmacros_version_major_number_tl {5} -\tl_const:Nn \c_chemmacros_version_minor_number_tl {8} -\tl_const:Nn \c_chemmacros_version_subrelease_tl {f} +\tl_const:Nn \c_chemmacros_version_minor_number_tl {9} +\tl_const:Nn \c_chemmacros_version_subrelease_tl {} \tl_const:Nx \c_chemmacros_version_number_tl { \c_chemmacros_version_major_number_tl . diff --git a/macros/latex/contrib/chemmacros/chemmacros_en.pdf b/macros/latex/contrib/chemmacros/chemmacros_en.pdf Binary files differindex b62e8b0501..ee2ecb6eee 100644 --- a/macros/latex/contrib/chemmacros/chemmacros_en.pdf +++ b/macros/latex/contrib/chemmacros/chemmacros_en.pdf diff --git a/macros/latex/contrib/chemmacros/chemmacros_en.tex b/macros/latex/contrib/chemmacros/chemmacros_en.tex index feb89102c4..3fccfe7634 100644 --- a/macros/latex/contrib/chemmacros/chemmacros_en.tex +++ b/macros/latex/contrib/chemmacros/chemmacros_en.tex @@ -139,9 +139,14 @@ ]{geometry} -\expandafter\def\csname libertine@figurestyle\endcsname{LF} +\makeatletter +\def\libertine@figurestyle{LF} +\usepackage{amsmath} +\undef\lvert \undef\lVert +\undef\rvert \undef\rVert \usepackage[libertine]{newtxmath} -\expandafter\def\csname libertine@figurestyle\endcsname{OsF} +\def\libertine@figurestyle{OsF} +\makeatother \usepackage[biblatex]{embrac} \ChangeEmph{[}[,.02em]{]}[.055em,-.08em] @@ -1374,20 +1379,6 @@ existing ones: If you additionally load \pkg{chemstyle}~\cite{pkg:chemstyle} said package will \emph{not} define its own \cs{latin}. -% The package \pkg{chemstyle}~\cite{pkg:chemstyle} provides the command -% \cs{latin} to typeset common latin phrases in a consistent way. \chemmacros\ -% defines a similar \cs{latin} only if \pkg{chemstyle} has \emph{not} been -% loaded and additionally provides these commands: -% \begin{center} -% \cs{insitu} \insitu \quad -% \cs{abinitio} \abinitio \quad -% \cs{invacuo} \invacuo -% \end{center} - -% \emph{If the package \pkg{chemstyle} has been loaded they are defined using -% \pkg{chemstyle}'s \cs{latin} command. This means that then the appearance -% depends on \pkg{chemstyle}'s option \code{abbremph}.} - The last three commands mentioned above are defined through \begin{commands} \command{NewChemLatin}[\marg{cs}\marg{phrase}] @@ -3461,7 +3452,7 @@ units. Like all \pkg{siunitx} units they're only valid inside \command{Molar} \si{\Molar} \command{MolMass} \si{\MolMass} \command{normal} \si{\normal} - \command{torr} \si{\torr} + \command{Torr} \si{\Torr} \end{commands} By the way: \cs*{mmHg} \si{\mmHg} already is defined by \pkg{siunitx}. diff --git a/macros/latex/contrib/etoc/README.md b/macros/latex/contrib/etoc/README.md index 88f2d05bf8..9a186ade41 100644 --- a/macros/latex/contrib/etoc/README.md +++ b/macros/latex/contrib/etoc/README.md @@ -1,6 +1,6 @@ <!-- --> - Source: etoc.dtx (v1.09-2019/03/09) + Source: etoc.dtx (v1.09b-2019/11/17) Author: Jean-Francois Burnol Author: Christine Roemer et al. (German tranlation) Info: Completely customisable TOCs @@ -48,22 +48,13 @@ to the standard `.toc` file. INSTALLATION ============ -The simplest is to download +To extract the package (.sty) and driver (.tex) files from etoc.dtx, +execute `etex etoc.dtx`. -> <http://mirrors.ctan.org/install/macros/latex/contrib/etoc.tds.zip> - -and then run `unzip etoc.tds.zip -d <DEST>` where `<DEST>` is a -TDS-compliant repertory. - -Else, to extract the package (.sty) and driver (.tex) files from etoc.dtx: - -- if etoc.ins is present: etex etoc.ins -- without etoc.ins: etex etoc.dtx - -It is also possible to run latex or pdflatex directly on etoc.dtx. +It is also possible to execute latex or pdflatex directly on etoc.dtx. To produce etoc.pdf one can run pdflatex (thrice) directly on etoc.dtx or on -the file etoc.tex which was extracted from previous step. +the file etoc.tex which was extracted from `etex etoc.dtx` step. Options can be set in etoc.tex: @@ -110,12 +101,21 @@ The Authors of this Work are: collaborators for the translation into German of the documentation. This Work consists of the main source file etoc.dtx and the -derived files etoc.sty, etoc.ins, etoc.tex, etoc-DE.tex, +derived files etoc.sty, etoc.tex, etoc-DE.tex, etoc.pdf, etoc-DE.pdf, etoc.dvi, etoc-DE.dvi. RECENT CHANGES ============== +v1.09a, v1.09b \[2019/11/17\] +----------------------------- + +Sync with `memoir v3.7i` which has a better location of the TOC +hyperref anchor. The `\etocaftertitlehook` can now freely be +used also with memoir class (formerly its usage in case of +memoir class was preempted by etoc itself). For more details +refer to the section "Compatibility with the memoir class". + v1.09 \[2019/03/09\] -------------------- diff --git a/macros/latex/contrib/etoc/etoc-DE.pdf b/macros/latex/contrib/etoc/etoc-DE.pdf Binary files differindex 7c82540906..6b443b78ae 100644 --- a/macros/latex/contrib/etoc/etoc-DE.pdf +++ b/macros/latex/contrib/etoc/etoc-DE.pdf diff --git a/macros/latex/contrib/etoc/etoc.dtx b/macros/latex/contrib/etoc/etoc.dtx index 9c997ac56a..a500a3b01d 100644 --- a/macros/latex/contrib/etoc/etoc.dtx +++ b/macros/latex/contrib/etoc/etoc.dtx @@ -2,12 +2,12 @@ % N.B.: this dtx file is NOT for use with \DocInput. The latex source of the % user manual is not prefixed with percent signs. %<*none> -\def\etocdtxtimestamp {Time-stamp: <10-03-2019 at 09:35:44 CET>}% +\def\etocdtxtimestamp {Time-stamp: <17-11-2019 at 13:36:39 CET>}% %</none> %<*!readme> %% %% Package: etoc -%% Version: 1.09-2019/03/09 +%% Version: 1.09b-2019/11/17 %% License: LPPL 1.3c %% Copyright (C) 2012-2019 Jean-Francois Burnol %% <jfbu at free dot fr> @@ -16,15 +16,13 @@ %% and collaborators for the translation into German of the documentation %% %</!readme> -%<*insfile> -\def\etocpkgdate {2019/03/09} -\def\etocdocdate {2019/03/09} -\def\etocpkgversion {v1.09} -\def\etocpkgdescription {Completely customisable TOCs (JFB)} -%</insfile> %<*none> -\def\etocDEpkgdate {09.03.2019}% METTRE À JOUR À CHAQUE BUMP! -\def\etocDEdocdate {09.03.2019} +\def\etocpkgdate {2019/11/17} +\def\etocdocdate {2019/11/17} +\def\etocpkgversion {v1.09b} +\def\etocpkgdescription {Completely customisable TOCs (JFB)} +\def\etocDEpkgdate {17.11.2019}% METTRE À JOUR À CHAQUE BUMP! +\def\etocDEdocdate {17.11.2019} \def\etocDEDEdocdate {09.04.2015}% \def\etocDEDEpkgversion {v1.08d}% % Definition of \etocLicense @@ -35,7 +33,7 @@ \catcode32=13\catcode`\\=12^^Brelax^^A ^^Bfirstofone{^^Bendgroup^^Bdef^^BetocLicense^^A {% Package: etoc -% Version: 1.09-2019/03/09 +% Version: 1.09b-2019/11/17 % License: LPPL 1.3c % Copyright (C) 2012-2019 Jean-Francois Burnol <jfbu at free dot fr> % Copyright (C) 2014-2019 Christine Roemer <Christine_Roemer at t-online dot de> @@ -57,11 +55,11 @@ % for the translation into German of the documentation. % % This Work consists of the main source file etoc.dtx and the derived -% files etoc.sty, etoc.ins, etoc.tex, etoc-DE.tex, etoc.pdf, etoc-DE.pdf, +% files etoc.sty, etoc.tex, etoc-DE.tex, etoc.pdf, etoc-DE.pdf, % etoc.dvi, etoc-DE.dvi, README.md. % % Running etex (or latex or pdflatex) on etoc.dtx extracts etoc.sty, -% etoc.ins, etoc.tex, etoc-DE.tex, and README.md. See README.md for +% etoc.tex, etoc-DE.tex, and README.md. See README.md for % further instructions. }}% \bgroup\catcode2 0 \catcode`\\ 12 ^^Biffalse @@ -69,7 +67,7 @@ %<*readme> <!-- --> - Source: etoc.dtx (v1.09-2019/03/09) + Source: etoc.dtx (v1.09b-2019/11/17) Author: Jean-Francois Burnol Author: Christine Roemer et al. (German tranlation) Info: Completely customisable TOCs @@ -117,22 +115,13 @@ to the standard `.toc` file. INSTALLATION ============ -The simplest is to download - -> <http://mirrors.ctan.org/install/macros/latex/contrib/etoc.tds.zip> - -and then run `unzip etoc.tds.zip -d <DEST>` where `<DEST>` is a -TDS-compliant repertory. - -Else, to extract the package (.sty) and driver (.tex) files from etoc.dtx: +To extract the package (.sty) and driver (.tex) files from etoc.dtx, +execute `etex etoc.dtx`. -- if etoc.ins is present: etex etoc.ins -- without etoc.ins: etex etoc.dtx - -It is also possible to run latex or pdflatex directly on etoc.dtx. +It is also possible to execute latex or pdflatex directly on etoc.dtx. To produce etoc.pdf one can run pdflatex (thrice) directly on etoc.dtx or on -the file etoc.tex which was extracted from previous step. +the file etoc.tex which was extracted from `etex etoc.dtx` step. Options can be set in etoc.tex: @@ -179,12 +168,21 @@ The Authors of this Work are: collaborators for the translation into German of the documentation. This Work consists of the main source file etoc.dtx and the -derived files etoc.sty, etoc.ins, etoc.tex, etoc-DE.tex, +derived files etoc.sty, etoc.tex, etoc-DE.tex, etoc.pdf, etoc-DE.pdf, etoc.dvi, etoc-DE.dvi. RECENT CHANGES ============== +v1.09a, v1.09b \[2019/11/17\] +----------------------------- + +Sync with `memoir v3.7i` which has a better location of the TOC +hyperref anchor. The `\etocaftertitlehook` can now freely be +used also with memoir class (formerly its usage in case of +memoir class was preempted by etoc itself). For more details +refer to the section "Compatibility with the memoir class". + v1.09 \[2019/03/09\] -------------------- @@ -364,69 +362,6 @@ Thanks to Christine Römer! %%% mode: latex %%% End: %</DEtex>----------------------------------------------------------------------- -%<*insfile>--------------------------------------------------------------------- -%% Run etex on this file to extract from etoc.dtx: -%% etoc.sty, etoc.tex, etoc-DE.tex and README.md -%% -%% To produce etoc.pdf run pdflatex (thrice) on etoc.tex. -%% -%% Options can be set in etoc.tex (and etoc-DE.tex): -%% - scrdoc class options (paper size, font size, ...) -%% - with or without source code, -%% - with dvipdfmx or with latex/pdflatex. -%% -%% Since release 1.08h pdflatex is the default in etoc.tex (prior it -%% was latex+dvipdfmx as it produces smaller PDFs) in order to allow -%% inclusion via the use of package `attachfile` of about 25 code -%% samples as file attachment annotations. -%% -%% Um etoc-DE.pdf zu erzeugen ist pdflatex dreimal mit etoc-DE.tex -%% laufen zu lassen. -%% -%% Installation: -%% -%% etoc.sty -> TDS:tex/latex/etoc/etoc.sty -%% etoc.dtx -> TDS:source/latex/etoc/etoc.dtx -%% etoc.pdf -> TDS:doc/latex/etoc/etoc.pdf -%% etoc-DE.pdf -> TDS:doc/latex/etoc/etoc-DE.pdf -%% README.md -> TDS:doc/latex/etoc/README.md -%% -\input docstrip.tex -\askforoverwritefalse -\def\etocpkgpreamble{\defaultpreamble^^J\MetaPrefix^^J% -\string\NeedsTeXFormat{LaTeX2e}^^J% -\string\ProvidesPackage{etoc}^^J% -\space[\etocpkgdate\space\etocpkgversion\space\etocpkgdescription]}% -\generate{\nopreamble\nopostamble -\file{README.md}{\from{etoc.dtx}{readme}}% -\usepostamble\defaultpostamble -\file{etoc.tex}{\from{etoc.dtx}{tex}}% -\file{etoc-DE.tex}{\from{etoc.dtx}{DEtex}}% -\usepreamble\etocpkgpreamble -\file{etoc.sty}{\from{etoc.dtx}{package}}}% -\catcode32=13\relax% active space -\let =\space% -\Msg{************************************************************************} -\Msg{*} -\Msg{* To finish the installation you have to move the following} -\Msg{* file into a directory searched by TeX:} -\Msg{*} -\Msg{* etoc.sty} -\Msg{*} -\Msg{* To produce the documentation run latex thrice on file etoc.tex} -\Msg{* (or etoc-DE.tex) and then run dvipdfmx on file etoc.dvi, resp.} -\Msg{* etoc-DE.dvi} -\Msg{*} -\Msg{* Happy TeXing!} -\Msg{*} -\Msg{************************************************************************} -\ifx\numexpr\undefined -\Msg{* warning: to get correct utf-8 encoded README.md }% -\Msg{* do etex etoc.ins and not as here tex etoc.ins }% -\Msg{************************************************************************} -\fi -\endbatchfile -%</insfile>--------------------------------------------------------------------- %<*none>------------------------------------------------------------------------ ^^Bfi^^Begroup % @@ -483,7 +418,6 @@ Thanks to Christine Römer! \generate{\nopreamble\nopostamble \file{README.md}{\from{etoc.dtx}{readme}}% \usepostamble\defaultpostamble - \file{etoc.ins}{\from{etoc.dtx}{insfile}}% \file{etoc.tex}{\from{etoc.dtx}{tex}}% \file{etoc-DE.tex}{\from{etoc.dtx}{DEtex}}% \usepreamble\etocpkgpreamble @@ -4774,55 +4708,50 @@ Issue \csb{etocdisplay} to return to the default situation that |\tableofcontents| and variants issue a |\par| to switch to vertical mode before typesetting the TOC title and contents. -\section{Starred variants of the \csbhyp{tableofcontents} etc... commands} +\section{Starred variants and hooks} \label{tableofcontents*} \label{localtableofcontents*} \label{etocbeforetitlehook} \label{etocaftertitlehook} \label{etocaftercontentshook} \label{etocaftertochook} -\label{etocmemoirtoctotocfmt} -The \toc, \localtoc, \csa{etocmulticol}, and all their cousins and -variants have starred variants (the star must be before the other -arguments). For all but the |memoir| class, they are like the original. -For the |memoir| class, the original prints an entry in the |.toc| file, -as is the usage for the original \toc command in that class, whereas the -starred variants do not, as is the habit in that class. - -As soon as one starts using local table of contents one -discovers that the default |memoir| thing which is to create a -|chapter| entry for each TOC is not convenient. The command -\csb{etocmemoirtoctotocfmt}\marg{kind}\marg{name} will change -the format (\meta{kind} is |chapter|, |section|, |subsection|... and -\meta{name} can be for example \csa{contentsname}.) The initial set-up -is with |chapter| and |\contentsname|. - -The format of the actual heading of the TOC should also be set -appropriately (for example with \csa{etoctocstyle}), to use the -identical division unit as in the first argument to -\csa{etocmemoirtoctotocfmt}. - -A weird situation arises when one has two successive -\csa{localtableofcontents} (obviously this is not a truly real -life situation), just after a \csa{part} for example. The first -one creates (if the default has not been modified as indicated -above) a Chapter heading which is -written to the |.toc|. Then the second one thinks to be local -to this chapter . . . and as a result it displays nothing. The -fix is to define the second one to be a clone of the first -one. - -Independently of the situation with the |memoir| class there is -generally speaking a hook macro called -\csb{etocaftertitlehook} which is inhibited by using the -starred variants of the displaying commands. Except for the -|memoir| class, this hook is initially defined to do nothing. - -There are also (independently of the document class) +The \toc, \localtoc, \csa{etocmulticol}, and all their cousins have starred +variants (the star must be before the other arguments). The non-starred +variants execute the \csb{etocaftertitlehook}, whose default definition is to +do nothing. The starred variants do not execute this hook. + +For example, imagine you are using |book| class and want \localtoc to use a +section-like title, but unnumbered. Assuming the main \toc comes first in the +document, you can insert this after it: +\begin{verbatim} + \etocarticlestyle + \renewcommand{\etocaftertitlehook}{\addcontentsline{toc}{section}{\contentsname}} +\end{verbatim} +This configures the way \localtoc will behave (or \toc) from now on in the +document. + +The first line tells essentially to use |\section*{\contentsname}|, and the +second line says to insert the title in the |.toc| file itself (thus to be +displayed by the main table of contents). Notice that |hyperref| package will +then automatically create suitable anchor and one should \emph{not} use +explicitly \cs{phantomsection} here (it would let the anchor be located below +not above the title). + +With this set-up issuing \localtoc|*| will ignore the \csa{etocaftertitlehook} +hence not send the local toc title to the |.toc| file. This mimicks the +|memoir| class behavior, and can also be used with it. For more on |memoir| +class with \etoc, see \autoref{ssec:memoir}. + +There are further hook macros: \csb{etocaftercontentshook}, \csb{etocbeforetitlehook} and \csb{etocaftertochook} which are initially defined to do nothing and can be -used for some special effects. +used for some special effects. They are executed whether or not the table of +contents command was starred.% +% +\footnote{Hackers can test within these hooks if the context is starred or not + via an \cs{ifx}\cs{Etoc@aftertitlehook}\cs{@empty} conditional. Perhaps a + future release will provide \cs{etociftocisstarred} wrapper.} \clearpage @@ -5827,6 +5756,9 @@ example) throughout the document the macros \csa{l@section}, table of contents typeset by \etoc in compatibility mode. \subsection{Compatibility with the \texttt{memoir} class} +\label{ssec:memoir} +\label{etocmemoirtoctotocfmt} +\label{etocmemoirstyle} Release |1.07l| has also improved the compatibility with the |memoir| class: its |appendix| level has been made known to \etoc. It is at the same level as @@ -5835,6 +5767,62 @@ defined boolean whose activation may be added to the |.toc| file at the suitable location via |\addtocontents{toc}{..}|, if one needs to distinguish the two kinds of divisions. +The |memoir| mechanism relative to \toc versus \toc|*| is obeyed +automatically, and applies with \localtoc too. + +A weird situation arises under when one has two successive +\csa{localtableofcontents} (obviously this is not a truly real life +situation), just after a \csa{part} for example. The first one creates (if the +default has not been modified) a chapter heading which is written to the +|.toc| (because \etoc by default obeys |memoir| class behaviour). Then the +second one thinks to be local to this chapter . . . and as a result it +displays nothing. The fix is to define the second one to be a clone of the +first one. + +Actually, that \localtoc by default uses like \toc a chapter style is often +inconvenient. One can use the |memoir| macros to modify this: according to +|memoir| documentation, |\tocheadstart| and |\printtoctitle| seem to be the +most relevant. If you do that you will probably want the added line in |.toc| +file to use |{section}| not |{chapter}|. \etoc provides to this effect +\csb{etocmemoirtoctotocfmt}\marg{kind}\marg{name} whose first argument +\meta{kind} is |chapter|, |section|, |subsection|, etc... and the second +argument stands for the title and thus \csa{contentsname} is appropriate. Hence +\begin{verbatim} + \etocmemoirtoctotocfmt{section}{\contentsname} +\end{verbatim} +seems the natural choice in this context as an addition to the customizing the +|memoir| toc related macros to achieve a section like rendering (for more +details on the latter, please refer to |memoir| manual). + +A completely different approach, arguably simpler, is to overrule the \etoc +default under |memoir| (after the main document \toc which should still use a +chapter styling) via these simple +commands: +\begin{verbatim} + \etocarticlestyle % means to use \section*{\contentsname} (and marks) + \renewcommand{\etocaftertitlehook}{\addcontentsline{toc}{section}{\contentsname}} +\end{verbatim} +exactly as one would do with |book| class for example. Don't use any +|\phantomsection| in there, |hyperref| hyperlinks will work just fine (and the +anchor will be slightly above toc title, not below). + +Notice that prior to \etoc |1.09b|, the \csb{etocaftertitlehook} macro was +used by \etoc itself under the |memoir| class. Hence \localtoc obeyed the +|memoir| mechanism relative to starred or not starred, even after issuing +\csa{etocarticlestyle}, as long as the user did not redefine +\csb{etocaftertitlehook}. Starting with |1.09b| (which syncs with a |memoir| +change at |v3.7i|) it is needed in a case like here where the user issues +\csa{etocarticlestyle} to also configure explicitly the +\csa{etocaftertitlehook} to achieve the ``insert title in |.toc|'' effect (if +so wished), because \etoc uses another mechanism and does not pre-empt usage +of this user macro anymore. + +To recover the \etoc default under |memoir| class one can issue +\csa{etocmemoirstyle} and then +\csa{etocmemoirtoctotocfmt}|{chapter}{\contentsname}| (but attention that a +custom \csb{etocaftertitlehook} will still be obeyed; for info: it will get +executed before the \cs{cfttocbeforelisthook}). + \subsection{Compatibility with package \texttt{tocvsec2}} \etoc used to be incompatible with package @@ -5889,6 +5877,7 @@ line containing an \etoc inner command and an identification number is added to the |.toc| file. The correct local table of contents will be displayed only on the next |latex| run. + \section{Errors and catastrophes} After using \csa{etocsetstyle} for one level, the remaining @@ -9423,53 +9412,54 @@ nichts im Token"=Stream hinterlassen. Mit \csb{etocdisplay} werden (nochmal) von dem |\tableofcontents|"=Befehl und seinen Varianten zuerst ein |\par| erstellt. -\section{Gesternde Varianten des \csbhyp{tableofcontents} etc. Befehls} +\begin{otherlanguage}{english} + +\section{Starred variants and hooks} \label{tableofcontents*} \label{localtableofcontents*} \label{etocbeforetitlehook} \label{etocaftertitlehook} \label{etocaftercontentshook} \label{etocaftertochook} -\label{etocmemoirtoctotocfmt} - -Die Befehle \toc, \localtoc, \csa{etocmulticol} und all ihre Cousins und -Varianten haben Stern"=Varianten (der Stern muss vor den anderen Argumenten -kommen). Für alle Klassen außer |memoir| verhalten diese sich wie die Originale. -Für |memoir| jedoch, schreibt das Original einen Eintrag in die |.toc|-Datei, -genau so wie die Verwendung des echten \toc Befehls in dieser Klasse, während -aber die Stern"=Variante genau das nicht tut, wie es in |memoir| die Regel ist. - -Sobald man damit beginnt, lokale Inhaltsverzeichnisse zu benutzen merkt man, -dass der |memoir|-Standard, welcher dazu gedacht ist, einen |chapter|-Eintrag -für jedes Inhaltsverzeichnis zu erzeugen, nicht praktisch ist. Der Befehl -\csb{etocmemoirtoctotocfmt}\marg{Typ}\allowbreak\marg{name} ändert das Format -(\meta{Typ} ist wieder |chapter|, |section|, |subsection| etc. und \meta{name} -kann bspw. \csa{contentsname} sein.) Die Standardwerte für diese Größen sind -|chapter| und |\contentsname|. - -Das Format der tatsächlichen Überschrift des Inhaltsverzeichnisses sollte -ebenfalls ordnungsgemäß gesetzt werden (z.\,B. mit \csa{etoctocstyle}), um -einfach die selbe Einheitsgröße zu nutzen wie im ersten Argument von -\csa{etocmemoirtoctotocfmt}. - -Eine ungewöhnliche Situation tritt auf, wenn man zwei aufeinanderfolgende -\csa{localtableofcontents} hat (offensichtlich ist das eine nicht sehr -wahrscheinliche Situation), direkt nach einem \csa{part} zum Beispiel. Der erste -würde dann eine Kapitelüberschrift erzeugen (wenn der Standard nicht geändert -wurde, wie oben angedeutet), welche in die |.toc|-Datei geschrieben werden -würde. Das zweite Inhaltsverzeichnis denkt dann, es ist ein lokales zu diesem -Kapitel gehörig und würde aus diesem Grund nichts darstellen. Die Lösung für -dieses Problem ist es, das zweite als Klon des ersten zu definieren. -Unabhängig von der Situation hat man bei der |memoir|-Klasse immer ein -Hook"=Makro namens \csb{etocaftertitlehook}, welches man unterdrückt, indem man -die Stern"=Varianten der Darstellungsbefehle nutzt. Außer für die |memoir|-Klasse -ist dieser Hook dazu gedacht, überhaupt nichts zu tun. +The \toc, \localtoc, \csa{etocmulticol}, and all their cousins have starred +variants (the star must be before the other arguments). The non-starred +variants execute the \csb{etocaftertitlehook}, whose default definition is to +do nothing. The starred variants do not execute this hook. -Außerdem gibt es auch \csb{etocaftercontentshook}, \csb{etocbeforetitlehook} -und \csb{etocaftertochook} all drei ähnlich definiert um nichts zu tun und die -für einige spezielle Effekte genutzt werden können. +For example, imagine you are using |book| class and want \localtoc to use a +section-like title, but unnumbered. Assuming the main \toc comes first in the +document, you can insert this after it: +\begin{verbatim} + \etocarticlestyle + \renewcommand{\etocaftertitlehook}{\addcontentsline{toc}{section}{\contentsname}} +\end{verbatim} +This configures the way \localtoc will behave (or \toc) from now on in the +document. + +The first line tells essentially to use |\section*{\contentsname}|, and the +second line says to insert the title in the |.toc| file itself (thus to be +displayed by the main table of contents). Notice that |hyperref| package will +then automatically create suitable anchor and one should \emph{not} use +explicitly \cs{phantomsection} here (it would let the anchor be located below +not above the title). + +With this set-up issuing \localtoc|*| will ignore the \csa{etocaftertitlehook} +hence not send the local toc title to the |.toc| file. This mimicks the +|memoir| class behavior, and can also be used with it. For more on |memoir| +class with \etoc, see \autoref{ssec:memoir}. + +There are further hook macros: +\csb{etocaftercontentshook}, \csb{etocbeforetitlehook} and +\csb{etocaftertochook} which are initially defined to do nothing and can be +used for some special effects. They are executed whether or not the table of +contents command was starred.% +% +\footnote{Hackers can test within these hooks if the context is starred or not + via an \cs{ifx}\cs{Etoc@aftertitlehook}\cs{@empty} conditional. Perhaps a + future release will provide \cs{etociftocisstarred} wrapper.} +\end{otherlanguage} \clearpage @@ -10483,6 +10473,9 @@ benutzen und der Effekt wird im nächsten Inhaltsverzeichnis durch den Kompatibilitätsmodus von \etoc sichtbar werden. \subsection{Kompatibilität mit der \texttt{memoir}-Klasse} +\label{ssec:memoir} +\label{etocmemoirtoctotocfmt} +\label{etocmemoirstyle} Die Release |1.07l| hat ebenfalls die Kompatibilität mit der |memoir|-Klasse verbessert: Seine |appendix|-Ebene kann mit \etoc gemacht werden. Es ist die @@ -10491,6 +10484,71 @@ Test für einige boolesche"=Ausdrücke sein, die aktiviert sein können via eine Instruktion an die |.toc|-Datei aufgenommen werden, wenn man zwei Arten von Unterteilungen unterscheidet. +\begin{otherlanguage}{english} + +The |memoir| mechanism relative to \toc versus \toc|*| is obeyed +automatically, and applies with \localtoc too. + +\end{otherlanguage} + +Eine ungewöhnliche Situation tritt auf, wenn man zwei aufeinanderfolgende +\csa{localtableofcontents} hat (offensichtlich ist das eine nicht sehr +wahrscheinliche Situation), direkt nach einem \csa{part} zum Beispiel. Der erste +würde dann eine Kapitelüberschrift erzeugen, welche in die |.toc|-Datei geschrieben werden +würde. Das zweite Inhaltsverzeichnis denkt dann, es ist ein lokales zu diesem +Kapitel gehörig und würde aus diesem Grund nichts darstellen. Die Lösung für +dieses Problem ist es, das zweite als Klon des ersten zu definieren. + +\begin{otherlanguage}{english} + +Actually, that \localtoc by default uses like \toc a chapter style is often +inconvenient. One can use the |memoir| macros to modify this: according to +|memoir| documentation, |\tocheadstart| and |\printtoctitle| seem to be the +most relevant. If you do that you will probably want the added line in |.toc| +file to use |{section}| not |{chapter}|. \etoc provides to this effect +\csb{etocmemoirtoctotocfmt}\marg{kind}\marg{name} whose first argument +\meta{kind} is |chapter|, |section|, |subsection|, etc... and the second +argument stands for the title and thus \csa{contentsname} is appropriate. Hence +\begin{verbatim} + \etocmemoirtoctotocfmt{section}{\contentsname} +\end{verbatim} +seems the natural choice in this context as an addition to the customizing the +|memoir| toc related macros to achieve a section like rendering (for more +details on the latter, please refer to |memoir| manual). + +A completely different approach, arguably simpler, is to overrule the \etoc +default under |memoir| (after the main document \toc which should still use a +chapter styling) via these simple +commands: +\begin{verbatim} + \etocarticlestyle % means to use \section*{\contentsname} (and marks) + \renewcommand{\etocaftertitlehook}{\addcontentsline{toc}{section}{\contentsname}} +\end{verbatim} +exactly as one would do with |book| class for example. Don't use any +|\phantomsection| in there, |hyperref| hyperlinks will work just fine (and the +anchor will be slightly above toc title, not below). + +Notice that prior to \etoc |1.09b|, the \csb{etocaftertitlehook} macro was +used by \etoc itself under the |memoir| class. Hence \localtoc obeyed the +|memoir| mechanism relative to starred or not starred, even after issuing +\csa{etocarticlestyle}, as long as the user did not redefine +\csb{etocaftertitlehook}. Starting with |1.09b| (which syncs with a |memoir| +change at |v3.7i|) it is needed in a case like here where the user issues +\csa{etocarticlestyle} to also configure explicitly the +\csa{etocaftertitlehook} to achieve the ``insert title in |.toc|'' effect (if +so wished), because \etoc uses another mechanism and does not pre-empt usage +of this user macro anymore. + +To recover the \etoc default under |memoir| class one can issue +\csa{etocmemoirstyle} and then +\csa{etocmemoirtoctotocfmt}|{chapter}{\contentsname}| (but attention that a +custom \csb{etocaftertitlehook} will still be obeyed; for info: it will get +executed before the \cs{cfttocbeforelisthook}). + +\end{otherlanguage} + + + \subsection{Kompatibilität mit \texttt{tocvsec2}} % la traduction allemande était déficiente semble-t-il, j'améliore un peu @@ -10661,7 +10719,15 @@ Dokumentation erzeugt von der Quelldatei mit dem Stempel \begin{multicols}{2} \begin{jfverbatim} -v1.09 [2019/03/09]^ +v1.09a, v1.09b [2019/11/17]^ + + Sync with memoir v3.7i which has a better location of the TOC + hyperref anchor. The \etocaftertitlehook can now freely be + used also with memoir class (formerly its usage in case of + memoir class was preempted by etoc itself). For more details + refer to the section "Compatibility with the memoir class". + +~v1.09 [2019/03/09]^ New features: \etoclocaltop, \localtableofcontentswithrelativedepth. Thanks to Tony Roberts for feature request. @@ -11110,11 +11176,11 @@ v1.09 [2019/03/09]^ \texttt{\parindent 0pt\rightskip 1cm minus 1cm This documentation has been compiled without inclusion of the source code. To produce the English documentation with source code included:\endgraf - \ \ \ \ run etex on etoc.dtx or etoc.ins to produce etoc.tex,\endgraf + \ \ \ \ run etex on etoc.dtx to produce etoc.tex,\endgraf \ \ \ \ then thrice pdflatex on etoc.tex.\endgraf \medskip To produce the German documentation with source code included, run etex on - etoc.dtx or etoc.ins to produce etoc-DE.tex, then edit etoc-DE.tex + etoc.dtx to produce etoc-DE.tex, then edit etoc-DE.tex to set \string\NoSourceCode\space to 0, and run pdflatex thrice on etoc-DE.tex.\endgraf }% \fi @@ -11126,12 +11192,12 @@ v1.09 [2019/03/09]^ % Um % die englische Dokumentation mit dem Quellcode zu produzieren, ist % einzubeziehen: \endgraf - % \ \ \ \ kompilieren etex mit etoc.dtx oder etoc.ins, um etoc.tex zu + % \ \ \ \ kompilieren etex mit etoc.dtx, um etoc.tex zu % produzieren, \endgraf % \ \ \ \ dann dreimal pdflatex mit etoc.tex.\endgraf \endgraf Um die deutsche Dokumentation mit Einbeziehung des Quellcodes zu erstellen, - ist zu kompilieren etex mit etoc.dtx oder etoc.ins, um etoc-DE.tex zu + ist zu kompilieren etex mit etoc.dtx, um etoc-DE.tex zu erzeugen, dann ist \string\NoSourceCode\space in etoc-DE.tex auf 0 zu setzen, dann ist pdflatex dreimal mit etoc-DE.tex laufen zu lassen.\endgraf % \medskip @@ -12628,10 +12694,14 @@ v1.09 [2019/03/09]^ % \end{macrocode} % |1.08i| removes definition of |\etoc@startlocaltoc| from here. It is done % in |\Etoc@localtableofcontents| or uses its default of |\@gobble|. +% +% |1.09b| uses a |\def| in non-starred variant for allowing tricks to +% recognize later on if we are in a starred or non-starred case, whatever the +% user definition of \cs{etocaftertitlehook} may be. % \begin{macrocode} \@ifstar - {\def\Etoc@aftertitlehook{}\Etoc@table@fcontents} - {\let\Etoc@aftertitlehook\etocaftertitlehook\Etoc@table@fcontents}% + {\let\Etoc@aftertitlehook\@empty\Etoc@table@fcontents} + {\def\Etoc@aftertitlehook{\etocaftertitlehook}\Etoc@table@fcontents}% }% \etoctableofcontents \let\tableofcontents\etoctableofcontents \newcommand*\localtableofcontents{% @@ -12641,8 +12711,8 @@ v1.09 [2019/03/09]^ \let\tof@begingroup\@empty \let\tof@endgroup \@empty \@ifstar - {\def\Etoc@aftertitlehook{}\Etoc@localtable@fcontents} - {\let\Etoc@aftertitlehook\etocaftertitlehook\Etoc@localtable@fcontents}% + {\let\Etoc@aftertitlehook\@empty\Etoc@localtable@fcontents} + {\def\Etoc@aftertitlehook{\etocaftertitlehook}\Etoc@localtable@fcontents}% }% \localtableofcontents % \end{macrocode} % |1.09| adds \localtocwrdp. The motivation is that it is impossible to set @@ -13272,19 +13342,44 @@ v1.09 [2019/03/09]^ {\if@restonecol \twocolumn \fi}} \let\etocreportstyle\etocbookstyle \let\etocreportstylenomarks\etocbookstylenomarks +% \end{macrocode} +% |v3.7i| of memoir has moved the \cs{phantomsection} to a better location, +% before typesetting the title and we follow suit at |1.09a|, and less rashly +% at |1.09b|. Formerly \etoc used \cs{etocaftertitlehook} to mimick the +% memoir code but as its name indicate, it is supposedly executed after the +% title... and this also had the defect of making \cs{etocaftertitlehook} not +% anymore a user command. Thus we here use some refactoring of the +% \cs{Etoc@aftertitlehook} internal mechanism to help recognize if we are +% in the starred case or not. +% +% \cs{phantomsection} is always defined by memoir, empty if hyperref absent. +% \begin{macrocode} \def\etocmemoirtoctotocfmt #1#2{% \def\Etoc@addsuitablecontentsline{\addcontentsline {toc}{#1}{#2}}% - \renewcommand*\etocaftertitlehook{% - \ifmem@em@starred@listof - \else - \phantomsection - \aftergroup\Etoc@addsuitablecontentsline - \fi}% } \def\etocmemoirstyle{% \etocsettocstyle - {\ensureonecol \par \begingroup \@nameuse {@tocmaketitle} - \Etoc@aftertitlehook\let\Etoc@aftertitlehook\relax + {\ensureonecol \par \begingroup \phantomsection + \ifx\Etoc@aftertitlehook\@empty + \else + % non-starred variant + \ifmem@em@starred@listof + \else + \Etoc@addsuitablecontentsline + \fi + \fi + \@nameuse {@tocmaketitle} %<< space token here from memoir code + \ifx\Etoc@aftertitlehook\@empty + \else +% \end{macrocode} +% Execute etoc hook before the \cs{cfttocbeforelisthook} and keep distinction +% between starred and non-starred contexts for other hooks. Notice that the +% memoir class way of implementing \cs{tableofcontents} leaves no way for code +% executed by the TOC code to know if it is executed in starred or non-starred +% context. +% \begin{macrocode} + \Etoc@aftertitlehook \let \Etoc@aftertitlehook \relax + \fi \parskip \cftparskip \@nameuse {cfttocbeforelisthook}} {\@nameuse {cfttocafterlisthook}\endgroup\restorefromonecol}} % \end{macrocode} @@ -13677,7 +13772,7 @@ v1.09 [2019/03/09]^ Grave accent \` Left brace \{ Vertical bar \| Right brace \} Tilde \~} -\CheckSum{3497}% +\CheckSum{3506}% \csname check@checksum\endcsname \Finale diff --git a/macros/latex/contrib/etoc/etoc.pdf b/macros/latex/contrib/etoc/etoc.pdf Binary files differindex 1b43c65c89..111b8b2b7e 100644 --- a/macros/latex/contrib/etoc/etoc.pdf +++ b/macros/latex/contrib/etoc/etoc.pdf diff --git a/macros/latex/contrib/pkuthss/README b/macros/latex/contrib/pkuthss/README.txt index 4f7e832a45..424793e9b8 100644 --- a/macros/latex/contrib/pkuthss/README +++ b/macros/latex/contrib/pkuthss/README.txt @@ -13,6 +13,6 @@ Licence: This package provides a simple, clear and flexible LaTeX template for dissertations in Peking University. -This file (README) is *NOT* intended as the documentation for this +This file (`README.txt') is *NOT* intended as the documentation for this package; please see the file `pkuthss.pdf' instead. diff --git a/macros/latex/contrib/pkuthss/doc/example.pdf b/macros/latex/contrib/pkuthss/doc/example.pdf Binary files differindex f4e66e5d31..b996c5d1b9 100644 --- a/macros/latex/contrib/pkuthss/doc/example.pdf +++ b/macros/latex/contrib/pkuthss/doc/example.pdf diff --git a/macros/latex/contrib/pkuthss/doc/pkuthss.pdf b/macros/latex/contrib/pkuthss/doc/pkuthss.pdf Binary files differindex e862048119..97a7442140 100644 --- a/macros/latex/contrib/pkuthss/doc/pkuthss.pdf +++ b/macros/latex/contrib/pkuthss/doc/pkuthss.pdf diff --git a/macros/latex/contrib/pkuthss/doc/readme/ChangeLog.txt b/macros/latex/contrib/pkuthss/doc/readme/ChangeLog.txt index 57eac504ca..820daecd54 100644 --- a/macros/latex/contrib/pkuthss/doc/readme/ChangeLog.txt +++ b/macros/latex/contrib/pkuthss/doc/readme/ChangeLog.txt @@ -1,3 +1,10 @@ +2019-11-17, v1.8.2 + + * Misc: + - CTAN now also wants README in the TDS archive. + - `README' -> `README.txt' do avoid collision with the `readme' directory. + - Fix ignored `\docversion' update. + 2019-11-15, v1.8.1 * Changes to example template: diff --git a/macros/latex/contrib/pkuthss/doc/readme/pkuthss.tex b/macros/latex/contrib/pkuthss/doc/readme/pkuthss.tex index 70989bac57..2e8b081f48 100644 --- a/macros/latex/contrib/pkuthss/doc/readme/pkuthss.tex +++ b/macros/latex/contrib/pkuthss/doc/readme/pkuthss.tex @@ -49,7 +49,7 @@ tabsize = 4, formatcom = {\ifXeTeX\xeCJKVerbAddon\fi} } -\newcommand*{\docversion}{v1.8.0} +\newcommand*{\docversion}{v1.8.2} \pkuthssinfo{ cthesisname = {本科生毕业论文}, ethesisname = {Undergraduate Thesis}, ctitle = {北京大学学位论文模版\\pkuthss \docversion}, diff --git a/macros/latex/contrib/pkuthss/tex/pkulogo.pdf b/macros/latex/contrib/pkuthss/tex/pkulogo.pdf Binary files differindex 629fab21e0..0d70935c6a 100644 --- a/macros/latex/contrib/pkuthss/tex/pkulogo.pdf +++ b/macros/latex/contrib/pkuthss/tex/pkulogo.pdf diff --git a/macros/latex/contrib/pkuthss/tex/pkuthss-gbk.def b/macros/latex/contrib/pkuthss/tex/pkuthss-gbk.def index 8ebb0f6ea2..02e885da95 100644 --- a/macros/latex/contrib/pkuthss/tex/pkuthss-gbk.def +++ b/macros/latex/contrib/pkuthss/tex/pkuthss-gbk.def @@ -22,7 +22,7 @@ % pkuword.eps \ProvidesFile{pkuthss-gbk.def} - [2019/11/15 v1.8.1 Labels and captions in GBK encoding + [2019/11/17 v1.8.2 Labels and captions in GBK encoding for the pkuthss document class] \def\label@ctitle{Ŀ} diff --git a/macros/latex/contrib/pkuthss/tex/pkuthss-utf8.def b/macros/latex/contrib/pkuthss/tex/pkuthss-utf8.def index 64cbcf129b..9bc6000ac1 100644 --- a/macros/latex/contrib/pkuthss/tex/pkuthss-utf8.def +++ b/macros/latex/contrib/pkuthss/tex/pkuthss-utf8.def @@ -22,7 +22,7 @@ % pkuword.eps \ProvidesFile{pkuthss-utf8.def} - [2019/11/15 v1.8.1 Labels and captions in UTF-8 encoding + [2019/11/17 v1.8.2 Labels and captions in UTF-8 encoding for the pkuthss document class] \def\label@ctitle{题目:} diff --git a/macros/latex/contrib/pkuthss/tex/pkuthss.cls b/macros/latex/contrib/pkuthss/tex/pkuthss.cls index 0e0c766eec..7f75114da4 100644 --- a/macros/latex/contrib/pkuthss/tex/pkuthss.cls +++ b/macros/latex/contrib/pkuthss/tex/pkuthss.cls @@ -23,7 +23,7 @@ \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesClass{pkuthss} - [2019/11/15 v1.8.1 Peking University dissertation document class] + [2019/11/17 v1.8.2 Peking University dissertation document class] % eg. `\thss@int@boolopt{spacing}{true}' will expand to: % \newif\ifthss@opt@spacing \thss@opt@spacingtrue diff --git a/macros/latex/contrib/pkuthss/tex/pkuword.pdf b/macros/latex/contrib/pkuthss/tex/pkuword.pdf Binary files differindex e38fdcef3e..762067f759 100644 --- a/macros/latex/contrib/pkuthss/tex/pkuword.pdf +++ b/macros/latex/contrib/pkuthss/tex/pkuword.pdf diff --git a/macros/latex/contrib/scontents/README.md b/macros/latex/contrib/scontents/README.md index bd42d3ab4f..9cb1056924 100644 --- a/macros/latex/contrib/scontents/README.md +++ b/macros/latex/contrib/scontents/README.md @@ -1,13 +1,13 @@ ## scontents — Stores LaTeX contents in memory or files -- Version: 1.7 -- Date: 2019-10-29 +- Version: 1.8 +- Date: 2019-11-18 - Author: Pablo González ## Description -The `scontents` package stores valid `LaTeX` code in memory (sequences) using the -`l3seq` module of `expl3`. The stored content, including `verbatim` material, can be -used as many times as desired in the document, additionally can be written -to external files. +This package allows to store `LaTeX` code, including _"verbatim"_, in <code><sequences></code> +using the `l3seq` module of `expl3`. The <code><stored content></code> can be used +as many times as desired in the document, additionally you can write to <code><external files></code> +or show it in <code><verbatim style></code>. ## Requirements The package loads and depends on updated versions of: @@ -35,8 +35,13 @@ the files to appropriate locations: then run `mktexlsr`. ## Examples -The file `scontents.pdf` contains attached examples, which can be extracted -from the PDF viewer or using `pdfdetach -saveall scontents.pdf` from command line. +The file <code><scontents.pdf></code> contains attached examples, which can be extracted +from the PDF viewer or from the command line by running: + +``` +$ pdfdetach -saveall scontents.pdf +``` +and then you can use the excellent `arara` tool to compile them. ## License The scontents package may be modified and distributed under the terms and diff --git a/macros/latex/contrib/scontents/scontents.dtx b/macros/latex/contrib/scontents/scontents.dtx index c2316fb999..3f362eea95 100644 --- a/macros/latex/contrib/scontents/scontents.dtx +++ b/macros/latex/contrib/scontents/scontents.dtx @@ -31,10 +31,10 @@ % and later we will copy the write stream opened by imakeidx into \@indexfile % so that entries written to both streams end up in the same file. \usepackage[english]{babel} -\usepackage[top=0.5in,bottom=0.5in,left=2in,right=0.7in,footskip=0.2in,headsep=10pt]{geometry} +\usepackage[top=0.5in,bottom=0.3in,left=2in,right=0.7in,footskip=0.2in,headheight=1cm,headsep=0.27cm]{geometry} \usepackage[osf,mono=false,scale=0.95,llscaled=0.95]{libertine} \setmonofont[ - Ligatures = TeX, + %Ligatures = TeX, Numbers = OldStyle, Scale = 0.80, UprightFont = *-Regular, @@ -42,11 +42,15 @@ BoldFont = *-Semibold, BoldItalicFont = *-SemiboldIt, RawFeature = {+zero,+ss06}, - FontFace = {m}{sc}{*-ExtraLight}, + FontFace = {m}{sc}{LinBiolinum_R.otf}, Extension = .otf]{SourceCodePro} -\newfontfamily\sourcecodeprolight{SourceCodePro-Regular.otf}[Scale = 0.80,FakeStretch =0.75] +\newfontfamily\sourcecodeprolight{SourceCodePro-Regular.otf}[ + Scale = 0.80,FakeStretch =0.75, + FontFace = {m}{it}{Font =SourceCodePro-RegularIt.otf,Color=FF0000}] \RenewDocumentCommand{\MacroLongFont}{} - { \sourcecodeprolight\small } + { + \sourcecodeprolight\small + } % The character of visible space is now taken from Latin Modern Mono % to prevent fonts in T1. The original definition for xetex/luatex is % \def\verbvisiblespace{\usefont{OT1}{cmtt}{m}{n}\asciispace} @@ -64,11 +68,6 @@ \setmathfont[Scale = 0.95]{latinmodern-math.otf} \usepackage{fontawesome5} -\newfontfamily\lmmitalic{lmmono10-italic.otf}[ - Scale = 0.95,% - Extension = .otf,% - ItalicFont = lmmono10-italic,% - ] \newfontfamily\fetamontotf{ffmw10.otf}[ Scale = 0.95,% RawFeature = {+latn,+rand,+kern,+size},% @@ -76,10 +75,11 @@ ] \usepackage[svgnames]{xcolor} \usepackage[sf,bf,compact,medium,pagestyles]{titlesec} -\usepackage{hyperxmp,lastpage,imakeidx,microtype,attachfile2} +\usepackage{lastpage,imakeidx,microtype,attachfile2} \usepackage{adjustbox,multicol,listings,accsupp,titletoc} \usepackage{scontents} % main \usepackage[contents]{colordoc} +% \show\docCodelineNo \def\textnew#1{\color{color-def}#1\/} \def\AltMacroFont{\fontencoding\encodingdefault \fontfamily\ttdefault @@ -104,6 +104,15 @@ |catcode`| 12|gdef|sxmacro@code#1% \end{macrocode*}[|liii@xmacro@code[#1]|end[macrocode*]] |endgroup +% Other patch for colordoc.sty to work xelatex +\makeatletter +\def\@moddecr#1{% + \global\advance#1\m@ne + \reset@color + \ifnum#1>\z@\else + \global#1\@colorlevels\fi} +\makeatother + \EnableCrossrefs % \PageIndex % \CodelineIndex undoes what \PageIndex does % \CodelineIndex tries to open another write stream for the index file. We don't @@ -117,9 +126,19 @@ \expandafter\DoNotIndex\expandafter{\string\}} \expandafter\DoNotIndex\expandafter{\string\begin} \newcommand{\HP}[1]{\emph{\hyperpage{#1}}\normalsize} -\def\MYSortIndex#1#2{\index[userdoc]{#1\actualchar#2|HP}} +\ExplSyntaxOn +\cs_new_protected:Npn \StartImplementation + { \bool_set_true:N \l__codedoc_in_implementation_bool } +\bool_set_false:N \l__codedoc_in_implementation_bool +\cs_new_protected:Npn \MYSortIndex #1 #2 + { + \bool_if:NTF \l__codedoc_in_implementation_bool + { \index{#1\actualchar#2|HP} } + { \index[userdoc]{#1\actualchar#2|HP} } + } +\ExplSyntaxOff -\indexsetup{level=\section,firstpagestyle=myheader} +\indexsetup{level=\section,firstpagestyle=myheader,othercode=\pagestyle{myheader}} \makeindex[name=userdoc,options=-s gind.ist,columnsep=15pt,title={Index of Documentation}] \makeindex[options=-s gind.ist,columnsep=15pt,title={Index of Implementation}] % Now, after imakeidx opens the write stream for the index file, we copy @@ -130,104 +149,108 @@ \setlength{\parindent}{0pt} -%%-------------------- ONLY FOR DOCUMENTATION ------------------------%% -% Colors for options +% Colors \definecolor{optcolor}{rgb}{0.281,0.275,0.485} -\definecolor{mypkgcolor}{RGB}{0,128,128}% +\definecolor{pkgcolor}{rgb}{0,0.5,0.5} +\definecolor{araracolor}{rgb}{0, 0.72, 0.28} +\definecolor{linkcolor}{rgb}{0.04,0.38,0.04} +\definecolor{rulecolor}{rgb}{0.96,0.96,0.96} -% Logo with fetamont font for title -\makeatletter -\newsavebox{\logobox} -\savebox{\logobox}{% - \normalsize\fetamontotf{\textcolor{mypkgcolor}{s}\textcolor{OrangeRed}{content}\textcolor{mypkgcolor}{s}}} -\newcommand{\mylogo}{% - \settoheight{\@tempdima}{L}% - \resizebox{!}{\@tempdima}{\usebox{\logobox}}% - } -\makeatother +% Only for arara... I like arara :) +\usepackage[scale=0.85]{comfortaa} +\newcommand{\araratext}[1]{{\small\normalfont\comfortaa\color{araracolor}\bfseries#1}} +\newcommand*\arara{\araratext{ar\kern-.03emar\kern-.03ema}} -% Custom \meta[...]{...}, \marg[...]{...} and \oarg[...]{...} with color -\ExplSyntaxOn % User level commands +\ExplSyntaxOn +% Logo with fetamont font +\NewDocumentCommand{\pkglogo}{} + { + \group_begin: + \fetamontotf{\textcolor{pkgcolor}{s}\textcolor{OrangeRed}{content}\textcolor{pkgcolor}{s}} + \group_end: + } + +% Custom \meta[...]{...}, \marg[...]{...} and \oarg[...]{...} with color \NewDocumentCommand{\mymeta}{O{}m} { - \userdoc_meta_generic:Nnn \userdoc_meta:n { #1 } { #2 } + \userdoc_meta_generic:Nnn \userdoc_meta:n { #1 } { #2 } } \NewDocumentCommand{\mymarg}{O{}m} { - \userdoc_meta_generic:Nnn \userdoc_marg:n { #1 } { #2 } + \userdoc_meta_generic:Nnn \userdoc_marg:n { #1 } { #2 } } \NewDocumentCommand{\myoarg}{O{}m} { - \userdoc_meta_generic:Nnn \userdoc_oarg:n { #1 } { #2 } + \userdoc_meta_generic:Nnn \userdoc_oarg:n { #1 } { #2 } } % Variables and keys \tl_new:N \l_userdoc_meta_font_tl \keys_define:nn { userdoc / mymeta } { - type .choice:, - type / tt .code:n = \tl_set:Nn \l_userdoc_meta_font_tl { \ttfamily }, - type / rm .code:n = \tl_set:Nn \l_userdoc_meta_font_tl { \rmfamily }, - type .initial:n = rm, - cf .tl_set:N = \l_userdoc_meta_color_tl, - cf .initial:n = optcolor, - ac .tl_set:N = \l_userdoc_meta_anglecolor_tl, - ac .initial:n = lightgray, - sbc .tl_set:N = \l_userdoc_meta_brackcolor_tl, - sbc .initial:n = gray, - cbc .tl_set:N = \l_userdoc_meta_bracecolor_tl, - cbc .initial:n = gray, + type .choice:, + type / tt .code:n = \tl_set:Nn \l_userdoc_meta_font_tl { \ttfamily }, + type / rm .code:n = \tl_set:Nn \l_userdoc_meta_font_tl { \rmfamily }, + type .initial:n = rm, + cf .tl_set:N = \l_userdoc_meta_color_tl, + cf .initial:n = optcolor, + ac .tl_set:N = \l_userdoc_meta_anglecolor_tl, + ac .initial:n = lightgray, + sbc .tl_set:N = \l_userdoc_meta_brackcolor_tl, + sbc .initial:n = gray, + cbc .tl_set:N = \l_userdoc_meta_bracecolor_tl, + cbc .initial:n = gray, } % Internal commands \cs_new_protected:Npn \userdoc_meta_generic:Nnn #1 #2 #3 { - \group_begin: - \keys_set:nn { userdoc / mymeta } { #2 } - \color{ \l_userdoc_meta_color_tl } - \l_userdoc_meta_font_tl - #1 { #3 } % #1 is \userdoc_meta:n, \userdoc_marg:n or \userdoc_oarg:n - \group_end: + \group_begin: + \keys_set:nn { userdoc / mymeta } { #2 } + \color{ \l_userdoc_meta_color_tl } + \l_userdoc_meta_font_tl + #1 { #3 } % #1 is \userdoc_meta:n, \userdoc_marg:n or \userdoc_oarg:n + \group_end: } \cs_new_protected:Npn \userdoc_meta:n #1 { - \userdoc_meta_angle:n { \textlangle } - \userdoc_meta_meta:n { #1 } - \userdoc_meta_angle:n { \textrangle } + \userdoc_meta_angle:n { \textlangle } + \userdoc_meta_meta:n { #1 } + \userdoc_meta_angle:n { \textrangle } } \cs_new_protected:Npn \userdoc_marg:n #1 { - \userdoc_meta_brace:n { \textbraceleft } - \userdoc_meta:n { #1 } - \userdoc_meta_brace:n { \textbraceright } + \userdoc_meta_brace:n { \textbraceleft } + \userdoc_meta:n { #1 } + \userdoc_meta_brace:n { \textbraceright } } \cs_new_protected:Npn \userdoc_oarg:n #1 { - \userdoc_meta_brack:n { [ } - \userdoc_meta:n { #1 } - \userdoc_meta_brack:n { ] } + \userdoc_meta_brack:n { [ } + \userdoc_meta:n { #1 } + \userdoc_meta_brack:n { ] } } \cs_new_protected:Npn \userdoc_meta_meta:n #1 { - \textnormal{\textit{#1}} + \textnormal{\textit{#1}} } \cs_new_protected:Npn \userdoc_meta_angle:n #1 { - \group_begin: - \fontfamily{lmr}\selectfont - \textcolor{\l_userdoc_meta_anglecolor_tl}{#1} - \group_end: + \group_begin: + \fontfamily{lmr}\selectfont + \textcolor{\l_userdoc_meta_anglecolor_tl}{#1} + \group_end: } \cs_new_protected:Npn \userdoc_meta_brace:n #1 { - \group_begin: - \color{\l_userdoc_meta_bracecolor_tl} + \group_begin: + \color{\l_userdoc_meta_bracecolor_tl} #1 - \group_end: + \group_end: } \cs_new_protected:Npn \userdoc_meta_brack:n #1 { - \textcolor{\l_userdoc_meta_brackcolor_tl}{#1} + \textcolor{\l_userdoc_meta_brackcolor_tl}{#1} } % \envexamp{m} \newsavebox{\boxexaenv} @@ -236,10 +259,10 @@ \begin{lrbox}{\boxexaenv}% \begin{minipage}[t]{\marginparwidth}% \raggedright\ttfamily\small - \textcolor{gray}{\textbackslash begin\{\textcolor{mypkgcolor}{{#1}}\}\myoarg + \textcolor{gray}{\textbackslash begin\{\textcolor{pkgcolor}{{#1}}\}\myoarg [type=tt,sbc=gray,ac=lightgray,cf=optcolor]{keyval ~ list}}\par% \hspace{0.5cm}\mymeta[type=tt,ac=lightgray,cf=gray]{env ~ contents}\par% - \textcolor{gray}{\textbackslash end\{{\textcolor{mypkgcolor}{{#1}}}\}}\par + \textcolor{gray}{\textbackslash end\{{\textcolor{pkgcolor}{{#1}}}\}}\par \end{minipage}% \end{lrbox}% \usebox{\boxexaenv} @@ -249,10 +272,10 @@ \begin{lrbox}{\boxexaenv}% \begin{minipage}[t]{\marginparwidth}% \raggedright\ttfamily\small - \textcolor{mypkgcolor}{{\textbackslash#1#2}}\myoarg + \textcolor{pkgcolor}{{\textbackslash#1#2}}\myoarg [type=tt,sbc=gray,ac=lightgray,cf=optcolor]{keyval ~ list}\par% \hspace{0.5cm}\mymeta[type=tt,ac=lightgray,cf=gray]{env ~ contents}\par% - \textcolor{mypkgcolor}{{\textbackslash #3#2}}\par + \textcolor{pkgcolor}{{\textbackslash #3#2}}\par \end{minipage}% \end{lrbox}% \usebox{\boxexaenv} @@ -261,22 +284,20 @@ % \cmdexamp{s m o m o} \DeclareDocumentCommand{\cmdexamp}{o m o m o} { - \group_begin: - \small\ttfamily - \textcolor{mypkgcolor}{\textbackslash#2} - \IfValueT{#1}{ \textcolor{MediumOrchid}{#1} } - \IfValueT{#3}{ \myoarg[type=tt,sbc=gray,ac=lightgray,cf=optcolor]{#3} } - \IfValueTF{#5} - { - \mymeta[ac=gray,type=tt,cf=MediumOrchid]{#5}% - \mymeta[type=tt,ac=gray,cf=optcolor]{#4} - \mymeta[ac=gray,type=tt,cf=MediumOrchid]{#5}% - } - { \mymarg[type=tt,cbc=gray,ac=lightgray,cf=optcolor]{#4} } - \par - \group_end: - \MYSortIndex{Commands}{Commands ~ provide ~ by ~ - {\fetamontotf{\textcolor{mypkgcolor}{s}\textcolor{OrangeRed}{content}\textcolor{mypkgcolor}{s}}}:}% + \group_begin: + \small\ttfamily + \textcolor{pkgcolor}{\textbackslash#2} + \IfValueT{#1}{ \textcolor{MediumOrchid}{#1} } + \IfValueT{#3}{ \myoarg[type=tt,sbc=gray,ac=lightgray,cf=optcolor]{#3} } + \IfValueTF{#5} + { + \mymeta[ac=gray,type=tt,cf=MediumOrchid]{#5}% + \mymeta[type=tt,ac=gray,cf=optcolor]{#4} + \mymeta[ac=gray,type=tt,cf=MediumOrchid]{#5}% + } + { \mymarg[type=tt,cbc=gray,ac=lightgray,cf=optcolor]{#4} } + \par + \group_end: } % \keyexamp{mmm} @@ -286,19 +307,25 @@ \adjustbox{outer=-\marginparsep}{\textcolor{black}{\small\ttfamily{#1}}} \textcolor{gray}{\,\bfseries\texttt{=}}\,{} \mymarg[type=tt,cbc=gray,ac=lightgray,cf=optcolor]{\small{#2}} - \hfill\textcolor{gray}{ \small (\textsf{default}:~\emph{#3})} + \hfill\textcolor{gray}{\small\textsf{default}:~\emph{#3}} \par \MYSortIndex{Keys}{Keys>\texttt{#1}}% } +% \mykey{m} +\DeclareDocumentCommand{\mykey}{ m } + { + \textcolor{optcolor}{\texttt{#1}} + \MYSortIndex{Keys}{Keys>\texttt{#1}}% + } + % \mypkg{sm} \NewDocumentCommand{\mypkg}{sm} { \group_begin: \IfBooleanTF{#1} { - %\textsf{\textcolor{mypkgcolor}{s}\textcolor{OrangeRed}{content}\textcolor{mypkgcolor}{s}} - \fetamontotf{\textcolor{mypkgcolor}{s}\textcolor{OrangeRed}{content}\textcolor{mypkgcolor}{s}} + \pkglogo \MYSortIndex{packages}{Packages>\texttt{#2}} } { @@ -313,13 +340,12 @@ { \IfBooleanTF{#1} { - \textcolor{mypkgcolor}{\ttfamily{#2}}% - \MYSortIndex{environment}{ Environment ~ provide ~ by ~ - {\fetamontotf{\textcolor{mypkgcolor}{s}\textcolor{OrangeRed}{content}\textcolor{mypkgcolor}{s}}}:>\texttt{#2}} + \textcolor{pkgcolor}{\ttfamily{#2}}% + \MYSortIndex{environment}{ Environment ~ provide ~ by ~\pkglogo :>\texttt{#2}} } { - \textcolor{darkgray}{\ttfamily{#2}}% - \MYSortIndex{environment}{Environments>\texttt{#2}} + \textcolor{darkgray}{\ttfamily{#2}}% + \MYSortIndex{environment}{Environments>\texttt{#2}} } } @@ -330,12 +356,8 @@ { \tl_set:Nn \l_tmpa_tl { #2 } \regex_replace_once:nnN { (\*) } { \c{textcolor}\cB\{MediumOrchid\cE\}\cB\{\1\cE\} } \l_tmpa_tl - \textcolor{mypkgcolor}{\ttfamily\textbackslash{\tl_use:N \l_tmpa_tl}} - \MYSortIndex{Commands}{ Commands ~ provide ~ by ~ - { - \fetamontotf{ - \textcolor{mypkgcolor}{s}\textcolor{OrangeRed}{content}\textcolor{mypkgcolor}{s}} - }:>\texttt{\textbackslash#2}} + \textcolor{pkgcolor}{\ttfamily\textbackslash{\tl_use:N \l_tmpa_tl}} + \MYSortIndex{Commands}{ Commands ~ provide ~ by ~ \pkglogo :>\texttt{\textbackslash#2}} } { \textcolor{darkgray}{\ttfamily\textbackslash{#2}} @@ -363,10 +385,9 @@ \lstnewenvironment{verbatimsc} { \lstset{ - language=,% - basicstyle= \ttfamily, - columns = fullflexible, - gobble = 2,% + language =,% + basicstyle = \ttfamily\small, + gobble = 2,% } }{} \makeatother @@ -376,100 +397,100 @@ % Create a language for documentation \lstdefinelanguage{scontents-doc}{ - texcsstyle=*,% - escapechar=`,% - extendedchars=true,% - breakatwhitespace=true,% - breaklines=true,% - keepspaces=true,% - columns=fullflexible,% - stringstyle= {\color{red}},% - basicstyle=\ttfamily\small,% - alsoletter={-,@,.},% + texcsstyle = *,% + escapechar = Ç,% + extendedchars = true,% + keepspaces = true,% + stringstyle = {\color{red}},% + basicstyle = \ttfamily\small,% + alsoletter = {-,@,.},% % comments - morecomment=[l]{\%},% - commentstyle=\lmmitalic\small\itshape\color{lightgray},% + morecomment = [l]{\%},% + commentstyle = \ttfamily\small\color{lightgray},% % Important words 1 - keywordstyle=[1]{\color{gray}},% - keywords=[1]{begin,end,Verbatim},% + keywordstyle = [1]{\color{gray}},% + keywords = [1]{begin,end,Verbatim,env,myseq,false},% % Other words 2 - keywordstyle=[2]{\color{blue!75}},% - keywords=[2]{usepackage,section,documentclass,input,usemodule, - subsection,ExplSyntaxOff,ExplSyntaxOn,RequirePackage, - ProvidesExplPackage},% + keywordstyle = [2]{\color{blue!75}},% + keywords = [2]{usepackage,section,documentclass,input,usemodule, + subsection,ExplSyntaxOff,ExplSyntaxOn,RequirePackage, + ProvidesExplPackage},% % Other words 3 - keywordstyle=[3]{\color{optcolor!85}},% - keywords=[3]{document,article,setlength,pagestyle,definecolor},% + keywordstyle = [3]{\color{optcolor!85}},% + keywords = [3]{document,article,setlength,pagestyle,definecolor},% % Reserved words 4 (scontents pkg) - keywordstyle=[4]{\color{mypkgcolor}},% - keywords=[4]{scontents,Scontents,getstored,typestored,verbatimsc,% - endverbatimsc,countsc,meaningsc,foreachsc,macros - endscontents,startscontents,stopscontents,scontents.tex},% -% Reserved in red - keywordstyle=[5]{\color{red}},% - keywords=[5]{makeatletter,makeatother,let,verb,@undefined,makebox,def,% - par,item,parindent,lstinline,@ifpackagelater,ver@xparse.sty,% - dospecials,do@noligs,char,outer},% -% Reserved in orange - keywordstyle=[6]{\color{optcolor}},% - keywords=[6]{store-cmd,store-env,print-env,print-cmd,write-env,% - start,stopt,wrapper,sep,step,before,after,write-out,% - width-tab,force-eol,inner,outer,I,J,M,L,Ascheol},% -% Reserved in orange - keywordstyle=[7]{\color{OrangeRed}},% - keywords=[7]{DefineVerbatimEnvironment,lstnewenvironment,newminted,% - newtheorem,newenvironment,VerbatimEnvironment},% + keywordstyle = [4]{\color{pkgcolor}},% + keywords = [4]{scontents,Scontents,getstored,typestored,verbatimsc,% + endverbatimsc,countsc,meaningsc,foreachsc,macros,newenvsc, + endscontents,startscontents,stopscontents,scontents.tex},% +% Reserved words 5 (in red) + keywordstyle = [5]{\color{red}},% + keywords = [5]{makeatletter,makeatother,let,verb,@undefined,makebox,def,% + par,item,parindent,lstinline,@ifpackagelater,ver@xparse.sty,% + ver@scontents.sty,dospecials,do@noligs,char,outer,jobname,inner},% +% Reserved words 6 (optcolor) + keywordstyle = [6]{\color{optcolor}},% + keywords = [6]{store-cmd,store-env,print-env,print-cmd,write-env,% + start,stopt,wrapper,sep,step,before,after,write-out,% + overwrite,width-tab,force-eol,inner,outer,I,J,M,L,Ascheol},% +% Reserved words 7 (OrangeRed) + keywordstyle = [7]{\color{OrangeRed}},% + keywords = [7]{DefineVerbatimEnvironment,lstnewenvironment,newminted,% + newtheorem,newenvironment,VerbatimEnvironment,myenvstore},% % literate - literate=*{\{}{{{\color{gray}{\char`\{}}}}{1} - {\}}{{{\color{gray}{\char`\}}}}}{1} - {\|}{{{\color{gray}{\char`\|}}}}{1} - {\$}{{{\color{gray}{\char`\$}}}}{1} - {\#}{{{\color{optcolor}{\char`\#}}}}{1} - {[}{{\textcolor{gray}{[}}}{1} - {]}{{\textcolor{gray}{]}}}{1} - {,}{{\textcolor{gray}{,}}}{1} - {;}{{\textcolor{gray}{;}}}{1} - {\&}{{\textcolor{gray}{\&}}}{1} - {>}{{\textcolor{OrangeRed}{\guillemotright}}}{1} - {*}{{\textcolor{MediumOrchid}{*}}}{1} - %{@}{{\textcolor{red}{@}}}{1} - {\^}{{\textcolor{optcolor}{\textasciicircum}}}{1} - {0}{{\textcolor{MediumOrchid}{0}}}{1} - {1}{{\textcolor{MediumOrchid}{1}}}{1} - {2}{{\textcolor{MediumOrchid}{2}}}{1} - %{3}{{\textcolor{MediumOrchid}{3}}}{1}% expl3 - {4}{{\textcolor{MediumOrchid}{4}}}{1} - {5}{{\textcolor{MediumOrchid}{5}}}{1} - {6}{{\textcolor{MediumOrchid}{6}}}{1} - {7}{{\textcolor{MediumOrchid}{7}}}{1} - {8}{{\textcolor{MediumOrchid}{8}}}{1} - {9}{{\textcolor{MediumOrchid}{9}}}{1} - {.0}{{\textcolor{MediumOrchid}{.0}}}{2}% Following is to ensure that only periods - {.1}{{\textcolor{MediumOrchid}{.1}}}{2}% followed by a digit are changed. - {.2}{{\textcolor{MediumOrchid}{.2}}}{2} - {.3}{{\textcolor{MediumOrchid}{.3}}}{2} - {.4}{{\textcolor{MediumOrchid}{.4}}}{2} - {.5}{{\textcolor{MediumOrchid}{.5}}}{2} - {.6}{{\textcolor{MediumOrchid}{.6}}}{2} - {.7}{{\textcolor{MediumOrchid}{.7}}}{2} - {.8}{{\textcolor{MediumOrchid}{.8}}}{2} - {.9}{{\textcolor{MediumOrchid}{.9}}}{2} - {=}{{\textcolor{gray}{=}}}{1},% + literate =*{\{}{{{\color{gray}{\char`\{}}}}{1} + {\}}{{{\color{gray}{\char`\}}}}}{1} + {\|}{{{\color{gray}{\char`\|}}}}{1} + {\$}{{{\color{gray}{\char`\$}}}}{1} + {\#}{{{\color{optcolor}{\char`\#}}}}{1} + {[}{{\textcolor{gray}{[}}}{1} + {]}{{\textcolor{gray}{]}}}{1} + {,}{{\textcolor{gray}{,}}}{1} + {;}{{\textcolor{gray}{;}}}{1} + {`}{{\textcolor{gray}{\textasciigrave}}}{1} + {\&}{{\textcolor{gray}{\&}}}{1} + {>}{{\textcolor{OrangeRed}{\guillemotright}}}{1} + {<}{{\textcolor{OrangeRed}{\guillemotleft}}}{1} + {*}{{\textcolor{MediumOrchid}{*}}}{1} + {\^}{{\textcolor{optcolor}{\textasciicircum}}}{1} + {0}{{\textcolor{MediumOrchid}{0}}}{1} + {1}{{\textcolor{MediumOrchid}{1}}}{1} + {2}{{\textcolor{MediumOrchid}{2}}}{1} + {3}{{\textcolor{MediumOrchid}{3}}}{1} + {4}{{\textcolor{MediumOrchid}{4}}}{1} + {5}{{\textcolor{MediumOrchid}{5}}}{1} + {6}{{\textcolor{MediumOrchid}{6}}}{1} + {7}{{\textcolor{MediumOrchid}{7}}}{1} + {8}{{\textcolor{MediumOrchid}{8}}}{1} + {9}{{\textcolor{MediumOrchid}{9}}}{1} + {.0}{{\textcolor{MediumOrchid}{.0}}}{2}% Following is to ensure that only periods + {.1}{{\textcolor{MediumOrchid}{.1}}}{2}% followed by a digit are changed. + {.2}{{\textcolor{MediumOrchid}{.2}}}{2} + {.3}{{\textcolor{MediumOrchid}{.3}}}{2} + {.4}{{\textcolor{MediumOrchid}{.4}}}{2} + {.5}{{\textcolor{MediumOrchid}{.5}}}{2} + {.6}{{\textcolor{MediumOrchid}{.6}}}{2} + {.7}{{\textcolor{MediumOrchid}{.7}}}{2} + {.8}{{\textcolor{MediumOrchid}{.8}}}{2} + {.9}{{\textcolor{MediumOrchid}{.9}}}{2} + {=}{{\textcolor{gray}{=}}}{1},% }[keywords,tex,comments,strings]% end languaje % \begin{examplecode}[key=val]...\end{examplecode} \lstnewenvironment{examplecode}[1][]{% \lstset{ - language=scontents-doc,% - stringstyle= {\color{red}},% - basicstyle=\ttfamily\small,% - numbersep=1em,% - numberstyle=\tiny\color{lightgray}\noaccsupp,% - rulecolor=\color{gray!50},% - framesep=\fboxsep,% - framerule=\fboxrule,% - xleftmargin=\dimexpr\fboxsep+\fboxrule\relax,% - xrightmargin=\dimexpr\fboxsep+\fboxrule\relax,% + language = scontents-doc,% + stringstyle = {\color{red}},% + basicstyle = \ttfamily\small,% + columns = fullflexible,% + fontadjust = true,% + aboveskip = 8pt,% + belowskip = 5pt,% + rulecolor = \color{gray!50},% + framesep = \fboxsep,% + framerule = \fboxrule,% + xleftmargin = \dimexpr\fboxsep+\fboxrule\relax,% + xrightmargin= \dimexpr\fboxsep+\fboxrule\relax,% #1,% }% close lstset }{}% close examplecode @@ -477,56 +498,55 @@ % \lstinline[style=inline]|...| \lstdefinestyle{inline} { - language=scontents-doc,% - escapechar=`,% - upquote=true,% - numbersep=1em,% - columns=fullflexible,% - numberstyle=\tiny\color{lightgray}\noaccsupp,% - literate=*{\%}{{\bfseries\textcolor{gray}{\%}}}{1} + language = scontents-doc,% + upquote = true,% + numbersep = 1em,% + numberstyle = \tiny\color{lightgray}\noaccsupp,% + literate =*{\%}{{\textcolor{gray}{\%}}}{1} } % Set default \lstinline style \lstset{style=inline} + +% Set short §...§ \lstMakeShortInline[language=scontents-doc,basicstyle=\ttfamily]§ % Get file info \GetFileInfo{\jobname.sty} % Config hyperref -\definecolor{linkcolour}{cmyk}{0.64,0,0.95,0.40}% <-Olive Green \hypersetup{ - linkcolor = linkcolour,% - citecolor = linkcolour,% - urlcolor = linkcolour,% + allcolors = linkcolor, colorlinks = true,% linktoc = all,% pdftitle = {.:: The scontents package --- \fileinfo{} ::.},% pdfauthor = {Pablo González L}, pdfsubject = {Documentation for \fileversion{} [\filedate] },% - pdfcopyright = {\textcopyright 2019 by Pablo González}, - pdfcontacturl = {https://github.com/pablgonz/scontents}, pdfkeywords = {sequences, contents, external files, expl3, xparse, l3seq, store contents}, - pdfstartview = {FitH},% bookmarksopenlevel = 1,% } % Configuration titleps and titlesec \settitlemarks{section} -\renewpagestyle{plain}[\color{gray}\small\sffamily]{ -\setfoot{}{}{\thepage/\pageref{LastPage}}} - -\newpagestyle{myheader}[\color{gray}\small\sffamily]{ -\renewcommand\makeheadrule{\color{gray}\rule[0.45\baselineskip]{\linewidth}{0.4pt}} -\setfoot{\scalebox{0.8}{\mylogo}\space\textcopyright\space 2019 by Pablo González} - {} - {\thepage/\pageref{LastPage}} -\sethead{\raisebox{0.75\baselineskip}{Documentation for \fileversion\space[\filedate]}} - {} - {\raisebox{0.75\baselineskip}{\scshape\small\S.\thesection\space\sectiontitle}} +\renewpagestyle{plain}[\color{optcolor}\small\sffamily]{% +\setfoot{\rlap{\hskip\dimexpr-\oddsidemargin-1in\relax% + \parbox{1.93\paperwidth\relax}{\hfil\thepage\,/\,\pageref{LastPage}}}}% + {}% + {}% +} +\newpagestyle{myheader}[\color{optcolor}\small\sffamily]{% +\renewcommand\makeheadrule{% +\rlap{\hskip\dimexpr-\oddsidemargin-1in\relax + \color{rulecolor}\rule[0.3cm]{\paperwidth}{0.7cm}}\hss +} +\setfoot{\rlap{\hskip\dimexpr-\oddsidemargin-1in\relax% + \parbox{1.93\paperwidth\relax}{\hfil\thepage\,/\,\pageref{LastPage}}}}% + {\parbox{\textwidth}{\raggedright \textcolor{gray}{\raisebox{-1pt}{\textcopyright}{}2019 by Pablo González}}}% + {}% +\sethead{\llap{\raisebox{0.55cm}{\parbox{\dimexpr\oddsidemargin+1in\relax}{\makebox[0pt][l]{\hspace{15pt}\pkglogo\space\fileversion}}}}} + {\raisebox{0.55cm}{\parbox{\textwidth}{\hspace*{-\oddsidemargin}\centering\small\S.\thesection\space\sectiontitle}}}% + {}% } - -\setlength{\headheight}{21pt}% \titlecontents{section}[0mm]{}% {\bfseries\contentspush{\makebox[5mm][l]{\thecontentslabel\hfill}}}% @@ -541,7 +561,7 @@ \makeatletter \renewcommand\tableofcontents{% \begingroup% -\section*{\contentsname\quad{\color{optcolor}\leaders\hrule height 5pt depth -4.4pt\hfill}% +\section*{\contentsname\quad{\color{gray}\leaders\hrule height 5pt depth -4.4pt\hfill}% \@mkboth{% \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}% \vspace*{-14pt} @@ -549,11 +569,18 @@ \begin{multicols}{2}% \@starttoc{toc}% \end{multicols}% -\vspace*{-3pt}{\color{optcolor}\hrule height 0.6pt}% +\vspace*{-3pt}{\color{gray}\hrule height 0.6pt}% \vspace*{5pt} \endgroup } \makeatother +% thanks +\makeatletter +\renewcommand*{\@fnsymbol}[1]{\ensuremath{\ifcase#1\or \textcolor{pkgcolor}{*} +\or \textcolor{pkgcolor}{\dagger} \or \ddagger\or \mathsection +\or \mathparagraph\or \|\or **\or \dagger\dagger +\or \ddagger\ddagger \else\@ctrerr\fi}} +\makeatother \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -561,7 +588,7 @@ % \fi % % \title{ -% \scalebox{1.025}{\mylogo}\\[2pt] +% \scalebox{1.57}{\pkglogo}\\[2pt] % \Large % \textsf{Stores \hologo{LaTeX}}{ \fetamontotf{contents} }\\[3pt] % \fileversion{} --- \filedate\thanks{ @@ -569,24 +596,24 @@ % \filedate.}\\[25pt] % \author{ % \large -% \raisebox{-1pt}{\textcopyright}{}2019 by Pablo González -% \thanks{E-mail: \textsf{\guillemotleft}\email{pablgonz@educarchile.cl}\textsf{\guillemotright}}% +% \raisebox{-1pt}{\textcopyright}{}2019 by Pablo González\thanks{ +% E-mail: \textcolor{OrangeRed}{\textsf{\guillemotleft}}\email{pablgonz@educarchile.cl}\textcolor{OrangeRed}{\textsf{\guillemotright}}. +% }% % } % \small -% \textsc{ctan}: \url{http://www.ctan.org/pkg/scontents}\\ -% \textsc{git}: \url{https://github.com/pablgonz/scontents} +% \textsc{ctan}: \url{https://www.ctan.org/pkg/scontents}\\ +% \textcolor{gray}{\scriptsize\faIcon[regular]{github}}\,\,\,\url{https://github.com/pablgonz/scontents} % \vspace*{-2cm} % } % \date{} % \maketitle % -% \begin{scontents}[store-env=abstract,print-env=true] +% \begin{scontents}[store-env=abstract, print-env=true] % \begin{abstract} -% The \mypkg*{scontents} package stores valid \hologo{LaTeX} code in -% \mymeta{sequences} using the \mypkg{l3seq} module of \mypkg{expl3}. -% The \mymeta{stored content}, including \emph{verbatim}, can be used -% as many times as desired in the document, additionally can be written -% to \mymeta{external files}. +% This package allows to store \hologo{LaTeX} code, including \enquote{\emph{verbatim}}, +% in \mymeta{sequences} using the \mypkg{l3seq} module of \mypkg{expl3}. The \mymeta{stored +% content} can be used as many times as desired in the document, additionally you can write +% to \mymeta{external files} or show it in \mymeta{verbatim style}. % \end{abstract} % \end{scontents} % @@ -597,10 +624,10 @@ % \section{Motivation and Acknowledgments} % % In \hologo{LaTeX} there is no direct way to record content for later use, although -% you can do this using §\macros§, recording \mymeta{verbatim content} is a +% you can do this using §\macros§, recording \mymeta[type=rm]{verbatim content} is a % problem, usually you can avoid this by creating external files or boxes. The % general idea of this package is to try to imitate this implementation -% \emph{buffers} that has \hologo{ConTeXt} which allows you to save content in +% \enquote{\emph{buffers}} that has \hologo{ConTeXt} which allows you to save content in % memory, including \emph{verbatim}, to be used later. The package % \mypkg{filecontentsdef} solves this problem and since \mypkg{expl3} has an % excellent way to manage data, ideas were combined giving rise to this package. @@ -613,7 +640,7 @@ % of the \href{https://tex.stackexchange.com}{TeX-SX} community who have provided % great answers and ideas. Here a note of the main ones: % -% \begin{enumerate}[nosep] +% \begin{enumerate}[left=0pt, labelsep=5pt, noitemsep, nosep, label=\small\arabic*.] % \item \href{https://tex.stackexchange.com/q/45946/7832}{Stack datastructure using LaTeX} % % \item \href{https://tex.stackexchange.com/q/5338/7832}{LaTeX equivalent of ConTeXt buffers} @@ -651,12 +678,11 @@ % \subsection{Description of the package and load} % % \begin{scontents}[store-env=description, print-env=true] -% The \mypkg*{scontents} package allows to \mymeta{store contents} in -% \mymeta{sequences} or \mymeta{external files}. In some ways it is -% similar to the \mypkg{filecontentsdef} package, with the difference -% in which the \mymeta{content} is stored. The idea behind this package -% is to get an approach to \hologo{ConTeXt} \enquote{\emph{buffers}} -% by making use \mymeta{sequences}. +% The \mypkg*{scontents} package allows to \mymeta{store contents} in \mymeta{sequences} +% or \mymeta{external files}. In some ways it is similar to the \mypkg{filecontentsdef} +% package, with the difference in which the \mymeta{content} is stored. The idea behind +% this package is to get an approach to \hologo{ConTeXt} \enquote{\emph{buffers}} by +% making use \mymeta{sequences}. % \end{scontents} % % The package is loaded in the usual way: @@ -671,13 +697,14 @@ % \iffalse %</example> % \fi -% \vspace*{-5pt} +% % or +% % \iffalse %<*example> % \fi \begin{examplecode}[frame=single] -\usepackage`\small\myoarg[type=tt]{key \textnormal{\textcolor{gray}{=}} val}`{scontents} +\usepackageÇ\small\myoarg[type=tt]{key \textnormal{\textcolor{gray}{=}} val}Ç{scontents} \end{examplecode} % \iffalse %</example> @@ -715,8 +742,8 @@ % % Some users use horizontal "TAB"s \enquote{\LKeyTab} from keyboard to indented the source % code of the document and depending on the text editor used, some will use real "TAB"s -% (\enquote{hard tabs}), others with \enquote{soft tabs}(\verbvisiblespace\verbvisiblespace{} -% or \verbvisiblespace\verbvisiblespace\verbvisiblespace\verbvisiblespace) or both. +% (\enquote{hard tabs}), others with \enquote{soft tabs}(\verb*| | or \verb*| |) +% or both. % % At first glance it may seem the same, but the way in which "TAB"s (\enquote{hard tabs}) % are processed according to the context in which they are found within @@ -745,7 +772,7 @@ % % Most of the options can be passed directly to the package or using the % command \ics*{setupsc}. All boolean keys can be passed using the -% equal sign \enquote{\textnormal{\textcolor{optcolor}{=}}} or just the +% equal sign \enquote{\textnormal{\textcolor{gray}{=}}} or just the % name of the key, all unknown keys will return an error. In this section % are described some of the options, a summary of all options is shown in % section \ref{sec:optover}. @@ -764,32 +791,37 @@ % % \keyexamp{verb-font}{font family}{\textnormal{\ttfamily\textbackslash{}ttfamily}} % Sets the \mymeta{font family} used to display the \mymeta{stored content} for the -% commands \ics*{typestored} and \ics*{meaningsc}. This key is only available +% \ics*{typestored} and \ics*{meaningsc} commands. This key is only available % as a package option or using \ics*{setupsc}. % % \medskip % % \keyexamp{store-all}{seq name}{not used} -% It is a \mymeta{meta-key} that sets the §store-env§ key of the \myenv*{scontents} -% environment and the §store-cmd§ key of the \ics*{Scontents} command. This key is +% It is a \mymeta{meta-key} that sets the \mykey{store-env} key of the \myenv*{scontents} +% environment and the \mykey{store-cmd} key of the \ics*{Scontents} command. This key is % only available as a package option or using \ics*{setupsc}. % % \medskip % +% \keyexamp{overwrite}{true \textnormal{\textcolor{lightgray}{\textbar}} false}{false} +% Sets whether the \mymeta{files} generated by \mykey{write-out} and \mykey{write-env} +% from the \myenv*{scontents} environment will be rewritten. This key is +% available as a package option or using \ics*{setupsc} or \myenv*{scontents} +% environment. +% \medskip +% % \keyexamp{print-all}{true \textnormal{\textcolor{lightgray}{\textbar}} false}{false} -% It is a \mymeta{meta-key} that sets the §print-env§ key of the \myenv*{scontents} -% environment and the §print-cmd§ key of the \ics*{Scontents} command. This key is +% It is a \mymeta{meta-key} that sets the \mykey{print-env} key of the \myenv*{scontents} +% environment and the \mykey{print-cmd} key of the \ics*{Scontents} command. This key is % only available as a package option or using \ics*{setupsc}. % -% \medskip -% % \keyexamp{force-eol}{true \textnormal{\textcolor{lightgray}{\textbar}} false}{false} % Sets if the end of line for the \mymeta{stored content} is hidden or not. % This key is necessary only if the last line is the closing of some % environment defined by the \mypkg{fancyvrb} package as §\end{Verbatim}§ -% or another environment that does not support a comments \enquote{\textcolor{gray}{\%}} -% after closing §\end{§\textcolor{gray}{...}§}%§. This key is available for the \myenv*{scontents} -% environment and the \ics*{Scontents} command. +% or another environment that does not support a comments \enquote{\ttfamily\textcolor{gray}{\%}} +% after closing §\end{<env>}%§. This key is available +% for the \myenv*{scontents} environment and the \ics*{Scontents} command. % % \keyexamp{width-tab}{integer}{1} % Sets the equivalence in \mymeta{spaces} for the character "TAB" @@ -800,29 +832,30 @@ % \subsection{Options Overview} % \label{sec:optover} % -% \newcommand*{\xmark}{\textcolor{red}{✘}}% -% \newcommand*{\cmark}{\textcolor{green}{✔}}% +% \newcommand*{\xmark}{\textcolor{OrangeRed}{✘}}% +% \newcommand*{\cmark}{\textcolor{linkcolor}{✔}}% % -% Summary of available options. +% Summary of available options: % % \setlength{\tabcolsep}{0.25em} % \begin{center} % \small % \begin{tabular}{cccccccc} % \toprule -% \texttt{key} &package &\ics{setupsc} &\myenv*{scontents} &\ics*{Scontents} &\ics*{Scontents*} &\ics*{typestored} &\ics*{meaningsc}\\ +% \texttt{key} &package &\ics*{setupsc} &\myenv*{scontents} &\ics*{Scontents} &\ics*{Scontents*} &\ics*{typestored} &\ics*{meaningsc}\\ % \midrule -% \texttt{store-env} & \cmark & \cmark & \cmark & \xmark & \xmark & \xmark & \xmark \\ -% \texttt{store-cmd} & \cmark & \cmark & \xmark & \cmark & \cmark & \xmark & \xmark \\ -% \texttt{print-env} & \cmark & \cmark & \cmark & \xmark & \xmark & \xmark & \xmark \\ -% \texttt{print-cmd} & \cmark & \cmark & \xmark & \cmark & \cmark & \xmark & \xmark \\ -% \texttt{print-all} & \cmark & \cmark & \xmark & \xmark & \xmark & \xmark & \xmark \\ -% \texttt{store-all} & \cmark & \cmark & \xmark & \xmark & \xmark & \xmark & \xmark \\ -% \texttt{write-env} & \xmark & \xmark & \cmark & \xmark & \xmark & \xmark & \xmark \\ -% \texttt{write-out} & \xmark & \xmark & \cmark & \xmark & \xmark & \xmark & \xmark \\ -% \texttt{width-tab} & \cmark & \cmark & \xmark & \xmark & \xmark & \cmark & \cmark \\ -% \texttt{force-eol} & \cmark & \cmark & \cmark & \xmark & \cmark & \xmark & \xmark \\ -% \texttt{verb-font} & \cmark & \cmark & \xmark & \xmark & \xmark & \xmark & \xmark \\ +% \mykey{store-env} & \cmark & \cmark & \cmark & \xmark & \xmark & \xmark & \xmark \\ +% \mykey{store-cmd} & \cmark & \cmark & \xmark & \cmark & \cmark & \xmark & \xmark \\ +% \mykey{print-env} & \cmark & \cmark & \cmark & \xmark & \xmark & \xmark & \xmark \\ +% \mykey{print-cmd} & \cmark & \cmark & \xmark & \cmark & \cmark & \xmark & \xmark \\ +% \mykey{print-all} & \cmark & \cmark & \xmark & \xmark & \xmark & \xmark & \xmark \\ +% \mykey{store-all} & \cmark & \cmark & \xmark & \xmark & \xmark & \xmark & \xmark \\ +% \mykey{write-env} & \xmark & \xmark & \cmark & \xmark & \xmark & \xmark & \xmark \\ +% \mykey{write-out} & \xmark & \xmark & \cmark & \xmark & \xmark & \xmark & \xmark \\ +% \mykey{overwrite} & \cmark & \cmark & \cmark & \xmark & \xmark & \xmark & \xmark \\ +% \mykey{width-tab} & \cmark & \cmark & \xmark & \xmark & \xmark & \cmark & \cmark \\ +% \mykey{force-eol} & \cmark & \cmark & \cmark & \xmark & \cmark & \xmark & \xmark \\ +% \mykey{verb-font} & \cmark & \cmark & \xmark & \xmark & \xmark & \xmark & \xmark \\ % \bottomrule % \end{tabular} % \end{center} @@ -870,14 +903,11 @@ % \fi \begin{examplecode}[frame=single] \begin{scontents}[store-env=outer] -This text is in the outer environment -(before nested). +This text is in the outer environment (before nested). \begin{scontents}[store-env=inner] -This text is found in the inner environment -(inside of nested). +This text is found in the inner environment (inside of nested). \end{scontents} -This text is in the outer environment -(after nested). +This text is in the outer environment (after nested). \end{scontents} \end{examplecode} % \iffalse @@ -886,13 +916,11 @@ This text is in the outer environment % % Of course, content stored in the \mymeta{inner} sequence is only available % after content stored in the \mymeta{outer} sequence one has been retrieved, -% either by using the key §print-env§ or §\getstored§ command. +% either by using the key \mykey{print-env} or \ics*{getstored} command. % % It is advisable to store content within sequences with different names, % so as not to get lost in the order in which content is stored. % -% \newpage -% % \subsection*{Notes for \hologo{plainTeX} and \hologo{ConTeXt} users} % % In \hologo{plainTeX} there is not environments as in \hologo{LaTeX}. @@ -918,7 +946,7 @@ This text is in the outer environment % The environment options can be configured globally using option % in package or the \ics*{setupsc} command and locally using % \myoarg{key \textnormal{\textcolor{gray}{=}} val} in the environment. -% The key §force-eol§ is available for this environment. +% The key \mykey{force-eol} is available for this environment. % % \keyexamp{store-env}{seq name}{contents} % Sets the name of the \mymeta{sequence} in which the contents will be @@ -957,6 +985,43 @@ This text is in the outer environment % must add \texttt{\textcolor{optcolor}{-8bit}} at the command line, % otherwise you will get \hologo{TeX}-"TAB" (§^^I§) in \mymeta{file.ext}. % +% +% \subsection{The command \cs{newenvsc}} +% \label{sec:newenvsc} +% +% \newsavebox{\exaboxtmp} +% \begin{lrbox}{\exaboxtmp} +% \small\ttfamily +% \textcolor{pkgcolor}{\textbackslash newenvsc}\mymarg[type=tt]{env name}\myoarg[type=tt]{initial keys} +% \end{lrbox} +% +% \vspace*{-10pt} +% +% \begin{function}{\newenvsc} +% \begin{syntax} +% \usebox{\exaboxtmp} +% \end{syntax} +% \end{function} +% +% The command \ics*{newenvsc} allows you to create \mymeta{new environments} +% based on the same characteristics of the \myenv*{scontents} environment. +% The values entered in \myoarg{initial keys} will be considered as the +% default values for this new environment and the valid \mymeta{keys} are the +% same as those of the \myenv*{scontents} environment. For example: +% +% \iffalse +%<*example> +% \fi +\begin{examplecode}[frame=single] +\newenvsc{myenvstore}[store-env=myseq,print-env=false] +\end{examplecode} +% \iffalse +%</example> +% \fi +% +% created the §myenvstore§ environment that stored the content in the §myseq§ +% sequence and will not display the content when it is executed. +% % \subsection{The command \cs{Scontents}} % \label{sec:Scontents} % @@ -987,6 +1052,8 @@ This text is in the outer environment % \enquote{\texttt{\textcolor{gray}{\textbackslash\}}}} must also be % balanced if the argument is used with braces and "TAB"s characters typed % from the keyboard are converted into spaces. +% The starred argument (§*§) and \myoarg{key \textnormal{\textcolor{gray}{=}} val} +% must not be separated by horizontal spaces between them and the command. % % Both versions can be used anywhere in the document and cannot be used % as an \mymeta{argument} for other command. @@ -996,7 +1063,7 @@ This text is in the outer environment % % The command options can be configured globally using option in package % or the \ics*{setupsc} command and locally using \myoarg{key \textnormal{\textcolor{gray}{=}} val}. -% The key §force-eol§ is available for this command. +% The key \mykey{force-eol} is available for this command. % % \keyexamp{store-cmd}{seq name}{contents} % Sets the name of the \mymeta{sequence} in which the contents will be stored. @@ -1022,9 +1089,9 @@ This text is in the outer environment % % The command \ics*{getstored} gets the content stored in \mymarg{seq name} % according to the \mymeta{index} in which it was stored. The command is -% robust and can be used as an \mymeta{argument} for another command. If the -% optional argument is not passed it defaults to the first element stored -% in the \mymarg{seq name}. +% robust and can be used as an \mymeta{argument} for another command. If +% the optional argument is not passed, the default value is the \enquote{last +% element} stored in \mymarg{seq name}. % % \subsection{The command \cs{foreachsc}} % \label{sec:foreachsc} @@ -1072,8 +1139,13 @@ This text is in the outer environment % Sets the \mymarg{code} that will be executed \mymeta{after} each content stored % in \mymarg{seq name}. The \mymarg{code} must be passed between braces. % -% \keyexamp{wrapper}{code \textnormal{\textcolor{gray}{\{\#1\}}} more code}{empty} -% Wraps the content stored in \mymarg{seq name} referenced by \mymarg{\#1}. +% \newsavebox{\hashbox} +% \begin{lrbox}{\hashbox} +% \lstinline[language=scontents-doc,basicstyle=\ttfamily]+{#1}+ +% \end{lrbox} +% +% \keyexamp{wrapper}{code{} \space\usebox{\hashbox} more code}{empty} +% Wraps the content stored in \mymarg{seq name} referenced by §{#1}§. % The \mymarg{code} must be passed between braces. For example % §\foreachsc[wrapper={\makebox[1em][l]{#1}}]{contents}§. % @@ -1093,9 +1165,10 @@ This text is in the outer environment % \end{function} % % If the optional argument is not passed it defaults to the first element -% stored in the \mymarg{seq name}. The key §width-tab§ is available for +% stored in the \mymarg{seq name}. The key \mykey{width-tab} is available for % this command. % +% % \subsection{The environment \env{verbatimsc}} % \label{sec:verbatimsc} % @@ -1111,9 +1184,9 @@ This text is in the outer environment % a real \emph{verbatim} environment. The \mypkg{verbatim} package is not % compatible with the implementation of the \myenv*{verbatimsc} environment. % -% The \myenv*{verbatimsc} environment can be customized in the following ways: +%^^A \newpage % -% \newpage +% The \myenv*{verbatimsc} environment can be customized in the following ways: % % Using the package \mypkg{fancyvrb}: % \iffalse @@ -1188,7 +1261,7 @@ This text is in the outer environment % \end{function} % % If the optional argument is not passed it defaults to the first element -% stored in the \mymarg{seq name}. The key §width-tab§ is available for +% stored in the \mymarg{seq name}. The key \mykey{width-tab} is available for % this command. % % \subsection{The command \cs{countsc}} @@ -1243,11 +1316,10 @@ This text is in the outer environment \begin{examplecode}[numbers=left] \begin{scontents}[store-env=abstract,print-env=true] \begin{abstract} -The \mypkg*{scontents} package stores valid \hologo{(La)TeX} code in -\mymeta{sequences} using the \mypkg{l3seq} module of \mypkg{expl3}. -The \mymeta{stored content}, including \emph{verbatim}, can be used -as many times as desired in the document, additionally can be written -to \mymeta{external files}. +This package allows to store \hologo{LaTeX} code, including \enquote{\emph{verbatim}}, +in \mymeta{sequences} using the \mypkg{l3seq} module of \mypkg{expl3}. The \mymeta{stored +content} can be used as many times as desired in the document, additionally you can write +to \mymeta{external files} or show it in \mymeta{verbatim style}. \end{abstract} \end{scontents} \end{examplecode} @@ -1262,12 +1334,11 @@ to \mymeta{external files}. % \fi \begin{examplecode}[numbers=left] \begin{scontents}[store-env=description, print-env=true] -The \mypkg*{scontents} package allows to \mymeta{store contents} in -\mymeta{sequences} or \mymeta{external files}. In some ways it is -similar to the \mypkg{filecontentsdef} package, with the difference -in which the \mymeta{content} is stored. The idea behind this package -is to get an approach to \hologo{ConTeXt} \enquote{\emph{buffers}} -by making use \mymeta{sequences}. +The \mypkg*{scontents} package allows to \mymeta{store contents} in \mymeta{sequences} +or \mymeta{external files}. In some ways it is similar to the \mypkg{filecontentsdef} +package, with the difference in which the \mymeta{content} is stored. The idea behind +this package is to get an approach to \hologo{ConTeXt} \enquote{\emph{buffers}} by +making use \mymeta{sequences}. \end{scontents} \end{examplecode} % \iffalse @@ -1280,7 +1351,19 @@ by making use \mymeta{sequences}. % \section{Examples} % % These are some adapted examples that have served as inspiration for -% the creation of this package. +% the creation of this package. The examples are attached to this documentation +% and can be extracted from your PDF viewer or from the command line by running: +% \iffalse +%<*example> +% \fi +\begin{examplecode}[frame=single] +$ pdfdetach -saveall scontents.pdf +\end{examplecode} +% \iffalse +%</example> +% \fi +% and then you can use the excellent \arara\footnote{The cool \TeX\ automation tool: +% \url{https://www.ctan.org/pkg/arara}} tool to compile them. % % \subsection{From \texttt{answers} package} % @@ -1290,6 +1373,8 @@ by making use \mymeta{sequences}. %<*example> % \fi \begin{scontents}[write-out=scexamp1.ltx] +% arara: pdflatex +% arara: clean: { extensions: [ aux, log] } \documentclass{article} \usepackage[store-cmd=solutions]{scontents} \newtheorem{ex}{Exercise} @@ -1314,7 +1399,7 @@ Second exercise % \fi % % Adaptation of example 1 of the package \mypkg{answers} -% \textattachfile[color=0 0 1]{scexamp1.ltx}{\faFile*[regular]}. +% \textattachfile[color=linkcolor,print=false]{scexamp1.ltx}{\faFile*[regular]}. % \lstinputlisting[language=scontents-doc,numbers=left]{scexamp1.ltx} % % \subsection{From \texttt{filecontentsdef} package} @@ -1325,6 +1410,8 @@ Second exercise %<*example> % \fi \begin{scontents}[write-out=scexamp2.ltx] +% arara: pdflatex +% arara: clean: { extensions: [ aux, log] } \documentclass{article} \usepackage[store-env=defexercise,store-cmd=defexercise]{scontents} \pagestyle{empty} @@ -1356,7 +1443,7 @@ seventies that the \NSA\ has known that for 40 years.\par % \fi % % Adaptation of example from package \mypkg{filecontentsdef} -% \textattachfile[color=0 0 1]{scexamp2.ltx}{\faFile*[regular]}. +% \textattachfile[color=linkcolor,print=false]{scexamp2.ltx}{\faFile*[regular]}. % \lstinputlisting[language=scontents-doc,numbers=left]{scexamp2.ltx} % % \subsection{From TeX-SX} @@ -1367,6 +1454,8 @@ seventies that the \NSA\ has known that for 40 years.\par %<*example> % \fi \begin{scontents}[write-out=scexamp3.ltx] +% arara: pdflatex +% arara: clean: { extensions: [ aux, log] } \documentclass{article} \usepackage[store-cmd=tikz]{scontents} \usepackage{tikz} @@ -1418,7 +1507,7 @@ This is a \verb*|fake poor man's buffer :)|. % \fi % % Adapted from \href{https://tex.stackexchange.com/q/5338/7832}{LaTeX equivalent of ConTeXt buffers} -% \textattachfile[color=0 0 1]{scexamp3.ltx}{\faFile*[regular]}. +% \textattachfile[color=linkcolor,print=false]{scexamp3.ltx}{\faFile*[regular]}. % \lstinputlisting[language=scontents-doc,numbers=left]{scexamp3.ltx} % % \subsubsection*{Example 4} @@ -1427,6 +1516,8 @@ This is a \verb*|fake poor man's buffer :)|. %<*example> % \fi \begin{scontents}[write-out=scexamp4.ltx] +% arara: pdflatex +% arara: clean: { extensions: [ aux, log] } \documentclass{article} \usepackage{scontents} \pagestyle{empty} @@ -1458,7 +1549,7 @@ This is stored in other: \getstored[1]{other} % \fi % % Adapted from \href{https://tex.stackexchange.com/q/184503/7832}{Collecting contents of environment and store them for later retrieval} -% \textattachfile[color=0 0 1]{scexamp4.ltx}{\faFile*[regular]}. +% \textattachfile[color=linkcolor,print=false]{scexamp4.ltx}{\faFile*[regular]}. % \lstinputlisting[language=scontents-doc,numbers=left]{scexamp4.ltx} % % \subsubsection*{Example 5} @@ -1467,6 +1558,8 @@ This is stored in other: \getstored[1]{other} %<*example> % \fi \begin{scontents}[write-out=scexamp5.ltx] +% arara: pdflatex +% arara: clean: { extensions: [ aux, log] } \documentclass{article} \usepackage{scontents} \pagestyle{empty} @@ -1494,10 +1587,9 @@ This is from the verbatim environment: % \fi % % Adapted from \href{https://tex.stackexchange.com/q/373647/7832}{Collect contents of an environment (that contains verbatim content)} -% \textattachfile[color=0 0 1]{scexamp5.ltx}{\faFile*[regular]}. +% \textattachfile[color=linkcolor,print=false]{scexamp5.ltx}{\faFile*[regular]}. % \lstinputlisting[language=scontents-doc,numbers=left]{scexamp5.ltx} % -% \subsection{Customization of \texttt{verbatimsc}} % % \subsubsection*{Example 6} % @@ -1505,7 +1597,40 @@ This is from the verbatim environment: %<*example> % \fi \begin{scontents}[write-out=scexamp6.ltx] +% arara: pdflatex +% arara: clean: { extensions: [ aux, log] } +\documentclass[10pt]{article} +\usepackage{scontents} +\newenvsc{forshort}[store-env=forshort,print-env=false] +\begin{document} + +Something in the whole course. + +\begin{forshort} + Just a summary... +\end{forshort} + +\end{document} +\end{scontents} +% \iffalse +%</example> +% \fi +% +% Adapted from \href{https://tex.stackexchange.com/q/509595/7832}{Environment hiding its content} +% \textattachfile[color=linkcolor,print=false]{scexamp6.ltx}{\faFile*[regular]}. +% \lstinputlisting[language=scontents-doc,numbers=left]{scexamp6.ltx} +% +% \subsection{Customization of \texttt{verbatimsc}} +% +% \subsubsection*{Example 7} +% +% \iffalse +%<*example> +% \fi +\begin{scontents}[write-out=scexamp7.ltx] \documentclass{article} +% arara: pdflatex +% arara: clean: { extensions: [ aux, log] } \usepackage{scontents} \makeatletter \let\verbatimsc\@undefined @@ -1560,15 +1685,17 @@ Prove new \Verb*{ fancyvrb whit braces } and environment \verb+Verbatim*+ % % Customization of \myenv*{verbatimsc} using the \mypkg{fancyvrb} and % \mypkg{tcolorbox} package -% \textattachfile[color=0 0 1]{scexamp6.ltx}{\faFile*[regular]}. -% \lstinputlisting[language=scontents-doc,numbers=left]{scexamp6.ltx} +% \textattachfile[color=linkcolor,print=false]{scexamp7.ltx}{\faFile*[regular]}. +% \lstinputlisting[language=scontents-doc,numbers=left]{scexamp7.ltx} % -% \subsubsection*{Example 7} +% \subsubsection*{Example 8} % % \iffalse %<*example> % \fi -\begin{scontents}[write-out=scexamp7.ltx] +\begin{scontents}[write-out=scexamp8.ltx] +% arara: pdflatex +% arara: clean: { extensions: [ aux, log] } \documentclass{article} \usepackage{scontents} \makeatletter @@ -1624,16 +1751,17 @@ and more.+ % \fi % % Customization of \myenv*{verbatimsc} using the \mypkg{listings} package -% \textattachfile[color=0 0 1]{scexamp7.ltx}{\faFile*[regular]}. -% \lstinputlisting[language=scontents-doc,numbers=left]{scexamp7.ltx} +% \textattachfile[color=linkcolor,print=false]{scexamp8.ltx}{\faFile*[regular]}. +% \lstinputlisting[language=scontents-doc,numbers=left]{scexamp8.ltx} % -% \subsubsection*{Example 8} +% \subsubsection*{Example 9} % % \iffalse %<*example> % \fi -\begin{scontents}[write-out=scexamp8.ltx] -% need -shell-escape +\begin{scontents}[write-out=scexamp9.ltx] +% arara: xelatex : {shell: true, options: [-8bit]} +% arara: clean: { extensions: [ aux, log] } \documentclass{article} \usepackage{scontents} \makeatletter @@ -1648,19 +1776,22 @@ and more.+ \section{Test \texttt{\textbackslash begin\{scontents\}} whit \texttt{minted}} Test \verb+{scontents}+ \par -\begin{scontents}[write-env=usingtab.tex,force-eol=true] +\begin{scontents}[overwrite,write-env=\jobname.tsc,force-eol=true] Using \verb+scontents+ env no \verb+[key=val]+, save in seq \verb+contents+ with index 1.\par Prove new \Verb*{ new fvextra whit braces } and environment \verb+Verbatim*+ -% Real TABs here :) -\begin{Verbatim}[obeytabs, showtabs, tab=\rightarrowfill, tabcolor=red,showspaces, spacecolor=blue] +\begin{Verbatim}[obeytabs, showtabs, tab=\rightarrowfill, tabcolor=red] No tab One real tab Two real Tab plus one tab \end{Verbatim} \end{scontents} +\section{See \Verb{\jobname.tsc}} +Read \Verb{\jobname.tsc} (shows TABs as red arrows): +\VerbatimInput[obeytabs, showtabs, tab=\rightarrowfill, tabcolor=red]{\jobname.tsc} + \section{Test \texttt{\textbackslash Scontents} whit \texttt{minted}} \Scontents{ We have coded \par this in \LaTeX: $E=mc^2$.} @@ -1679,8 +1810,10 @@ No tab % \fi % % Customization of \myenv*{verbatimsc} using the \mypkg{minted} package -% \textattachfile[color=0 0 1]{scexamp8.ltx}{\faFile*[regular]}. -% \lstinputlisting[language=scontents-doc,numbers=left]{scexamp8.ltx} +% \textattachfile[color=linkcolor,print=false]{scexamp9.ltx}{\faFile*[regular]}. +% \lstinputlisting[language=scontents-doc,numbers=left]{scexamp9.ltx} +% +% \newpage % % \section{Change history} % \label{sec:changes} @@ -1689,6 +1822,8 @@ No tab % development, from the first public implementation using the \mypkg{filecontentsdef} % package to the current version with only \mypkg{expl3}. % +% \medskip +% % \setlist[itemize,1]{label=\textendash,wide=0.5em,nosep,noitemsep,leftmargin=10pt} % \newlength\descrwidth % \settowidth{\descrwidth}{\textsf{v1.0, (ctan), 2019-07-30} } @@ -1696,6 +1831,14 @@ No tab % \begin{description}[font=\small\sffamily,wide=0pt,style=multiline,leftmargin=\descrwidth,nosep,noitemsep] % \item [\fileversion{} (ctan), \filedate] % \begin{itemize} +% \item Add |\newenvsc| command. +% \item Fix nested environment in \hologo{plainTeX} and \hologo{ConTeXt}. +% \item Modified default value in |\getstored|. +% \item Add |overwrite| key to reduce |I/O| operations. +% \item Deleted an unnecessary group in the code. +% \end{itemize} +% \item [v1.7 (ctan), 2019-10-29] +% \begin{itemize} % \item The |verbatimsc| environment was rewritten. % \item Minor adjustments in documentation. % \end{itemize} @@ -1744,18 +1887,24 @@ No tab % \end{itemize} % \item [v1.0 (ctan), 2019-07-30] % \begin{itemize} -% \item First public release, +% \item First public release. % \end{itemize} % \end{description} % % \newpage % +% \indexprologue{ +% The italic numbers denote the pages where the corresponding entry is +% described.} +% % \printindex[userdoc] % % \newpage % +% \StartImplementation +% % \StopEventually{^^A -% \newgeometry{top=0.5in,bottom=0.5in,left=1.0in,right=0.5in,footskip=0.2in,headsep=10pt} +% \newgeometry{top=0.5in,bottom=0.3in,left=1.0in,right=0.5in,footskip=0.2in,headheight=1cm,headsep=0.27cm} % \addtocontents{toc}{\protect\setcounter{tocdepth}{2}} % \cleardoublepage % \phantomsection @@ -1767,10 +1916,18 @@ No tab % \printindex % } % +% % \section{Implementation} % \label{sec:Implementation} % \addtocontents{toc}{\protect\setcounter{tocdepth}{0}} % +% The most recent publicly released version of \mypkg*{scontents} is available at +% \textsc{ctan}: \url{https://www.ctan.org/pkg/scontents}. Historical and +% developmental versions are available at \textcolor{gray}{\scriptsize\faIcon[regular]{github}} +% \url{https://github.com/pablgonz/scontents}. While general feedback via email is +% welcomed, specific bugs or feature requests should be reported through the issue +% tracker: \url{https://github.com/pablgonz/scontents/issues}. +% % \subsection{Declaration of the package} % % First we set up the module name for \pkg{l3doc}: @@ -1780,10 +1937,10 @@ No tab % % Now we define some common macros to hold the package date and version: % \begin{macrocode} -%<loader>\def\ScontentsFileDate{2019-10-29}% -%<core>\def\ScontentsCoreFileDate{2019-10-29}% +%<loader>\def\ScontentsFileDate{2019-11-18}% +%<core>\def\ScontentsCoreFileDate{2019-11-18}% %<*loader> -\def\ScontentsFileVersion{1.7}% +\def\ScontentsFileVersion{1.8}% \def\ScontentsFileDescription{Stores LaTeX contents in memory or files}% % \end{macrocode} % @@ -1799,13 +1956,13 @@ No tab {scontents} {\ScontentsFileDate} {\ScontentsFileVersion} {\ScontentsFileDescription} \@ifpackageloaded { verbatim } { - \iow_term:n + \msg_set:nnn { scontents } { unsupported-verbatim } { - The~implementation~of~the~'verbatimsc'~environment~\\ - used~by~\tl_to_str:n{\typestored}~is~not~compatible~with~package\\ - 'verbatim'.~Review~the~documentation~and~redefine~\\ - the~'verbatimsc'~environment. + The~implementation~of~the~'verbatimsc'~environment~used~by~ + \iow_char:N \\typestored~is~not~compatible~with~package~'verbatim'.~ + Review~the~documentation~and~redefine~the~'verbatimsc'~environment. } + \msg_warning:nn { scontents } { unsupported-verbatim } } { } %</latex> % \end{macrocode} @@ -1829,7 +1986,7 @@ No tab % \begin{macrocode} %<*plain> \msg_gset:nnn { scontents } { already-loaded } - { The~`scontents'~package~is~already~loaded.~Aborting~input~\msg_line_context:. } + { The~'scontents'~package~is~already~loaded.~Aborting~input~\msg_line_context:. } \cs_if_exist:NT \@@_rescan_tokens:n { \msg_warning:nn { scontents } { already-loaded } @@ -1863,7 +2020,7 @@ No tab %<latex|plain> end %<context> stop %<latex> \c_left_brace_str - scontents + \exp_not:N \l_@@_env_name_tl %<latex> \c_right_brace_str } % \end{macrocode} @@ -1954,6 +2111,9 @@ No tab force-eol .bool_set:N = \l_@@_forced_eol_bool, force-eol .initial:n = false, force-eol .default:n = true, + overwrite .bool_set:N = \l_@@_overwrite_bool, + overwrite .initial:n = false, + overwrite .default:n = true, width-tab .int_set:N = \l_@@_tab_width_int, width-tab .initial:n = 1, width-tab .value_required:n = true, @@ -2036,7 +2196,7 @@ No tab % \end{macro} % % -% \begin{macro}{\l_@@_foreach_before_bool,\l_@@_foreach_after_bool +% \begin{macro}{\l_@@_foreach_before_bool,\l_@@_foreach_after_bool, % \l_@@_foreach_stop_bool,\l_@@_foreach_wrapper_bool} % Boolean variables used by the §\foreachsc§ loop. % @@ -2152,6 +2312,8 @@ No tab store-env .meta:nn = { scontents } { store-env = #1 }, force-eol .meta:nn = { scontents } { force-eol = #1 }, force-eol .default:n = true, + overwrite .meta:nn = { scontents } { overwrite = #1 }, + overwrite .default:n = true, unknown .code:n = { \@@_parse_environment_keys:n {#1} } } % \end{macrocode} @@ -2203,7 +2365,8 @@ No tab step .initial:n = 1, wrapper .code:n = { \bool_set_true:N \l_@@_foreach_wrapper_bool - \cs_set_protected:Npn \@@_foreach_wrapper:n ##1 {#1} + \cs_set_protected:Npn + \@@_foreach_wrapper:n ##1 {#1} }, wrapper .value_required:n = true, sep .tl_set:N = \l_@@_foreach_sep_tl, @@ -2343,7 +2506,7 @@ No tab % in \pkg{miniltx}) so that \pkg{xparse} is loadable in any format. % % The bunch of macros below is adapted from the \LaTeX{} kernel (greatly simplified). -% \begin{macrocode} +% \begin{macrocode} %</core> %<*loader&!latex> \seq_new:N \l_@@_compat_seq @@ -2383,9 +2546,12 @@ No tab \clist_map_function:NN \l_@@_temp_tl \@@_require_auxiii:n } \cs_new_protected:Npn \@@_require_auxiii:n #1 - { \str_if_eq:eeF {expl3} {#1} { \msg_error:nnn { scontents } { invalid-package } {#1} } } + { + \str_if_eq:eeF {expl3} {#1} + { \msg_error:nnn { scontents } { invalid-package } {#1} } + } \msg_new:nnn { scontents } { invalid-package } - { Package~`#1'~invalid~in~scontents.~This~is~an~error~in~scontents. } + { Package~'#1'~invalid~in~scontents.~This~is~an~error~in~scontents. } \@@_compat_redefine:cpn { @ifpackagelater } #1 { \exp_args:Nc \@@_package_later_aux:Nn { ver@#1.sty } } \cs_new_protected:Npn \@@_package_later_aux:Nn #1 #2 @@ -2400,7 +2566,7 @@ No tab \cs_new:Npn \@@_parse_version_auxii:w #1-#2-#3#4#5 \q_mark { \tl_if_blank:nF {#2} {#1} #2 #3 #4 } \@@_compat_redefine:Npn \ProvidesExplPackage #1 #2 #3 #4 - { \@@_provides_aux:nn {#1} { #2 \ifx\relax#3\relax\else v#3\space\fi #4 } } + { \@@_provides_aux:nn {#1} { #2 \tl_if_empty:nF {#3} {#3~} #4 } } \cs_new_protected:Npn \@@_provides_aux:nn #1 #2 { \tl_gset:cx { ver@#1.sty } {#2} @@ -2521,43 +2687,77 @@ No tab % % \subsection{Construction of environment \env{scontents}} % -% We define the environment \env{scontents}, next to the system -% \myoarg{key \textnormal{\textcolor{gray}{=}} val}. The environment -% is divided into two parts. +% In order to be able to define environments that behave similarly to +% \myenv{scontents}, we define a generic environment and make all other +% environment as wappers around that one. % -% \begin{macro}{ -% scontents, -% \scontents, -% \startscontents, -% \endscontents, -% \stopscontents, -% \@@_scontents_env_begin:, -% \@@_scontents_env_end:, -% } -% This is the main environment used in the document. +% \subsubsection{The command \cs{newenvsc}} % +% \begin{macro}{\newenvsc,\l_@@_env_name_tl,\@@_scontents_setenv:nn} +% The \cs{newenvsc} command defines two functions \cs[no-index]{@@_\#1_env_begin:} +% and \cs[no-index]{@@_\#1_env_end:}, which set the current environment's +% default properties and then call the generic \cs{@@_env_generic_begin:} and +% \cs{@@_env_generic_end:}. % \begin{macrocode} +\tl_new:N \l_@@_env_name_tl +\cs_new_protected:Npn \@@_scontents_setenv:nn #1 #2 + { + \cs_new_protected:cpn { @@_#1_env_begin: } + { + \tl_set:Nn \l_@@_env_name_tl {#1} + \keys_set:nn { scontents } {#2} + \@@_setup_verb_processor: + \@@_env_generic_begin: + } + \cs_new_protected:cpn { @@_#1_env_end: } + { \@@_env_generic_end: } + \exp_args:Nooo % http://nooooooooooooooo.com :) jeje + \@@_env_define:nnn { \tl_to_str:n {#1} } + { \cs:w @@_#1_env_begin: \cs_end: } + { \cs:w @@_#1_env_end: \cs_end: } + } %</core> %<*loader> -%<!context>\NewDocumentEnvironment { scontents } { } -%<context>\cs_new_protected:Npn \startscontents +\NewDocumentCommand { \newenvsc } { m O{} } { -%<plain|context> \group_begin: - \@@_scontents_env_begin: +%<latex|plain> \cs_if_exist:cTF { #1 } +%<context> \cs_if_exist:cTF { start #1 } + { \msg_error:nnn { scontents } { env-already-defined } {#1} } + { \@@_scontents_setenv:nn {#1} {#2} } } -%<context>\cs_new_protected:Npn \stopscontents +\cs_new_protected:Npn \@@_env_define:nnn #1 #2 #3 { - \@@_scontents_env_end: -%<plain|context> \group_end: +%<latex|plain> \NewDocumentEnvironment {#1} { } +%<context> \cs_new_protected:cpn { start #1 } + { +%<!latex> \group_begin: + #2 + } +%<context> \cs_new_protected:cpn { stop #1 } + { + #3 +%<!latex> \group_end: + } } %</loader> %<*core> -\cs_new_protected:Npn \@@_scontents_env_begin: +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Generic definition of the environment} +% +% \begin{macro}{ +% \@@_env_generic_begin:, +% \@@_env_generic_begin:, +% } +% Now we define the generic environment \cs{@@_env_generic_begin:} +% \begin{macrocode} +\cs_new_protected:Npn \@@_env_generic_begin: { \char_set_catcode_active:N \^^M \@@_start_environment:w } -\cs_new_protected:Npn \@@_scontents_env_end: +\cs_new_protected:Npn \@@_env_generic_end: { \@@_stop_environment: \@@_atend_environment: @@ -2565,6 +2765,23 @@ No tab % \end{macrocode} % \end{macro} % +% \subsubsection{Definition of the environment \env{scontents}} +% +% \begin{macro}{ +% scontents, +% \scontents, +% \endscontents, +% \startscontents, +% \stopscontents, +% } +% Now defining the \myenv{scontents} environment should be easy: +% \begin{macrocode} +%</core> +%<loader>\newenvsc{scontents} +%<*core> +% \end{macrocode} +% \end{macro} +% % \subsubsection{key val for environment} % % Define a \myoarg{key \textnormal{\textcolor{gray}{=}} val} for @@ -2603,7 +2820,7 @@ No tab % \subsubsection{The environment itself} % % \begin{macro}{\@@_start_environment:w,\@@_start_after_option:w, -% \@@_check_line_and_process:xn,\@@_stop_environment:} +% \@@_check_line_process:xn,\@@_stop_environment:} % Here we make §^^I§, §^^L§ and §^^M§ active characters so that the end of % line can be \enquote{seen} to be used as a delimiter, and \hologo{TeX} doesn't try to % eliminate space-like characters. @@ -2616,22 +2833,17 @@ No tab % \cs{@@_start_after_option:w} also checks for trailing tokens after % the optional argument and issues an error if any. % -% In all cases \cs{@@_check_line_and_process:xn} is called to check that -% the rest of the §\begin{scontents}§ is empty and then process -% the environment. \cs{@@_check_line_and_process:xn} calls the +% In all cases, \cs{@@_check_line_process:xn} ckecks that +% everything past §\begin{scontents}§ is empty and then process +% the environment. \cs{@@_check_line_process:xn} calls the % \cs{@@_file_tl_write_start:V} function, which will then read the contents % of the environment and optionally store them in a token list or write to % an external file. % -% When that's done, \cs{@@_file_write_stop:N} does the cleanup and the -% read token list is smuggled out of the verbatim group. This part of +% When that's done, \cs{@@_file_write_stop:N} does the cleanup. This part of % the code is inspired and adapted from the code of the package \pkg{xsimverb} % by Clemens Niederberger. % -%^^A Hm... Apparently this is not the verbatim group, but one level above. Is -%^^A this group really necessary? -%^^A Reply : I've checked it several times, it seems to be correct. -% % \begin{macrocode} \group_begin: \char_set_catcode_active:N \^^I @@ -2645,31 +2857,32 @@ No tab { \str_if_eq:eeTF { \tl_head:n {#1} } { [ } { \@@_grab_optional:w #1 ^^M } - { \@@_check_line_and_process:xn { } {#1} } + { \@@_check_line_process:xn { } {#1} } } - { \@@_check_line_and_process:xn { } {#1} } + { \@@_check_line_process:xn { } {#1} } } \cs_new_protected:Npn \@@_start_after_option:w #1 ^^M - { \@@_check_line_and_process:xn { [...] } {#1} } - \cs_new_protected:Npn \@@_check_line_and_process:xn #1 #2 + { \@@_check_line_process:xn { [...] } {#1} } + \cs_new_protected:Npn \@@_check_line_process:xn #1 #2 { \tl_if_blank:nF {#2} { \msg_error:nnxn { scontents } { junk-after-begin } - { after~\c_backslash_str begin{scontents} #1 } {#2} + { after~\c_backslash_str begin { \l_@@_env_name_tl } #1 } {#2} } \@@_make_control_chars_active: - \group_begin: - \@@_file_tl_write_start:V \l_@@_fname_out_tl + \@@_file_tl_write_start:V \l_@@_fname_out_tl } \cs_new_protected:Npn \@@_stop_environment: { - \@@_file_write_stop:N \l_@@_macro_tmp_tl - \exp_args:NNNV - \group_end: - \tl_set:Nn \l_@@_macro_tmp_tl \l_@@_macro_tmp_tl - \tl_if_empty:NT \l_@@_macro_tmp_tl - { \msg_warning:nnn { scontents } { empty-environment } } + \@@_file_write_stop:N \l_@@_macro_tmp_tl + \bool_lazy_and:nnT + { \l_@@_storing_bool } + { \tl_if_empty_p:N \l_@@_macro_tmp_tl } + { + \msg_warning:nnx { scontents } { empty-environment } + { \l_@@_env_name_tl } + } } % \end{macrocode} % \end{macro} @@ -2678,6 +2891,8 @@ No tab % \@@_file_tl_write_start:n, % \@@_file_tl_write_start:V, % \@@_verb_processor_iterate:w, +% \@@_verb_processor_iterate:nnn, +% \@@_setup_verb_processor:, % \@@_file_write_stop:N, % \@@_remove_leading_nl:n, % \@@_remove_leading_nl:w, @@ -2698,16 +2913,22 @@ No tab \cs_new_protected:Npn \@@_file_tl_write_start:n #1 { \group_begin: - \bool_if:NT \l_@@_writing_bool + \bool_if:nT { \l_@@_writing_bool && \l_@@_overwrite_bool } { - \file_if_exist:nTF {#1} - { \msg_warning:nnx { scontents } { rewriting-file } {#1} } - { \msg_warning:nnx { scontents } { writing-file } {#1} } - \iow_open:Nn \l_@@_file_iow {#1} + \file_if_exist:nTF {#1} + { \msg_warning:nnx { scontents } { overwrite-file } {#1} } + { \msg_warning:nnx { scontents } { writing-file } {#1} } + \iow_open:Nn \l_@@_file_iow {#1} + } + \bool_if:nT { \l_@@_writing_bool && !\l_@@_overwrite_bool } + { + \file_if_exist:nF {#1} + { \msg_warning:nnx { scontents } { writing-file } {#1} } + \iow_open:Nn \l_@@_file_iow {#1} } \tl_clear:N \l_@@_file_tl \seq_map_function:NN \l_char_special_seq \char_set_catcode_other:N - \int_step_function:nnN { 128 } { 255 } \char_set_catcode_letter:n + \int_step_function:nnnN { 128 } { 1 } { 255 } \char_set_catcode_letter:n \cs_set_protected:Npx \@@_ret:w ##1 ^^M { \exp_not:N \@@_verb_processor_iterate:w @@ -2718,48 +2939,65 @@ No tab \@@_make_control_chars_active: \@@_ret:w } - \use:x + \cs_new:Npn \@@_setup_verb_processor: { - \cs_new:Npn \exp_not:N \@@_verb_processor_iterate:w - ##1 \c_@@_end_env_tl - ##2 \c_@@_end_env_tl - ##3 \exp_not:N \q_@@_stop - } { - \tl_if_blank:nTF {#3} - { - \@@_analyse_nesting:n {#1} - \@@_verb_processor_output:n {#1} - } - { - \@@_if_nested:TF - { - \@@_nesting_decr: - \@@_verb_processor_output:x - { \exp_not:n {#1} \c_@@_end_env_tl \exp_not:n {#2} } - } - { - \tl_if_blank:nF {#1} - { \@@_verb_processor_output:n {#1} } - \cs_set_protected:Npx \@@_ret:w - { - \@@_format_case:nnn - { \exp_not:N \end{scontents} } % LaTeX - { \endscontents } % Plain/Generic - { \stopscontents } % ConTeXt - \bool_lazy_or:nnF - { \tl_if_blank_p:n {#2} } - { \str_if_eq_p:ee {#2} { \c_percent_str } } - { - \str_if_eq:VnF \c_@@_hidden_space_str {#2} - { \msg_warning:nnn { scontents } { rescanning-text } {#2} } - \@@_rescan_tokens:n {#2} - } - } - \char_set_active_eq:NN ^^M \@@_ret:w - } - } - ^^M - } + \use:x + { + \cs_set:Npn \exp_not:N \@@_verb_processor_iterate:w + ####1 \c_@@_end_env_tl + ####2 \c_@@_end_env_tl + ####3 \exp_not:N \q_@@_stop + } { \@@_verb_processor_iterate:nnn {##1} {##2} {##3} } + } + \cs_new:Npn \@@_verb_processor_iterate:nnn #1 #2 #3 + { + \tl_if_blank:nTF {#3} + { + \@@_analyse_nesting:n {#1} + \@@_verb_processor_output:n {#1} + } + { + \@@_if_nested:TF + { + \@@_nesting_decr: + \@@_verb_processor_output:x + { \exp_not:n {#1} \c_@@_end_env_tl \exp_not:n {#2} } + } + { + \tl_if_blank:nF {#1} + { \@@_verb_processor_output:n {#1} } + \cs_set_protected:Npx \@@_ret:w + { + \@@_env_end_function: + \bool_lazy_or:nnF + { \tl_if_blank_p:n {#2} } + { \str_if_eq_p:ee {#2} { \c_percent_str } } + { + \str_if_eq:VnF \c_@@_hidden_space_str {#2} + { + \msg_warning:nnnn { scontents } { rescanning-text } + {#2} { \tl_use:N \l_@@_env_name_tl } + } + \@@_rescan_tokens:n {#2} + } + } + \char_set_active_eq:NN ^^M \@@_ret:w + } + } + ^^M + } + \cs_new:Npn \@@_env_end_function: + { + \@@_format_case:nnn + { \exp_not:N \end { \if_false: } \fi: } + { \exp_after:wN \exp_not:N \cs:w end } + { \exp_after:wN \exp_not:N \cs:w stop } + \tl_use:N \l_@@_env_name_tl + \@@_format_case:nnn + { \if_false: { \fi: } } + { \cs_end: } + { \cs_end: } + } \cs_new_protected:Npn \@@_file_write_stop:N #1 { \bool_if:NT \l_@@_writing_bool @@ -2797,23 +3035,10 @@ No tab % \begin{macro}{ % \@@_verb_processor_output:n, % \@@_verb_processor_output:x, -% \@@_analyse_nesting:n, -% \@@_analyse_nesting:w, -% \@@_nesting_decr:, -% \@@_use_none_delimit_by_q_stop:w, % } -% \begin{macro}[TF]{\@@_if_nested:} % \cs{@@_verb_processor_output:n} does the output of each line read, % to a token list and to a file, depending on the booleans % \cs{l_@@_writing_bool} and \cs{l_@@_storing_bool}. -% -% \cs{@@_analyse_nesting:n} looks for nested §\begin{scontents}§ -% and adds to a \cs{l_@@_env_nesting_int} counter. The \cs{@@_if_nested:} -% conditional tests if we're in a nested environment, and -% \cs{@@_nesting_decr:} reduces the nesting level, if an §\end{scontents}§ -% is found. -% -% Multiple §\end{scontents}§ in the same line are not supported... % \begin{macrocode} \cs_new_protected:Npn \@@_verb_processor_output:n #1 { @@ -2822,51 +3047,120 @@ No tab \bool_if:NT \l_@@_storing_bool { \tl_put_right:Nn \l_@@_file_tl { ^^J #1 } } } - \cs_generate_variant:Nn \@@_verb_processor_output:n { x } - \cs_new_protected:Npx \@@_analyse_nesting:n #1 - { - \int_zero:N \l_@@_tmpa_int - \exp_not:N \@@_analyse_nesting:w #1 - \c_backslash_str begin - \c_left_brace_str \exp_not:N \q_@@_mark \c_right_brace_str - \exp_not:N \q_@@_stop - \int_compare:nNnT { \l_@@_tmpa_int } > { 1 } - { \msg_warning:nn { scontents } { multiple-begin } } - } - \use:x - { - \cs_new_protected:Npn \exp_not:N \@@_analyse_nesting:w ##1 - \c_backslash_str begin \c_left_brace_str ##2 \c_right_brace_str - } { - \if_meaning:w \q_@@_mark #2 - \exp_after:wN \use_i:nn - \else: - \exp_after:wN \use_ii:nn - \fi: - { \@@_use_none_delimit_by_q_stop:w } - { - \str_if_eq:eeT {#2} {scontents} - { - \int_incr:N \l_@@_env_nesting_int - \int_incr:N \l_@@_tmpa_int - \@@_analyse_nesting:w - } - \@@_analyse_nesting:w - } - } - \cs_new_protected:Npn \@@_nesting_decr: - { \int_decr:N \l_@@_env_nesting_int } - \prg_new_protected_conditional:Npnn \@@_if_nested: { TF } - { - \int_compare:nNnTF { \l_@@_env_nesting_int } > { \c_zero_int } - { \prg_return_true: } - { \prg_return_false: } - } - \cs_new:Npn \@@_use_none_delimit_by_q_stop:w #1 \q_@@_stop { } \group_end: +\cs_generate_variant:Nn \@@_verb_processor_output:n { x } \cs_generate_variant:Nn \@@_file_tl_write_start:n { V } % \end{macrocode} % \end{macro} +% +% \begin{macro}{ +% \@@_analyse_nesting:n, +% \@@_analyse_nesting:w, +% \@@_nesting_decr:, +% \@@_use_none_delimit_by_q_stop:w, +% } +% \begin{macro}[TF]{\@@_if_nested:} +% \cs{@@_analyse_nesting:n} scans nested §\begin{scontents}§ +% and steps a \cs{l_@@_env_nesting_int} counter. The \cs{@@_if_nested:} +% conditional tests if we're in a nested environment, and +% \cs{@@_nesting_decr:} reduces the nesting level, if an §\end{scontents}§ +% is found. +% +% Multiple §\end{scontents}§ in the same line are not supported\dots +% \begin{macrocode} +\cs_new_protected:Npn \@@_analyse_nesting:n #1 + { + \int_zero:N \l_@@_tmpa_int + \@@_analyse_nesting_format:n {#1} + \int_compare:nNnT { \l_@@_tmpa_int } > { 1 } + { \msg_warning:nn { scontents } { multiple-begin } } + } +\cs_new_protected:Npn \@@_nesting_incr: + { + \int_incr:N \l_@@_env_nesting_int + \int_incr:N \l_@@_tmpa_int + } +\cs_new_protected:Npn \@@_nesting_decr: + { \int_decr:N \l_@@_env_nesting_int } +\prg_new_protected_conditional:Npnn \@@_if_nested: { TF } + { + \int_compare:nNnTF { \l_@@_env_nesting_int } > { \c_zero_int } + { \prg_return_true: } + { \prg_return_false: } + } +\cs_new:Npn \@@_use_none_delimit_by_q_stop:w #1 \q_@@_stop { } +% \end{macrocode} +% In \LaTeX{}, environments start with §\begin{<env>}§, so checking if a +% string contains §\begin{scontents}§ is straightforward. Since no §}§ can +% appear inside §<env>§, then just a macro delimited by §}§ is enough. +% \begin{macrocode} +\use:x + { + \cs_new_protected:Npn \exp_not:N \@@_analyse_nesting_latex:w ##1 + \c_backslash_str begin \c_left_brace_str ##2 \c_right_brace_str + } { + \@@_tl_if_head_is_q_mark:nTF {#2} + { \@@_use_none_delimit_by_q_stop:w } + { + \str_if_eq:VnT \l_@@_env_name_tl {#2} + { \@@_nesting_incr: } + \@@_analyse_nesting_latex:w + } + } +\cs_new_protected:Npx \@@_analyse_nesting_latex:n #1 + { + \@@_analyse_nesting_latex:w #1 + \c_backslash_str begin + \c_left_brace_str \exp_not:N \q_@@_mark \c_right_brace_str + \exp_not:N \q_@@_stop + } +% \end{macrocode} +% In other formats, however, we don't have an \enquote{end anchor} to delimit the +% environment name, so a delimited macro won't help. We have to search for +% the entire environment command (usually §\scontents§ and §\startscontents§). +% \begin{macrocode} +\cs_new_protected:Npn \@@_analyse_nesting_generic_process:nn #1 #2 + { + \tl_if_head_is_N_type:nTF {#2} + { + \@@_tl_if_head_is_q_mark:nF {#2} + { + \@@_nesting_incr: + \@@_analyse_nesting_generic:w #2 \q_@@_stop + } + } + { \@@_analyse_nesting_generic:w #2 \q_@@_stop } + } +\cs_new_protected:Npn \@@_analyse_nesting_generic:nn #1 #2 + { + \@@_define_generic_nesting_function:n {#1} + \use:x + { + \exp_not:N \@@_analyse_nesting_generic:w #2 + \c_backslash_str #1 \tl_use:N \l_@@_env_name_tl + \exp_not:N \q_@@_mark \exp_not:N \q_@@_stop + } + } +\cs_new_protected:Npn \@@_define_generic_nesting_function:n #1 + { + \use:x + { + \cs_set_protected:Npn \exp_not:N \@@_analyse_nesting_generic:w ####1 + \c_backslash_str #1 \tl_use:N \l_@@_env_name_tl + ####2 \exp_not:N \q_@@_stop + } { \@@_analyse_nesting_generic_process:nn {##1} {##2} } + } +%</core> +%<*loader> +%<latex>\cs_new_eq:NN \@@_analyse_nesting_format:n +%<latex> \@@_analyse_nesting_latex:n +%<!latex>\cs_new_protected:Npn \@@_analyse_nesting_format:n +%<plain> { \@@_analyse_nesting_generic:nn { } } +%<context> { \@@_analyse_nesting_generic:nn { start } } +%</loader> +%<*core> +% \end{macrocode} +% \end{macro} % \end{macro} % % \subsubsection{Recording of the content in the sequence} @@ -2881,8 +3175,12 @@ No tab \bool_if:NT \l_@@_storing_bool { \bool_if:NF \l_@@_forced_eol_bool - { \tl_put_right:Nx \l_@@_macro_tmp_tl { \c_@@_hidden_space_str } } - \@@_store_to_seq:NN \l_@@_macro_tmp_tl \l_@@_name_seq_env_tl + { + \tl_put_right:Nx \l_@@_macro_tmp_tl + { \c_@@_hidden_space_str } + } + \@@_store_to_seq:NN \l_@@_macro_tmp_tl + \l_@@_name_seq_env_tl \bool_if:NT \l_@@_print_env_bool { \@@_lastfrom_seq:n \l_@@_name_seq_env_tl } } @@ -2899,7 +3197,8 @@ No tab \cs_new_protected:Npn \verbatimsc { \group_begin: - \@@_verbatimsc_aux: \frenchspacing \@@_vobeyspaces: \@@_xverb: + \@@_verbatimsc_aux: \frenchspacing \@@_vobeyspaces: + \@@_xverb: } \cs_new_protected:Npn \endverbatimsc { \group_end: } @@ -3036,7 +3335,7 @@ No tab % \begin{macrocode} %</core> %<*loader> -\NewDocumentCommand { \getstored } { O{1} m } +\NewDocumentCommand { \getstored } { O{-1} m } { \@@_getstored_internal:nn {#1} {#2} } %</loader> %<*core> @@ -3082,7 +3381,10 @@ No tab { \l_@@_foreach_stop_int } \@@_foreach_add_body:n \tl_gset:Nx \g_@@_temp_tl - { \seq_use:Nn \l_@@_foreach_print_seq { \tl_use:N \l_@@_foreach_sep_tl } } + { + \seq_use:Nn \l_@@_foreach_print_seq + { \tl_use:N \l_@@_foreach_sep_tl } + } \group_end: \exp_after:wN \tl_gclear:N \exp_after:wN \g_@@_temp_tl @@ -3235,6 +3537,21 @@ No tab % \end{macrocode} % \end{macro} % +% \begin{macro}[TF]{\@@_tl_if_head_is_q_mark:n} +% Tests if the head of the token list is \cs{q_@@_mark}. +% \begin{macrocode} +\prg_new_protected_conditional:Npnn \@@_tl_if_head_is_q_mark:n #1 + { T, F, TF } + { + \if_meaning:w \q_@@_mark #1 \scan_stop: + \prg_return_true: + \else: + \prg_return_false: + \fi: + } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{ % \@@_set_active_eq:NN, % \@@_make_control_chars_active:, @@ -3335,7 +3652,6 @@ No tab % % \subsection{The command \cs{countsc}} % -% % \begin{macro}{\countsc} % User command §\countsc§ to count number of contents stored in |seq|. % @@ -3376,18 +3692,25 @@ No tab \\ \\ #2 } +\msg_new:nnnn { scontents } { env-already-defined } + { Environment~'#1'~already~defined! } + { + You~have~used~\newenvsc + with~an~environment~that~already~has~a~definition. \\ \\ + The~existing~definition~of~'#1'~will~not~be~altered. + } \msg_new:nnn { scontents } { empty-stored-content } { Empty~value~for~key~'getstored'~\msg_line_context:. } \msg_new:nnn { scontents } { empty-variable } { Variable~'#1'~empty~\msg_line_context:. } -\msg_new:nnn { scontents } { rewriting-file } - { Overwriting ~ file ~ '#1' } +\msg_new:nnn { scontents } { overwrite-file } + { Overwriting~file~'#1'. } \msg_new:nnn { scontents } { writing-file } - { Writing ~ file ~ '#1' } + { Writing~file~'#1'. } \msg_new:nnn { scontents } { rescanning-text } - { Rescanning~text~'#1'~after~\c_backslash_str end{scontents}~\msg_line_context:.} + { Rescanning~text~'#1'~after~\c_backslash_str end{#2}~\msg_line_context:.} \msg_new:nnn { scontents } { multiple-begin } - { Multiple~\c_backslash_str begin{scontents}~\msg_line_context:.} + { Multiple~\c_backslash_str begin{ \l_@@_env_name_tl }~\msg_line_context:.} \msg_new:nnn { scontents } { undefined-storage } { Storage~named~'#1'~is~not~defined. } \msg_new:nnn { scontents } { index-out-of-range } @@ -3401,15 +3724,21 @@ No tab } } \msg_new:nnnn { scontents } { env-key-unknown } - { The~key~'#1'~is~unknown~by~environment~'scontents'~and~is~being~ignored.} { - The~environment~'scontents'~does~not~have~a~key~called~'#1'.\\ + The~key~'#1'~is~unknown~by~environment~ + '\l_@@_env_name_tl'~and~is~being~ignored. + } + { + The~environment~'\l_@@_env_name_tl'~does~not~have~a~key~called~'#1'.\\ Check~that~you~have~spelled~the~key~name~correctly. } \msg_new:nnnn { scontents } { env-key-value-unknown } - { The~key~'#1=#2'~is~unknown~by~environment~'scontents'~and~is~being~ignored. } { - The~environment~'scontents'~does~not~have~a~key~called~'#1'.\\ + The~key~'#1=#2'~is~unknown~by~environment~ + '\l_@@_env_name_tl'~and~is~being~ignored. + } + { + The~environment~'\l_@@_env_name_tl'~does~not~have~a~key~called~'#1'.\\ Check~that~you~have~spelled~the~key~name~correctly. } \msg_new:nnnn { scontents } { cmd-key-unknown } @@ -3449,7 +3778,7 @@ No tab This~command~only~accepts~the~key~'width-tab'. } \msg_new:nnn { scontents } { empty-environment } - { scontents~environment~empty~\msg_line_context:. } + { environment~'#1'~empty~\msg_line_context:. } \msg_new:nnnn { scontents } { verbatim-newline } { Verbatim~argument~of~#1~ended~by~end~of~line. } { @@ -3479,4 +3808,5 @@ No tab %</core> %<plain|context>\ExplSyntaxOff % \end{macrocode} +% % \Finale diff --git a/macros/latex/contrib/scontents/scontents.ins b/macros/latex/contrib/scontents/scontents.ins index 6c761fe6b0..953dc79bb6 100644 --- a/macros/latex/contrib/scontents/scontents.ins +++ b/macros/latex/contrib/scontents/scontents.ins @@ -33,11 +33,11 @@ and the derived files scontents.sty, \declarepreamble\context \string\module [ file=t-scontents, - version=1.7, + version=1.8, title=\string\CONTEXT\ User Module, subtitle=Storing Contents, author=Pablo González, - date=2019-10-29, + date=2019-11-18, copyright=Pablo González, email=pablgonz@educarchile.cl, license=LPPL] diff --git a/macros/latex/contrib/scontents/scontents.pdf b/macros/latex/contrib/scontents/scontents.pdf Binary files differindex 958da1dcc6..eea74b0101 100644 --- a/macros/latex/contrib/scontents/scontents.pdf +++ b/macros/latex/contrib/scontents/scontents.pdf diff --git a/macros/latex/required/amsmath/README.md b/macros/latex/required/amsmath/README.md index 868efe52c2..c08ef1b2ab 100644 --- a/macros/latex/required/amsmath/README.md +++ b/macros/latex/required/amsmath/README.md @@ -1,7 +1,7 @@ The amsmath bundle for LaTeX ============================ -Release 2019-10-01 patch level 1 +Release 2019-11-17 Overview -------- diff --git a/macros/latex/required/amsmath/amsbsy.pdf b/macros/latex/required/amsmath/amsbsy.pdf Binary files differindex b436223e2f..3260fb10a7 100644 --- a/macros/latex/required/amsmath/amsbsy.pdf +++ b/macros/latex/required/amsmath/amsbsy.pdf diff --git a/macros/latex/required/amsmath/amscd.pdf b/macros/latex/required/amsmath/amscd.pdf Binary files differindex 69e05ee5c7..6094e56e41 100644 --- a/macros/latex/required/amsmath/amscd.pdf +++ b/macros/latex/required/amsmath/amscd.pdf diff --git a/macros/latex/required/amsmath/amsgen.pdf b/macros/latex/required/amsmath/amsgen.pdf Binary files differindex 12312f4193..d81a3e9c4c 100644 --- a/macros/latex/required/amsmath/amsgen.pdf +++ b/macros/latex/required/amsmath/amsgen.pdf diff --git a/macros/latex/required/amsmath/amsldoc.pdf b/macros/latex/required/amsmath/amsldoc.pdf Binary files differindex a221839b30..747bd6b264 100644 --- a/macros/latex/required/amsmath/amsldoc.pdf +++ b/macros/latex/required/amsmath/amsldoc.pdf diff --git a/macros/latex/required/amsmath/amsldoc.tex b/macros/latex/required/amsmath/amsldoc.tex index 9e08f029f5..8573682a66 100644 --- a/macros/latex/required/amsmath/amsldoc.tex +++ b/macros/latex/required/amsmath/amsldoc.tex @@ -64,7 +64,7 @@ Bug reports can be opened (category \texttt{#1}) at\\% \title{User's Guide for the \nipkg{amsmath} Package (Version~2.1)} \author{American Mathematical Society, \LaTeX3 Project} -\date{1999-12-13 (revised 2002-02-25, 2016-11-14, 2018-04-05)} +\date{1999-12-13\\(revised 2002-02-25, 2016-11-14, 2018-04-05, 2019-10-14)} \makeatletter \def\@thanks{\bigskip\MaintainedByLaTeXTeam{amslatex}} \makeatother @@ -1372,9 +1372,12 @@ superscript\index{subscripts and superscripts} above a binary relation. In the \nipkg{amsmath} package there are somewhat more general commands, \cn{overset} and \cn{underset}, that can be used to place one symbol above or below another symbol, whether it's a relation or something -else. The input |\overset{*}{X}| will place a superscript-size $*$ above -the $X$: $\overset{*}{X}$; \cn{underset} is the analog for adding a -symbol underneath. +else. The input |\overset{*}{X}| will place a superscript-size {\small$*$} above +the {\small$X$}: {\small$\smash{\overset{*}{X}}$}; +\cn{underset} is the analog for adding a +symbol underneath. The command \cn{overunderset} is a combination of +these, taking three arguments to place superscript sized expressions +above and below the same base. See also the description of \cn{sideset} in \secref{sideset}. diff --git a/macros/latex/required/amsmath/amsmath.dtx b/macros/latex/required/amsmath/amsmath.dtx index 8671694b70..11b7545c26 100644 --- a/macros/latex/required/amsmath/amsmath.dtx +++ b/macros/latex/required/amsmath/amsmath.dtx @@ -86,7 +86,7 @@ Bug reports can be opened (category \texttt{#1}) at\\% % \end{macrocode} % % \begin{macrocode} -\ProvidesPackage{amsmath}[2019/04/01 v2.17c AMS math features] +\ProvidesPackage{amsmath}[2019/11/16 v2.17d AMS math features] % \end{macrocode} % % \section{Catcode defenses} @@ -1641,10 +1641,19 @@ Foreign command \@backslashchar#1;\MessageBreak % By redefining \cs{set@mathaccent} we ensure that % \cn{DeclareMathAccent} will define accent commands to run our % \cs{mathaccentV} function instead of the primitive \cs{mathaccent}. +% \changes{v2.17d}{2019/11/16}{Added \cs{MakeRobust} to match kernel +% change (gh/216)} % \begin{macrocode} \def\set@mathaccent#1#2#3#4{% - \xdef#2{\@nx\protect\@nx\mathaccentV +% \end{macrocode} +% Now that the redefinitions done inside amsmath of the basic accents +% are all robust we can drop the \cs{protect} here. +% \begin{macrocode} + \xdef#2{% +% \@nx\protect + \@nx\mathaccentV {\@xp\@gobble\string#2}\hexnumber@#1#4}% + \MakeRobust#2% } % \end{macrocode} % @@ -1714,6 +1723,13 @@ Foreign command \@backslashchar#1;\MessageBreak Unable to redefine math accent \string#5}% \fi\fi} \def\@tempc#1"#2#3#4#5#6\@nil#7{% +% \end{macrocode} +% Drop the inner part of the robust accent so that it can be recreated +% without a warning. +% \changes{v2.17d}{2019/11/16}{Make temporarily fragile to match kernel +% change (gh/216)} +% \begin{macrocode} + \@xp\let\csname\@xp\@gobble\string#7\space\endcsname\@undefined \chardef\@tempd="#3\relax\set@mathaccent\@tempd{#7}{#2}{#4#5}} \def\@tempd#1\@nil#2{% \PackageWarningNoLine{amsmath}{% @@ -2091,7 +2107,7 @@ Foreign command \@backslashchar#1;\MessageBreak % \begin{macro}{\overunderset} % This is the combination of the previous two commands which is % something that is sometimes needed. -% \changes{v2.17c}{FMi}{New command \cs{overunderset}} +% \changes{v2.17c}{2019/04/01}{New command \cs{overunderset}} % \begin{macrocode} \newcommand{\overunderset}[3]{\binrel@{#3}% \binrel@@{\mathop{\kern\z@#3}\limits^{#1}_{#2}}} diff --git a/macros/latex/required/amsmath/amsmath.pdf b/macros/latex/required/amsmath/amsmath.pdf Binary files differindex 71b273d85c..df541ceec9 100644 --- a/macros/latex/required/amsmath/amsmath.pdf +++ b/macros/latex/required/amsmath/amsmath.pdf diff --git a/macros/latex/required/amsmath/amsopn.pdf b/macros/latex/required/amsmath/amsopn.pdf Binary files differindex 1543a5c08e..9e2fe3336d 100644 --- a/macros/latex/required/amsmath/amsopn.pdf +++ b/macros/latex/required/amsmath/amsopn.pdf diff --git a/macros/latex/required/amsmath/amstext.pdf b/macros/latex/required/amsmath/amstext.pdf Binary files differindex 73e4af364a..2a2001b640 100644 --- a/macros/latex/required/amsmath/amstext.pdf +++ b/macros/latex/required/amsmath/amstext.pdf diff --git a/macros/latex/required/amsmath/amsxtra.pdf b/macros/latex/required/amsmath/amsxtra.pdf Binary files differindex 77ac075445..651c9db0da 100644 --- a/macros/latex/required/amsmath/amsxtra.pdf +++ b/macros/latex/required/amsmath/amsxtra.pdf diff --git a/macros/latex/required/amsmath/changes.txt b/macros/latex/required/amsmath/changes.txt index 054633ff2d..e5e234cea2 100644 --- a/macros/latex/required/amsmath/changes.txt +++ b/macros/latex/required/amsmath/changes.txt @@ -1,4 +1,14 @@ ######################### +# 2019-11-17 Release +######################### + +2019-11-16 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * amsmath.dtx (section{Math accents}): + Added \MakeRobust inside \DeclareMathAccent to match kernel + change (gh/216) + +######################### # 2019-10-01b Release ######################### diff --git a/macros/latex/required/amsmath/subeqn.pdf b/macros/latex/required/amsmath/subeqn.pdf Binary files differindex 9250612b54..9e6e072673 100644 --- a/macros/latex/required/amsmath/subeqn.pdf +++ b/macros/latex/required/amsmath/subeqn.pdf diff --git a/macros/latex/required/amsmath/technote.pdf b/macros/latex/required/amsmath/technote.pdf Binary files differindex 4db485d6c8..5457ffe15f 100644 --- a/macros/latex/required/amsmath/technote.pdf +++ b/macros/latex/required/amsmath/technote.pdf diff --git a/macros/latex/required/amsmath/testmath.pdf b/macros/latex/required/amsmath/testmath.pdf Binary files differindex f1af9357a3..91012a919d 100644 --- a/macros/latex/required/amsmath/testmath.pdf +++ b/macros/latex/required/amsmath/testmath.pdf diff --git a/macros/luatex/generic/luatexja/README b/macros/luatex/generic/luatexja/README index 5d4bb017e1..5086578af9 100644 --- a/macros/luatex/generic/luatexja/README +++ b/macros/luatex/generic/luatexja/README @@ -1,4 +1,4 @@ -The LuaTeX-ja Package 20190926.0 +The LuaTeX-ja Package 20191117.0 -------------------------------- Copyright (c) 2011--2019 The LuaTeX-ja project License: modified BSD (see COPYING) @@ -23,7 +23,7 @@ Installation 0. Please make sure that your TeX distribution is up-to-date. This version of LuaTeX-ja requires - LuaTeX 1.0.0 or later - - luaotfload (v2.98 or later recommended) + - luaotfload (v3.1 or later recommended) - adobemapping (Adobe CMap files) - everysel package - etoolbox package @@ -34,8 +34,8 @@ Installation - stfloats package - IPAex fonts (http://ipafont.ipa.go.jp/) - LuaHBTeX and HarfTeX are not supported for now. With these engines, - one might be able to typeset documents without an error, but with + Using LuaTeX-ja with LuaHBTeX is not well tested. + One might be able to typeset documents without an error, but with some unwanted results. 1. If you are using TeX Live 2019 or later, you can install LuaTeX-ja via tlmgr. @@ -43,9 +43,9 @@ Installation 2. If you must/want to install manually: a. Download the source archive from CTAN, - or tagged as 20190926.0 in the Git repository by + or tagged as 20191117.0 in the Git repository by <http://git.osdn.jp/view?p=luatex-ja/luatexja.git - ;a=snapshot;h=refs/tags/20190926.0;sf=tgz> + ;a=snapshot;h=refs/tags/20191117.0;sf=tgz> b. Extract the archive and process following three files by LuaLaTeX to generate classes for Japanese typesetting: @@ -79,6 +79,9 @@ Simply loading luatexja.sty by \input or \usepackage does the minimal setting. Notes ----- +* We don't recommend defining a Japanese font with HarfBuzz, by specifying + "Renderer=..." (fontspec) or "mode=harf" (otherwise). + * This archive contains four .{dtx,ins} pairs: src/ltjclasses.{ins,dtx}, src/ltjltxdoc.{ins,dtx} src/ltjsclasses.{ins,dtx}, doc/luatexja.{ins,dtx} @@ -90,4 +93,4 @@ Notes * src/*.{ins.dtx} and src/ltj-kinsoku_make.tex are not needed in regular use. -Last commit date: Thu Sep 26 19:19:46 2019 +0900 +Last commit date: Sun Nov 17 18:30:58 2019 +0900 diff --git a/macros/luatex/generic/luatexja/doc/luatexja-en.pdf b/macros/luatex/generic/luatexja/doc/luatexja-en.pdf Binary files differindex 28016a4d7d..b23ce9bcd2 100644 --- a/macros/luatex/generic/luatexja/doc/luatexja-en.pdf +++ b/macros/luatex/generic/luatexja/doc/luatexja-en.pdf diff --git a/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf b/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf Binary files differindex b40752576c..52ede1e3ec 100644 --- a/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf +++ b/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf diff --git a/macros/luatex/generic/luatexja/doc/luatexja-zhfonts.pdf b/macros/luatex/generic/luatexja/doc/luatexja-zhfonts.pdf Binary files differdeleted file mode 100644 index 6b6ee65fdf..0000000000 --- a/macros/luatex/generic/luatexja/doc/luatexja-zhfonts.pdf +++ /dev/null diff --git a/macros/luatex/generic/luatexja/doc/luatexja-zhfonts.tex b/macros/luatex/generic/luatexja/doc/luatexja-zhfonts.tex deleted file mode 100644 index e220c0de05..0000000000 --- a/macros/luatex/generic/luatexja/doc/luatexja-zhfonts.tex +++ /dev/null @@ -1,280 +0,0 @@ -\documentclass[DIV=13]{article} -\usepackage{typearea} -\usepackage{hologo} -\makeatletter -\def\verbatim{\@verbatim \frenchspacing\@vobeyspaces\luatexlocalleftbox{\hskip3\zw} \@xverbatim} -\makeatother -\def\pTeX{p\TeX} -\def\LuaTeX{Lua\TeX} -\def\XeTeX{\hologo{XeTeX}} -\def\ConTeXt{Con\TeX t} -\usepackage{booktabs} -\usepackage{multicol} -\usepackage{indentfirst} -\usepackage{luatexja-fontspec} -\parindent2\zw -\linespread{1.25} -\setmainjfont{FandolSong} -\title{\textbf{\LuaTeX-ja简体中文字体配置}} -\author{马起园\hskip2.5\zw 苏 杰} -\date{2013年5月} -\begin{document} -\maketitle -\section{\LuaTeX-ja项目简介} -\LuaTeX-ja项目旨在将\pTeX 处理汉字的机制及相关功能移植到\LuaTeX 下,当前项目 -的成员有:北川弘典、前田一贵、八登崇之、黑木裕介 、阿部纪行、山本宗宏、本田知 -亮、斋藤修三郎和马起园。 - -\LuaTeX 虽然在编码上支持Unicode,但并不能直接处理汉字断行以及禁则应用,而 -在\pTeX 系列中则能够处理断行并应用禁则,但并不支持PDF输出。\LuaTeX 下处理 -汉字的断行和应用禁则需要使用其内建的诸多callback来进行。\pTeX 扩展TFM为JFM, -但是JFM抽象程度更高,该文件涉及到的内容是字体的标点压缩,可以用于多个汉字字体。 - -当前版本的\LuaTeX-ja 可以应用于\TeX\ Live和W32\TeX,在旧版本MikTeX下使用会 -出问题,因为MikTeX下的\LuaTeX 存在编译上的bug。 - -\section{字体使用} - -\subsection{关于\LuaTeX-ja的字体调用} - -\XeTeX 在调用字体的时候需要使用freetype和fontconfig库,所以需要更新字体缓 -存,但是在\LuaTeX 下就不太一样。\LuaTeX 只需要在初次使用的时候刷新字体数据 -库即可(此数据库是一个lua文件)。\LuaTeX 下的字体缓存实际上是将字体的各种 -信息导出并保存的文件,在调用一个新字体的时候会生成一个。\LuaTeX 对于字体的 -处理并没有使用freetype,而是使用了fontforge,不过可能由于该库的接口有一些 -问题,导致部分字体无法在\LuaTeX 下使用。 - -在使用\LuaTeX-ja的时候,需要先刷新字体数据库,该命令的使用方法如下: -\begin{verbatim} -Usage: mkluatexfontdb [OPTION]... - -Rebuild the LuaTeX font database. - -Valid options: - -f --force force re-indexing all fonts - -q --quiet don't output anything - -v --verbose=LEVEL be more verbose (print the searched directories) - -vv print the loaded fonts - -vvv print all steps of directory searching - -V --version print version and exit - -h --help print this message -\end{verbatim} - -在新版本的\texttt{luaotfload}包中,提供了新的命令\texttt{luaotfload-tool}, -但如上所述的\texttt{mkluatexfontdb}依然能够使用。 - -又是可能遇到通不过的字体,需要将这个字体的绝对路径添加到\texttt{luaotfload-blacklist.cnf}中, -这个文件的内容如下: -\begin{verbatim} -% Takes ages to load -LastResort.ttf % a MacOSX font, but also available for free from unicode.org -% Segfaults under LuaTeX 0.76 -lingoes.ttf -% http://tug.org/pipermail/luatex/2013-May/004239.html -Diablindall.ttf -spltfgbd.ttf -spltfgbi.ttf -spltfgit.ttf -spltfgrg.ttf -\end{verbatim} - -如果你在\texttt{texmf-local}下添加了某些私有字体,请及时运行\texttt{texhash}, -这样能够方便在运行\LuaTeX 的时候能够通过kpathsea库找到他们。 - -Lua\TeX 调用TrueType和OpenType字体并没有固定的方式,\XeTeX 使用了固定的接口, -而Lua\TeX 需要使用luaotfload包来进行字体的调用。这两种字体一般都有高级特性, -在\TeX\ Live或者W32\TeX 中可以使用\texttt{otfinfo}命令来查看相关的信息: -\begin{verbatim} -'Otfinfo' reports information about an OpenType font to standard output. -Options specify what information to print. - -Usage: otfinfo [-sfzpg | OPTIONS] [OTFFILES...] - -Query options: - -s, --scripts Report font's supported scripts. - -f, --features Report font's GSUB/GPOS features. - -z, --optical-size Report font's optical size information. - -p, --postscript-name Report font's PostScript name. - -a, --family Report font's family name. - -v, --font-version Report font's version information. - -i, --info Report font's names and designer/vendor info. - -g, --glyphs Report font's glyph names. - -t, --tables Report font's OpenType tables. - -T, --dump-table NAME Output font's 'NAME' table. - -Other options: - --script=SCRIPT[.LANG] Set script used for --features [latn]. - -V, --verbose Print progress information to standard error. - -h, --help Print this message and exit. - -q, --quiet Do not generate any error messages. - --version Print version number and exit. - -Report bugs to <ekohler@gmail.com>. -\end{verbatim} - -\subsection{使用字体的方法} - -目前\LuaTeX-ja支持在plain \TeX 和\LaTeX 下使用。如果你使用texinfo,那么很 -不幸,你不太可能使用\LuaTeX-ja来处理中文,因为texinfo是针对pdf\TeX 设计的, -在\LuaTeX 下使用已经有了一定的不兼容现象,即使完全兼容也需要对texinfo中的 -字体配置进行调整,如果你急需使用texinfo来处理中文,请尝试W32\TeX 下的texinfo, -这个发行版中的texinfo已经打了补丁。对于\ConTeXt 用户,请使用李延瑞的zhfonts模块 -\footnote{见https://github.com/liyanrui/zhfonts}。 - -在plain \TeX 中使用Lua\TeX-ja可以在源文件中写入: -\begin{verbatim} -\input luatexja-core.sty -\end{verbatim} - -Lua\TeX-ja移植的了\verb!\jfont!命令,在plain \TeX 下需要通过该命令来 -控制输出的汉字字体,例如: -\begin{verbatim} -\jfont\song={name:SimSun:jfm=banjiao} at 10pt -\song 我能吞下玻璃而不伤身体。 -\end{verbatim} - -上文中的\verb!jfm=banjiao!使用来控制标点压缩的,如果此项未设定,则 -使用默认的\verb!ujis!压缩模式,对于简体中文来讲,可用的模式有: -\texttt{quanjiao,banjiao,kaiming, CCT}。 - -而在\LaTeX 下使用则较为简单,使用: -\begin{verbatim} -\usepackage{luatexja-fontspec} -\end{verbatim} -这个包对fontspec包进行了封装,令其能够较为便利地设定汉字字体。 -这个包提供的命令如下: -\begin{table}[htbp] - \centering - \begin{tabular}{ll} - \toprule - \multicolumn{1}{c}{\textbf{命令}} & \multicolumn{1}{c}{\textbf{用途}} \\ - \midrule - \verb!\jfontspec! & 改变当前汉字字体 \\ - \verb!\setmainjfont! & 设定文档主汉字字体 \\ - \verb!\setsansjfont! & 设定文档的无衬线汉字字体(黑体) \\ - \verb!\newjfontfamily! & 设定新的汉字字体族命令 \\ - \verb!\newjfontface! & 设定新的汉字字体命令 \\ - \verb!\defaultjfontfeatures! & 默认汉字字体的特性 \\ - \verb!\addjfontfeatures! & 设定当前字体的特性 \\ - \bottomrule - \end{tabular}% -\end{table}% - -\subsection{不可用字体系列} - -中文字体在丰度上与日文字体对比并不占优势,所以中文\TeX 文档在使用使用字体 -上没有太大变化。当你想在\LuaTeX-ja下是有部分特色字体的时候,请做好此种字体 -可能无法使用的准备。目前报错明显的字体有数个: -\begin{itemize} -\item 灵格斯词典附带的音标字体,这些字体会安装到系统字体文件夹下,在更新 - 字体数据库的时候会出现程序崩溃的情况,这是字体本身的原因,需要添加到黑名单中 -\item 康熙字典体,这是中国大陆一位业余字体设计者所设计的字体,由于该作者 - 缺乏相关技术知识,导致此字体的CMap出错,无论是完全版还是试用版都会出现 - 问题,此外该字体的boundingbox也是错误的,在嵌入pdf文档中十分影响阅读 -\item 信黑体,这个字体也是CMap的问题,无法使用 -\end{itemize} -\subsection{Fandol字体系列} -Fandol系列字体由本文档两位作者联合开发,含有数种样式。 -该套字体可以在TeXLive下进行更新。 - -\begin{table}[htbp] - \centering - \begin{tabular}{lll} - \toprule - \multicolumn{1}{c}{\textbf{字体名}} & \multicolumn{1}{c}{\textbf{文件名}} & \multicolumn{1}{c}{\textbf{样例}} \\ - \midrule - FandolSong-Regular & \texttt{FandolSong-Regular.otf} & {我能吞下玻璃而不伤身体} \\ - FandolSong-Bold & \texttt{FandolSong-Bold.otf} & {\bf 我能吞下玻璃而不伤身体} \\ - FandolHei-Regular & \texttt{FandolHei-Regular.otf} & {\jfontspec{FandolHei-Regular}我能吞下玻璃而不伤身体} \\ - FandolHei-Bold & \texttt{FandolHei-Bold.otf} & {\jfontspec{FandolHei-Bold}我能吞下玻璃而不伤身体} \\ - FandolFang-Regular & \texttt{FandolFang-Regular.otf} & {\jfontspec{FandolFang-Regular}我能吞下玻璃而不伤身体}\\ - FandolKai-Regular & \texttt{FandolKai-Regular} & {\jfontspec{FandolKai-Regular}我能吞下玻璃而不伤身体}\\ - \bottomrule - \end{tabular}% -\end{table}% - - -\subsection{华文字体系列} -在微软提供的Office套装中附带了一定数量的中文字体, -这些字体是常州华文印刷新技术有限公司制造的。 -这些字体安装在系统字体文件夹下,在使用\LuaTeX-ja 的时候 -可以酌情使用。在本文档中,我们推荐简体中文用户使用 -此套字体,从使用率上看,各大学都会装有微软的操作系统 -和微软的Office,可以说已经相当普及,故做推荐。 - -\begin{table}[htbp] - \centering - \begin{tabular}{llll} - \toprule - \multicolumn{1}{c}{\textbf{字体名}} & \multicolumn{1}{c}{\textbf{文件名}} & \multicolumn{1}{c}{\textbf{PostScript名}} & \multicolumn{1}{c}{\textbf{样例}} \\ - \midrule - 华文宋体 & \texttt{STSONG.TTF} & STSong & {\jfontspec{STSong}我能吞下玻璃而不伤身体} \\ - 华文中宋 & \texttt{STZHONGS.TTF} & STZhongsong & {\jfontspec{STZhongsong}我能吞下玻璃而不伤身体} \\ - 华文细黑 & \texttt{STXIHEI.TTF} & STXihei & {\jfontspec{STXihei}我能吞下玻璃而不伤身体} \\ - 华文楷体 & \texttt{STKAITI.TTF} & STKaiti & {\jfontspec{STKaiti}我能吞下玻璃而不伤身体} \\ - 华文仿宋 & \texttt{STFANGSO.TTF} & STFangsong & {\jfontspec{STFangsong}我能吞下玻璃而不伤身体} \\ - \bottomrule - \end{tabular}% -\end{table} - -\subsection{中易字体系列} -在Windows系统简体中文版中,附带了数种中文字体。 -这些字体为中易中标电子信息技术有限公司制造的。 -同我们强烈推荐的第一种方案比较,没有中宋。 -如果按照CCT的传统,一般使用黑体替换。 - -\begin{table}[htbp] - \centering - \begin{tabular}{llll} - \toprule - \multicolumn{1}{c}{\textbf{字体名}} & \multicolumn{1}{c}{\textbf{文件名}} & \multicolumn{1}{c}{\textbf{PostScript名}} & \multicolumn{1}{c}{\textbf{样例}} \\ - \midrule - 宋体 & \texttt{simsun.ttc} & SimSun & {\jfontspec{SimSun}我能吞下玻璃而不伤身体} \\ - 黑体 & \texttt{simhei.ttf} & SimHei & {\jfontspec{SimHei}我能吞下玻璃而不伤身体} \\ - 楷体 & \texttt{simkai.ttf} & KaiTi & {\jfontspec{KaiTi}我能吞下玻璃而不伤身体} \\ - 仿宋 & \texttt{simkai.ttf} & FangSong & {\jfontspec{FangSong}我能吞下玻璃而不伤身体} \\ - \bottomrule - \end{tabular}% -\end{table}% - -\subsection{Adobe字体系列} -在Adobe Reader简体中文版中,附带了宋体和黑体两种字体。 -这两种字体实际上是华文字体,但是和华文字体不能混用, -因为Adobe Reader中的中文字体的基线都进行了调整, -不能互相匹配。在Adobe InDesign中还附带了楷体和仿宋体。 -Adobe的中文字体的Postscript名即为文件名去掉后缀名。 - -\begin{table}[htbp] - \centering - \begin{tabular}{lll} - \toprule - \multicolumn{1}{c}{\textbf{字体名}} & \multicolumn{1}{c}{\textbf{文件名}} & \multicolumn{1}{c}{\textbf{样例}} \\ - \midrule - Adobe 宋体 Std & \texttt{AdobeSongStd-Light.otf} & {\jfontspec{AdobeSongStd-Light}我能吞下玻璃而不伤身体} \\ - Adobe 黑体 Std & \texttt{AdobeHeitiStd-Regular.otf} & {\jfontspec{AdobeHeitiStd-Regular}我能吞下玻璃而不伤身体} \\ - Adobe 楷体 Std & \texttt{AdobeKaitiStd-Regular.otf} & {\jfontspec{AdobeKaitiStd-Regular}我能吞下玻璃而不伤身体} \\ - Adobe 仿宋 Std & \texttt{AdobeFangsongStd-Regular.otf} & {\jfontspec{AdobeFangsongStd-Regular}我能吞下玻璃而不伤身体} \\ - \bottomrule - \end{tabular}% -\end{table}% - -\subsection{方正字体系列} -方正字体的来源有两种,第一种是使用方正的排版系统的时候会 -安装到Windows系统的字体文件夹下,第二种是针对Linux系统 -来说的,WPS for Linux附带了部分方正字体。 - -\begin{table}[htbp] - \centering - \begin{tabular}{llll} - \toprule - \multicolumn{1}{c}{\textbf{字体名}} & \multicolumn{1}{c}{\textbf{文件名}} & \multicolumn{1}{c}{\textbf{全名}} & \multicolumn{1}{c}{\textbf{样例}} \\ - \midrule - 方正书宋\_GBK & \texttt{FZSSK.TTF} & FZShuSong-Z01 & {\jfontspec{FZShuSong-Z01}我能吞下玻璃而不伤身体} \\ - 方正小标宋\_GBK & \texttt{FZXBSK.TTF} & FZXiaoBiaoSong-B05 & {\jfontspec{FZXiaoBiaoSong-B05}我能吞下玻璃而不伤身体} \\ - 方正黑体\_GBK & \texttt{FZHTK.TTF} & FZHei-B01 & {\jfontspec{FZHei-B01}我能吞下玻璃而不伤身体} \\ - 方正楷体\_GBK & \texttt{FZKTK.TTF} & FZKai-Z03 & {\jfontspec{FZKai-Z03}我能吞下玻璃而不伤身体} \\ - 方正仿宋\_GBK & \texttt{FZFSK.TTF} & FZFangSong-Z02 & {\jfontspec{FZFangSong-Z02}我能吞下玻璃而不伤身体} \\ - \bottomrule - \end{tabular}% -\end{table}% -\end{document} diff --git a/macros/luatex/generic/luatexja/doc/luatexja.dtx b/macros/luatex/generic/luatexja/doc/luatexja.dtx index b404fc4636..19332cfb06 100644 --- a/macros/luatex/generic/luatexja/doc/luatexja.dtx +++ b/macros/luatex/generic/luatexja/doc/luatexja.dtx @@ -17,26 +17,11 @@ \makeatletter %%%%%%%% \def\pgfsysdriver{pgfsys-pdftex.def} -\directlua{if jit then jit.on() end} \usepackage{metalogo,amsmath,array,tikz,pict2e,multienum,float,mathtools} \usepackage{booktabs,multicol,luatexja-ruby} \usepackage[all]{xy} \usepackage{lltjext,alltt,comment} -%%%%%%%% Lua GC -\patchcmd\@outputpage{\stepcounter{page}}{% - \directlua{% - if jit then - local k = collectgarbage("count") - if k>900000 then - collectgarbage("collect") - texio.write_nl("term and log", "GC: ", math.floor(k), math.floor(collectgarbage("count"))) - end - end - }% - \stepcounter{page}% -}{}{} - %%%%%%%% fonts \usepackage{luatexja-otf} \usepackage[no-math]{fontspec} @@ -46,7 +31,8 @@ %<ja> Scale=MatchLowercase, FakeStretch=1.137121, ItalicFont=iosevka-slab-oblique, BoldFont=iosevka-slab-bold, BoldItalicFont=iosevka-slab-bolditalic, -]{iosevka-slab-regular} +%<en> ]{iosevka-slab-regular} +%<ja> ]{iosevka-slab-light} \setsansfont[Scale=MatchLowercase,Ligatures=TeX,RawFeature=-notdef]{Linux Biolinum O} \usepackage[match]{luatexja-fontspec} \usepackage[kozuka-pr6n]{luatexja-preset} @@ -87,14 +73,22 @@ \def\IVS#1{\char\numexpr "E0100+#1\relax}%" \def\IVSA#1#2#3#4#5{% - \textcolor{blue}{\raisebox{3.5pt}{\normalfont\ttfamily% - \fboxsep=0.5pt\fbox{\tiny \oalign{0#1#2\crcr#3#4#5\crcr}}}}% + \hbox to1em{\hss\textcolor{blue}{\raisebox{3.5pt}{\normalfont\ttfamily% + \fboxsep=0.5pt\fbox{\hbox to0.75em{\hss\tiny \oalign{0#1#2\crcr#3#4#5\crcr}\hss}}}}\hss}% } {\catcode`\%=11 \gdef\IVSB#1{\expandafter\IVSA\directlua{ local cat_str = luatexbase.catcodetables['string'] tex.sprint(cat_str, string.format('%X', 0xE00EF+#1)) }}} +\def\UCSA#1#2#3#4{% + \hbox to1em{\hss\textcolor{blue}{\raisebox{3.5pt}{\normalfont\ttfamily% + \fboxsep=0.5pt\fbox{\hbox to0.75em{\hss\tiny \oalign{#1#2\crcr#3#4\crcr}\hss}}}}\hss}% +} +\def\UCSB#1#2{% + \hbox to1em{\hss\textcolor{red}{\raisebox{3.5pt}{\normalfont\ttfamily% + \fboxsep=0.5pt\fbox{\hbox to0.75em{\hss\tiny \oalign{\hss#1\hss\crcr\hss#2\hss\crcr}\hss}}}}\hss}% +} \usepackage{listings,showexpl,enumitem} \lstset{ @@ -648,32 +642,21 @@ and \emph{Japanese fonts} for fonts used in \textbf{JAchar}. %<ja>\section{使い方} %<en>\subsection{Installation} %<ja>\subsection{インストール} - +\label{ssec:install} %<en>The following packages are needed for the \LuaTeX-ja\ package. %<ja>\LuaTeX-jaパッケージの動作には次のパッケージ類が必要である. \begin{itemize} \item \href{http://www.luatex.org/}{\LuaTeX}\ 1.0.0 (or later) -\item recent \href{https://github.com/latex3/luaotfload}{\Pkg{luaotfload}} (v2.98 or later recommended) +\item recent \href{https://github.com/latex3/luaotfload}{\Pkg{luaotfload}} (v3.1 or later recommended) \item \Pkg{adobemapping} (Adobe cmap and pdfmapping files) -\item \Pkg{etoolbox}, \Pkg{everysel} (if you want to use \LuaTeX-ja with \LaTeXe) +\item \href{https://github.com/josephwright/etoolbox/}{\Pkg{etoolbox}}, + \Pkg{everysel} (if you want to use \LuaTeX-ja with \LaTeXe) \item \Pkg{ltxcmds}, \Pkg{pdftexcmds}, \Pkg{filehook}, \Pkg{atbegshi} -\item \Pkg{fontspec} v2.7c (or later) +\item \href{https://github.com/wspr/fontspec/}{\Pkg{fontspec}} v2.7c (or later) %<en>\item \emph{IPAex fonts} (\url{http://ipafont.ipa.go.jp/}) %<ja>\item \emph{IPAexフォント(\url{http://ipafont.ipa.go.jp/})} \end{itemize} -%<*en> -LuaHB\TeX~and~\href{https://github.com/khaledhosny/harftex}{Harf\TeX}, -which are \LuaTeX-variants integrated with Harfbuzz, are not supported for now. -Maybe documents can typeset without an error, -but with unwanted results (especially, vertical typesetting and \cs{CID}). -%</en> -%<*ja> -現時点では,LuaHB\TeX や\href{https://github.com/khaledhosny/harftex}{Harf\TeX}といった -Harfbuzzを利用したエンジンでの動作は未保証である. -エラーが発生せずにタイプセットできるかもしれないが,特に縦組時や -\cs{CID}などで意図しない結果となりうる可能性が大きい. -%</ja> %<*en> Now \LuaTeX-ja is available from @@ -681,8 +664,8 @@ CTAN (in the \texttt{macros/luatex/generic/luatexja} directory), and the following distributions: \begin{itemize} \item MiK\TeX\ (in \texttt{luatexja.tar.lzma}); see the next subsection - \item \TeX\ Live (in \texttt{texmf-dist/tex/luatex/luatexja}) - \item W32\TeX\ (in \texttt{luatexja.tar.xz}) + \item \href{https://www.tug.org/texlive/}{\TeX\ Live} (in \texttt{texmf-dist/tex/luatex/luatexja}) + \item \href{http://w32tex.org/}{W32\TeX}\ (in \texttt{luatexja.tar.xz}) \end{itemize} IPAex fonts are also available in these distributions. %</en> @@ -698,6 +681,27 @@ IPAex fonts are also available in these distributions. W32\TeX においてはIPAexフォントは \texttt{luatexja.tar.xz} 内にある. %</ja> +%<*en> +\paragraph{Using \LuaTeX-ja with LuaHB\TeX} +Using \LuaTeX-ja with LuaHB\TeX (\LuaTeX\ integrated with +\href{https://github.com/harfbuzz/harfbuzz}{HarfBuzz}) is not well tested. +Maybe documents can typeset without an error, +but with unwanted results (especially, vertical typesetting and \cs{CID}). + +Especially, +\emph{We don't recommend defining a Japanese font with HarfBuzz}, +by specifying \texttt{Renderer=Harfbuzz}~etc.\ (\Pkg{fontspec}) or~{mode=harf} (otherwise). +%</en> +%<*ja> +\paragraph{LuaHB\TeX 下での\LuaTeX-jaの使用} +現時点では,LuaHB\TeX 下での\LuaTeX-jaの使用は十分にテストされていない. +エラーが発生せずにタイプセットできるかもしれないが,特に縦組時や +\cs{CID}などで意図しない結果となりうる可能性が大きい. + +特に,\texttt{Renderer=Harfbuzz}等(\Pkg{fontspec})や\texttt{mode=harf}指定(それ以外)を用いて +\emph{和文フォントに対してHarfBuzzを用いることは推奨しない}. +%</ja> + %<en>\paragraph{Manual installation} %<ja>\paragraph{手動インストール方法} @@ -707,7 +711,7 @@ W32\TeX においてはIPAexフォントは \texttt{luatexja.tar.xz} 内にあ At the present, \LuaTeX-ja has no \emph{stable} release. \begin{itemize} -\item Clone the Git repository: +\item Clone the Git repository by \begin{lstlisting} $ git clone git://git.osdn.jp/gitroot/luatex-ja/luatexja.git \end{lstlisting} @@ -725,11 +729,11 @@ the forefront of development is not the \texttt{master} branch. 開発版であって,安定版でないことに注意. \begin{itemize} -\item Gitリポジトリをクローンする: +\item Gitリポジトリを次のコマンドでクローンする: \begin{lstlisting} $ git clone git://git.osdn.jp/gitroot/luatex-ja/luatexja.git \end{lstlisting} -\item \texttt{master} ブランチのスナップショット(\texttt{tar.gz} 形式)をダウンロードする. +\item \texttt{master} ブランチのスナップショット(\texttt{tar.gz} 形式)をダウンロードする: \begin{flushleft} \url{http://git.osdn.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}. \end{flushleft} @@ -1161,8 +1165,7 @@ so \Pkg{ltjsclasses} uses the \texttt{nomag*} option\footnote{Same effect as \footnote{\Pkg{jsclasses}や,八登崇之氏による\Pkg{BXjscls}クラスにおける同名のオプションと 同じ.上記クラスは\TeX コードのみで実装しているが,\Pkg{ltjsclasses}ではLuaコードも用いている.}が標準で 有効になっており,これを使って本文フォントサイズの設定を行っている. -しかし,この\texttt{nomag*}オプションでは(20180121.0版より前の版において\Pkg{unicode-math}パッケージ使用時に -起きたように)予想外の意図しない現象に遭遇する危険がある.そのような場合は +しかし,この\texttt{nomag*}オプションでは(バージョン20180121.0より前で\Pkg{unicode-math}パッケージ使用時に起きたように)予想外の意図しない現象に遭遇する危険がある.そのような場合は \cs{documentclass}において\texttt{nomag}オプションを指定してほしい. %</ja> @@ -1647,7 +1650,7 @@ The following presets are defined: \begin{quote} \ttfamily \hyphenchar\font=-1 \exhyphenchar=-1 - hiragino-pro, hiragino-pron, ipa, ipa-hg, ipaex, ipaex-hg, + haranoaji, hiragino-pro, hiragino-pron, ipa, ipa-hg, ipaex, ipaex-hg, kozuka-pr6, kozuka-pr6n, kozuka-pro, moga-mobo, moga-mobo-ex, bizud, morisawa-pr6n, morisawa-pro, ms, ms-hg, noembed, noto-otc, noto-otf, sourcehan, sourcehan-jp, ume, yu-osx, yu-win, yu-win10 @@ -2125,6 +2128,52 @@ setting, you can use \cs{ltjalchar} and \cs{ltjjachar} respectively, as the foll \end{LTXexample} %</ja> +%<*ja> +\paragraph{絵文字など,複数コードポイントの列で表現される字形をを利用する場合の注意} +(\Pkg{luaotfload}による)OpenType機能や合字等の処理は,\LuaTeX-jaが +段落・水平ボックスの中身全体に対して「この文字は\textbf{JAchar}だから和文フォントで組む」と +フォントを置き換えた後に適用される. +そのため,異体字セレクタや絵文字といった複数のコードポイントの列で表現される文字を +組む場合には,列全体で\textbf{JAchar}の範囲か\textbf{ALchar}の範囲かが +統一されていないといけない. + +例えば,CJK統合漢字(とその拡張達)と +IVS用の異体字セレクタ(\texttt{U+E0100}--\texttt{U+E01EF})は標準では +どちらも同じ文字範囲6であるため,(フォントがサポートしていれば)IVSは正しく機能する. +しかし,下の例のように異体字セレクタを\textbf{ALchar}の文字範囲(4)に移動させると, +IVSは機能しなくなる: +\ltjdefcharrange{4}{"E0100-"E01EF} +\begin{LTXexample} +\ltjdefcharrange{4}{"E0100-"E01EF} +葛󠄀城市,葛󠄁飾区,葛西 +\end{LTXexample} +\ltjdefcharrange{6}{"E0100-"E01EF} + +また,標準では絵文字として使われる可能性が大きい一部の文字が\textbf{JAchar}となっている +\footnote{同じUnicodeブロック内にAdobe-Japan1-6の文字があったため.}. +絵文字を用いる場合にはこの点に留意する必要がある. + +\begin{center} + \begin{minipage}{.5\textwidth}\small\ttfamily +\verb!\ltjsetparameter{jacharrange={+3}}!\\ +\verb!\font\nce=NotoColorEmoji.ttf:mode=harf\nce!\\ +\IVSA 1F469\UCSB{ZW}{J}\UCSA 2764\UCSB{VS}{16}\UCSB{ZW}J\IVSA 1F48B\UCSB{ZW}J\IVSA 1F468\ + \textcolor{green}{\% U+2764: JAchar}\\ +\verb!\ltjsetparameter{jacharrange={-3}}!\\ +\IVSA 1F469\UCSB{ZW}{J}\UCSA 2764\UCSB{VS}{16}\UCSB{ZW}J\IVSA 1F48B\UCSB{ZW}J\IVSA 1F468\ + \textcolor{green}{\% U+2764: ALchar} + \end{minipage}% + \begin{minipage}{.5\textwidth} +\ltjsetparameter{jacharrange={+3}} +\font\nce=NotoColorEmoji.ttf:mode=harf\nce +👩❤️💋👨 +\ltjsetparameter{jacharrange={-3}} +👩❤️💋👨 + \end{minipage} +\end{center} +\ltjsetparameter{jacharrange={+3}} +%</ja> + %<en>\subsection{\Param{kanjiskip} and \Param{xkanjiskip}} %<ja>\subsection{\Param{kanjiskip}と\Param{xkanjiskip}} @@ -3424,14 +3473,16 @@ JFMは文字と和文組版で自動的に挿入される \def\r#1#2{% \hbox{\Large\vrule \parbox[b]{7\zw}{% - \addjfontfeatures{YokoFeatures={Opacity=0.5, Color=#2, JFM=#1}}\noindent + \addjfontfeatures{YokoFeatures={JFM=#1}}\noindent + \color{#2}\transparent{0.5} ◆◆◆◆◆◆◆ ある日モモちゃんがお使いで迷子になって泣きました. }\vrule}} \def\s#1#2{% \Large \parbox[b]{7\zw}{% - \addjfontfeatures{YokoFeatures={Opacity=0.5, Color=#2, JFM=#1}}\noindent + \addjfontfeatures{YokoFeatures={JFM=#1}}\noindent + \color{#2}\transparent{0.5} ちょっと!何 }} \def\t#1#2#3{\hbox to 0pt{\hss% @@ -3713,14 +3764,16 @@ This functionality is disabled by \texttt{-ltjksp} specification. \def\r#1#2{% \hbox{\tate\Large\vrule \parbox{7\zw}{% - \addjfontfeatures{TateFeatures={Opacity=0.5, Color=#2, JFM=#1}}\noindent + \addjfontfeatures{TateFeatures={JFM=#1}}\noindent + \color{#2}\transparent{0.5} ◆◆◆◆◆◆◆ ある日モモちゃんが「お使い」で迷子になって泣きました。 }\vrule}} \def\s#1#2{% \hbox{\tate\Large \parbox{7\zw}{% - \addjfontfeatures{TateFeatures={Opacity=0.5, Color=#2, JFM=#1}}\noindent + \addjfontfeatures{TateFeatures={JFM=#1}}\noindent + \color{#2}\transparent{0.5} ちょっと!何 }}} \def\t#1#2#3{\hbox to 0pt{\hss% @@ -6428,11 +6481,11 @@ to <family>. See Subsection~\ref{ssec:fontfamilycmd} for detail. \begin{figure}[!tb] \begin{LTXexample}[pos=b] \DeclareKanjiFamily{JY3}{edm}{} -\DeclareFontShape{JY3}{edm}{m}{n} {<-> s*KozMinPr6N-Regular:jfm=ujis;}{} -\DeclareFontShape{JY3}{edm}{m}{green}{<-> s*KozMinPr6N-Regular:jfm=ujis;color=007F00}{} -\DeclareFontShape{JY3}{edm}{m}{blue} {<-> s*KozMinPr6N-Regular:jfm=ujis;color=0000FF}{} -\DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{green}{"4E00-"67FF,{-2}-{-2}} -\DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{blue}{ "6800-"9FFF} +\DeclareFontShape{JY3}{edm}{m}{n} {<-> s*KozMinPr6N-Regular:jfm=ujis;}{} +\DeclareFontShape{JY3}{edm}{m}{fb} {<-> s*KozGoPr6N-Regular:jfm=ujis}{} +\DeclareFontShape{JY3}{edm}{m}{fb2} {<-> s*KozGoPr6N-Medium:jfm=ujis}{} +\DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{fb}{ "4E00-"67FF,{-2}-{-2}} +\DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{fb2}{"6800-"9FFF} {\kanjifamily{edm}\selectfont 日本国民は、正当に選挙された国会における代表者を通じて行動し、……} \end{LTXexample} @@ -6810,11 +6863,11 @@ will not be embedded in the output PDF file. See Subsection~\ref{ssec:psft}. \begin{figure}[!tb] \begin{LTXexample}[width=0.25\textwidth] \jfontspec[ - YokoFeatures={Color=007F00}, TateFeatures={Color=00007F}, + YokoFeatures={FakeBold=3}, TateFeatures={FakeBold=6}, TateFont=KozGoPr6N-Regular ]{KozMinPr6N-Regular} \hbox{\yoko 横組のテスト}\hbox{\tate 縦組のテスト} -\addjfontfeatures{Color=FF0000} +\addjfontfeatures{FakeBold=0} \hbox{\yoko 横組}\hbox{\tate 縦組} \end{LTXexample} %<ja>\caption{\texttt{TateFeatures} 等の使用例} @@ -6860,8 +6913,8 @@ A demonstrarion is shown in \autoref{fig:yokotate-fontspec}. \begin{LTXexample}[pos=b] \jfontspec[ AltFont={ - {Range="4E00-"67FF, Color=007F00}, - {Range="6800-"9EFF, Color=0000FF}, + {Range="4E00-"67FF, Font=KozGoPr6N-Medium}, + {Range="6800-"9EFF, FakeBold=4}, {Range="3040-"306F, Font=KozGoPr6N-Regular}, } ]{KozMinPr6N-Regular} @@ -6924,7 +6977,7 @@ For example, \begin{lstlisting} AltFont = { { Font=HogeraMin-Light, BoldFont=HogeraMin-Bold, - Range="3000-"30FF, BoldFeatures={Color=007F00} } + Range="3000-"30FF, BoldFeatures={FakeBold=1} } } \end{lstlisting} does \emph{not} work. Instead, one have to write @@ -6933,7 +6986,7 @@ UprightFeatures = { AltFont = { { Font=HogeraMin-Light, Range="3000-"30FF, } }, }, BoldFeatures = { - AltFont = { { Font=HogeraMin-Bold, Range="3000-"30FF, Color=007F00 } }, + AltFont = { { Font=HogeraMin-Bold, Range="3000-"30FF, FakeBold=1 } }, } \end{lstlisting} @@ -6956,7 +7009,7 @@ has no effect, because a color specification is already done in \begin{lstlisting} AltFont = { { Font=HogeraMin-Light, BoldFont=HogeraMin-Bold, - Range="3000-"30FF, BoldFeatures={Color=007F00} } + Range="3000-"30FF, BoldFeatures={FakeBold=1} } } \end{lstlisting} のように指定することは出来ず, @@ -6965,7 +7018,7 @@ UprightFeatures = { AltFont = { { Font=HogeraMin-Light, Range="3000-"30FF, } }, }, BoldFeatures = { - AltFont = { { Font=HogeraMin-Bold, Range="3000-"30FF, Color=007F00 } }, + AltFont = { { Font=HogeraMin-Bold, Range="3000-"30FF, FakeBold=1 } }, } \end{lstlisting} のように指定しなければならない. @@ -6975,8 +7028,8 @@ BoldFeatures = { 指定することは可能であり.また\ \texttt{YokoFeatures},~\texttt{TateFeatures} キーの 中身に \texttt{AltFont} を指定することができる. -また,\autoref{fig:yokotate-fontspec}後半部では6行目の色の指定が効かず, -2行目で指定した\ \texttt{YokoFeatures},~\texttt{TateFeatures}\ による色の指定が有効になっ +また,\autoref{fig:yokotate-fontspec}後半部では6行目の疑似太字無効化の指定が効かず, +2行目で指定した\ \texttt{YokoFeatures},~\texttt{TateFeatures}\ による疑似太字の指定が有効になっ たままである.これは\emph{\ \texttt{YokoFeatures},~\texttt{TateFeatures}\ による OpenType機能指定は 組方向に依存しないOpenType機能の指定より後に解釈される}からである. @@ -7071,13 +7124,13 @@ ordinary characters in the following points: 有効か無効かを問わず,\cs{UTF} で出力される文字にはこれらのOpenType機能が働いた字形になる. %</ja> %<*en> -\item Processing codes for supporting other OpenType features (for example, +\item Processes for supporting other OpenType features (for example, glyph replacement and kerning) by the \Pkg{luaotfload} package is not performed to these characters. %</en> %<*ja> \item その他のOpenType機能(例えばグリフ置換やカーニング)をサポートするための - \Pkg{luaotfload}パッケージのコードはこれらの文字には働かない. + \Pkg{luaotfload}パッケージによる処理はこれらの文字には働かない. %</ja> \end{itemize} @@ -7949,13 +8002,13 @@ We didn't taken account of when more than one options among them are specified. \label{sssec:ltjpreset-multi} %<*en> -Besides \texttt{bizud}, \texttt{morisawa-pro},~and~\texttt{morisawa-pr6n} presets, +Besides \texttt{bizud}, \texttt{haranoaji}, \texttt{morisawa-pro},~and~\texttt{morisawa-pr6n} presets, fonts are specified by font name, not by file name. In following tables, starred fonts (e.g.~KozGo\dots-Regular) are used for medium series of \textit{gothic}, \emph{if and only if \texttt{deluxe} option is specified}. %</en> %<*ja> -\texttt{bizud}, \texttt{morisawa-pro}, \texttt{morisawa-pr6n}以外はフォントの指定は +\texttt{bizud}, \texttt{haranoaji}, \texttt{morisawa-pro}, \texttt{morisawa-pr6n}以外はフォントの指定は (ファイル名でなく)フォント名で行われる. 以下の表において,*\,つきのフォント(e.g.,~KozGo\dots-Regular)は,\emph{\texttt{deluxe}オプション指定時に} ゴシック体中字として用いられるものを示している. @@ -7991,12 +8044,12 @@ There is not rounded gothic family in Kozuka fonts. &KozGoPro-Medium&KozGoProVI-Medium&KozGoPr6N-Medium\\ \cmidrule(l){2-5} %<en>\smash{\raisebox{2ex}{\textit{gothic}}}% -%<ja>\smash{\raisebox{2ex}{\gt ゴシック}}% +%<ja>\smash{\raisebox{2ex}{\textgt{ゴシック}}}% &bold&KozGoPro-Bold&KozGoProVI-Bold&KozGoPr6N-Bold\\ &extra bold&KozGoPro-Heavy&KozGoProVI-Heavy&KozGoPr6N-Heavy\\ \midrule %<en>\textit{rounded gothic} -%<ja>\gt 丸ゴシック +%<ja>\textgt{丸ゴシック} &&KozGoPro-Heavy&KozGoProVI-Heavy&KozGoPr6N-Heavy\\ \bottomrule \end{tabular} @@ -8037,18 +8090,17 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である. &Hiragino~Kaku~Gothic~Pro~W6&Hiragino~Kaku~Gothic~ProN~W6\\ \cmidrule(l){2-4} %<en>\smash{\raisebox{2ex}{\textit{gothic}}}% -%<ja>\smash{\raisebox{2ex}{\gt ゴシック}}% +%<ja>\smash{\raisebox{2ex}{\textgt{ゴシック}}}% &bold&Hiragino~Kaku~Gothic~Pro~W6&Hiragino~Kaku~Gothic~ProN~W6\\ &extra bold&Hiragino~Kaku~Gothic~Std~W8&Hiragino~Kaku~Gothic~StdN~W8\\ \midrule %<en>\textit{rounded gothic} -%<ja>\gt 丸ゴシック +%<ja>\textgt{丸ゴシック} &&Hiragino~Maru~Gothic~Pro~W4&Hiragino~Maru~Gothic~ProN~W4\\ \bottomrule \end{tabular} \end{center} -%<ja>\newpage \item[bizud] BIZ UD fonts (by Morisawa Inc.) bundled with Windows~10 October 2018 Update. \begin{center}\small @@ -8063,12 +8115,12 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である. &medium&BIZ-UDGothicR.ttc\\ \cmidrule(l){2-3} %<en>\textit{gothic}% -%<ja>\gt ゴシック +%<ja>\textgt{ゴシック} &bold&BIZ-UDGothicB.ttc\\ &extra bold&BIZ-UDGothicB.ttc\\ \midrule %<en>\textit{rounded gothic} -%<ja>\gt 丸ゴシック +%<ja>\textgt{丸ゴシック} &&BIZ-UDGothicB.ttc\\ \bottomrule \end{tabular} @@ -8086,18 +8138,18 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である. \midrule &medium&A-OTF-RyuminPro-Light.otf&A-OTF-RyuminPr6N-Light.otf\\ %<en>\smash{\raisebox{1.5ex}{\textit{mincho}}}% -%<ja>\smash{\raisebox{1.5ex}{\gt 明朝}}% +%<ja>\smash{\raisebox{1.5ex}{\textgt{明朝}}}% &bold&A-OTF-FutoMinA101Pro-Bold.otf&A-OTF-FutoMinA101Pr6N-Bold.otf\\ \midrule &medium &A-OTF-GothicBBBPro-Medium.otf&A-OTF-GothicBBBPr6N-Medium.otf\\ %<en>\textit{gothic}% -%<ja>\gt ゴシック +%<ja>\textgt{ゴシック} &bold&A-OTF-FutoGoB101Pro-Bold.otf&A-OTF-FutoGoB101Pr6N-Bold.otf\\ &extra bold&A-OTF-MidashiGoPro-MB31.otf&A-OTF-MidashiGoPr6N-MB31.otf\\ \midrule %<en>\textit{rounded gothic} -%<ja>\gt 丸ゴシック +%<ja>\textgt{丸ゴシック} &&A-OTF-Jun101Pro-Light.otf&A-OTF-ShinMGoPr6N-Light.otf\\ \bottomrule \end{tabular} @@ -8125,12 +8177,12 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である. &YuGothic-Regular&YuGothic-Medium&YuGothic~Medium\\ \cmidrule(l){2-5} %<en>\textit{gothic}% -%<ja>\gt ゴシック +%<ja>\textgt{ゴシック} &bold&YuGothic-Bold&YuGothic-Bold&YuGothic~Bold\\ &extra bold&YuGothic-Bold&YuGothic-Bold&YuGothic~Bold\\ \midrule %<en>\textit{rounded gothic} -%<ja>\gt 丸ゴシック +%<ja>\textgt{丸ゴシック} &&YuGothic-Bold&YuGothic-Bold&YuGothic~Bold\\ \bottomrule \end{tabular} @@ -8148,17 +8200,17 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である. \midrule &medium&Moga90Mincho&MogaMincho\\ %<en>\smash{\raisebox{1.5ex}{\textit{mincho}}}% -%<ja>\smash{\raisebox{1.5ex}{\gt 明朝}}% +%<ja>\smash{\raisebox{1.5ex}{\textgt{明朝}}}% &bold&Moga90Mincho Bold&MogaMincho Bold\\ \midrule &medium&Moga90Gothic&MogaGothic\\ %<en>\textit{gothic}% -%<ja>\gt ゴシック +%<ja>\textgt{ゴシック} &bold&Moga90Gothic Bold&MogaGothic Bold\\ &extra bold&Moga90Gothic Bold&MogaGothic Bold\\ \midrule %<en>\textit{rounded gothic} -%<ja>\gt 丸ゴシック +%<ja>\textgt{丸ゴシック} &&Mobo90Gothic&MoboGothic\\ \bottomrule \end{tabular} @@ -8176,19 +8228,19 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である. \midrule &medium&Ume Mincho\\ %<en>\smash{\raisebox{1.5ex}{\textit{mincho}}}% -%<ja>\smash{\raisebox{1.5ex}{\gt 明朝}}% +%<ja>\smash{\raisebox{1.5ex}{\textgt{明朝}}}% &bold&Ume Mincho\\ \midrule &&Ume Gothic*\\ &\smash{\raisebox{1.5ex}{medium}}&Ume Gothic O5\\ \cmidrule(l){2-3} %<en>\textit{gothic}% -%<ja>\gt ゴシック +%<ja>\textgt{ゴシック} &bold&Ume Gothic O5\\ &extra bold&Ume Gothic O5\\ \midrule %<en>\textit{rounded gothic} -%<ja>\gt 丸ゴシック +%<ja>\textgt{丸ゴシック} &&Ume Gothic O5\\ \bottomrule \end{tabular} @@ -8215,12 +8267,12 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である. &\AD{Sans}{Medium}\\ \cmidrule(l){2-4} %<en>\smash{\raisebox{2ex}{\textit{gothic}}}% -%<ja>\smash{\raisebox{2ex}{\gt ゴシック}}% +%<ja>\smash{\raisebox{2ex}{\textgt{ゴシック}}}% &bold&\AD{Sans}{Bold}\\ &extra bold&\AD{Sans}{Heavy}\\ \midrule %<en>\textit{rounded gothic} -%<ja>\gt 丸ゴシック +%<ja>\textgt{丸ゴシック} &&\AD{Sans}{Heavy}\\ \bottomrule \end{tabular} @@ -8247,18 +8299,54 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である. &\AD{Sans}{Medium}\\ \cmidrule(l){2-4} %<en>\smash{\raisebox{2ex}{\textit{gothic}}}% -%<ja>\smash{\raisebox{2ex}{\gt ゴシック}}% +%<ja>\smash{\raisebox{2ex}{\textgt{ゴシック}}}% &bold&\AD{Sans}{Bold}\\ &extra bold&\AD{Sans}{Black}\\ \midrule %<en>\textit{rounded gothic} -%<ja>\gt 丸ゴシック +%<ja>\textgt{丸ゴシック} &&\AD{Sans}{Black}\\ \bottomrule \end{tabular} \end{center} +\item[haranoaji] Harano Aji Fonts. +%<en>\par These fonts can be downloaded from\\\hfill \url{https://github.com/trueroad/HaranoAjiFonts}. +%<ja>これらのフォントは \url{https://github.com/trueroad/HaranoAjiFonts} からダウンロードできる. +%<*en> +There is not rounded gothic family in Harano Aji Fonts. +%</en> +%<*ja> +「原ノ味丸ゴシック」は存在しないので,便宜的に原ノ味角ゴシックHeavyによって代用している. +%</ja> +\begin{center}\small +\begin{tabular}{lll} +\toprule +\bf family&\bf series&\texttt{haranoaji}\\ +\midrule + &light&HaranoAjiMincho-Light.otf\\ +%<en>\textit{mincho}% +%<ja>\textgt{明朝}% + &medium&HaranoAjiMincho-Regular.otf\\ + &bold&HaranoAjiMincho-Bold.otf\\ +\midrule + &&HaranoAjiGothic-Regular.otf*\\ + &\smash{\raisebox{1.5ex}{medium}} + &HaranoAjiGothic-Medium.otf\\ +\cmidrule(l){2-3} +%<en>\smash{\raisebox{2ex}{\textit{gothic}}}% +%<ja>\smash{\raisebox{2ex}{\textgt{ゴシック}}}% + &bold&HaranoAjiGothic-Bold.otf\\ + &extra bold&HaranoAjiGothic-Heavy.otf\\ +\midrule +%<en>\textit{rounded gothic} +%<ja>\textgt{丸ゴシック} +&&HaranoAjiGothic-Heavy.otf\\ +\bottomrule +\end{tabular} +\end{center} \end{cslist} + %<en>\subsubsection{Presets which do not support multi weights} %<ja>\subsubsection{単ウェイト用プリセット一覧} \label{sssec:ltjpreset-single} @@ -8776,19 +8864,19 @@ Nodes for \LuaTeX-ja's stack system (see the next \item[\textit{char\_by\_cid}] %<*en> -Nodes for \textbf{JAchar} which the callback process of - \Pkg{luaotfload} won't be applied, and the character code is +Nodes for \textbf{JAchar} which processes by \Pkg{luaotfload} won't be applied, + and the character code is stored in the \texttt{value} field. Each node of this type are converted to a \textit{glyph\_node} \emph{after} - the callback process of luaotfload. -Nodes of this type is used in \cs{CID}, \cs{UTF} and IVS support. + processes by luaotfload. +Nodes of this type is used in \cs{CID}~and~\cs{UTF}. %</en> %<*ja> -\Pkg{luaotfload}のコールバックによる処理が適用されない\textbf{JAchar}のためのノードで, +\Pkg{luaotfload}による処理が適用されない\textbf{JAchar}のためのノードで, \texttt{value} フィールドに文字コードが格納されている. この種類のノードはそれぞれが\Pkg{luaotfload}のコールバックの処理の \emph{後で}\textit{glyph\_node}に変換される. -\cs{CID}, \cs{UTF}やIVS対応処理でこの種類のノードが利用されている. +\cs{CID}, \cs{UTF}でこの種類のノードが利用されている. %</ja> \item[\textit{replace\_vs}] @@ -10349,9 +10437,8 @@ variation selectors are ``combined'' with the previous character. \texttt{vsraw}は,ブール値の値をとるキーであり,標準ではfalseである. \begin{itemize} - \item trueの場合は,異体字セレクタは「直前の文字に続けて」出力される. -もしもIVSサポート(\ref{ssec:ltjotf}節)が有効になっていた場合は, -以下の例(左側は入力,右側はその出力)のようになる. + \item trueの場合は,異体字セレクタは「直前の文字に続けて」出力されるため, +例えば以下の例(左側は入力,右側はその出力)のようになる. %</ja> \begin{LTXexample} \begin{lstlisting}[vsraw=true] @@ -10379,8 +10466,8 @@ The default setting of the \texttt{vscmd} key produces the following. %<en> For example, the following code is the setting of the \texttt{vscmd} key in this document. \begin{lstlisting}[numbers=left] \def\IVSA#1#2#3#4#5{% - \textcolor{blue}{\raisebox{3.5pt}{\tt% - \fboxsep=0.5pt\fbox{\tiny \oalign{0#1#2\crcr#3#4#5\crcr}}}}% + \hbox to1em{\hss\textcolor{blue}{\raisebox{3.5pt}{\normalfont\ttfamily% + \fboxsep=0.5pt\fbox{\hbox to0.75em{\hss\tiny \oalign{0#1#2\crcr#3#4#5\crcr}\hss}}}}\hss}% } {\catcode`\%=11 \gdef\IVSB#1{\expandafter\IVSA\directlua{ diff --git a/macros/luatex/generic/luatexja/src/addons/luatexja-fontspec-25c.sty b/macros/luatex/generic/luatexja/src/addons/luatexja-fontspec-25c.sty deleted file mode 100644 index 9c67b70358..0000000000 --- a/macros/luatex/generic/luatexja/src/addons/luatexja-fontspec-25c.sty +++ /dev/null @@ -1,357 +0,0 @@ -% -% luatexja-fontspec-25c.sty -% - -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luatexja-fontspec-25c}[2019/05/14 fontspec support of LuaTeX-ja] -\RequirePackage{l3keys2e} -\ExplSyntaxOn - -%%%%%%%% Change Japanese font family by \rmfamily or not -\cs_new:Npn \ltj_fontspec_match_cmd { - \renewcommand\jttdefault{\gtdefault} - \@ltj@match@familytrue - \DeclareDocumentCommand \setmonojfont { O{} m O{} } { - \ltj_fontspec_set_family:Nnn \jttdefault {##1,##3}{##2} - \normalfont - } -} -\bool_if:NT \__ltj_fontspec_match_bool \ltj_fontspec_match_cmd - -%%%%%%%% Messages -\msg_new:nnn {luatexja-fontspec} {addjfontfeatures-ignored} -{ - \string\addjfontfeature (s)~ ignored;\\ - it~ cannot~ be~ used~ with~ a~ font~ that~ wasn't~ selected~ by~ luatexja-fontspec. -} - -\msg_new:nnn {luatexja-fontspec} {altfont-ignored-by-norange} -{ - ignored~ sublist~ `#1'~ in~ AltFont~ (no~ range~ is~ specified). -} - -\msg_new:nnn {luatexja-fontspec} {altfont-ignored-by-rangeonly} -{ - ignored~ sublist~ `#1'~ in~ AltFont~ (only~ range~ is~ specified). -} - -\cs_generate_variant:Nn \prg_new_conditional:Nnn {Nnx} - -%%%%%%%% Internal control sequences -%% Each CS is ltj_fontspec version that corresponds to original CS of fontspec. -\cs_new:Nn \ltj_fontspec_define_option:nn { - \__fontspec_keys_define_code:nnn {fontspec} {#1} {#2} -} -\cs_new:Nn \ltj_fontspec_define_preparse_external:nn { - \__fontspec_keys_define_code:nnn {fontspec-preparse-external} {#1} {#2} -} -\cs_new:Nn \ltj_fontspec_define_altfont_option:nn { - \__fontspec_keys_define_code:nnn {fontspec-ltjaltfont} {#1} {#2} -} - -%% Alternate Fonts -%% Spec: AltFont = { -%% ... -%% { Range = <range>, <font features> }, -%% { Range = <range>, Font = <font name>, <font features> }, -%% { Range = <range>, Font = <font name> }, -%% ... -%% } -\tl_new:N \l_ltj_fontspec_altname_tl -\tl_new:N \l_ltj_fontspec_altrange_tl -\clist_new:N \l_ltj_fontspec_altfont_clist -\clist_new:N \l_ltj_fontspec_altfont_leftover_clist -\int_new:N \g_ltj_fontspec_altnumber_int - -\ltj_fontspec_define_altfont_option:nn {Range} { - \tl_set:Nn \l_ltj_fontspec_altrange_tl {#1} -} -\ltj_fontspec_define_altfont_option:nn {Font} { - \fontspec_complete_fontname:Nn \l_ltj_fontspec_altname_tl {#1} -} -\__fontspec_keys_define_code:nnn {fontspec-ltjaltfont-reparse} {AltFont} { - \clist_put_right:Nn \l_ltj_fontspec_altfont_clist { #1 } -} -\__fontspec_keys_define_code:nnn {fontspec-ltjaltfont-reparse} {YokoFeatures} { - \clist_put_right:Nn \l_ltj_fontspec_fontfeat_yoko_clist { #1 } -} -\__fontspec_keys_define_code:nnn {fontspec-ltjaltfont-reparse} {TateFeatures} { - \clist_put_right:Nn \l_ltj_fontspec_fontfeat_tate_clist { #1 } -} -\__fontspec_keys_define_code:nnn {fontspec-ltjaltfont-reparse} {TateFont} { - \tl_if_empty:nF {#1} { - \fontspec_complete_fontname:Nn \l_ltj_fontspec_fontname_tate_tl {#1} - } -} -%% -\clist_new:N \l_ltj_fontspec_fontfeat_yoko_clist -\clist_new:N \l_ltj_fontspec_fontfeat_tate_clist -\tl_new:N \l_ltj_fontspec_fontname_tate_tl - -\cs_new:Npn \ltj_fontspec_DeclareFontFamily #1 #2 #3 { - \DeclareKanjiFamily {JY3} {#2} {#3} - \DeclareKanjiFamily {JT3} {#2} {#3} -} - -\cs_set_eq:NN \__ltj_orig_fontspec_select_font_family:nn \__fontspec_select_font_family:nn -\cs_new_protected:Nn \ltj_fontspec_select_font_family:nn { - \group_begin: - \ltj_fontspec_define_option:nn {NoEmbed} {} - \ltj_fontspec_define_option:nn {AltFont} { - \clist_put_right:Nn \l_ltj_fontspec_altfont_clist { ##1 } - } - \ltj_fontspec_define_option:nn {CID} { - \__fontspec_update_featstr:n {cid=##1} - } - \ltj_fontspec_define_option:nn {Kanjiskip} { - \str_if_eq_x:nnTF {false} { \str_lower_case:n { ##1 } }{ - \__fontspec_update_featstr:n {-ltjksp} - } { - \__fontspec_update_featstr:n {+ltjksp} - } - } - \ltj_fontspec_define_option:nn {JFM} { - \__fontspec_update_featstr:n {jfm=##1} - } - % vary by shape - \ltj_fontspec_define_option:nn {YokoFeatures} { - \clist_put_right:Nn \l_ltj_fontspec_fontfeat_yoko_clist { ##1 } - } - \ltj_fontspec_define_option:nn {TateFeatures} { - \clist_put_right:Nn \l_ltj_fontspec_fontfeat_tate_clist { ##1 } - } - \ltj_fontspec_define_option:nn {TateFont} - { - \tl_if_empty:nF {##1} { - \fontspec_complete_fontname:Nn \l_ltj_fontspec_fontname_tate_tl {##1} - } - } - \ltj_fontspec_define_option:nn {JFM-var} { - \__fontspec_update_featstr:n {jfmvar=##1} - } - \ltj_fontspec_define_preparse_external:nn {NoEmbed} { - \cs_set:Npn \__fontspec_fontname_wrap:n ##1 {psft:##1} - } - - %% Omit the warning message - %% "OpenType feature 'Kerning=Off' (-kern) not available ..." - \keys_define:nn {fontspec-opentype} { - Kerning/Off.code:n=\__fontspec_update_featstr:n {-kern} - } - \clist_set:Nx \g__fontspec_default_fontopts_clist { - YokoFeatures = { JFM=\ltj@stdyokojfm }, TateFeatures = { JFM=\ltj@stdtatejfm }, - Scale=\Cjascale, Kerning=Off, Script=CJK, - \g__ltj_fontspec_default_fontopts_clist - } - \prop_set_eq:NN \g__fontspec_fontopts_prop \g__ltj_fontspec_fontopts_prop - \cs_set_eq:NN \__fontspec_make_font_shapes:Nnnnn \ltj_fontspec_make_font_shapes:Nnnnn - \cs_set_eq:NN \DeclareFontFamily \ltj_fontspec_DeclareFontFamily - \tl_set:Nn \g_fontspec_encoding_tl {JY3} - \__ltj_orig_fontspec_select_font_family:nn{#1}{#2} - \group_end: -} - -%% declare_shape - -\cs_new:Nn \ltj_fontspec_declare_shape_yoko:nnnn { - \ltj_fontspec_declare_shape_aux:nnnnnn {#1} {#2} {#3} {#4} { JY3 } { \l_ltj_fontspec_fontfeat_yoko_clist } -} -\cs_new:Nn \ltj_fontspec_declare_shape_tate:nnnn { - \ltj_fontspec_declare_shape_aux:nnnnnn {#1} {#2} {#3} {#4} { JT3 } { \l_ltj_fontspec_fontfeat_tate_clist } -} -\cs_new:Nn \ltj_fontspec_declare_shape:nnnn { - \ltj_fontspec_declare_shape_yoko:nnnn {#1} {#2} {#3} {#4} - \ltj_fontspec_declare_shape_tate:nnnn {#1} {#2} {#3} {#4} -} -\cs_generate_variant:Nn \ltj_fontspec_declare_shape:nnnn {nnxx} -\cs_generate_variant:Nn \ltj_fontspec_declare_shape_yoko:nnnn {nnxx} -\cs_generate_variant:Nn \ltj_fontspec_declare_shape_tate:nnnn {nnxx} - -\cs_new:Nn \ltj_fontspec_declare_shape_aux:nnnnnn - { - \tl_clear:N \l__fontspec_nfss_tl - \tl_clear:N \l__fontspec_nfss_sc_tl - \tl_set_eq:NN \l__fontspec_saved_fontname_tl \l_fontspec_fontname_tl - - \tl_set:Nn \g_fontspec_encoding_tl {#5} - \tl_set:Nn \l__fontspec_nfss_enc_tl {#5} - \exp_args:Nx \clist_map_inline:nn {#4} - { - \tl_clear:N \l__fontspec_size_tl - \tl_set_eq:NN \l__fontspec_sizedfont_tl \l__fontspec_saved_fontname_tl % in case not spec'ed - - \keys_set_known:nxN {fontspec-sizing} { \exp_after:wN \use:n ##1 } - \l__fontspec_sizing_leftover_clist - \tl_if_empty:NT \l__fontspec_size_tl { \__fontspec_error:n {no-size-info} } - - \str_if_eq:nnTF { #5 } { JY3 } { - % "normal" - \__fontspec_load_fontname:n {\l__fontspec_sizedfont_tl} - } { - \tl_if_empty:NTF \l_ltj_fontspec_fontname_tate_tl - { \__fontspec_load_fontname:n {\l__fontspec_sizedfont_tl} } - { \__fontspec_load_fontname:n {\l_ltj_fontspec_fontname_tate_tl} } - } - \__fontspec_setup_nfss:Nnnn \l__fontspec_nfss_tl {#3} {#6} {} - } - \bool_set_true:N \l__fontspec_nosc_bool - \__fontspec_declare_shapes_normal:nn {#1} {#2} - \__fontspec_declare_shape_slanted:nn {#1} {#2} - } - -\cs_new:Nn \ltj_fontspec_set_family:Nnn { - \cs_set_eq:NN \__fontspec_select_font_family:nn \ltj_fontspec_select_font_family:nn - \__ltj_orig_fontspec_set_family:Nnn #1 {#2} {#3} - \cs_set_eq:NN \__fontspec_select_font_family:nn \__ltj_orig_fontspec_select_font_family:nn -} -\cs_set_eq:NN \__ltj_orig_fontspec_set_family:Nnn \fontspec_set_family:Nnn -\cs_set_eq:NN \__ltj_orig_fontspec_make_font_shapes:Nnnnn \__fontspec_make_font_shapes:Nnnnn -\cs_set_eq:NN \__ltj_fontspec_orig_DeclareFontShape \DeclareFontShape - -\cs_new:Nn \ltj_fontspec_make_font_shapes:Nnnnn { - \group_begin: - %% 基底フォント - \cs_set_eq:NN \__fontspec_font_set:Nnn \use_none:nnn - \cs_set_eq:NN \__fontspec_font_if_null:NT \use_none:nn - \cs_set_eq:NN \__fontspec_declare_shape:nnxx \ltj_fontspec_declare_shape:nnxx - \__ltj_orig_fontspec_make_font_shapes:Nnnnn {#1} {#2} {#3} {#4} {#5} - %% - \ltj_fontspec_make_font_shapes_alt:Nnnnnn {#1}{#2}{#3} - {#4, \l_ltj_fontspec_fontfeat_yoko_clist}{#5} {JY3 } - \ltj_fontspec_make_font_shapes_alt:Nnnnnn {#1}{#2}{#3} - {#4, \l_ltj_fontspec_fontfeat_tate_clist}{#5} {JT3} - \group_end: - } - -%%% Altfont 内部処理部 -\cs_new:Nn \ltj_fontspec_make_font_shapes_alt:Nnnnnn { - \group_begin: - \str_if_eq:nnTF { #6 } { JY3 } { - \cs_set_eq:NN \__fontspec_declare_shape:nnxx \ltj_fontspec_declare_shape_yoko:nnxx - }{ - \cs_set_eq:NN \__fontspec_declare_shape:nnxx \ltj_fontspec_declare_shape_tate:nnxx - } - \keys_set_known:nn {fontspec-ltjaltfont-reparse} { #4 } - \clist_if_empty:NF \l_ltj_fontspec_altfont_clist { - \int_gzero:N \g_ltj_fontspec_altnumber_int - \clist_map_inline:Nn \l_ltj_fontspec_altfont_clist { - \tl_clear:N \l_ltj_fontspec_altrange_tl - \tl_set:Nn \l_ltj_fontspec_altname_tl { #1 } - \tl_set:Nn \l_tmpa_tl { #1 } - - \keys_set_known:nxN {fontspec-ltjaltfont} { \exp_after:wN \use:n ##1 } - \l_ltj_fontspec_altfont_leftover_clist - \keys_set_known:nn {fontspec-ltjaltfont-reparse} { \exp_after:wN \use:n ##1 } - - \tl_if_empty:NT \l_ltj_fontspec_altrange_tl { - \msg_warning:nnn {luatexja-fontspec} {altfont-ignored-by-norange} { ##1 } - } { - \bool_if:nTF { - \tl_if_eq_p:NN \l_ltj_fontspec_altname_tl \l_tmpa_tl - && - \tl_if_empty_p:N \l_ltj_fontspec_altfont_leftover_clist - } { - \msg_warning:nnn {luatexja-fontspec} {altfont-ignored-by-rangeonly} { ##1 } - } { - \__ltj_orig_fontspec_make_font_shapes:Nnnnn - { \l_ltj_fontspec_altname_tl } {#2} - {#3 _ alt \int_use:N \g_ltj_fontspec_altnumber_int } - {#4, \l_ltj_fontspec_altfont_leftover_clist } - {#5} - \DeclareAlternateKanjiFont - { #6 }{ \l_fontspec_family_tl }{#2}{#3}% - { #6 }{ \l_fontspec_family_tl }{#2} - { #3 _alt \int_use:N \g_ltj_fontspec_altnumber_int } - { \l_ltj_fontspec_altrange_tl } - \int_gincr:N \g_ltj_fontspec_altnumber_int - } - } - } - } - \group_end: -} - - -%%%%%%%% User commands -\DeclareDocumentCommand \jfontspec { O{} m O{} } { - \ltj_fontspec_set_family:Nnn \k@family {#1,#3}{#2} - \selectfont - \ignorespaces -} - -\DeclareDocumentCommand \setmainjfont { O{} m O{} } { - \ltj_fontspec_set_family:Nnn \mcdefault {#1,#3}{#2} - \unless\ifltj@disablejfam - \DeclareSymbolFont{mincho}{JY3}{\l_fontspec_family_tl}{\mddefault}{n} - \SetSymbolFont{mincho}{bold}{JY3}{\l_fontspec_family_tl}{\bfdefault}{n} - \fi - \normalfont -} - -\DeclareDocumentCommand \setsansjfont { O{} m O{} } { - \ltj_fontspec_set_family:Nnn \gtdefault {#1,#3}{#2} - \unless\ifltj@disablejfam - \DeclareMathAlphabet{\mathgt}{JY3}{\l_fontspec_family_tl}{\mddefault}{n} - \fi - \normalfont -} - -\DeclareDocumentCommand \newjfontfamily { m O{} m O{} } { - \cs_set_eq:NN \fontspec_set_family:Nnn \ltj_fontspec_set_family:Nnn - \newfontfamily #1 [#2,#4] {#3} - \cs_set_eq:NN \fontspec_set_family:Nnn \__ltj_orig_fontspec_set_family:Nnn -} - -\DeclareDocumentCommand \newjfontface { m O{} m O{} } { - \newjfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2,#4 ] {#3} -} - -\clist_new:N \g__ltj_fontspec_default_fontopts_clist -\prop_new:N \g__ltj_fontspec_fontopts_prop -\DeclareDocumentCommand \defaultjfontfeatures { t+ o m } - { - \IfNoValueTF {#2} - { \__ltj_fontspec_set_default_features:nn {#1} {#3} } - { \__ltj_fontspec_set_font_default_features:nnn {#1} {#2} {#3} } - \ignorespaces - } -\cs_new:Nn \__ltj_fontspec_set_default_features:nn - { - \clist_set_eq:NN \l__ltj_fontspec_tmp_clist \g__fontspec_default_fontopts_clist - \clist_set_eq:NN \g__fontspec_default_fontopts_clist \g__ltj_fontspec_default_fontopts_clist - \__fontspec_set_default_features:nn {#1} {#2} - \clist_set_eq:NN \g__ltj_fontspec_default_fontopts_clist \g__fontspec_default_fontopts_clist - \clist_set_eq:NN \g__fontspec_default_fontopts_clist \l__ltj_fontspec_tmp_clist - } -\cs_new:Nn \__ltj_fontspec_set_font_default_features:nnn - { - \prop_set_eq:NN \l__ltj_fontspec_tmp_prop \g__fontspec_fontopts_prop - \prop_set_eq:NN \g__fontspec_fontopts_prop \g__ltj_fontspec_fontopts_prop - \__fontspec_set_font_default_features:nnn {#1} {#2} {#3} - \prop_set_eq:NN \g__ltj_fontspec_fontopts_prop \g__fontspec_fontopts_prop - \prop_set_eq:NN \g__fontspec_fontopts_prop \l__ltj_fontspec_tmp_prop - } - -\DeclareDocumentCommand \addjfontfeatures {m} { - \ltj_fontspec_if_fontspec_font:TF - { - \group_begin: - \tl_set_eq:NN \f@family \k@family - \cs_set_eq:NN \__fontspec_select_font_family:nn \ltj_fontspec_select_font_family:nn - \addfontfeatures {#1} - \group_end: - \fontfamily\l_fontspec_family_tl\selectfont - }{ - \msg_warning:nn {luatexja-fontspec} {addjfontfeatures-ignored} - } - \ignorespaces -} - -\cs_set_eq:NN \addjfontfeature \addjfontfeatures - -\prg_new_conditional:Nnn \ltj_fontspec_if_fontspec_font: {TF,T,F} -{ - \cs_if_exist:cTF {g__fontspec_ \k@family _prop} \prg_return_true: \prg_return_false: -} - -\endinput diff --git a/macros/luatex/generic/luatexja/src/addons/luatexja-fontspec-26h.sty b/macros/luatex/generic/luatexja/src/addons/luatexja-fontspec-26h.sty deleted file mode 100644 index 1472633bb0..0000000000 --- a/macros/luatex/generic/luatexja/src/addons/luatexja-fontspec-26h.sty +++ /dev/null @@ -1,412 +0,0 @@ -% -% luatexja-fontspec-26h.sty -% - -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luatexja-fontspec-26h}[2019/05/14 fontspec support of LuaTeX-ja] -\RequirePackage{l3keys2e} -\ExplSyntaxOn - -%%%%%%%% Change Japanese font family by \rmfamily or not -\cs_new:Npn \__ltj_fontspec_match_cmd { - \renewcommand\jttdefault{\gtdefault} - \@ltj@match@familytrue - \DeclareDocumentCommand \setmonojfont { O{} m O{} } { - \__ltj_fontspec_set_family:Nnn \jttdefault {##1,##3}{##2} - \normalfont - } -} -\bool_if:NT \__ltj_fontspec_match_bool \__ltj_fontspec_match_cmd - -%%%%%%%% Messages -\msg_new:nnn {luatexja-fontspec} {addjfontfeatures-ignored} -{ - \string\addjfontfeature (s)~ ignored;\\ - it~ cannot~ be~ used~ with~ a~ font~ that~ wasn't~ selected~ by~ luatexja-fontspec. -} - -\msg_new:nnn {luatexja-fontspec} {altfont-ignored-by-norange} -{ - ignored~ sublist~ `#1'~ in~ AltFont~ (no~ range~ is~ specified). -} - -\msg_new:nnn {luatexja-fontspec} {altfont-ignored-by-rangeonly} -{ - ignored~ sublist~ `#1'~ in~ AltFont~ (only~ range~ is~ specified). -} - -\cs_generate_variant:Nn \prg_new_conditional:Nnn {Nnx} - -%%%%%%%% Internal control sequences -%% Each CS is ltj_fontspec version that corresponds to original CS of fontspec. -\cs_new:Nn \__ltj_fontspec_define_option:nn { - \__fontspec_keys_define_code:nnn {fontspec} {#1} {#2} -} -\cs_new:Nn \__ltj_fontspec_define_preparse_external:nn { - \__fontspec_keys_define_code:nnn {fontspec-preparse-external} {#1} {#2} -} -\cs_new:Nn \__ltj_fontspec_define_altfont_option:nn { - \__fontspec_keys_define_code:nnn {fontspec-ltjaltfont} {#1} {#2} -} - -%% Alternate Fonts -%% Spec: AltFont = { -%% ... -%% { Range = <range>, <font features> }, -%% { Range = <range>, Font = <font name>, <font features> }, -%% { Range = <range>, Font = <font name> }, -%% ... -%% } -\tl_new:N \l__ltj_fontspec_altname_tl -\tl_new:N \l__ltj_fontspec_altrange_tl -\clist_new:N \l__ltj_fontspec_altfont_clist -\clist_new:N \l__ltj_fontspec_altfont_leftover_clist -\int_new:N \g__ltj_fontspec_altnumber_int - -\__ltj_fontspec_define_altfont_option:nn {Range} { - \tl_set:Nn \l__ltj_fontspec_altrange_tl {#1} -} -\__ltj_fontspec_define_altfont_option:nn {Font} { - \fontspec_complete_fontname:Nn \l__ltj_fontspec_altname_tl {#1} -} -\__fontspec_keys_define_code:nnn {fontspec-ltjaltfont-reparse} {AltFont} { - \clist_put_right:Nn \l__ltj_fontspec_altfont_clist { #1 } -} -\__fontspec_keys_define_code:nnn {fontspec-ltjaltfont-reparse} {YokoFeatures} { - \clist_put_right:Nn \l__ltj_fontspec_fontfeat_yoko_clist { #1 } -} -\__fontspec_keys_define_code:nnn {fontspec-ltjaltfont-reparse} {TateFeatures} { - \clist_put_right:Nn \l__ltj_fontspec_fontfeat_tate_clist { #1 } -} -\__fontspec_keys_define_code:nnn {fontspec-ltjaltfont-reparse} {TateFont} { - \tl_if_empty:nF {#1} { - \fontspec_complete_fontname:Nn \l__ltj_fontspec_fontname_tate_tl {#1} - } -} -%% -\clist_new:N \l__ltj_fontspec_fontfeat_yoko_clist -\clist_new:N \l__ltj_fontspec_fontfeat_tate_clist -\tl_new:N \l__ltj_fontspec_fontname_tate_tl - -\cs_new:Npn \__ltj_fontspec_DeclareFontFamily #1 #2 #3 { - \DeclareKanjiFamily {JY3} {#2} {#3} - \DeclareKanjiFamily {JT3} {#2} {#3} -} - -%% save and restore global variable -\tl_new:N \g__ltj_fontspec_kanji_nfss_family_tl -\tl_new:N \g__ltj_fontspec_orig_nfss_family_tl -\seq_new:N \g__ltj_fontspec_kanji_bf_series_seq -\seq_new:N \g__ltj_fontspec_orig_bf_series_seq -\clist_new:N \g__ltj_fontspec_kanji_default_fontopts_clist -\clist_new:N \g__ltj_fontspec_orig_default_fontopts_clist - -\cs_new:Nn \__ltj_set_global_variable_for_kanji: { - \tl_gset_eq:NN \g__ltj_fontspec_orig_nfss_family_tl \g__fontspec_nfss_family_tl - \tl_gset_eq:NN \g__fontspec_nfss_family_tl \g__ltj_fontspec_kanji_nfss_family_tl - \seq_gset_eq:NN \g__ltj_fontspec_orig_bf_series_seq \g__fontspec_bf_series_seq - \seq_gset_eq:NN \g__fontspec_bf_series_seq \g__ltj_fontspec_kanji_bf_series_seq - %\seq_gclear:N \g__fontspec_bf_series_seq - \clist_set_eq:NN \g__ltj_fontspec_orig_default_fontopts_clist \g__fontspec_default_fontopts_clist - \clist_set_eq:NN \g__fontspec_default_fontopts_clist \g__ltj_fontspec_kanji_default_fontopts_clist -} - -\cs_new:Nn \__ltj_restore_global_variable: { - \tl_gset_eq:NN \g__ltj_fontspec_kanji_nfss_family_tl \g__fontspec_nfss_family_tl - \tl_gset_eq:NN \g__fontspec_nfss_family_tl \g__ltj_fontspec_orig_nfss_family_tl - \seq_gset_eq:NN \g__ltj_fontspec_kanji_bf_series_seq \g__fontspec_bf_series_seq - \seq_gset_eq:NN \g__fontspec_bf_series_seq \g__ltj_fontspec_orig_bf_series_seq - \clist_set_eq:NN \g__ltj_fontspec_kanji_default_fontopts_clist \g__fontspec_default_fontopts_clist - \clist_set_eq:NN \g__fontspec_default_fontopts_clist \g__ltj_fontspec_orig_default_fontopts_clist -} - -\cs_set_eq:NN \__ltj_orig_fontspec_select_font_family:nn \__fontspec_select_font_family:nn -\cs_new_protected:Nn \__ltj_fontspec_select_font_family:nn { - \group_begin: - \__ltj_fontspec_define_option:nn {NoEmbed} {} - \__ltj_fontspec_define_option:nn {AltFont} { - \clist_put_right:Nn \l__ltj_fontspec_altfont_clist { ##1 } - } - \__ltj_fontspec_define_option:nn {CID} { - \__fontspec_update_featstr:n {cid=##1} - } - \__ltj_fontspec_define_option:nn {Kanjiskip} { - \str_if_eq_x:nnTF {false} { \str_lower_case:n { ##1 } }{ - \__fontspec_update_featstr:n {-ltjksp} - } { - \__fontspec_update_featstr:n {+ltjksp} - } - } - \__ltj_fontspec_define_option:nn {JFM} { - \__fontspec_update_featstr:n {jfm=##1} - } - % vary by shape - \__ltj_fontspec_define_option:nn {YokoFeatures} { - \clist_put_right:Nn \l__ltj_fontspec_fontfeat_yoko_clist { ##1 } - } - \__ltj_fontspec_define_option:nn {TateFeatures} { - \clist_put_right:Nn \l__ltj_fontspec_fontfeat_tate_clist { ##1 } - } - \__ltj_fontspec_define_option:nn {TateFont} - { - \tl_if_empty:nF {##1} { - \fontspec_complete_fontname:Nn \l__ltj_fontspec_fontname_tate_tl {##1} - } - } - \__ltj_fontspec_define_option:nn {JFM-var} { - \__fontspec_update_featstr:n {jfmvar=##1} - } - \__ltj_fontspec_define_preparse_external:nn {NoEmbed} { - \cs_set:Npn \__fontspec_fontname_wrap:n ##1 {psft:##1} - } - - %% Omit the warning message - %% "OpenType feature 'Kerning=Off' (-kern) not available ..." - \keys_define:nn {fontspec-opentype} { - Kerning/Off.code:n=\__fontspec_update_featstr:n {-kern} - } - \clist_set:Nx \g__fontspec_default_fontopts_clist { - YokoFeatures = { JFM=\ltj@stdyokojfm }, TateFeatures = { JFM=\ltj@stdtatejfm }, - Scale=\Cjascale, Kerning=Off, Script=CJK, - \g__ltj_fontspec_kanji_default_fontopts_clist - } - \prop_set_eq:NN \g__fontspec_fontopts_prop \g__ltj_fontspec_fontopts_prop - \cs_set_eq:NN \__fontspec_make_font_shapes:Nnnnn \__ltj_fontspec_make_font_shapes:Nnnnn - \cs_set_eq:NN \DeclareFontFamily \__ltj_fontspec_DeclareFontFamily - \tl_set:Nn \g_fontspec_encoding_tl {JY3} - \__ltj_orig_fontspec_select_font_family:nn{#1}{#2} - - \cs_gset:Npx \__ltj_fontspec_aftergroup { - \exp_not:N \tl_set:Nn \exp_not:N \l_fontspec_family_tl { \l_fontspec_family_tl } - } - \aftergroup \__ltj_fontspec_aftergroup - \group_end: -} - -%% declare_shape - -\cs_new:Nn \__ltj_fontspec_declare_shape_yoko:nnnn { - \__ltj_fontspec_declare_shape_aux:nnnnnn {#1} {#2} {#3} {#4} { JY3 } { \l__ltj_fontspec_fontfeat_yoko_clist } -} -\cs_new:Nn \__ltj_fontspec_declare_shape_tate:nnnn { - \__ltj_fontspec_declare_shape_aux:nnnnnn {#1} {#2} {#3} {#4} { JT3 } { \l__ltj_fontspec_fontfeat_tate_clist } -} -\cs_new:Nn \__ltj_fontspec_declare_shape:nnnn { - \__ltj_fontspec_declare_shape_yoko:nnnn {#1} {#2} {#3} {#4} - \__ltj_fontspec_declare_shape_tate:nnnn {#1} {#2} {#3} {#4} -} -\cs_generate_variant:Nn \__ltj_fontspec_declare_shape:nnnn {nnxx} -\cs_generate_variant:Nn \__ltj_fontspec_declare_shape_yoko:nnnn {nnxx} -\cs_generate_variant:Nn \__ltj_fontspec_declare_shape_tate:nnnn {nnxx} - -\cs_new:Nn \__ltj_fontspec_declare_shape_aux:nnnnnn - { - \tl_clear:N \l__fontspec_nfss_tl - \tl_clear:N \l__fontspec_nfss_sc_tl - \tl_set_eq:NN \l__fontspec_saved_fontname_tl \l_fontspec_fontname_tl - - \tl_set:Nn \g_fontspec_encoding_tl {#5} - \tl_set:Nn \g__fontspec_nfss_enc_tl {#5} - \exp_args:Nx \clist_map_inline:nn {#4} - { - \tl_clear:N \l__fontspec_size_tl - \tl_set_eq:NN \l__fontspec_sizedfont_tl \l__fontspec_saved_fontname_tl % in case not spec'ed - - \keys_set_known:nxN {fontspec-sizing} { \exp_after:wN \use:n ##1 } - \l__fontspec_sizing_leftover_clist - \tl_if_empty:NT \l__fontspec_size_tl { \__fontspec_error:n {no-size-info} } - - \cs_if_exist:NTF \__fontspec_load_fontname:Nn - { %% >= v2.7 - \str_if_eq:nnTF { #5 } { JY3 } { - % "normal" - \__fontspec_load_fontname:Nn \l_fontspec_fontname_tl {\l__fontspec_sizedfont_tl} - } { - \tl_if_empty:NTF \l__ltj_fontspec_fontname_tate_tl - { \__fontspec_load_fontname:Nn \l_fontspec_fontname_tl {\l__fontspec_sizedfont_tl} } - { \__fontspec_load_fontname:Nn \l_fontspec_fontname_tl {\l__ltj_fontspec_fontname_tate_tl} } - } - } { %% < v2.7 - \str_if_eq:nnTF { #5 } { JY3 } { - % "normal" - \__fontspec_load_fontname:n {\l__fontspec_sizedfont_tl} - } { - \tl_if_empty:NTF \l__ltj_fontspec_fontname_tate_tl - { \__fontspec_load_fontname:n {\l__fontspec_sizedfont_tl} } - { \__fontspec_load_fontname:n {\l__ltj_fontspec_fontname_tate_tl} } - } - } - \__fontspec_setup_nfss:Nnnn \l__fontspec_nfss_tl {#3} {#6} {} - } - \bool_set_true:N \l__fontspec_nosc_bool - \__fontspec_declare_shapes_normal:nn {#1} {#2} - \__fontspec_declare_shape_slanted:nn {#1} {#2} - } - -\cs_new:Nn \__ltj_fontspec_set_family:Nnn { - \__ltj_set_global_variable_for_kanji: - \cs_set_eq:NN \__fontspec_select_font_family:nn \__ltj_fontspec_select_font_family:nn - \__ltj_orig_fontspec_set_family:Nnn #1 {#2} {#3} - \cs_set_eq:NN \__fontspec_select_font_family:nn \__ltj_orig_fontspec_select_font_family:nn - \__ltj_restore_global_variable: -} -\cs_set_eq:NN \__ltj_orig_fontspec_set_family:Nnn \fontspec_set_family:Nnn -\cs_set_eq:NN \__ltj_orig_fontspec_make_font_shapes:Nnnnn \__fontspec_make_font_shapes:Nnnnn -\cs_set_eq:NN \__ltj_fontspec_orig_DeclareFontShape \DeclareFontShape - -\cs_new:Nn \__ltj_fontspec_make_font_shapes:Nnnnn { - \group_begin: - %% 基底フォント - \cs_set_eq:NN \__fontspec_font_set:Nnn \use_none:nnn - \cs_set_eq:NN \__fontspec_font_if_null:NT \use_none:nn - \cs_set_eq:NN \__fontspec_declare_shape:nnxx \__ltj_fontspec_declare_shape:nnxx - \__ltj_orig_fontspec_make_font_shapes:Nnnnn {#1} {#2} {#3} {#4} {#5} - %% - \__ltj_fontspec_make_font_shapes_alt:Nnnnnn {#1}{#2}{#3} - {#4, \l__ltj_fontspec_fontfeat_yoko_clist}{#5} {JY3 } - \__ltj_fontspec_make_font_shapes_alt:Nnnnnn {#1}{#2}{#3} - {#4, \l__ltj_fontspec_fontfeat_tate_clist}{#5} {JT3} - \group_end: - } - -%%% Altfont 内部処理部 -\cs_new:Nn \__ltj_fontspec_make_font_shapes_alt:Nnnnnn { - \group_begin: - \str_if_eq:nnTF { #6 } { JY3 } { - \cs_set_eq:NN \__fontspec_declare_shape:nnxx \__ltj_fontspec_declare_shape_yoko:nnxx - }{ - \cs_set_eq:NN \__fontspec_declare_shape:nnxx \__ltj_fontspec_declare_shape_tate:nnxx - } - \keys_set_known:nn {fontspec-ltjaltfont-reparse} { #4 } - \clist_if_empty:NF \l__ltj_fontspec_altfont_clist { - \int_gzero:N \g__ltj_fontspec_altnumber_int - \clist_map_inline:Nn \l__ltj_fontspec_altfont_clist { - \tl_clear:N \l__ltj_fontspec_altrange_tl - \tl_set:Nn \l__ltj_fontspec_altname_tl { #1 } - \tl_set:Nn \l_tmpa_tl { #1 } - - \keys_set_known:nxN {fontspec-ltjaltfont} { \exp_after:wN \use:n ##1 } - \l__ltj_fontspec_altfont_leftover_clist - \keys_set_known:nn {fontspec-ltjaltfont-reparse} { \exp_after:wN \use:n ##1 } - - \tl_if_empty:NT \l__ltj_fontspec_altrange_tl { - \msg_warning:nnn {luatexja-fontspec} {altfont-ignored-by-norange} { ##1 } - } { - \bool_if:nTF { - \tl_if_eq_p:NN \l__ltj_fontspec_altname_tl \l_tmpa_tl - && - \tl_if_empty_p:N \l__ltj_fontspec_altfont_leftover_clist - } { - \msg_warning:nnn {luatexja-fontspec} {altfont-ignored-by-rangeonly} { ##1 } - } { - \__ltj_orig_fontspec_make_font_shapes:Nnnnn - { \l__ltj_fontspec_altname_tl } {#2} - {#3 _ alt \int_use:N \g__ltj_fontspec_altnumber_int } - {#4, \l__ltj_fontspec_altfont_leftover_clist } - {#5} - \DeclareAlternateKanjiFont - { #6 }{ \g__fontspec_nfss_family_tl }{#2}{#3}% - { #6 }{ \g__fontspec_nfss_family_tl }{#2} - { #3 _alt \int_use:N \g__ltj_fontspec_altnumber_int } - { \l__ltj_fontspec_altrange_tl } - \int_gincr:N \g__ltj_fontspec_altnumber_int - } - } - } - } - \group_end: -} - - -%%%%%%%% User commands -\DeclareDocumentCommand \jfontspec { O{} m O{} } { - \__ltj_fontspec_set_family:Nnn \k@family {#1,#3}{#2} - \selectfont - \ignorespaces -} - -\DeclareDocumentCommand \setmainjfont { O{} m O{} } { - \__ltj_fontspec_set_family:Nnn \mcdefault {#1,#3}{#2} - \unless\ifltj@disablejfam - \DeclareSymbolFont{mincho}{JY3}{\mcdefault}{\mddefault}{n} - \SetSymbolFont{mincho}{bold}{JY3}{\mcdefault}{\bfdefault}{n} - \fi - \normalfont -} - -\DeclareDocumentCommand \setsansjfont { O{} m O{} } { - \__ltj_fontspec_set_family:Nnn \gtdefault {#1,#3}{#2} - \unless\ifltj@disablejfam - \DeclareMathAlphabet{\mathgt}{JY3}{\gtdefault}{\mddefault}{n} - \fi - \normalfont -} - -\DeclareDocumentCommand \newjfontfamily { m O{} m O{} } { - \cs_set_eq:NN \fontspec_set_family:Nnn \__ltj_fontspec_set_family:Nnn - \newfontfamily #1 [#2,#4] {#3} - \cs_set_eq:NN \fontspec_set_family:Nnn \__ltj_orig_fontspec_set_family:Nnn -} -\DeclareDocumentCommand \renewjfontfamily { m O{} m O{} } { - \cs_set_eq:NN \fontspec_set_family:Nnn \__ltj_fontspec_set_family:Nnn - \renewfontfamily #1 [#2,#4] {#3} - \cs_set_eq:NN \fontspec_set_family:Nnn \__ltj_orig_fontspec_set_family:Nnn -} -\DeclareDocumentCommand \setjfontfamily { m O{} m O{} } { - \cs_set_eq:NN \fontspec_set_family:Nnn \__ltj_fontspec_set_family:Nnn - \setfontfamily #1 [#2,#4] {#3} - \cs_set_eq:NN \fontspec_set_family:Nnn \__ltj_orig_fontspec_set_family:Nnn -} - -\DeclareDocumentCommand \newjfontface { m O{} m O{} } { - \newjfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2,#4 ] {#3} -} - -\prop_new:N \g__ltj_fontspec_fontopts_prop -\DeclareDocumentCommand \defaultjfontfeatures { t+ o m } - { - \IfNoValueTF {#2} - { \__ltj_fontspec_set_default_features:nn {#1} {#3} } - { \__ltj_fontspec_set_font_default_features:nnn {#1} {#2} {#3} } - \ignorespaces - } -\cs_new:Nn \__ltj_fontspec_set_default_features:nn - { - \__ltj_set_global_variable_for_kanji: - \__fontspec_set_default_features:nn {#1} {#2} - \__ltj_restore_global_variable: - } -\cs_new:Nn \__ltj_fontspec_set_font_default_features:nnn - { - \prop_set_eq:NN \l__ltj_fontspec_tmp_prop \g__fontspec_fontopts_prop - \prop_set_eq:NN \g__fontspec_fontopts_prop \g__ltj_fontspec_fontopts_prop - \__fontspec_set_font_default_features:nnn {#1} {#2} {#3} - \prop_set_eq:NN \g__ltj_fontspec_fontopts_prop \g__fontspec_fontopts_prop - \prop_set_eq:NN \g__fontspec_fontopts_prop \l__ltj_fontspec_tmp_prop - } - -\DeclareDocumentCommand \addjfontfeatures {m} { - \__ltj_fontspec_if_fontspec_font:TF - { - \__ltj_set_global_variable_for_kanji: - \group_begin: - \tl_set_eq:NN \f@family \k@family - \cs_set_eq:NN \__fontspec_select_font_family:nn \__ltj_fontspec_select_font_family:nn - \addfontfeatures {#1} - \group_end: - \kanjifamily\g__fontspec_nfss_family_tl\selectfont - \__ltj_restore_global_variable: - }{ - \msg_warning:nn {luatexja-fontspec} {addjfontfeatures-ignored} - } - \ignorespaces -} - -\cs_set_eq:NN \addjfontfeature \addjfontfeatures - -\prg_new_conditional:Nnn \__ltj_fontspec_if_fontspec_font: {TF,T,F} -{ - \cs_if_exist:cTF {g__fontspec_fontinfo_ \k@family _prop} \prg_return_true: \prg_return_false: -} - -\endinput diff --git a/macros/luatex/generic/luatexja/src/addons/luatexja-fontspec-27c.sty b/macros/luatex/generic/luatexja/src/addons/luatexja-fontspec-27c.sty index 88d6b37b58..bb6b5f0bd1 100644 --- a/macros/luatex/generic/luatexja/src/addons/luatexja-fontspec-27c.sty +++ b/macros/luatex/generic/luatexja/src/addons/luatexja-fontspec-27c.sty @@ -3,7 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luatexja-fontspec-27c}[2019/05/14 fontspec support of LuaTeX-ja] +\ProvidesPackage{luatexja-fontspec-27c}[2019/11/15 fontspec support of LuaTeX-ja] \RequirePackage{l3keys2e} \ExplSyntaxOn @@ -131,7 +131,7 @@ \__fontspec_update_featstr:n {cid=##1} } \__ltj_fontspec_define_option:nn {Kanjiskip} { - \str_if_eq_x:nnTF {false} { \str_lower_case:n { ##1 } }{ + \str_if_eq:eeTF {false} { \str_lower_case:n { ##1 } }{ \__fontspec_update_featstr:n {-ltjksp} } { \__fontspec_update_featstr:n {+ltjksp} @@ -226,7 +226,7 @@ \l__fontspec_sizing_leftover_clist \tl_if_empty:NT \l__fontspec_size_tl { \__fontspec_error:n {no-size-info} } - \str_if_eq:nnTF { \g__fontspec_nfss_enc_tl } { JY3 } { + \str_if_eq:eeTF { \g__fontspec_nfss_enc_tl } { JY3 } { % "normal" \__fontspec_load_fontname:Nn \l_fontspec_fontname_tl {\l__fontspec_sizedfont_tl} } { @@ -266,7 +266,7 @@ %%% Altfont 内部処理部 \cs_new:Nn \__ltj_fontspec_make_font_shapes_alt:Nnnnnn { \group_begin: - \str_if_eq:nnTF { #6 } { JY3 } { + \str_if_eq:eeTF { #6 } { JY3 } { \cs_set_eq:NN \__fontspec_declare_shape:nnxx \__ltj_fontspec_declare_shape_yoko:nnxx }{ \cs_set_eq:NN \__fontspec_declare_shape:nnxx \__ltj_fontspec_declare_shape_tate:nnxx diff --git a/macros/luatex/generic/luatexja/src/addons/luatexja-fontspec.sty b/macros/luatex/generic/luatexja/src/addons/luatexja-fontspec.sty index b967926cb7..e32d20ab38 100644 --- a/macros/luatex/generic/luatexja/src/addons/luatexja-fontspec.sty +++ b/macros/luatex/generic/luatexja/src/addons/luatexja-fontspec.sty @@ -27,12 +27,8 @@ } \ProcessKeysOptions{ luatexja-fontspec } -\RequirePackage{fontspec}[2017/01/01]% v2.5c -\@ifpackagelater{fontspec}{2018/07/29}% - {\@ifpackagelater{fontspec}{2019/03/15}% - {\RequirePackage{luatexja-fontspec-27c}} % v2.7c - {\RequirePackage{luatexja-fontspec-26h}}}% v2.6h - {\RequirePackage{luatexja-fontspec-25c}} % v2.5c +\RequirePackage{fontspec}[2019/03/15]% v2.7c +\RequirePackage{luatexja-fontspec-27c} % v2.7c \ExplSyntaxOff %%%%%%%% Now we completely ignore kanjifont definition file. diff --git a/macros/luatex/generic/luatexja/src/addons/luatexja-preset.sty b/macros/luatex/generic/luatexja/src/addons/luatexja-preset.sty index 2eb38c8384..e126f6f90f 100644 --- a/macros/luatex/generic/luatexja/src/addons/luatexja-preset.sty +++ b/macros/luatex/generic/luatexja/src/addons/luatexja-preset.sty @@ -312,6 +312,19 @@ __custom = false, __office = false, __noembed = false, } +% HaranoAji {Mincho, Gothic} +\ltjpreset_declare_preset:nx{haranoaji}{ + mc-m = HaranoAjiMincho-Regular.otf, + mc-bx = HaranoAjiMincho-Bold.otf, + gt-d = HaranoAjiGothic-Regular.otf, + gt-bx = HaranoAjiGothic-Bold.otf, + gt-u = HaranoAjiGothic-Medium.otf, + gt-eb = HaranoAjiGothic-Heavy.otf, + mg-m = HaranoAjiGothic-Heavy.otf, + mc-l = HaranoAjiMincho-Light.otf, + __custom = false, __office = false, __noembed = false, +} + % ipa, ipaex, ms \ltjpreset_declare_preset:nx{ipa}{ diff --git a/macros/luatex/generic/luatexja/src/ltj-base.lua b/macros/luatex/generic/luatexja/src/ltj-base.lua index a069215b09..3f4a0ba1f8 100644 --- a/macros/luatex/generic/luatexja/src/ltj-base.lua +++ b/macros/luatex/generic/luatexja/src/ltj-base.lua @@ -185,7 +185,7 @@ end -- not used in current LuaTeX-ja do --! ixbase.counter と同じ - counter = {} + local counter = {} local mt_counter = {} setmetatable(counter, mt_counter) @@ -373,10 +373,10 @@ function ltjb.add_to_callback(name,fun,description,priority) "resetting exclusive callback: " .. name) luatexbase.reset_callback(name) end - local saved_callback={},ff,dd + local saved_callback={} for k,v in ipairs(luatexbase.callback_descriptions(name)) do if k >= priority then - ff,dd= luatexbase.remove_from_callback(name, v) + local ff,dd = luatexbase.remove_from_callback(name, v) saved_callback[#saved_callback+1]={ff,dd} end end diff --git a/macros/luatex/generic/luatexja/src/ltj-jfont.lua b/macros/luatex/generic/luatexja/src/ltj-jfont.lua index dc832e9836..d63da29447 100644 --- a/macros/luatex/generic/luatexja/src/ltj-jfont.lua +++ b/macros/luatex/generic/luatexja/src/ltj-jfont.lua @@ -773,16 +773,18 @@ do if rotate_in_uax50(i) then rot[i] = true end end ltju.loop_over_feat(tfmdata, vert_vrt2, function (i,k) rot[i] = nil end) - -- 同じグリフが複数の Unicode ポイントを持っている場合. - -- いずれかの Unicode ポイントで rot = true ならば全体で rotate - ltju.loop_over_duplicates(tfmdata, - function (i, v) - local f = rot[i] - if not f then - for j,_ in pairs(v) do if rot[j] then f=true; break end end - end - rot[i]=f; for j,_ in pairs(v) do rot[j]=f end - end) + -- ↓「TeX Live 2019のLuaLaTeXで縦書きの三点リーダーが横書きになる」 + -- (https://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=2722) により無効化 + -- -- 同じグリフが複数の Unicode ポイントを持っている場合. + -- -- いずれかの Unicode ポイントで rot = true ならば全体で rotate + --ltju.loop_over_duplicates(tfmdata, + -- function (i, v) + -- local f = rot[i] + -- if not f then + -- for j,_ in pairs(v) do if rot[j] then f=true; break end end + -- end + -- rot[i]=f; for j,_ in pairs(v) do rot[j]=f end + -- end) for i,_ in pairs(rot) do dest = dest or {}; dest.rotation = dest.rotation or {} dest.rotation[i] = true diff --git a/macros/luatex/generic/luatexja/src/ltj-lotf_aux.lua b/macros/luatex/generic/luatexja/src/ltj-lotf_aux.lua index 613291f7a9..04cae9d2f1 100644 --- a/macros/luatex/generic/luatexja/src/ltj-lotf_aux.lua +++ b/macros/luatex/generic/luatexja/src/ltj-lotf_aux.lua @@ -10,10 +10,6 @@ luatexja.lotf_aux = aux local font_metric_table = {} aux.font_metric_table = font_metric_table -local function is_harf(t) - return luaharfbuzz and package.loaded['harf'] and require("harf-base") -end - local getfont = font.getfont local provides_feature = luaotfload.aux.provides_feature function aux.exist_feature(id, name) @@ -28,15 +24,15 @@ function aux.enable_feature(id, name) local t = getfont(id) if t and t.shared and t.shared.features then t.shared.features[name] = true - elseif t and is_harf(t) then -- HARFLOAD - local hb, tf = require("harf-base"), t.hb.spec.features + elseif t and t.hb then -- HARF + local hb, tf = luaotfload.harfbuzz, t.hb.spec.hb_features tf[#tf+1] = hb.Feature.new(name) end end function aux.specified_feature(id, name) local t = getfont(id) return t and (t.shared and t.shared.features and t.shared.features[name]) - or (t.hb and t.hb.spec and t.hb.spec.options and t.hb.spec.options[name]) -- HARFLOAD + or (t.hb and t.hb.spec and t.hb.spec.features.raw and t.hb.spec.features.raw[name]) -- HARF end @@ -53,14 +49,18 @@ end local function get_asc_des(id) local t, v = getfont(id), font_metric_table[id] local a, d - if t and t.shared then + if t and t.shared and t.shared.rawdata then local u = t.units local t2 = t.shared.rawdata.metadata if t2 then a, d = t2.ascender and t2.ascender/u, t2.descender and -t2.descender/u end - -- HARFLOAD h_extents() returns "too large" value...? - -- rawdata.metadata.horizontalmetrics is same + elseif t.hb then -- HARF + local hbfont, u = t.hb.shared.font, t.hb.shared.upem + local h = hbfont:get_h_extents() + if h and u then + a, d = h.ascender and h.ascender/u, h.descender and -h.descender/u + end end v.ascender, v.descender = (a or 0.88)*t.size, (d or 0.12)*t.size end @@ -80,9 +80,10 @@ local dummy_vht, dummy_vorg = {}, {} setmetatable(dummy_vht, {__index = function () return 1 end } ) setmetatable(dummy_vorg, {__index = function () return 0.88 end } ) local function get_vmet_table(tfmdata, dest) - if (not tfmdata) or (not tfmdata.shared) then + if (not tfmdata) or (not tfmdata.shared) or (not tfmdata.shared.rawdata) then dest = dest or {} dest.vorigin, dest.vheight = dummy_vorg, dummy_vht + dest.ind_to_uni = {} return dest end local rawdata = tfmdata.shared.rawdata @@ -115,7 +116,7 @@ end local function loop_over_duplicates(id, func) -- func: return non-nil iff abort this fn local t = (type(id)=="table") and id or getfont(id) - if t and t.resources and t.resources.duplicates then + if t and t.resources and t.resources.duplicates then -- HARF: not executed for i,v in pairs(t.resources.duplicates) do func(i,v) end @@ -128,7 +129,7 @@ local function loop_over_feat(id, feature_name, func, universal) -- func: return non-nil iff abort this fn -- universal: true iff look up all (script, lang) pair local t = (type(id)=="table") and id or getfont(id) - if t and t.resources and t.resources.sequences then + if t and t.resources and t.resources.sequences then -- HARF: not executed for _,i in pairs(t.resources.sequences) do if i.order[1] and feature_name[i.order[1]] then local f = i.features and i.features[i.order[1]] diff --git a/macros/luatex/generic/luatexja/src/ltj-rmlgbm.lua b/macros/luatex/generic/luatexja/src/ltj-rmlgbm.lua index 7fc5eb11af..bd3110fd7f 100644 --- a/macros/luatex/generic/luatexja/src/ltj-rmlgbm.lua +++ b/macros/luatex/generic/luatexja/src/ltj-rmlgbm.lua @@ -210,7 +210,9 @@ do end -- Save - k.characters[46].width = math.floor(655360/14); + if k and k.characters and k.characters[46] then + k.characters[46].width = math.floor(655360/14); + end ltjb.save_cache( "ltj-cid-auto-" .. string.lower(cid_name), { version = cache_ver, diff --git a/macros/luatex/generic/luatexja/src/ltjclasses.dtx b/macros/luatex/generic/luatexja/src/ltjclasses.dtx index 3112fd1c22..590ff597a2 100644 --- a/macros/luatex/generic/luatexja/src/ltjclasses.dtx +++ b/macros/luatex/generic/luatexja/src/ltjclasses.dtx @@ -121,7 +121,8 @@ % (sync with ltsect.dtx 2018/09/26 v1.1c)} % \changes{v1.8b}{2019/04/02}{新元号対応} % \changes{v1.8b-ltj-17}{2019/08/12}{disablejfamの``Unused global option(s)''警告を出さないようにした} - +% \changes{v1.8c}{2019/10/17}{フォントサイズ変更命令をrobustに +% (sync with classes.dtx 2019/08/27 v1.4j)} % \fi % % \iffalse @@ -151,7 +152,7 @@ %<11pt&bk>\ProvidesFile{ltjtbk11.clo} %<12pt&bk>\ProvidesFile{ltjtbk12.clo} %</tate> - [2019/08/12 v1.8b-ltj-17 + [2019/10/17 v1.8c-ltj-17 %<article|report|book> Standard LuaLaTeX-ja class] %<10pt|11pt|12pt> Standard LuaLaTeX-ja file (size option)] %<*driver> @@ -718,6 +719,17 @@ %<tate>\kanjiencoding{\kanjiencodingdefault}% \normalsize % \end{macrocode} +% +% |\normalsize|をrobustにします。 +% すぐ上で|\DeclareRobustCommand|とせずに、 +% カーネルの定義を|\renewcommand|した後に|\MakeRobust|を使っている理由は、 +% ログに |LaTeX Info: Redefining \normalsize on input line ...| という +% メッセージを出したくないからです。 +% \changes{v1.8c}{2019/10/17}{フォントサイズ変更命令をrobustに +% (sync with classes.dtx 2019/08/27 v1.4j)} +% \begin{macrocode} +\MakeRobust\normalsize +% \end{macrocode} % \end{macro} % \end{macro} % @@ -748,8 +760,11 @@ % % \begin{macro}{\small} % |\small|コマンドの定義は、|\normalsize|に似ています。 +% こちらはカーネルで未定義なので、直接|\DeclareRobustCommand|で定義します。 +% \changes{v1.8c}{2019/10/17}{フォントサイズ変更命令をrobustに +% (sync with classes.dtx 2019/08/27 v1.4j)} % \begin{macrocode} -\newcommand{\small}{% +\DeclareRobustCommand{\small}{% %<*10pt> \@setfontsize\small\@ixpt{11}% \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@ @@ -786,8 +801,11 @@ % % \begin{macro}{\footnotesize} % |\footnotesize|コマンドの定義は、|\normalsize|に似ています。 +% こちらも直接|\DeclareRobustCommand|で定義します。 +% \changes{v1.8c}{2019/10/17}{フォントサイズ変更命令をrobustに +% (sync with classes.dtx 2019/08/27 v1.4j)} % \begin{macrocode} -\newcommand{\footnotesize}{% +\DeclareRobustCommand{\footnotesize}{% %<*10pt> \@setfontsize\footnotesize\@viiipt{9.5}% \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@ @@ -831,32 +849,34 @@ % \begin{macro}{\Huge} % これらは先ほどのマクロよりも簡単です。これらはフォントサイズを変更する % だけで、リスト環境とディスプレイ数式のパラメータは変更しません。 +% \changes{v1.8c}{2019/10/17}{フォントサイズ変更命令をrobustに +% (sync with classes.dtx 2019/08/27 v1.4j)} % \begin{macrocode} %<*10pt> -\newcommand{\scriptsize}{\@setfontsize\scriptsize\@viipt\@viiipt} -\newcommand{\tiny}{\@setfontsize\tiny\@vpt\@vipt} -\newcommand{\large}{\@setfontsize\large\@xiipt{17}} -\newcommand{\Large}{\@setfontsize\Large\@xivpt{21}} -\newcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{25}} -\newcommand{\huge}{\@setfontsize\huge\@xxpt{28}} -\newcommand{\Huge}{\@setfontsize\Huge\@xxvpt{33}} +\DeclareRobustCommand{\scriptsize}{\@setfontsize\scriptsize\@viipt\@viiipt} +\DeclareRobustCommand{\tiny}{\@setfontsize\tiny\@vpt\@vipt} +\DeclareRobustCommand{\large}{\@setfontsize\large\@xiipt{17}} +\DeclareRobustCommand{\Large}{\@setfontsize\Large\@xivpt{21}} +\DeclareRobustCommand{\LARGE}{\@setfontsize\LARGE\@xviipt{25}} +\DeclareRobustCommand{\huge}{\@setfontsize\huge\@xxpt{28}} +\DeclareRobustCommand{\Huge}{\@setfontsize\Huge\@xxvpt{33}} %</10pt> %<*11pt> -\newcommand{\scriptsize}{\@setfontsize\scriptsize\@viiipt{9.5}} -\newcommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt} -\newcommand{\large}{\@setfontsize\large\@xiipt{17}} -\newcommand{\Large}{\@setfontsize\Large\@xivpt{21}} -\newcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{25}} -\newcommand{\huge}{\@setfontsize\huge\@xxpt{28}} -\newcommand{\Huge}{\@setfontsize\Huge\@xxvpt{33}} +\DeclareRobustCommand{\scriptsize}{\@setfontsize\scriptsize\@viiipt{9.5}} +\DeclareRobustCommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt} +\DeclareRobustCommand{\large}{\@setfontsize\large\@xiipt{17}} +\DeclareRobustCommand{\Large}{\@setfontsize\Large\@xivpt{21}} +\DeclareRobustCommand{\LARGE}{\@setfontsize\LARGE\@xviipt{25}} +\DeclareRobustCommand{\huge}{\@setfontsize\huge\@xxpt{28}} +\DeclareRobustCommand{\Huge}{\@setfontsize\Huge\@xxvpt{33}} %</11pt> %<*12pt> -\newcommand{\scriptsize}{\@setfontsize\scriptsize\@viiipt{9.5}} -\newcommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt} -\newcommand{\large}{\@setfontsize\large\@xivpt{21}} -\newcommand{\Large}{\@setfontsize\Large\@xviipt{25}} -\newcommand{\LARGE}{\@setfontsize\LARGE\@xxpt{28}} -\newcommand{\huge}{\@setfontsize\huge\@xxvpt{33}} +\DeclareRobustCommand{\scriptsize}{\@setfontsize\scriptsize\@viiipt{9.5}} +\DeclareRobustCommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt} +\DeclareRobustCommand{\large}{\@setfontsize\large\@xivpt{21}} +\DeclareRobustCommand{\Large}{\@setfontsize\Large\@xviipt{25}} +\DeclareRobustCommand{\LARGE}{\@setfontsize\LARGE\@xxpt{28}} +\DeclareRobustCommand{\huge}{\@setfontsize\huge\@xxvpt{33}} \let\Huge=\huge %</12pt> %</10pt|11pt|12pt> @@ -2218,9 +2238,9 @@ % これらの3つのコマンドは\file{ltsect.dtx}で提供されています。 % これらのコマンドは次のように定義されています。 % \begin{macrocode} -%\newcommand*{\title}[1]{\gdef\@title{#1}} -%\newcommand*{\author}[1]{\gdef\@author{#1}} -%\newcommand*{\date}[1]{\gdef\@date{#1}} +%\DeclareRobustCommand*{\title}[1]{\gdef\@title{#1}} +%\DeclareRobustCommand*{\author}[1]{\gdef\@author{#1}} +%\DeclareRobustCommand*{\date}[1]{\gdef\@date{#1}} % \end{macrocode} % |\date|マクロのデフォルトは、今日の日付です。 % \begin{macrocode} diff --git a/macros/luatex/generic/luatexja/src/luatexja.sty b/macros/luatex/generic/luatexja/src/luatexja.sty index 2dfee28a50..3956193af0 100644 --- a/macros/luatex/generic/luatexja/src/luatexja.sty +++ b/macros/luatex/generic/luatexja/src/luatexja.sty @@ -41,7 +41,7 @@ \ProcessOptions\relax \fi %</LaTeX> %%%% VERSION -\def\LuaTeXjaversion{20190926.0} +\def\LuaTeXjaversion{20191117.0} \directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs diff --git a/macros/luatex/generic/luatexja/src/patches/lltjp-fontspec.sty b/macros/luatex/generic/luatexja/src/patches/lltjp-fontspec.sty index 6f469fc08f..9f630754bd 100644 --- a/macros/luatex/generic/luatexja/src/patches/lltjp-fontspec.sty +++ b/macros/luatex/generic/luatexja/src/patches/lltjp-fontspec.sty @@ -1,5 +1,5 @@ % -% lltjp-fontspec.sty 2018-08-24 +% lltjp-fontspec.sty 2019-10-21 % \NeedsTeXFormat{LaTeX2e} @@ -13,7 +13,65 @@ \fi %%%%%%%% fontspec v2.5c overwrites \rmfamily etc. in \setmainfont -\@ifpackagelater{fontspec}{2018/07/29}{ %% 2.6h or later +\@ifpackagelater{fontspec}{2019/10/19}{ %% 2.7d or later +\cs_set:Nn \__fontspec_main_setmainfont:nn + { + \fontspec_set_family:Nnn \l__fontspec_rmfamily_family_tl {#1} {#2} + \tl_set_eq:NN \rmdefault \l__fontspec_rmfamily_family_tl + \use:x + { + \exp_not:n { \DeclareRobustCommand \rmfamily } + { + \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl } + \exp_not:N \fontfamily { \exp_not:N \rmdefault } + \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\mcdefault\exp_not:N\fi%%% + \exp_not:N \selectfont + } + } + \str_if_eq:eeT {\familydefault} {\rmdefault} + { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } + \__fontspec_setmainfont_hook:nn {#1} {#2} + \normalfont + } +\cs_set:Nn \__fontspec_main_setsansfont:nn + { + \fontspec_set_family:Nnn \l__fontspec_sffamily_family_tl {#1} {#2} + \tl_set_eq:NN \sfdefault \l__fontspec_sffamily_family_tl + \use:x + { + \exp_not:n { \DeclareRobustCommand \sffamily } + { + \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl } + \exp_not:N \fontfamily { \exp_not:N \sfdefault } + \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\gtdefault\exp_not:N\fi%%% + \exp_not:N \selectfont + } + } + \str_if_eq:eeT {\familydefault} {\sfdefault} + { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } + \__fontspec_setsansfont_hook:nn {#1} {#2} + \normalfont + } +\cs_set:Nn \__fontspec_main_setmonofont:nn + { + \fontspec_set_family:Nnn \l__fontspec_ttfamily_family_tl {#1} {#2} + \tl_set_eq:NN \ttdefault \l__fontspec_ttfamily_family_tl + \use:x + { + \exp_not:n { \DeclareRobustCommand \ttfamily } + { + \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl } + \exp_not:N \fontfamily { \exp_not:N \ttdefault } + \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\jttdefault\exp_not:N\fi%%% + \exp_not:N \selectfont + } + } + \str_if_eq:eeT {\familydefault} {\ttdefault} + { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } + \__fontspec_setmonofont_hook:nn {#1} {#2} + \normalfont + } +}{\@ifpackagelater{fontspec}{2018/07/29}{ %% 2.6h <= and <= 2.7c \cs_set:Nn \__fontspec_main_setmainfont:nn { \fontspec_set_family:Nnn \l__fontspec_rmfamily_family_tl {#1} {#2} @@ -28,7 +86,7 @@ \exp_not:N \selectfont } } - \str_if_eq_x:nnT {\familydefault} {\rmdefault} + \str_if_eq:eeT {\familydefault} {\rmdefault} { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } \__fontspec_setmainfont_hook:nn {#1} {#2} \normalfont @@ -47,7 +105,7 @@ \exp_not:N \selectfont } } - \str_if_eq_x:nnT {\familydefault} {\sfdefault} + \str_if_eq:eeT {\familydefault} {\sfdefault} { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } \__fontspec_setsansfont_hook:nn {#1} {#2} \normalfont @@ -66,7 +124,7 @@ \exp_not:N \selectfont } } - \str_if_eq_x:nnT {\familydefault} {\ttdefault} + \str_if_eq:eeT {\familydefault} {\ttdefault} { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } \__fontspec_setmonofont_hook:nn {#1} {#2} \normalfont @@ -84,7 +142,7 @@ \exp_not:N \selectfont } } - \str_if_eq_x:nnT {\familydefault} {\rmdefault} + \str_if_eq:eeT {\familydefault} {\rmdefault} { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } \normalfont \ignorespaces @@ -101,7 +159,7 @@ \exp_not:N \selectfont } } - \str_if_eq_x:nnT {\familydefault} {\sfdefault} + \str_if_eq:eeT {\familydefault} {\sfdefault} { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } \normalfont \ignorespaces @@ -118,12 +176,12 @@ \exp_not:N \selectfont } } - \str_if_eq_x:nnT {\familydefault} {\ttdefault} + \str_if_eq:eeT {\familydefault} {\ttdefault} { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } \normalfont \ignorespaces } -} +}} \cs_set:Nn \fontspec_visible_space: { diff --git a/macros/luatex/generic/luatexja/src/patches/lltjp-microtype.sty b/macros/luatex/generic/luatexja/src/patches/lltjp-microtype.sty index db2fac8481..5663551bea 100644 --- a/macros/luatex/generic/luatexja/src/patches/lltjp-microtype.sty +++ b/macros/luatex/generic/luatexja/src/patches/lltjp-microtype.sty @@ -1,33 +1,37 @@ % -% lltjp-microtype.sty 2019-08-12 +% lltjp-microtype.sty % % (Work in Progress) % \NeedsTeXFormat{LaTeX2e} - \RequirePackage{etoolbox} \makeatletter -\def\MT@register@font{% - \xdef\MT@font@list{\expandonce{\MT@font@list\MT@font},}% !!! -} -\def\MT@register@subst@font{\MT@exp@one@n\MT@in@clist\font@name\MT@font@list - \ifMT@inlist@\else - \xdef\MT@font@list{\expandonce{\MT@font@list\font@name},}% !!! - \fi} +\PackageWarningNoLine{luatexja}% + {LuaTeX-ja's patch against the microtype package \MessageBreak + (lltjp-microtype.sty, 2019-11-08) may not work} +\patchcmd\MT@register@font + {\xdef\MT@font@list{\MT@font@list\MT@font,}}% + {\directlua{luatexja.jfont.is_kenc('\luatexluaescapestring{\f@encoding}')}% + \unless\ifin@ + \xdef\MT@font@list{\MT@font@list\MT@font,} + \fi + }{}{} +\patchcmd\MT@register@subst@font + {\xdef\MT@font@list{\MT@font@list\font@name,}}% + {\directlua{luatexja.jfont.is_kenc('\luatexluaescapestring{\f@encoding}')}% + \unless\ifin@ + \xdef\MT@font@list{\MT@font@list\font@name,} + \fi}{}{} \let\ltj@MT@tracking@\MT@tracking@ -\def\MT@tracking@{% - \MT@exp@one@n\MT@in@clist\MT@font\MT@tr@font@list - \ifMT@inlist@\else - \MT@maybe@do{tr}% - \ifMT@do\else - \xdef\MT@tr@font@list{\expandonce{\MT@tr@font@list\MT@font,}}% !!! - \fi - \fi -} +\patchcmd\MT@tracking@ + {\xdef\MT@tr@font@list{\MT@tr@font@list\MT@font,}}% + {\directlua{luatexja.jfont.is_kenc('\luatexluaescapestring{\f@encoding}')}% + \unless\ifin@ + \xdef\MT@tr@font@list{\MT@tr@font@list\MT@font,} + \fi}{}{} \ifx\MT@tracking\ltj@MT@tracking@\let\MT@tracking\MT@tracking@\fi - %\endinput \begingroup \catcode`\/=\z@ |