summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bxjscls/bxjsja-pandoc.def
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-09-04 21:13:16 +0000
committerKarl Berry <karl@freefriends.org>2018-09-04 21:13:16 +0000
commit93e6562acceca9eddeeca7348813746c09ac2d94 (patch)
treec1f51970a5b501909399d02a9cb8a5c47ef222b4 /Master/texmf-dist/tex/latex/bxjscls/bxjsja-pandoc.def
parentb3571583a30d61c5d29cee022d11b5f3a801eef2 (diff)
bxjscls (4sep18)
git-svn-id: svn://tug.org/texlive/trunk@48576 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/bxjscls/bxjsja-pandoc.def')
-rw-r--r--Master/texmf-dist/tex/latex/bxjscls/bxjsja-pandoc.def108
1 files changed, 77 insertions, 31 deletions
diff --git a/Master/texmf-dist/tex/latex/bxjscls/bxjsja-pandoc.def b/Master/texmf-dist/tex/latex/bxjscls/bxjsja-pandoc.def
index aeea92baf96..2de6829c0c3 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}
- [2018/08/20 v1.9b BXJS document classes]
+ [2018/09/04 v1.9c BXJS document classes]
\input{bxjsja-standard.def}
\RequirePackage{bxjspandoc}
\@onlypreamble\bxjs@endpreamble@hook
@@ -36,61 +36,107 @@
\@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
-\newif\ifbxjs@dlp
+\@onlypreamble\bxjs@org@reset@ptions
+\let\bxjs@org@reset@ptions\relax
\def\@if@ptions#1#2#3{%
- \bxjs@dlpfalse
+ \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
- \bxjs@dlptrue \fi
+ \let\bxjs@next\@firstoftwo \fi
\fi
- \ifbxjs@dlp \expandafter\bxjs@do@dupload@proc
- \else \expandafter\bxjs@org@if@ptions
- \fi {#1}{#2}{#3}}
+ \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{%
- \csname bxjs@dlp/#2.#1\endcsname{#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}
-\newif\ifbxjs@lang@exists
+\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
- {Loading of polyglossia is blocked}%
- \bxjs@lang@existstrue}
-\ifx\setmainlanguage\@undefined
-\newcommand*\setmainlanguage[2][]{}
-\newcommand*\setotherlanguage[2][]{%
- \ifcat_#2_\else
- \expandafter\let\csname #2\endcsname\@empty
- \expandafter\let\csname end#2\endcsname\@empty
- \expandafter\let\csname text#2\endcsname\@firstofone
- \fi}
-\newcommand*\setotherlanguages[2][]{%
- \@for\bxjs@tmpa:={#2}\do{%
- \setotherlangauge{\bxjs@tmpa}}}
-\fi
+ {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{%
- \ifbxjs@lang@exists\else
+ \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
- {Loading of babel is blocked}%
- \bxjs@lang@existstrue}
-\let\foreignlanguage\@secondoftwo
-\let\otherlanguage\@gobble
-\let\endotherlanguage\@empty
+ {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{%
- \ifbxjs@lang@exists\else
- \csundef{ver@babel.sty}%
+ \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]{babel}[]%
+ }\bxjs@next
+ \RequirePackage[main=japanese]{pxbabel}[]}
\fi
\bxjs@set@dupload@proc{geometry.sty}{%
\setpagelayout*{#1}}