%%
%% This is file `bxjsja-pandoc.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% bxjscls.dtx  (with options: `drv,pandoc')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from bxjsja-pandoc.def.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file bxjscls.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
\ProvidesFile{bxjsja-pandoc.def}
  [2026/03/29 v2.9e BXJS document classes]
\if x\jsEngine
  \PassOptionsToPackage{nospace}{xeCJK}
\fi
\input{bxjsja-standard.def}
\RequirePackage{bxjspandoc}
\ifjsWitheTeX\else
  \ClassWarningNoLine\bxjs@clsname
   {!!!!!!!! WARNING !!!!!!!!\MessageBreak
    This engine does not support e-TeX extension!\MessageBreak
    Some feature might not work properly}
\fi
\newif\ifbxjs@bxghost@available
\ifjsWitheTeX
  \RequirePackage{pdftexcmds}[2009/09/22]% v0.5
  \IfFileExists{bxghost.sty}{%
    \bxjs@bxghost@availabletrue
    \@namedef{bxjs@bgbv/79E70A0991967E27981832C84DB5DF99}{1}%v0.2.0
    \ifx\pdf@filemdfivesum\@undefined\else
      \expandafter\ifx\csname bxjs@bgbv/\pdf@filemdfivesum{bxghost.sty}%
          \endcsname\relax\else \bxjs@bxghost@availablefalse \fi
    \fi
  }{}
\fi
\RequirePackage{iftex}[2013/04/04]% v0.2
\ifjsWitheTeX
  \RequirePackage{etoolbox}[2010/08/21]% v2.0
  \RequirePackage{filehook}[2011/10/12]% v0.5d
