From 2ec558d7eabcf796669f115c3481cb80d4a40624 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 14 Jun 2023 20:13:52 +0000
Subject: bxjscls (14jun23)

git-svn-id: svn://tug.org/texlive/trunk@67364 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/tex/latex/bxjscls/bxjsja-pandoc.def | 73 +++++++++++++---------
 1 file changed, 43 insertions(+), 30 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/bxjscls/bxjsja-pandoc.def')

diff --git a/Master/texmf-dist/tex/latex/bxjscls/bxjsja-pandoc.def b/Master/texmf-dist/tex/latex/bxjscls/bxjsja-pandoc.def
index a51c0097880..a4b5bd23688 100644
--- a/Master/texmf-dist/tex/latex/bxjscls/bxjsja-pandoc.def
+++ b/Master/texmf-dist/tex/latex/bxjscls/bxjsja-pandoc.def
@@ -21,7 +21,7 @@
 %% same distribution. (The sources need not necessarily be
 %% in the same archive or directory.)
 \ProvidesFile{bxjsja-pandoc.def}
-  [2022/04/10 v2.7a BXJS document classes]
+  [2023/06/14 v2.8  BXJS document classes]
 \input{bxjsja-standard.def}
 \RequirePackage{bxjspandoc}
 \ifjsWitheTeX\else
@@ -84,7 +84,7 @@
 \let\bxjs@kv@orblockheading@true\bxjs@jp@or@block@headingtrue
 \let\bxjs@kv@orblockheading@false\bxjs@jp@or@block@headingfalse
 \define@key{bxjsPan}{or-block-heading}[true]{%
-  \bxjs@set@keyval{blockheading}{#1}{}}
+  \bxjs@set@keyval{orblockheading}{#1}{}}
 \def\bxjs@next#1{\bxjs@safe@setkeys{bxjsPan}{#1}}
 \expandafter\bxjs@next\expandafter{\jsJaParam}
 \@onlypreamble\bxjs@set@dupload@proc
@@ -121,7 +121,6 @@
     \bxjs@next{#3}}%
   \@firstoftwo}
 \let\bxjs@polyglossia@options\relax
-\let\bxjs@babel@options\relax
 \ifnum0\if x\jsEngine1\fi\if l\jsEngine1\fi>0
 \pandocSkipLoadPackage{polyglossia}
 \bxjs@set@dupload@proc{polyglossia.sty}{%
@@ -161,6 +160,7 @@
       \setotherlangauge{\bxjs@tmpa}}}%
   \let\bxjs@polyglossia@options\relax}%
 \fi
+\let\bxjs@babel@options\relax
 \pandocSkipLoadPackage{babel}
 \bxjs@set@dupload@proc{babel.sty}{%
   \bxjs@unset@dupload@proc{babel.sty}%
@@ -168,39 +168,52 @@
    {Package babel is requested}%
   \@tempswafalse \let\bxjs@babel@options\@empty
   \def\bxjs@tmpb{main=}%
-  \def\bxjs@next{main=japanese}%
   \@for\bxjs@tmpa:=#1\do{%
-    \ifx\bxjs@tmpa\bxjs@tmpb \@tempswatrue
-    \else\ifx\bxjs@tmpa\bxjs@next \@tempswatrue
-    \else \edef\bxjs@babel@options{\bxjs@babel@options,\bxjs@tmpa}%
-    \fi\fi}%
-  \if@tempswa
-    \ClassWarning\bxjs@clsname
-     {Main language is 'japanese', thus fallback\MessageBreak
-      definitions will be employed}%
-    \bxjs@pandoc@babel@ja
-  \else
-    \ClassWarning\bxjs@clsname
-     {Main language is not 'japanese',\MessageBreak
-      thus babel will be loaded}%
-    \bxjs@cslet{ver@babel.sty}\@undefined
-    \RequirePackage[#1]{babel}[]%
-  \fi}
+    \ifx\bxjs@tmpa\bxjs@tmpb \def\bxjs@tmpa{main=japanese}\fi
+    \edef\bxjs@babel@options{\bxjs@babel@options,\bxjs@tmpa}}%
+  \bxjs@cslet{ver@babel.sty}\@undefined
+  \edef\bxjs@next{%
+    \noexpand\RequirePackage[\bxjs@babel@options]{babel}\relax
+  }\bxjs@next
+  \RequirePackage{bxorigcapt}\relax}
 \g@addto@macro\bxjs@endpreamble@hook{%
   \ifx\bxjs@babel@options\relax
     \bxjs@cslet{ver@babel.sty}\@undefined
   \fi}
-\@onlypreamble\bxjs@pandoc@babel@ja
-\def\bxjs@pandoc@babel@ja{%
-  \bxjs@cslet{ver@babel.sty}\@undefined
-  \edef\bxjs@next{%
-    \noexpand\RequirePackage[\bxjs@babel@options,english]{babel}[]%
-  }\bxjs@next
-  \if j\jsEngine
-    \RequirePackage[main=japanese]{pxbabel}[]%
-  \else
-    \RequirePackage{bxorigcapt}[]%
+\ifjsWitheTeX
+\AtBeginOfFile{japanese.ldf}{\bxjs@begin@japanese@ldf@hook}
+\def\bxjs@begin@japanese@ldf@hook{%
+  \let\bxjs@begin@japanese@ldf@hook\relax
+  \let\bxjs@save@ProvidesLanguage\ProvidesLanguage
+  \let\bxjs@save@LdfInit\LdfInit
+  \def\ProvidesLanguage##1[##2]{\bxjs@do@japanese@ldf{##2}}%
+  \def\LdfInit##1##2{\bxjs@do@japanese@ldf{0000/00/00}}}
+\def\bxjs@do@japanese@ldf#1{\bxjs@do@japanese@ldf@a#1\@nil}
+\def\bxjs@do@japanese@ldf@a#1/#2/#3#4#5\@nil{%
+  \let\LdfInit\bxjs@save@LdfInit
+  \ClassInfo\bxjs@clsname
+   {Release date of japanese.ldf is:\MessageBreak
+    \@spaces #1/#2/#3#4\@gobble}%
+  \ifnum#1#2#3#4<20201206 % v3.0
+    \let\bxjs@japanese@ldf@skipped=t\csuse{endinput}%
+  \fi}
+\AtEndOfFile{japanese.ldf}{\bxjs@end@japanese@ldf@hook}
+\def\bxjs@end@japanese@ldf@hook{%
+  \let\bxjs@end@japanese@ldf@hook\relax
+  \let\ProvidesLanguage\bxjs@save@ProvidesLanguage
+  \let\LdfInit\bxjs@save@LdfInit
+  \ifx t\bxjs@japanese@ldf@skipped
+    \ClassWarningNoLine\bxjs@clsname
+     {Loading japanese.ldf is skipped}%
+    \ifundef\l@japanese{\chardef\l@japanese\z@}{}%
+    \let\datejapanese\@empty\let\captionsjapanese\@empty
+    \let\extrasjapanese\@empty\let\noextrasjapanese\@empty
+    \main@language{japanese}%
   \fi}
+\g@addto@macro\bxjs@begin@document@hook{%
+  \let\bxjs@begin@japanese@ldf@hook\relax
+  \let\bxjs@end@japanese@ldf@hook\relax}
+\fi
 \bxjs@set@dupload@proc{geometry.sty}{%
   \setpagelayout*{#1}}
 \if l\jsEngine
-- 
cgit v1.2.3

