From 6c856a310ee8889df64c704e1e2118fa30857b1f Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Tue, 12 Apr 2022 20:39:37 +0000
Subject: bxjscls (12apr22)

git-svn-id: svn://tug.org/texlive/trunk@63011 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/bxjscls/bxjsreport.cls | 50 ++++++++++++++--------
 1 file changed, 32 insertions(+), 18 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/bxjscls/bxjsreport.cls')

diff --git a/Master/texmf-dist/tex/latex/bxjscls/bxjsreport.cls b/Master/texmf-dist/tex/latex/bxjscls/bxjsreport.cls
index 7ed66aab6c2..4d50929b9dd 100644
--- a/Master/texmf-dist/tex/latex/bxjscls/bxjsreport.cls
+++ b/Master/texmf-dist/tex/latex/bxjscls/bxjsreport.cls
@@ -22,15 +22,16 @@
 %% in the same archive or directory.)
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{bxjsreport}
-  [2022/03/20 v2.6  BXJS document classes]
+  [2022/04/10 v2.7a BXJS document classes]
 %% このファイルは日本語文字を含みます.
 \def\bxjs@clsname{bxjsreport}
 \newif\ifjsc@needsp@tch
 \jsc@needsp@tchfalse
 \RequirePackage{calc}
 \RequirePackage{keyval}
+\def\jsAtEndOfClass{%
+  \expandafter\g@addto@macro\csname\bxjs@clsname.cls-h@@k\endcsname}
 \IfFileExists{bxjscompat.sty}{%
-  \let\jsAtEndOfClass\@gobble
   \RequirePackage{bxjscompat}%
 }{}
 \let\jsArticle=a
@@ -165,31 +166,33 @@
     \fi
   \fi}
   \def\bxjs@unit@Q{0.25mm}\let\bxjs@unit@H\bxjs@unit@Q
+\newif\ifbxjs@after@preamble
 \@onlypreamble\bxjs@begin@document@hook
-\let\bxjs@begin@document@hook\@empty
+\def\bxjs@begin@document@hook{\bxjs@after@preambletrue}
 \AtBeginDocument{\bxjs@begin@document@hook}
 \@onlypreamble\bxjs@post@option@hook
 \let\bxjs@post@option@hook\@empty
 \@onlypreamble\bxjs@pre@jadriver@hook
 \let\bxjs@pre@jadriver@hook\@empty
-\def\jsAtEndOfClass{%
-  \expandafter\g@addto@macro\csname\bxjs@clsname.cls-h@@k\endcsname}
 \@onlypreamble\bxjs@tmpdo
 \@onlypreamble\bxjs@tmpdo@a
 \@onlypreamble\bxjs@tmpdo@b
 \@onlypreamble\bxjs@tmpdo@c
 \@onlypreamble\bxjs@tmpdo@d
-\if l\jsEngine
-\def\bxjs@tmpdo#1{%
-  \xdef\bxjs@pre@jadriver@hook{%
-    \bxjs@pre@jadriver@hook
-    \catcode`#1=\the\catcode`#1\relax}%
-  \catcode`#1=11\relax}
-\@tfor\bxjs@tmpa:=和西暦\do
-  {\expandafter\bxjs@tmpdo\bxjs@tmpa}
-\fi
 \bxjs@robust@def\jsInhibitGlue{%
   \ifx\inhibitglue\@undefined\else \inhibitglue \fi}
+\@tempswatrue
+\if x\jsEngine
+  \ifdim\the\XeTeXversion\XeTeXrevision\p@<0.997\p@
+    \@tempswafalse \fi
+\fi
+\if@tempswa \expandafter\@gobble
+\else
+  \ClassError\bxjs@clsname
+   {The engine in use is all too old}
+   {It's a fatal error. I'll quit right now.}
+  \expandafter\@firstofone
+\fi{\endinput\@@end}
 \if@compatibility
   \ClassError\bxjs@clsname
    {Something went chaotic!\MessageBreak
@@ -467,6 +470,9 @@
 \DeclareOption{nodvidriver}{%
   \def\bxjs@driver@opt{nodvidriver}%
   \let\bxjs@driver@given\bxjs@driver@@none}
+\DeclareOption{nodvidriver*}{%
+  \def\bxjs@driver@opt{nodvidriver*}%
+  \let\bxjs@driver@given\bxjs@driver@@none}
 \DeclareOption{pdftex}{%
   \def\bxjs@driver@opt{pdftex}%
   \let\bxjs@driver@given\bxjs@driver@@pdfmode}
@@ -606,6 +612,7 @@
 \let\bxjs@dvidriver@@dviout=\bxjs@driver@@dvimode
 \let\bxjs@dvidriver@@xdvi=\bxjs@driver@@dvimode
 \let\bxjs@dvidriver@@nodvidriver=\bxjs@driver@@none
+\bxjs@cslet{bxjs@dvidriver@@nodvidriver*}\bxjs@driver@@none
 \define@key{bxjs}{dvi}{%
   \bxjs@csletcs{bxjs@tmpa}{bxjs@dvidriver@@#1}%
   \ifx\bxjs@tmpa\relax
@@ -791,9 +798,12 @@
   \bxjs@papersizefalse
 \fi
 \def\bxjs@@minimal{minimal}
+\def\bxjs@@standard{standard}
+\def\bxjs@@pandoc{pandoc}
+\def\bxjs@@modern{modern}
 \ifx\bxjs@jadriver\relax
   \ifx j\jsEngine
-    \def\bxjs@jadriver{standard}
+    \let\bxjs@jadriver\bxjs@@standard
   \else
     \ClassWarningNoLine\bxjs@clsname
      {The option 'ja' is MISSING!!\MessageBreak
@@ -804,7 +814,6 @@
     \let\bxjs@jadriver\bxjs@@minimal
   \fi
 \fi
-\def\bxjs@@pandoc{pandoc}
 \ifx\bxjs@jadriver\bxjs@@pandoc \ifx\bxjs@plautopatch@given\@undefined
     \ifjsWitheTeX
   \bxjs@plautopatchtrue
@@ -1217,7 +1226,6 @@
 \else
   \PassOptionsToPackage{driver=none}{geometry}
 \fi
-\bxjs@apply@bd@pre@geometry@hook
 \bxjs@apply@bd@pre@geometry@hook{\bxjs@bd@pre@geometry@hook}
 \bxjs@apply@bd@pre@geometry@hook{\ImposeOldLuaTeXBehavior}
 \bxjs@preproc@layout
@@ -1308,6 +1316,12 @@
   \fi\fi}
 \let\pltx@cleartorightpage\pltx@cleartooddpage
 \let\pltx@cleartoleftpage\pltx@cleartoevenpage
+\ifdim\vsize=\z@
+\begingroup
+\toks@\expandafter{\clearpage}
+\xdef\clearpage{\noexpand\ifbxjs@after@preamble\the\toks@\noexpand\fi}
+\endgroup
+\fi
 \if@openleft
   \let\cleardoublepage\pltx@cleartoleftpage
 \else\if@openright
@@ -2525,7 +2539,7 @@
     \global\let\bxjs@wareki@used\@empty
     \ClassWarning\bxjs@clsname
      {Wareki mode is not supported, since\MessageBreak
-      'bxwareki' is unavailable, found}}
+      'bxwareki' is unavailable, reported}}
   \g@addto@macro\bxjs@begin@document@hook{%
     \let\bxjs@wareki@used\@empty}
 \fi
-- 
cgit v1.2.3

