From 4f8b3e4ed4705d02b41abf5a895611ea067f1802 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Mon, 5 Mar 2018 22:10:32 +0000
Subject: bxjscls (5mar18)

git-svn-id: svn://tug.org/texlive/trunk@46845 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/bxjscls/bxjsslide.cls | 189 ++++++++++++++--------
 1 file changed, 123 insertions(+), 66 deletions(-)

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

diff --git a/Master/texmf-dist/tex/latex/bxjscls/bxjsslide.cls b/Master/texmf-dist/tex/latex/bxjscls/bxjsslide.cls
index 211b0c71777..bd9d15db150 100644
--- a/Master/texmf-dist/tex/latex/bxjscls/bxjsslide.cls
+++ b/Master/texmf-dist/tex/latex/bxjscls/bxjsslide.cls
@@ -22,7 +22,7 @@
 %% in the same archive or directory.)
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{bxjsslide}
-  [2018/02/04 v1.7c BXJS document classes]
+  [2018/03/03 v1.8  BXJS document classes]
 %% このファイルは日本語文字を含みます.
 \def\bxjs@clsname{bxjsslide}
 \newif\ifjsc@needsp@tch
@@ -94,6 +94,45 @@
   \expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname}
 \def\bxjs@catopt#1#2{%
   #1\if\relax#1\relax\else\if\relax#2\relax\else,\fi\fi#2}
