From 3ebff037dbea5e7f832f1b69e71662f206b791e3 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 17 Aug 2016 21:34:51 +0000
Subject: bxjscls (17aug16)

git-svn-id: svn://tug.org/texlive/trunk@41878 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/bxjscls/bxjsbook.cls | 130 ++++++++++++++++++++---
 1 file changed, 117 insertions(+), 13 deletions(-)

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

diff --git a/Master/texmf-dist/tex/latex/bxjscls/bxjsbook.cls b/Master/texmf-dist/tex/latex/bxjscls/bxjsbook.cls
index 43c0028cf4c..56d451894b3 100644
--- a/Master/texmf-dist/tex/latex/bxjscls/bxjsbook.cls
+++ b/Master/texmf-dist/tex/latex/bxjscls/bxjsbook.cls
@@ -37,14 +37,20 @@
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{bxjsbook}
-  [2016/08/01 v1.2 BXJS document classes]
-%% このファイルは日本語文字を含みます
+  [2016/08/16 v1.2a BXJS document classes]
+%% このファイルは日本語文字を含みます.
 \RequirePackage{calc}
 \RequirePackage{keyval}
 \IfFileExists{bxjscompat.sty}{%
   \let\jsAtEndOfClass\@gobble
   \RequirePackage{bxjscompat}%
 }{}
+\let\jsArticle=a
+\let\jsBook=b
+\let\jsReport=r
+\let\jsSlide=s
+\let\jsDocClass\jsBook
+\def\bxjs@clsname{bxjsbook}
 \let\jsEngine=n
 \def\bxjs@test@engine#1#2{%
   \edef\bxjs@tmpa{\string#1}%
@@ -52,6 +58,7 @@
   \ifx\bxjs@tmpa\bxjs@tmpb #2\fi}
 \bxjs@test@engine\kanjiskip{\let\jsEngine=j}
 \bxjs@test@engine\jintercharskip{\let\jsEngine=J}
+\bxjs@test@engine\Omegaversion{\let\jsEngine=O}
 \bxjs@test@engine\XeTeXversion{\let\jsEngine=x}
 \bxjs@test@engine\pdftexversion{\let\jsEngine=p}
 \bxjs@test@engine\luatexversion{\let\jsEngine=l}
@@ -60,8 +67,20 @@
   \jsWithupTeXtrue
 \fi\fi
 \let\if@jsc@uplatex\ifjsWithupTeX
+\newif\ifjsWithpTeXng
+\bxjs@test@engine\ngbanner{\jsWithpTeXngtrue}
 \newif\ifjsWitheTeX
 \bxjs@test@engine\eTeXversion{\jsWitheTeXtrue}
+\let\bxjs@tmpa\relax
+\ifx J\jsEngine \def\bxjs@tmpa{NTT-jTeX}\fi
+\ifx O\jsEngine \def\bxjs@tmpa{Omega}\fi
+\ifx\bxjs@tmpa\relax \expandafter\@gobble
+\else
+  \ClassError\@currname
+   {The engine in use (\bxjs@tmpa) is not supported}
+   {It's a fatal error. I'll quit right now.}
+  \expandafter\@firstofone
+\fi{\endinput\@@end}
 \ifjsWitheTeX \let\bxjs@protected\protected
 \else \let\bxjs@protected\@empty
 \fi
@@ -82,12 +101,6 @@
   #1\expandafter\@firstoftwo
   \else\expandafter\@secondoftwo
   \fi}
-\let\jsArticle=a
-\let\jsBook=b
-\let\jsReport=r
-\let\jsSlide=s
-\let\jsDocClass\jsBook
-\def\bxjs@clsname{bxjsbook}
 \def\jsAtEndOfClass{%
   \expandafter\g@addto@macro\csname\bxjs@clsname.cls-h@@k\endcsname}
 \@onlypreamble\bxjs@restore@jltrcc
@@ -305,6 +318,13 @@
 \DeclareOption{lualatex}{%
   \def\bxjs@engine@opt{lualatex}%
   \let\bxjs@engine@given=l}
+\DeclareOption{platex-ng}{%
+  \def\bxjs@engine@opt{platex-ng}%
+  \let\bxjs@engine@given=g}
+\DeclareOption{platex-ng*}{%
+  \def\bxjs@engine@opt{platex-ng*}%
+  \let\bxjs@platexng@nodrv=t%
+  \let\bxjs@engine@given=g}
 \let\bxjs@driver@@dvimode=0
 \let\bxjs@driver@@dvipdfmx=1
 \let\bxjs@driver@@pdfmode=2
@@ -376,9 +396,19 @@
   \setkeys{#1}{#2}%
   \let\KV@errx\bxjs@KV@errx}
 \def\bxjs@safe@setkeys@a#1{}
