texlive[52626] Master/texmf-dist: ifptex (3nov19)

commits+karl at tug.org commits+karl at tug.org
Sun Nov 3 23:42:03 CET 2019


Revision: 52626
          http://tug.org/svn/texlive?view=revision&revision=52626
Author:   karl
Date:     2019-11-03 23:42:02 +0100 (Sun, 03 Nov 2019)
Log Message:
-----------
ifptex (3nov19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/generic/ifptex/LICENSE
    trunk/Master/texmf-dist/doc/generic/ifptex/README-ja.md
    trunk/Master/texmf-dist/doc/generic/ifptex/README.md
    trunk/Master/texmf-dist/tex/generic/ifptex/ifptex.sty
    trunk/Master/texmf-dist/tex/generic/ifptex/ifuptex.sty

Modified: trunk/Master/texmf-dist/doc/generic/ifptex/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/generic/ifptex/LICENSE	2019-11-03 22:41:29 UTC (rev 52625)
+++ trunk/Master/texmf-dist/doc/generic/ifptex/LICENSE	2019-11-03 22:42:02 UTC (rev 52626)
@@ -1,6 +1,6 @@
 The MIT License
 
-Copyright (c) 2017 Takayuki YATO (aka. "ZR")
+Copyright (c) 2019 Takayuki YATO (aka. "ZR")
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

Modified: trunk/Master/texmf-dist/doc/generic/ifptex/README-ja.md
===================================================================
--- trunk/Master/texmf-dist/doc/generic/ifptex/README-ja.md	2019-11-03 22:41:29 UTC (rev 52625)
+++ trunk/Master/texmf-dist/doc/generic/ifptex/README-ja.md	2019-11-03 22:42:02 UTC (rev 52626)
@@ -9,15 +9,17 @@
 
 ### システム要件
 
-  - TeX フォーマット: plain TeX、LaTeX (および他の plain 互換なもの)
-  - TeX エンジン: 不問
-  - DVI ウェア(DVI 出力時): 不問
+  * TeX フォーマット: plain TeX、LaTeX、INI モード
+  * TeX エンジン: 不問
+  * DVI ウェア(DVI 出力時): 不問
+  * 依存パッケージ:
+      - iftex
 
 ### インストール
 
 TDS 1.1 に準拠するシステムの場合、以下のようにファイルを移動する:
 
-  - `*.sty` → $TEXMF/tex/latex/ifptex
+  - `*.sty` → $TEXMF/tex/generic/ifptex
 
 この後必要に応じて mktexlsr を実行する。
 
@@ -38,19 +40,19 @@
 
 注意:e-TeX拡張の有無は区別されない。
 
-  * `\ifpTeX`(又は `\ifptex`)[if-トークン]  
+  * `\ifptex`(又は `\ifpTeX`)[if-トークン]  
     pTeX(upTeX、pTeX-ng を含む)を使っているか。
-  * `\ifstrictpTeX`(又は `\ifstrictptex`)[if-トークン]  
+  * `\ifstrictptex`(又は `\ifstrictpTeX`)[if-トークン]  
     pTeX(upTeX、pTeX-ng ではなく)を使っているか。
-  * `\ifupTeX`(又は `\ifuptex`) [if-トークン]  
+  * `\ifuptex`(又は `\ifupTeX`) [if-トークン]  
     upTeX(pTeX-ng を含む)を使っているか。
-  * `\ifstrictupTeX`(又は `\ifstrictuptex`) [if-トークン]  
+  * `\ifstrictuptex`(又は `\ifstrictupTeX`) [if-トークン]  
     upTeX(pTeX-ng ではなく)を使っているか。
-  * `\ifnativeupTeX` [if-トークン]  
+  * `\ifnativeuptex`(又は `\ifnativeupTeX`) [if-トークン]  
     upTeX を内部文字コードが Unicode の状態で使っているか。  
-  * `\ifpTeXng`(又は `\ifptexng`)[if-トークン]  
+  * `\ifptexng`(又は `\ifpTeXng`)[if-トークン]  
     pTeX-ng を使っているか。  
-    ※一応 `\ifstrictpTeXng`(`\ifstrictptexng`)もある。
+    ※一応 `\ifstrictptexng`(`\ifstrictpTeXng`)もある。
   * `\RequirepTeX`  
     `\ifpTeX` 不成立の場合はエラーを出す。
   * `\RequireStirctpTeX`  
@@ -86,6 +88,11 @@
 更新履歴
 --------
 
+  * Version 2.0  〈2019/11/01〉
+      - LaTeX チームによる新しい iftex パッケージと動作を整合させる。
+          - 特に、iftex を中で読み込むようにする。
+          - `\if...tex` について常に小文字のみの名前を用意する。
+      - INI モードでの読込に対応。
   * Version 1.2c 〈2017/10/04〉
       - バグ修正。
   * Version 1.2b 〈2017/09/20〉

Modified: trunk/Master/texmf-dist/doc/generic/ifptex/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/generic/ifptex/README.md	2019-11-03 22:41:29 UTC (rev 52625)
+++ trunk/Master/texmf-dist/doc/generic/ifptex/README.md	2019-11-03 22:42:02 UTC (rev 52626)
@@ -9,15 +9,17 @@
 
 ### System Requirements
 
-  - TeX format: plain TeX, LaTeX (and any plain-compatible ones).
-  - TeX engine: Anything.
-  - DVI driver (in DVI mode): Anything.
+  * TeX format: plain TeX, LaTeX, and INI mode.
+  * TeX engine: Anything.
+  * DVI driver (in DVI mode): Anything.
+  * Dependent packages:
+      - iftex
 
 ### Installation
 
 In a system compliant to TDS 1.1, move the files as follows:
 
-  - `*.sty` → $TEXMF/tex/latex/ifptex
+  - `*.sty` → $TEXMF/tex/generic/ifptex
 
 And rehash your TEXMF trees if necessary.
 
@@ -42,17 +44,17 @@
 
 NB: Here “e-TeX-ness” is not considered.
 
-  * `\ifpTeX` (or `\ifptex`)  [if-token]  
+  * `\ifptex` (or `\ifpTeX`)  [if-token]  
     Whether the engine is pTeX (including upTeX or pTeX-ng).
-  * `\ifstrictpTeX` (or `\ifstrictptex`) [if-token]  
+  * `\ifstrictptex` (or `\ifstrictpTeX`) [if-token]  
     Whether the engine is pTeX but *not* upTeX or pTeX-ng.
-  * `\ifupTeX` (or `\ifuptex`) [if-token]  
+  * `\ifuptex` (or `\ifupTeX`) [if-token]  
     Whether the engine is upTeX (including pTeX-ng).
-  * `\ifstrictupTeX` (or `\ifstrictuptex`) [if-token]  
+  * `\ifstrictuptex` (or `\ifstrictupTeX`) [if-token]  
     Whether the engine is upTeX but *not* pTeX-ng.
-  * `\ifnativeupTeX` [if-token]  
+  * `\ifnativeuptex` (or `\ifnativeupTeX`) [if-token]  
     Whether the engine is upTeX and its internal encoding is Unicode.
-  * `\ifpTeXng` (or `\ifptexng`) [if-token]  
+  * `\ifptexng` (or `\ifpTeXng`) [if-token]  
     Whether the engine is pTeX-ng.
   * `\RequirepTeX`  
     Issues an error if `\ifpTeX` fails.
@@ -92,6 +94,12 @@
 Revision History
 ----------------
 
+  * Version 2.0  〈2019/11/01〉
+      - Adjust to work better with the new iftex package maintanined
+        by the LaTeX3 Project.
+          - Now iftex is loaded inside ifptex.
+          - Provide always all-lowercase `\if...tex` commands.
+      - Support for loading in INI mode.
   * Version 1.2c 〈2017/10/04〉
   * Version 1.2b 〈2017/09/20〉
   * Version 1.2a 〈2017/09/15〉

Modified: trunk/Master/texmf-dist/tex/generic/ifptex/ifptex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/ifptex/ifptex.sty	2019-11-03 22:41:29 UTC (rev 52625)
+++ trunk/Master/texmf-dist/tex/generic/ifptex/ifptex.sty	2019-11-03 22:42:02 UTC (rev 52626)
@@ -1,7 +1,7 @@
 %%
 %% This is file 'ifptex.sty'.
 %%
-%% Copyright (c) 2017 Takayuki YATO (aka. "ZR")
+%% Copyright (c) 2019 Takayuki YATO (aka. "ZR")
 %%   GitHub:   https://github.com/zr-tex8r
 %%   Twitter:  @zr_tex8r
 %%
@@ -9,29 +9,50 @@
 %%
 %
 %% avoid multiple loading
-\csname\if11bxipIfptexLoaded\fi\endcsname
+\csname\if11bxipIfptexLoaded\fi\endcsname%
 %% code guards
-\edef\x{%
+\begingroup\count255\catcode61\global\catcode61\catcode48%
+\catcode91=1\catcode93=2\xdef\bxipIfptexLoaded[%
+\catcode61=\the\count255%
+\catcode13=\the\catcode13%
 \catcode32=\the\catcode32%
+\catcode35=\the\catcode35%
+\catcode123=\the\catcode123%
+\catcode125=\the\catcode125%
+\endlinechar=\the\endlinechar]%
+\endgroup\catcode32=10\catcode13=5\endlinechar=13\relax%
+\catcode35=6 \catcode123=1 \catcode125=2
+\edef\bxipIfptexLoaded{\bxipIfptexLoaded
 \catcode33=\the\catcode33%
-\catcode35=\the\catcode35%
-\catcode42=\the\catcode42%
+\catcode34=\the\catcode34%
+\catcode39=\the\catcode39%
+\catcode45=\the\catcode45%
+\catcode46=\the\catcode46%
+\catcode47=\the\catcode47%
+\catcode58=\the\catcode58%
 \catcode60=\the\catcode60%
 \catcode62=\the\catcode62%
+\catcode63=\the\catcode63%
 \catcode64=\the\catcode64%
 \catcode91=\the\catcode91%
 \catcode93=\the\catcode93%
+\catcode96=\the\catcode96%
 \relax}
-\catcode32=10\relax
-\catcode33=11 %<">
-\catcode35=6  %<#>
-\catcode42=12 %<*>
-\catcode60=12 %<<>
-\catcode62=12 %<>>
-\catcode64=11 %<@>
-\catcode91=12 %<[>
-\catcode93=12 %<]>
-\edef\bxip at restore@codes{\x
+\catcode33=12 % <!>
+\catcode34=12 % <">
+\catcode39=12 % <'>
+\catcode45=12 % <->
+\catcode46=12 % <.>
+\catcode47=12 % </>
+\catcode58=12 % <:>
+\catcode60=12 % <<>
+\catcode62=12 % <>>
+\catcode63=12 % <?>
+\catcode64=11 % <@>
+\catcode91=12 % <[>
+\catcode93=12 % <]>
+\catcode96=12 % <`>
+\edef\bxip at restore@codes{\bxipIfptexLoaded
   \noexpand\let\noexpand\bxip at restore@codes\relax}
 \def\bxipIfptexLoaded{\endinput}
 
@@ -38,21 +59,28 @@
 %% check for LaTeX
 \ifx\RequirePackage\@undefined %<*!LaTeX>
   \let\bxip at latex=f
-  \long\def\x#1\ProvidesPackage#2[#3]{%
+  \long\def\bxip at input#1\ProvidesPackage#2[#3]{%
+    \def\bxip at input\RequirePackage##1[##2]{\input ##1.sty\relax}%
     \immediate\write-1{Package: #2 #3}}
-  \expandafter\x
+  \expandafter\bxip at input
 \else                          %<*LaTeX>
-  \let\bxip at latex=t \let\x\relax
+  \let\bxip at latex=t
+  \let\bxip at input\relax
 \fi                            %</LaTeX>
 
 %% package declaration
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ifptex}[2017/10/04 v1.2c pTeX checker]
+\ProvidesPackage{ifptex}[2019/11/01 v2.0 pTeX checker]
 \def\bxip at pkgname{ifptex}
 
-%% enter the big group
-\begingroup
+%% packages
+\ifx\newif\@undefined\else
+\bxip at input
+\RequirePackage{iftex}[2013/04/04]% v0.2
+\fi
 
+%=======================================
+\begingroup % entering a big group
 %--------------------------------------- helpers
 
 %% \bxip at csletcs{<csnameA>}{<csnameB>}
@@ -96,19 +124,29 @@
 \gdef\bxip at check@version at a#1#2#3#4#5#6\relax#7{%
   \bxip at err@required{#7 v.>=\number#2#3#4.#5#6}}
 
-%% \bxip at err@required{<string>}
-% NB: Now the same style as in ifxetex is used.
-\gdef\bxip at err@required#1{%
-  \begingroup
-    \errorcontextlines=-1\relax
-    \newlinechar=10\relax
-    \errmessage{^^J
-    ********************************************^^J
-    * #1 is required to compile this document.^^J
-    * Sorry!^^J
+%% \bxip at Require\ifXXX{<string>}\fi
+% (Equivalent to \IFTEX at Require of iftex.)
+\gdef\bxip at Require#1#2#3{%
+  #1\else
+    \newlinechar64\relax
+    \errorcontextlines-1\relax
+    \immediate\write20{@
+    ********************************************@
+    * #2 is required to compile this document.@
+    * Sorry!@
     ********************************************}%
-  \endgroup}
+    % do a hard stop
+    \batchmode\read-1to\bxip at tmpa
+  #3}
+\gdef\bxip at err@required#1{\bxip at Require\iftrue{#1}\fi}
 
+%% \bxip at protected
+\let\bxip at protected\protected
+\ifx\directlua\@undefined\else
+  \directlua{tex.enableprimitives('bxip@', {'protected'})}
+\fi
+\bxip at csletcs{bxip at protected}{bxip at protected}
+
 %--------------------------------------- guess version
 
 %% \bxip at uptex@new at version
@@ -135,12 +173,13 @@
 
 %--------------------------------------- public stuffs
 % Note:
-% 1) Names '\ifFooTeX' are used in iftex.
+% 1) Names '\ifFooTeX' were used in old iftex.
 % 2) Names '\iffootex' are used in ifxetex/ifluatex/....
-% My preferences are:
+% My preferences used to be:
 % - '\ifwhateverFooTeX' and '\RequireWhateverFooTeX'.
-% But I also provide aliases '\iffootex' and '\ifstrictfootex' for
-% compatibility with 1) and the old ifuptex.
+% But now I adopt the preferences of new iftex:
+% - '\ifwhateverfootex' and '\RequireWhateverFooTeX'.
+% I also provide aliases '\ifwhateverFooTeX' for compatibility.
 
 %%<+> \ifpTeX
 \global\bxip at false{ifpTeX}
@@ -161,6 +200,8 @@
 \fi
 %%<+> \ifuptex == \ifupTeX
 \global\bxip at csletcs{ifuptex}{ifupTeX}
+%%<+> \ifnativeuptex == \ifnativeupTeX
+\global\bxip at csletcs{ifnativeuptex}{ifnativeupTeX}
 
 %%<+> \ifpTeXng
 \global\bxip at false{ifpTeXng}
@@ -192,29 +233,29 @@
 \global\bxip at csletcs{ifstrictptexng}{ifstrictpTeXng}
 
 %%<+> \RequirepTeX
-\gdef\RequirepTeX{%
-  \ifpTeX\else \bxip at err@required{(u)pTeX}\fi}
+\bxip at protected\gdef\RequirepTeX{%
+  \bxip at Require\ifpTeX{(u)pTeX}\fi}
 %%<+> \RequireStrictpTeX
-\gdef\RequireStrictpTeX{%
-  \ifstrictpTeX\else \bxip at err@required{pTeX (not upTeX)}\fi}
+\bxip at protected\gdef\RequireStrictpTeX{%
+  \bxip at Require\ifstrictpTeX{pTeX (not upTeX)}\fi}
 %%<+> \RequireupTeX
-\gdef\RequireupTeX{%
-  \ifupTeX\else \bxip at err@required{upTeX}\fi}
+\bxip at protected\gdef\RequireupTeX{%
+  \bxip at Require\ifupTeX{upTeX}\fi}
 %%<+> \RequireStrictupTeX
-\gdef\RequireStrictupTeX{%
-  \ifstrictupTeX\else \bxip at err@required{upTeX (not pTeX-ng)}\fi}
+\bxip at protected\gdef\RequireStrictupTeX{%
+  \bxip at Require\ifstrictupTeX{upTeX (not pTeX-ng)}\fi}
 %%<+> \RequireNativeupTeX
-\gdef\RequireNativeupTeX{%
-  \ifnativeupTeX\else \bxip at err@required{upTeX in Unicode}\fi}
+\bxip at protected\gdef\RequireNativeupTeX{%
+  \bxip at Require\ifnativeupTeX{upTeX in Unicode}\fi}
 %%<+> \RequirepTeXng
-\gdef\RequirepTeXng{%
-  \ifpTeXng\else \bxip at err@required{pTeX-ng}\fi}
+\bxip at protected\gdef\RequirepTeXng{%
+  \bxip at Require\ifpTeXng{pTeX-ng}\fi}
 %%<+> \RequireStrictpTeXng
-\gdef\RequireStrictpTeXng{%
-  \ifstrictpTeXng\else \bxip at err@required{pTeX-ng}\fi}
+\bxip at protected\gdef\RequireStrictpTeXng{%
+  \bxip at Require\ifstrictpTeXng{pTeX-ng}\fi}
 
 %--------------------------------------- KanjiKoodo declaration
-\ifpTeX
+\ifpTeX \ifx t\bxip at latex
 
 %% \bxip at def@str\CS{<strcode>}
 \def\bxip at def@str#1#2{%
@@ -283,7 +324,7 @@
     \epTeXinputencoding utf8}% unterminated
 \fi
 
-\fi
+\fi\fi
 %--------------------------------------- deprecated stuffs
 
 %%<+>D \ifNativeupTeX == \ifnativeupTeX
@@ -317,6 +358,10 @@
 
 %--------------------------------------- all done
 \endgroup
+% clean up
+\let\bxip at latex\@undefined
+\let\bxip at input\@undefined
+\let\bxip at protected\@undefined
 \bxip at restore@codes
 \endinput
 %% EOF

Modified: trunk/Master/texmf-dist/tex/generic/ifptex/ifuptex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/ifptex/ifuptex.sty	2019-11-03 22:41:29 UTC (rev 52625)
+++ trunk/Master/texmf-dist/tex/generic/ifptex/ifuptex.sty	2019-11-03 22:42:02 UTC (rev 52626)
@@ -1,7 +1,7 @@
 %%
 %% This is file 'ifuptex.sty'.
 %% 
-%% Copyright (c) 2017 Takayuki YATO (aka. "ZR")
+%% Copyright (c) 2019 Takayuki YATO (aka. "ZR")
 %%   GitHub:   https://github.com/zr-tex8r
 %%   Twitter:  @zr_tex8r
 %%
@@ -11,10 +11,20 @@
 % NOTE: Now ifuptex is merely an alias to ifptex.
 %
 %% avoid multiple loading
-\csname\if11bxipIfuptexLoaded\fi\endcsname
+\csname\if11bxipIfuptexLoaded\fi\endcsname%
 %% code guards
-\edef\x{%
+\begingroup\count255\catcode61\global\catcode61\catcode48%
+\catcode91=1\catcode93=2\xdef\bxipIfuptexLoaded[%
+\catcode61=\the\count255%
+\catcode13=\the\catcode13%
 \catcode32=\the\catcode32%
+\catcode35=\the\catcode35%
+\catcode123=\the\catcode123%
+\catcode125=\the\catcode125%
+\endlinechar=\the\endlinechar]%
+\endgroup\catcode32=10\catcode13=5\endlinechar=13\relax%
+\catcode35=6 \catcode123=1 \catcode125=2
+\edef\bxipIfuptexLoaded{\bxipIfuptexLoaded
 \catcode45=\the\catcode45%
 \catcode46=\the\catcode46%
 \catcode47=\the\catcode47%
@@ -21,32 +31,32 @@
 \catcode58=\the\catcode58%
 \catcode64=\the\catcode64%
 \relax}
-\catcode32=10\relax
 \catcode45=12 % <->
 \catcode46=12 % <.>
 \catcode47=12 % </>
 \catcode58=12 % <:>
 \catcode64=11 % <@>
-\edef\bxip at up@restore at codes{\x
+\edef\bxip at up@restore at codes{\bxipIfuptexLoaded
   \noexpand\let\noexpand\bxip at up@restore at codes\relax}
 \def\bxipIfuptexLoaded{\endinput}
 
 %% check for LaTeX
-\ifx\RequirePackage\@undefined % non-LaTeX
-  \long\def\x#1\ProvidesPackage#2[#3]{%
-    \def\x\RequirePackage##1[##2]{\input ##1.sty\relax}%
+\ifx\RequirePackage\@undefined %<*!LaTeX>
+  \long\def\bxip at input#1\ProvidesPackage#2[#3]{%
+    \def\bxip at input\RequirePackage##1[##2]{\input ##1.sty\relax}%
     \immediate\write-1{Package: #2 #3}}
-  \expandafter\x
-\else % LaTeX
-  \let\x\relax
-\fi
+  \expandafter\bxip at input
+\else                          %<*LaTeX>
+  \let\bxip at input\relax
+\fi                            %</LaTeX>
 
 %% package declaration
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ifuptex}[2017/10/04 v1.2c upTeX checker]
+\ProvidesPackage{ifuptex}[2019/11/01 v2.0 pTeX checker]
 
 %% load ifptex
-\x\RequirePackage{ifptex}[2017/10/04]
+\bxip at input
+\RequirePackage{ifptex}[2019/11/01]
 
 %% all done
 \bxip at up@restore at codes



More information about the tex-live-commits mailing list