+\def\bxjs@ifplus#1{\@ifnextchar+{\@firstoftwo{#1}}}
+\let\c@bxjs@tempcnta\@tempcnta
+\def\bxjs@gset@tempcnta{\setcounter{bxjs@tempcnta}}
+\def\jsSetQHLength#1#2{%
+  \begingroup
+    \bxjs@parse@qh{#2}%
+    \ifx\bxjs@tmpb\relax
+      \setlength\@tempdima{#2}%
+      \xdef\bxjs@g@tmpa{\the\@tempdima}%
+    \else \global\let\bxjs@g@tmpa\bxjs@tmpb
+    \fi
+  \endgroup
+  #1=\bxjs@g@tmpa\relax}
+\if j\jsEngine \def\bxjs@parse@qh@all{zw,zh}
+\else \def\bxjs@parse@qh@all{trueQ,trueH,Q,H,zw,zh}
+\fi
+\def\bxjs@parse@qh#1{%
+  \let\bxjs@tmpb\relax
+  \@for\bxjs@tmpa:=\bxjs@parse@qh@all\do{%
+    \ifx\bxjs@tmpb\relax
+      \edef\bxjs@next{{\bxjs@tmpa}{#1}}%
+      \expandafter\bxjs@parse@qh@a\csname bxjs@unit@\bxjs@tmpa\expandafter
+          \endcsname\bxjs@next
+    \fi}}
+\def\bxjs@parse@qh@a#1#2#3{%
+  \def\bxjs@next##1#2\@nil##2\@nnil{\bxjs@parse@qh@b{##1}{##2}#1}%
+  \bxjs@next#3\@nil#2\@nil\@nnil}
+\def\bxjs@parse@qh@b#1#2#3{%
+  \ifx\@nnil#2\@nnil\else
+    \ifx#3\relax
+      \ClassError\bxjs@clsname
+       {You cannot use '\bxjs@tmpa' here}{\@ehc}%
+      \def\bxjs@tmpb{0pt}%
+    \else
+      \@tempdimb#3\relax \@tempdimb#1\@tempdimb
+      \edef\bxjs@tmpb{\the\@tempdimb}%
+    \fi
+  \fi}
+  \def\bxjs@unit@Q{0.25mm}\let\bxjs@unit@H\bxjs@unit@Q
 \def\jsAtEndOfClass{%
   \expandafter\g@addto@macro\csname\bxjs@clsname.cls-h@@k\endcsname}
 \@onlypreamble\bxjs@restore@jltrcc
@@ -150,30 +189,12 @@
 \def\bxjs@param@basefontsize{10pt}
 \def\jsUnusualPtSize{-20}
 \def\bxjs@setbasefontsize#1{%
-  \bxjs@setbasefontlength\@tempdima{#1}%
+  \jsSetQHLength\@tempdima{#1}%
   \edef\bxjs@param@basefontsize{\the\@tempdima}%
   \ifdim\@tempdima=10pt         \long\def\@ptsize{0}%
   \else\ifdim\@tempdima=10.95pt \long\def\@ptsize{1}%
   \else\ifdim\@tempdima=12pt    \long\def\@ptsize{2}%
   \else \long\edef\@ptsize{\jsUnusualPtSize}\fi\fi\fi}
-\def\bxjs@setbasefontlength#1#2{%
-  \bxjs@setbasefontlength@a#2true\@nnil
-  \ifx j\jsEngine \setlength#1{#2}%
-  \else
-    \bxjs@setbasefontlength@b#2\@nil Q\@nil\@nnil
-    \ifx\bxjs@tmpa\relax \setlength#1{#2}%
-    \else \@tempdimc0.25mm #1=\bxjs@tmpa\@tempdimc
-    \fi
-  \fi}
-\def\bxjs@setbasefontlength@b#1Q\@nil#2\@nnil{%
-  \ifx\@nnil#2\@nnil \let\bxjs@tmpa\relax
-  \else \def\bxjs@tmpa{#1}%
-  \fi}
-\def\bxjs@setbasefontlength@a#1true#2\@nnil{%
-  \ifx\@nnil#2\@nnil\else
-    \ClassWarningNoLine\bxjs@clsname
-    {You should not use 'true' lengths here}%
-  \fi}
 \newif\ifjsc@mag
 \newif\ifjsc@mag@xreal
 \DeclareOption{8pt}{\bxjs@setbasefontsize{8pt}}
@@ -442,23 +463,18 @@
 \def\bxjs@error@keyval#1#2{%
   \ClassError\bxjs@clsname
    {Invalid value '#2' for option #1}\@ehc}
-\newif\ifbxjs@scaleset
 \def\jsScale{0.924715}
-\define@key{bxjs}{base}{\bxjs@setbasefontsize{#1}}
-\@onlypreamble\bxjs@do@opt@jbase
-\let\bxjs@do@opt@jbase\relax
-\define@key{bxjs}{jbase}{\bxjs@setjbasefontsize{#1}}
-\def\bxjs@setjbasefontsize#1{%
-  \def\bxjs@do@opt@jbase{%
-    \bxjs@setbasefontlength\@tempdima{#1}%
-    \bxjs@invscale\@tempdima\jsScale
-    \bxjs@setbasefontsize{\@tempdima}}}
+\define@key{bxjs}{base}{%
+  \edef\bxjs@base@opt{#1}%
+  \bxjs@setbasefontsize{#1}}
+\define@key{bxjs}{fontsize}{\setkeys{bxjs}{base=#1}}
+\define@key{bxjs}{jbase}{\edef\bxjs@jbase@opt{#1}}
+\define@key{bxjs}{jafontsize}{\setkeys{bxjs}{jbase=#1}}
 \define@key{bxjs}{scale}{%
-  \bxjs@scalesettrue
-  \edef\jsScale{#1}}
-\DeclareOption{noscale}{%
-  \bxjs@scalesettrue
-  \def\jsScale{1}}
+  \edef\bxjs@scale@opt{#1}%
+  \let\jsScale\bxjs@scale@opt}
+\define@key{bxjs}{jsfontscale}{\setkeys{bxjs}{scale=#1}}
+\DeclareOption{noscale}{\setkeys{bxjs}{scale=1}}
 \let\bxjs@param@mag\relax
 \define@key{bxjs}{mag}{\edef\bxjs@param@mag{#1}}
 \define@key{bxjs}{paper}{\edef\bxjs@param@paper{#1}}
@@ -535,6 +551,10 @@
   \bxjs@set@keyval{layout}{#1}{}}
 \define@key{bxjs}{textwidth-limit}{%
   \edef\bxjs@textwidth@limit{#1}}
+\define@key{bxjs}{textwidth}{\edef\bxjs@textwidth@opt{#1}}
+\define@key{bxjs}{line_length}{\setkeys{bxjs}{textwidth=#1}}
+\define@key{bxjs}{number-of-lines}{\edef\bxjs@number@of@lines@opt{#1}}
+\define@key{bxjs}{number_of_lines}{\setkeys{bxjs}{number-of-lines=#1}}
 \define@key{bxjs}{paragraph-mark}{%
   \edef\bxjs@paragraph@mark{#1}}
 \newif\ifbxjs@whole@zw@lines \bxjs@whole@zw@linestrue
@@ -723,7 +743,23 @@
       The default value 'nomag*' is used instead.\MessageBreak \@ehc}
   \fi
 \fi
-\bxjs@do@opt@jbase
+\ifx\bxjs@jbase@opt\@undefined\else
+  \ifx\bxjs@base@opt\@undefined
+    \jsSetQHLength\@tempdima{\bxjs@jbase@opt}%
+    \bxjs@invscale\@tempdima\jsScale
+    \bxjs@setbasefontsize{\@tempdima}%
+  \else
+    \ifx\bxjs@scale@opt\@undefined\else
+      \ClassWarningNoLine\bxjs@clsname
+       {Redundant 'scale' option is ignored}%
+    \fi
+    \jsSetQHLength\@tempdima{\bxjs@jbase@opt}%
+    \@tempdimb=\bxjs@param@basefontsize\relax
+    \edef\jsScale{\strip@pt\@tempdimb}%
+    \bxjs@invscale\@tempdima\jsScale
+    \edef\jsScale{\strip@pt\@tempdima}%
+  \fi
+\fi
 \let\Cjascale\jsScale
 \if \if p\jsEngine T\else\if n\jsEngine T\else F\fi\fi T
   \@tempcnta="80 \loop \ifnum\@tempcnta<"100
@@ -759,8 +795,7 @@
   \divide\@tempdima16384\relax \@tempcnta\@tempdima\relax
   \edef\bxjs@param@mag{\the\@tempcnta}
 \else
-  \let\c@bxjs@cnta\@tempcnta
-  \setcounter{bxjs@cnta}{\bxjs@param@mag}
+  \bxjs@gset@tempcnta{\bxjs@param@mag}
   \ifnum\@tempcnta<\z@ \@tempcnta=\z@ \fi
   \edef\bxjs@param@mag{\the\@tempcnta}
   \advance\@tempcnta100000
@@ -982,22 +1017,36 @@
 \mag=\bxjs@param@mag
 \fi
 \setlength{\topskip}{10\p@?}
+\def\bxjs@unit@trueQ{0.25truemm}\let\bxjs@unit@trueH\bxjs@unit@trueQ
+\def\bxjs@unit@zw{\jsZw}\let\bxjs@unit@zh\bxjs@unit@zw
 \def\bxjs@read@a{\futurelet\bxjs@tmpa\bxjs@read@b}
 \def\bxjs@read@b{%
   \ifx\bxjs@tmpa\bgroup \expandafter\bxjs@read@c
   \else \expandafter\bxjs@read@d \fi}
-\def\bxjs@read@c#1#2#3\@nil{\def\bxjs@param@paper{papersize={#1,#2}}}
-\def\bxjs@read@d#1\@nil{}
-\expandafter\bxjs@read@a\bxjs@param@paper\@nil
+\def\bxjs@read@c#1#2#3\@nil{\edef\bxjs@param@paper{papersize={#1,#2}}}
+\def\bxjs@read@d#1\@nil{\bxjs@read@e#1,,\@nil}
+\def\bxjs@read@e#1,#2,#3\@nil{%
+  \ifx\@nil#3\@nil\else \edef\bxjs@param@paper{papersize={#1,#2}}\fi}
+\expandafter\bxjs@read@a\bxjs@param@paper\@empty\@empty\@nil
 \edef\bxjs@layout@paper{%
   \ifjsc@mag truedimen,\fi
   \if@landscape landscape,\fi
   \bxjs@param@paper}
-\def\bxjs@layout{%
+\def\bxjs@layout@base{%
   noheadfoot,%
+}
+\edef\bxjs@layout{\bxjs@layout@base
   hscale=0.9,hmarginratio=1:1,%
   vscale=0.944,vmarginratio=1:1,%
 }
+\ifx\bxjs@textwidth@opt\@undefined\else
+  \jsSetQHLength\@tempdima{\bxjs@textwidth@opt}
+  \edef\bxjs@layout{\bxjs@layout width=\the\@tempdima,}
+\fi
+\ifx\bxjs@number@of@lines@opt\@undefined\else
+  \bxjs@gset@tempcnta{\bxjs@number@of@lines@opt}
+  \edef\bxjs@layout{\bxjs@layout lines=\the\@tempcnta,}
+\fi
 \newdimen\fullwidth
 \def\bxjs@postproc@layout{%
   \ifx\bxjs@geometry@driver\relax\else
@@ -1006,6 +1055,7 @@
   \ifbxjs@whole@zw@lines
     \@tempdimb=\textwidth
     \if@twocolumn \@tempdima=2\Cwd \else \@tempdima=1\Cwd \fi
+    \advance\textwidth.005pt\relax
     \divide\textwidth\@tempdima \multiply\textwidth\@tempdima
     \advance\@tempdimb-\textwidth
     \advance\oddsidemargin 0.5\@tempdimb
@@ -1014,6 +1064,7 @@
   \fullwidth=\textwidth
   \@tempdimb=\textheight
   \advance\textheight-\topskip
+  \advance\textheight.005pt\relax
   \divide\textheight\baselineskip \multiply\textheight\baselineskip
   \advance\textheight\topskip
   \advance\@tempdimb-\textheight
@@ -1035,11 +1086,10 @@
 \edef\jsGeometryOptions{%
   \bxjs@layout@paper,\bxjs@layout}
 \ifx\bxjs@geometry\bxjs@geometry@class
-\@onlypreamble\bxjs@revert
-\let\bxjs@revert\@empty
-\edef\bxjs@tmpa{\the\ht\strutbox}
-\ht\strutbox=10\p@?
-\g@addto@macro\bxjs@revert{\ht\strutbox=\bxjs@tmpa\relax}
+\def\bxjs@geometry@guard@on{%
+  \edef\bxjs@gg@tmp{\the\ht\strutbox}\ht\strutbox=10\jsc@mpt}
+\def\bxjs@geometry@guard@off{%
+  \ht\strutbox=\bxjs@gg@tmp\relax}
 \ifbxjs@papersize
   \ifx\bxjs@driver@given\bxjs@driver@@dvipdfmx
     \PassOptionsToPackage{dvipdfm}{geometry}
@@ -1050,11 +1100,13 @@
 \else
   \PassOptionsToPackage{driver=none}{geometry}
 \fi
-\edef\bxjs@nxt{%
-  \noexpand\RequirePackage[\bxjs@layout@paper,\bxjs@layout]{geometry}}
 \AtBeginDocument{\bxjs@pre@geometry@hook}
 \AtBeginDocument{\ImposeOldLuaTeXBehavior}
-\bxjs@nxt \bxjs@revert
+\bxjs@geometry@guard@on
+\edef\bxjs@next{%
+  \noexpand\RequirePackage[\bxjs@layout@paper,\bxjs@layout]{geometry}%
+}\bxjs@next
+\bxjs@geometry@guard@off
 \AtBeginDocument{\RevokeOldLuaTeXBehavior}
 \let\bxjs@geometry@driver\Gm@driver
 \bxjs@postproc@layout
@@ -1077,14 +1129,23 @@
       \fi
     \fi
   }{}}
-\def\setpagelayout{\@ifstar
-  {\bxjs@reset@layout}{\bxjs@modify@layout}}
-\def\bxjs@modify@layout#1{%
-  \edef\bxjs@nxt{\noexpand\geometry{#1,truedimen}}%
-  \bxjs@nxt\bxjs@postproc@layout}
-\def\bxjs@reset@layout#1{%
-  \edef\bxjs@nxt{\noexpand\geometry{reset,\bxjs@layout@paper,#1,truedimen}}%
-  \bxjs@nxt\bxjs@postproc@layout}
+\def\setpagelayout{%
+  \bxjs@ifplus{\bxjs@setpagelayout@a\tw@}{%else
+    \@ifstar{\bxjs@setpagelayout@a\@ne}{\bxjs@setpagelayout@a\z@}}}
+\def\bxjs@setpagelayout@a#1#2{%
+  \ifcase#1% modify
+    \def\bxjs@next{\ifjsc@mag truedimen,\fi #2}%
+  \or% reset(*)
+    \def\bxjs@next{reset,\bxjs@layout@paper,#2}%
+  \or% semireset(+)
+    \def\bxjs@next{reset,\bxjs@layout@paper,\bxjs@layout@base,#2}%
+  \fi
+  \bxjs@geometry@guard@on
+  \edef\bxjs@next{%
+    \noexpand\geometry{\bxjs@next}%
+  }\bxjs@next
+  \bxjs@geometry@guard@off
+  \bxjs@postproc@layout}
 \else\ifx\bxjs@geometry\bxjs@geometry@user
 \AtBeginDocument{\bxjs@check@page@layout}
 \@onlypreamble\bxjs@check@page@layout
@@ -1098,8 +1159,9 @@
   \setlength{\textwidth}{6.5in}%
   \setlength{\textheight}{8in}}
 \let\bxjs@geometry@driver\relax
-\def\setpagelayout{\@ifstar
-  {\bxjs@pagelayout@a}{\bxjs@pagelayout@a}}
+\def\setpagelayout{%
+  \bxjs@ifplus{\bxjs@pagelayout@a}{%else
+    \@ifstar{\bxjs@pagelayout@a}{\bxjs@pagelayout@a}}}
 \def\bxjs@pagelayout@a#1{%
   \ClassError\bxjs@clsname
    {Command '\string\setpagelayout' is not supported,\MessageBreak
@@ -1829,18 +1891,13 @@
   \bxjs@oldfontcmd@list
   \ifx\@tempa\@empty\else
     \ClassWarningNoLine\bxjs@clsname
-     {Some old font commands were used in text\MessageBreak
-      (see the log file for detail)}%
-    \ClassInfo\bxjs@clsname
      {Some old font commands were used in text:\MessageBreak
       \space\@tempa\MessageBreak
       You should note, that since 1994 LaTeX2e provides a\MessageBreak
       new font selection scheme called NFSS2 with several\MessageBreak
       new, combinable font commands. The
       class provides\MessageBreak
-      the old font commands
-      only for compatibility%
-      \@gobble}%
+      the old font commands only for compatibility}
   \fi}
 \def\bxjs@warnoldfontcmd@kick@final{%
   \g@addto@macro\clearpage{\bxjs@warnoldfontcmd@final}}
-- 
cgit v1.2.3