+\def\bxjs@set@keyval#1#2#3{%
+  \expandafter\let\expandafter\bxjs@next\csname bxjs@kv@#1@#2\endcsname
+  \ifx\bxjs@next\relax
+    \bxjs@error@keyval{#1}{#2}%
+    #3%
+  \else \bxjs@next
+  \fi}
+\@onlypreamble\bxjs@error@keyval
+\def\bxjs@error@keyval#1#2{%
+  \ClassError\bxjs@clsname
+   {Invalid value '#2' for option #1}\@ehc}
 \newif\ifbxjs@scaleset
 \def\jsScale{0.924715}
-\def\Cjascale{\jsScale}
 \define@key{bxjs}{base}{\bxjs@setbasefontsize{#1}}
 \@onlypreamble\bxjs@do@opt@jbase
 \let\bxjs@do@opt@jbase\relax
@@ -418,6 +448,9 @@
 \ifx l\jsEngine \ifnum\luatexversion>86
   \let\bxjs@magstyle@default\bxjs@magstyle@xreal
 \fi\fi
+\ifjsWithpTeXng
+  \let\bxjs@magstyle@default\bxjs@magstyle@xreal
+\fi
 \let\bxjs@magstyle\bxjs@magstyle@default
 \define@key{bxjs}{magstyle}{%
   \expandafter\let\expandafter\bxjs@magstyle\csname
@@ -438,6 +471,11 @@
     {Invalid geometry value `#1'}\@ehc
     \let\bxjs@geometry\bxjs@geometry@class
   \fi}
+\newif\ifbxjs@fancyhdr \bxjs@fancyhdrtrue
+\let\bxjs@kv@fancyhdr@true\bxjs@fancyhdrtrue
+\let\bxjs@kv@fancyhdr@false\bxjs@fancyhdrfalse
+\define@key{bxjs}{fancyhdr}{%
+  \bxjs@set@keyval{fancyhdr}{#1}{}}
 \newif\ifbxjs@dvi@opt
 \let\bxjs@dvidriver@@dvipdfmx=\bxjs@driver@@dvipdfmx
 \let\bxjs@dvidriver@@dvips=\bxjs@driver@@dvimode
@@ -454,6 +492,29 @@
     \let\bxjs@driver@given\@undefined
     \bxjs@dvi@opttrue
   \fi}
+\newif\ifbxjs@layout@buggyhmargin \bxjs@layout@buggyhmargintrue
+\@namedef{bxjs@kv@layout@v1}{%
+  \bxjs@layout@buggyhmargintrue}
+\@namedef{bxjs@kv@layout@v2}{%
+  \bxjs@layout@buggyhmarginfalse}
+\define@key{bxjs}{layout}{%
+  \bxjs@set@keyval{layout}{#1}{}}
+\define@key{bxjs}{textwidth-limit}{%
+  \edef\bxjs@textwidth@limit{#1}}
+\define@key{bxjs}{paragraph-mark}{%
+  \edef\bxjs@paragraph@mark{#1}}
+\newif\ifbxjs@whole@zw@lines \bxjs@whole@zw@linestrue
+\let\bxjs@kv@wholezwlines@true\bxjs@whole@zw@linestrue
+\let\bxjs@kv@wholezwlines@false\bxjs@whole@zw@linesfalse
+\define@key{bxjs}{whole-zw-lines}{\bxjs@set@keyval{wholezwlines}{#1}{}}
+\newif\ifbxjs@dummy@microtype \bxjs@dummy@microtypetrue
+\let\bxjs@kv@dummymicrotype@true\bxjs@dummy@microtypetrue
+\let\bxjs@kv@dummymicrotype@false\bxjs@dummy@microtypefalse
+\define@key{bxjs}{dummy-microtype}{\bxjs@set@keyval{dummymicrotype}{#1}{}}
+\newif\ifbxjs@hyperref@enc \bxjs@hyperref@enctrue
+\let\bxjs@kv@hyperrefenc@true\bxjs@hyperref@enctrue
+\let\bxjs@kv@hyperrefenc@false\bxjs@hyperref@encfalse
+\define@key{bxjs}{hyperref-enc}{\bxjs@set@keyval{hyperrefenc}{#1}{}}
 \let\bxjs@ltx@removeelement\@removeelement
 \def\@removeelement#1#2#3{%
   \def\reserved@a{#2}%
@@ -485,10 +546,15 @@
   {papersize}\@classoptionslist\@classoptionslist
 \@expandtwoargs\@removeelement
   {10pt}\@classoptionslist\@classoptionslist
+\@expandtwoargs\@removeelement
+  {noscale}\@classoptionslist\@classoptionslist
 \ifx\bxjs@jadriver\relax\else
   \let\bxjs@jadriver@given\bxjs@jadriver
 \fi
 \let\bxjs@tmpb\jsEngine
+\ifx j\bxjs@tmpb\ifjsWithpTeXng
+  \let\bxjs@tmpb=g
+\fi\fi
 \ifx j\bxjs@tmpb\ifjsWithupTeX
   \let\bxjs@tmpb=u
 \fi\fi
@@ -509,6 +575,9 @@
     {Option `\bxjs@engine@opt' used on wrong engine}\@ehc
   \fi
 \fi
+\ifjsWithpTeXng
+  \g@addto@macro\@classoptionslist{,uplatex}
+\fi
 \@tempswatrue
 \ifx \bxjs@driver@given\@undefined\else
   \ifjsInPdfMode
@@ -525,6 +594,9 @@
     \else\ifx\bxjs@driver@given\bxjs@driver@@xetex
       \@tempswafalse
     \fi\fi
+    \ifjsWithpTeXng\ifx\bxjs@driver@given\bxjs@driver@@dvipdfmx\else
+      \@tempswafalse
+    \fi\fi
   \fi\fi
 \fi
 \if@tempswa\else
@@ -533,8 +605,9 @@
 \fi
 \ifjsInPdfMode \@tempswafalse
 \else\ifx x\jsEngine \@tempswafalse
+\else\ifjsWithpTeXng \@tempswafalse
 \else \@tempswatrue
-\fi\fi
+\fi\fi\fi
 \if@tempswa
   \ifx\bxjs@driver@opt\@undefined \ifx\bxjs@jadriver@given\@undefined\else
     \ClassWarningNoLine\bxjs@clsname
@@ -549,6 +622,13 @@
     }\bxjs@nxt
   \fi
 \fi
+\ifjsWithpTeXng
+  \ifx\bxjs@driver@given\bxjs@driver@@dvipdfmx
+    \let\bxjs@platexng@nodrv\@undefined
+  \else\ifx t\bxjs@platexng@nodrv\else
+    \g@addto@macro\@classoptionslist{,dvipdfmx}
+  \fi\fi
+\fi
 \def\bxjs@@minimal{minimal}
 \ifx\bxjs@jadriver\relax
   \ifx j\jsEngine
@@ -574,6 +654,7 @@
   \fi
 \fi
 \bxjs@do@opt@jbase
+\let\Cjascale\jsScale
 \if@slide
   \def\maybeblue{\@ifundefined{ver@color.sty}{}{\color{blue}}}
 \fi
@@ -594,7 +675,7 @@
 \fi
 \g@addto@macro\@classoptionslist{,nosetpagesize}
 \ifbxjs@oldfontcommands
-  \jsAtEndOfClass{\allowoldfontcommands}
+  \AtEndOfClass{\allowoldfontcommands}
 \fi
 \ifdim\bxjs@param@basefontsize<10pt \def\n@baseline{15}%
 \else \def\n@baseline{16}\fi
@@ -825,13 +906,26 @@
   \ifjsc@mag truedimen,\fi
   \if@landscape landscape,\fi
   \bxjs@param@paper}
+\ifbxjs@layout@buggyhmargin     %---
 \def\bxjs@layout{%
   headheight=\topskip,headsep=6\jsc@mmm,nofoot,includeheadfoot,%
   hmargin=36\jsc@mmm,hmarginratio=1:1,%
   vscale=0.83,vmarginratio=1:1,%
 }
+\else                           %---
+\def\bxjs@layout{%
+  headheight=\topskip,headsep=6\jsc@mmm,nofoot,includeheadfoot,%
+  hmargin=18\jsc@mmm,%
+  vscale=0.83,vmarginratio=1:1,%
+}
+\fi                             %---
 \newdimen\fullwidth
 \newcommand\jsTextWidthLimit{40}
+\ifx\bxjs@textwidth@limit\@undefined\else
+  \let\c@bxjs@cnta\@tempcnta
+  \setcounter{bxjs@cnta}{\bxjs@textwidth@limit}
+  \long\edef\jsTextWidthLimit{\the\@tempcnta}
+\fi
 \def\bxjs@postproc@layout{%
   \ifx\bxjs@geometry@driver\relax\else
     \let\Gm@driver\bxjs@geometry@driver
@@ -891,7 +985,8 @@
 \bxjs@postproc@layout
 \@onlypreamble\bxjs@pre@geometry@hook
 \def\bxjs@pre@geometry@hook{%
-  \@ifpackageloaded{geometry}{\@ifpackagelater{geometry}{2010/02/12}{}{%
+  \@ifpackageloaded{geometry}{%
+    \@ifpackagelater{geometry}{2010/02/12}{}{%else
       \PackageWarningNoLine\bxjs@clsname
        {The 'geometry' package installed\MessageBreak
         is too old (< v5.0)}%
@@ -900,7 +995,13 @@
         \ifx\pdfhorigin\@undefined \newdimen\pdfhorigin \fi
         \ifx\pdfvorigin\@undefined \newdimen\pdfvorigin \fi
       \fi\fi
-  }}{}}
+    }%
+    \ifjsWithpTeXng
+      \ifx\Gm@driver\@empty
+        \def\Gm@driver{pdftex}%
+      \fi
+    \fi
+  }{}}
 \def\setpagelayout{\@ifstar
   {\bxjs@reset@layout}{\bxjs@modify@layout}}
 \def\bxjs@modify@layout#1{%
@@ -1418,6 +1519,9 @@
     {\normalfont\normalsize\headfont}}
 \fi
 \newcommand\jsParagraphMark{\jsJaChar{■}}
+\ifx\bxjs@paragraph@mark\@undefined\else
+  \long\edef\jsParagraphMark{\noexpand\jsJaChar{\bxjs@paragraph@mark}}
+\fi
 \let\jsJaChar\@empty
 \if@twocolumn
   \newcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
-- 
cgit v1.2.3

