%%
%% 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}
  [2019/01/13 v1.9e BXJS document classes]
\input{bxjsja-standard.def}
\RequirePackage{bxjspandoc}
\@onlypreamble\bxjs@endpreamble@hook
\let\bxjs@endpreamble@hook\@empty
\ifjsWitheTeX
  \RequirePackage{etoolbox}[2010/08/21]% v2.0
  \AtEndPreamble{\bxjs@endpreamble@hook}
\fi
\@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{%
  \expandafter\let\csname bxjs@dlp/#1\endcsname\@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@lang@pkg@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 required}%
  \def\bxjs@lang@pkg@options{#1}%
  \newcommand*\setmainlanguage[2][]{%
    \ifblank{##2}{%
      \ClassWarning\bxjs@clsname
       {Main language is invalid, thus the fallback\MessageBreak
        definitions will be employed}%
      \bxjs@pandoc@lang@ja
    }{%else
      \ClassWarning\bxjs@clsname
       {Main language is valid (##2),\MessageBreak
        thus polyglossia will be loaded}%
      \csundef{ver@polyglossia.sty}%
      \edef\bxjs@next{%
        \noexpand\RequirePackage[\bxjs@lang@pkg@options]{polyglossia}[]%
      }\bxjs@next
      \setmainlanguage[##1]{##2}%
    }}}
\g@addto@macro\bxjs@endpreamble@hook{%
  \ifx\bxjs@lang@pkg@options\relax
    \csundef{ver@polyglossia.sty}%
  \fi}
\@onlypreamble\bxjs@pandoc@lang@ja
\def\bxjs@pandoc@lang@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@lang@pkg@options\relax}%
\else
\pandocSkipLoadPackage{babel}
\bxjs@set@dupload@proc{babel.sty}{%
  \bxjs@unset@dupload@proc{babel.sty}%
  \ClassWarning\bxjs@clsname
   {Package babel is required}%
  \@tempswafalse \let\bxjs@lang@pkg@options\@empty
  \def\bxjs@tmpb{main=}%
  \@for\bxjs@tmpa:=#1\do{%
    \ifx\bxjs@tmpa\bxjs@tmpb \@tempswatrue
    \else \edef\bxjs@lang@pkg@options{\bxjs@lang@pkg@options,\bxjs@tmpa}%
    \fi}%
  \if@tempswa
    \ClassWarning\bxjs@clsname
     {Main language is invalid, so fallback\MessageBreak
      definitions will be employed}%
    \bxjs@pandoc@lang@ja
  \else
    \ClassWarning\bxjs@clsname
     {Main language is valid,\MessageBreak
      thus babel will be loaded}%
    \expandafter\let\csname ver@babel.sty\endcsname\@undefined
    \RequirePackage[#1]{babel}[]%
  \fi}
\g@addto@macro\bxjs@endpreamble@hook{%
  \ifx\bxjs@lang@pkg@options\relax
    \expandafter\let\csname ver@babel.sty\endcsname\@undefined
  \fi}
\@onlypreamble\bxjs@pandoc@lang@ja
\def\bxjs@pandoc@lang@ja{%
  \expandafter\let\csname ver@babel.sty\endcsname\@undefined
  \edef\bxjs@next{%
    \noexpand\RequirePackage[\bxjs@lang@pkg@options,english]{babel}[]%
  }\bxjs@next
  \if j\jsEngine
    \RequirePackage[main=japanese]{pxbabel}[]%
  \else
    \RequirePackage{bxorigcapt}[]%
  \fi}
\fi
\bxjs@set@dupload@proc{geometry.sty}{%
  \setpagelayout*{#1}}
\if l\jsEngine
  \pandocSkipLoadPackage{xeCJK}
  \providecommand*{\setCJKmainfont}{\setmainjfont}
\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}
\ifnum0\if x\jsEngine1\fi\if l\jsEngine1\fi>\z@
  \catcode"3000=\active
  \begingroup \catcode`\!=7
  \protected\gdef!!!!3000{\zwspace}
  \endgroup
\else\ifx\DeclareUnicodeCharacter\@undefined\else
  \DeclareUnicodeCharacter{3000}{\bxjs@zsp@char}
  \bxjs@protected\def\bxjs@zsp@char{\zwspace}
\fi\fi
\if j\jsEngine
  \bxjs@fix@hyperref@unicode{false}
\else
  \bxjs@fix@hyperref@unicode{true}
\fi
\endinput
%%
%% End of file `bxjsja-pandoc.def'.