\fi
\newif\ifbxjs@jp@fix@strong \bxjs@jp@fix@strongtrue
\let\bxjs@kv@fixstrong@true\bxjs@jp@fix@strongtrue
\let\bxjs@kv@fixstrong@false\bxjs@jp@fix@strongfalse
\define@key{bxjsPan}{fix-strong}[true]{%
  \bxjs@set@keyval{fixstrong}{#1}{}}
\newif\ifbxjs@jp@fix@code \bxjs@jp@fix@codetrue
\let\bxjs@kv@fixcode@true\bxjs@jp@fix@codetrue
\let\bxjs@kv@fixcode@false\bxjs@jp@fix@codefalse
\define@key{bxjsPan}{fix-code}[true]{%
  \bxjs@set@keyval{fixcode}{#1}{}}
\chardef\bxjs@jp@strong=0
\def\bxjs@kv@strong@bold{\chardef\bxjs@jp@strong=0 }
\def\bxjs@kv@strong@sans{\chardef\bxjs@jp@strong=1 }
\def\bxjs@kv@strong@boldsans{\chardef\bxjs@jp@strong=2 }
\define@key{bxjsPan}{strong}{%
  \bxjs@set@keyval{strong}{#1}{}}
\newif\ifbxjs@jp@or@indent \bxjs@jp@or@indenttrue
\newif\ifbxjs@jp@or@secnumdepth \bxjs@jp@or@secnumdepthtrue
\newif\ifbxjs@jp@or@block@heading \bxjs@jp@or@block@headingtrue
\define@key{bxjsPan}{_plus}[]{%
  \bxjs@jp@or@indentfalse
  \bxjs@jp@or@secnumdepthfalse
  \bxjs@jp@or@block@headingfalse}
\let\bxjs@kv@orindent@true\bxjs@jp@or@indenttrue
\let\bxjs@kv@orindent@false\bxjs@jp@or@indentfalse
\define@key{bxjsPan}{or-indent}[true]{%
  \bxjs@set@keyval{orindent}{#1}{}}
\let\bxjs@kv@orsecnumdepth@true\bxjs@jp@or@secnumdepthtrue
\let\bxjs@kv@orsecnumdepth@false\bxjs@jp@or@secnumdepthfalse
\define@key{bxjsPan}{or-secnumdepth}[true]{%
  \bxjs@set@keyval{orsecnumdepth}{#1}{}}
\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{orblockheading}{#1}{}}
\def\bxjs@next#1{\bxjs@safe@setkeys{bxjsPan}{#1}}
\expandafter\bxjs@next\expandafter{\jsJaParam}
\@onlypreamble\bxjs@set@dupload@proc
\def\bxjs@set@dupload@proc#1{%
  \expandafter\bxjs@set@dupload@proc@a\csname bxjs@dlp/#1\endcsname}
\@onlypreamble\bxjs@set@dupload@proc@a
\def\bxjs@set@dupload@proc@a#1{%
  \@onlypreamble#1\def#1##1}
\def\bxjs@unset@dupload@proc#1{%
  \bxjs@cslet{bxjs@dlp/#1}\@undefined}
\@onlypreamble\bxjs@org@if@ptions
\let\bxjs@org@if@ptions\@if@ptions
\@onlypreamble\bxjs@org@reset@ptions
\let\bxjs@org@reset@ptions\relax
\def\@if@ptions#1#2#3{%
  \let\bxjs@next\@secondoftwo
  \def\bxjs@tmpa{#1}\def\bxjs@tmpb{\@currext}%
  \ifx\bxjs@tmpa\bxjs@tmpb
    \expandafter\ifx\csname bxjs@dlp/#2.#1\endcsname\relax\else
      \let\bxjs@next\@firstoftwo \fi
  \fi
  \bxjs@next\bxjs@do@dupload@proc\bxjs@org@if@ptions{#1}{#2}{#3}}
\g@addto@macro\bxjs@begin@document@hook{%
  \let\@if@ptions\bxjs@org@if@ptions}
\@onlypreamble\bxjs@do@dupload@proc
\def\bxjs@do@dupload@proc#1#2#3{%
  \ifx\bxjs@org@reset@ptions\relax
    \let\bxjs@org@reset@ptions\@reset@ptions
  \fi
  \bxjs@csletcs{bxjs@next}{bxjs@dlp/#2.#1}%
  \def\@reset@ptions{%
    \let\@reset@ptions\bxjs@org@reset@ptions
    \@reset@ptions
    \bxjs@next{#3}}%
  \@firstoftwo}
\let\bxjs@polyglossia@options\relax
\ifnum0\if x\jsEngine1\fi\if l\jsEngine1\fi>0
\pandocSkipLoadPackage{polyglossia}
\bxjs@set@dupload@proc{polyglossia.sty}{%
  \bxjs@unset@dupload@proc{polyglossia.sty}%
  \ClassWarning\bxjs@clsname
   {Package polyglossia is requested}%
  \def\bxjs@polyglossia@options{#1}%
  \newcommand*\setmainlanguage[2][]{%
    \ifboolexpr{test{\ifblank{##2}}or test{\ifstrequal{##2}{japanese}}}{%
      \ClassWarning\bxjs@clsname
       {Main language is 'japanese', thus fallback\MessageBreak
        definitions will be employed}%
      \bxjs@pandoc@polyglossia@ja
    }{%else
      \ClassWarning\bxjs@clsname
       {Main language is '##2',\MessageBreak
        thus polyglossia will be loaded}%
      \csundef{ver@polyglossia.sty}%
      \edef\bxjs@next{%
        \noexpand\RequirePackage[\bxjs@polyglossia@options]{polyglossia}[]%
      }\bxjs@next
      \setmainlanguage[##1]{##2}%
    }}}
\g@addto@macro\bxjs@endpreamble@hook{%
  \ifx\bxjs@polyglossia@options\relax
    \csundef{ver@polyglossia.sty}%
  \fi}
\@onlypreamble\bxjs@pandoc@polyglossia@ja
\def\bxjs@pandoc@polyglossia@ja{%
  \renewcommand*\setmainlanguage[2][]{}%
  \newcommand*\setotherlanguage[2][]{%
    \ifblank{##2}{}{%else
      \cslet{##2}\@empty \cslet{end##2}\@empty
      \cslet{text##2}\@firstofone}}%
  \newcommand*\setotherlanguages[2][]{%
    \@for\bxjs@tmpa:={##2}\do{%
      \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}%
  \ClassWarning\bxjs@clsname
   {Package babel is requested}%
  \@tempswafalse \let\bxjs@babel@options\@empty
  \def\bxjs@tmpb{main=}%
  \@for\bxjs@tmpa:=#1\do{%
    \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}
\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
  \pandocSkipLoadPackage{xeCJK}
  \providecommand*{\setCJKmainfont}{\setmainjfont}
\fi
\if x\jsEngine
  \expandafter\g@addto@macro\csname opt@xeCJK.sty\endcsname{%
    ,space}
\fi
\ifjsWitheTeX
\@onlypreamble\bxjs@info@or@ban
\def\bxjs@info@or@ban#1{%
  \PackageInfo\bxjs@clsname
   {Freeze layout on '#1',\MessageBreak reported}}
\unless\ifbxjs@jp@or@indent
  \bxjs@info@or@ban{indent}
  \IfFileExists{parskip.sty}{%
    \pandocSkipLoadPackage{parskip}%
  }{%else
    \eappto\bxjs@endpreamble@hook{%
      \parindent=\the\parindent\relax
      \parskip=\the\parskip\relax}}
\fi
\ifbxjs@jp@or@secnumdepth\else
  \bxjs@info@or@ban{secnumdepth}
  \eappto\bxjs@endpreamble@hook{%
    \c@secnumdepth=\the\c@secnumdepth\relax}
\fi
\ifbxjs@jp@or@block@heading\else
  \let\bxjs@frozen@paragraph\paragraph
  \let\bxjs@frozen@subparagraph\subparagraph
  \bxjs@info@or@ban{block-heading}
  \appto\bxjs@endpreamble@hook{%
  \let\oldparagraph\@undefined
  \let\paragraph\bxjs@frozen@paragraph
  \let\subparagraph\bxjs@frozen@subparagraph}
\fi
\fi
\g@addto@macro\bxjs@begin@document@hook{%
  \@tempswafalse
  \ifx\oldparagraph\@undefined\else
    \@tempswatrue
  \fi
  \ifnum\c@secnumdepth>3
    \@tempswatrue
  \fi
  \if@tempswa\ifx\jsParagraphMark\bxjs@org@paragraph@mark
    \let\jsParagraphMark\@empty
  \fi\fi}
\def\pandocZWSpace{\zwspace}
\ifnum0\if x\jsEngine1\fi\if l\jsEngine1\fi>\z@
  \catcode"3000=\active
  \begingroup \catcode`\!=7
  \protected\gdef!!!!3000{\pandocZWSpace}
  \endgroup
\else\ifx\DeclareUnicodeCharacter\@undefined\else
  \DeclareUnicodeCharacter{3000}{\bxjs@zsp@char}
  \bxjs@protected\def\bxjs@zsp@char{\pandocZWSpace}
\fi\fi
\if j\jsEngine
  \bxjs@fix@hyperref@unicode{false}
\else
  \bxjs@fix@hyperref@unicode{true}
\fi
\ifbxjs@jp@fix@strong\ifbxjs@jp@strong@cmd
  \let\orgtextbf\textbf
  \DeclareRobustCommand\pandocTextbf[1]{%
    \begingroup
      \let\textbf\orgtextbf
      \strong{#1}%
    \endgroup}%
  \g@addto@macro\bxjs@begin@document@hook{%
    \let\textbf\pandocTextbf}
\fi\fi
\jsAtEndOfClass{%
  \ifx\strongfontdeclare\@undefined\else
    \ifcase\bxjs@jp@strong
    \or \strongfontdeclare{\sffamily}%
    \or \strongfontdeclare{\sffamily\bfseries}%
    \fi
  \fi}
\ifbxjs@jp@fix@code
  \ifbxjs@bxghost@available
    \RequirePackage[verb]{bxghost}[2020/01/31]% v0.3.0
    \let\bxjs@eghostguarded\eghostguarded
  \else
  \chardef\bxjs@eghost@c=23
  \ifx j\jsEngine \xspcode\bxjs@eghost@c=3
  \else\ifx l\jsEngine \ltjsetparameter{alxspmode={\bxjs@eghost@c,3}}
  \else\ifx x\jsEngine %no-op
  \else \let\bxjs@eghost@c\@undefined
  \fi\fi\fi
  \ifx\bxjs@eghost@c\@undefined\else
    \font\bxjs@eghost@f=ec-lmr10 at 1.23456pt
    \def\bxjs@pan@eghost{\bgroup\bxjs@eghost@f\bxjs@eghost@c\egroup}
    \def\bxjs@eghostguarded#1{%
      \bxjs@pan@eghost\null#1\null\bxjs@pan@eghost}
  \fi
  \fi
  \ifx\bxjs@eghostguarded\@undefined\else
    \let\orgtexttt\texttt
    \DeclareRobustCommand\pandocTexttt[1]{%
      \ifmmode \nfss@text{\ttfamily #1}%
      \else
        \ifvmode \leavevmode \fi
        \bxjs@eghostguarded{\begingroup\ttfamily#1\endgroup}%
      \fi}
    \g@addto@macro\bxjs@begin@document@hook{%
      \let\texttt\pandocTexttt}
    \ifbxjs@bxghost@available\else
    \expandafter\def\expandafter\verb\expandafter{%
      \expandafter\bxjs@pan@eghost\verb}
    \g@addto@macro\verb@egroup{\bxjs@pan@eghost}
    \fi
  \fi
\fi
\if j\jsEngine
  \def\bxjs@check@frontier{%
    \expandafter\bxjs@check@frontier@a\@currnamestack\noindent...\@nil}
  \def\bxjs@check@frontier@a#1#2#3#4#5\@nil#6{%
    \ifx\noindent#4#6\fi}
  \@onlypreamble\bxjs@unforge@ifPDFTeX
  \def\bxjs@unforge@ifPDFTeX{\global\bxjs@csletcs{ifPDFTeX}{iffalse}}
  \@onlypreamble\bxjs@forge@ifPDFTeX
  \def\bxjs@forge@ifPDFTeX{\global\bxjs@csletcs{ifPDFTeX}{iftrue}}
  \def\bxjs@unload@forge@ifPDFTeX{%
    \bxjs@unforge@ifPDFTeX
    \global\let\bxjs@check@frontier\@gobble}
  \jsAtEndOfClass{\bxjs@forge@ifPDFTeX}
  \ifjsWitheTeX
    \AtBeginOfEveryFile{\bxjs@check@frontier\bxjs@unforge@ifPDFTeX}%
    \AtEndOfEveryFile{\bxjs@check@frontier\bxjs@forge@ifPDFTeX}%
    \g@addto@macro\bxjs@endpreamble@hook{\bxjs@unload@forge@ifPDFTeX}
  \else
    \g@addto@macro\bxjs@begin@document@hook{\bxjs@unload@forge@ifPDFTeX}
  \fi
\fi
\endinput
%%
%% End of file `bxjsja-pandoc.def'.
