From 31fa4a2461c0ff5efe56ef940af61052b14874ef Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sat, 11 Mar 2017 23:08:46 +0000
Subject: bxjscls (11mar17)

git-svn-id: svn://tug.org/texlive/trunk@43467 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/bxjscls/bxjsreport.cls | 160 +++++++++++++++------
 1 file changed, 119 insertions(+), 41 deletions(-)

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

diff --git a/Master/texmf-dist/tex/latex/bxjscls/bxjsreport.cls b/Master/texmf-dist/tex/latex/bxjscls/bxjsreport.cls
index aa90968f3bf..53db518aef2 100644
--- a/Master/texmf-dist/tex/latex/bxjscls/bxjsreport.cls
+++ b/Master/texmf-dist/tex/latex/bxjscls/bxjsreport.cls
@@ -22,7 +22,7 @@
 %% in the same archive or directory.)
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{bxjsreport}
-  [2017/02/03 v1.4 BXJS document classes]
+  [2017/03/11 v1.5 BXJS document classes]
 %% このファイルは日本語文字を含みます.
 \RequirePackage{calc}
 \RequirePackage{keyval}
@@ -114,6 +114,7 @@
 \newif\if@restonecol
 \newif\if@titlepage
 \newif\if@openright
+\newif\if@openleft
 \newif\if@mainmatter \@mainmattertrue
 \newif\if@enablejfam \@enablejfamfalse
 \def\bxjs@setpaper#1{\def\bxjs@param@paper{#1}}
@@ -198,8 +199,9 @@
 \DeclareOption{twocolumn}{\@twocolumntrue}
 \DeclareOption{titlepage}{\@titlepagetrue}
 \DeclareOption{notitlepage}{\@titlepagefalse}
-\DeclareOption{openright}{\@openrighttrue}
-\DeclareOption{openany}{\@openrightfalse}
+\DeclareOption{openright}{\@openrighttrue\@openleftfalse}
+\DeclareOption{openleft}{\@openlefttrue\@openrightfalse}
+\DeclareOption{openany}{\@openrightfalse\@openleftfalse}
 \def\eqnarray{%
    \stepcounter{equation}%
    \def\@currentlabel{\p@equation\theequation}%
@@ -485,11 +487,15 @@
     \let\bxjs@driver@given\@undefined
     \bxjs@dvi@opttrue
   \fi}
-\newif\ifbxjs@layout@buggyhmargin \bxjs@layout@buggyhmarginfalse
+\newif\ifbxjs@layout@buggyhmargin
+\newif\ifbxjs@force@chapterabstract
+\bxjs@force@chapterabstracttrue
 \@namedef{bxjs@kv@layout@v1}{%
-  \bxjs@layout@buggyhmargintrue}
+\bxjs@force@chapterabstracttrue
+}
 \@namedef{bxjs@kv@layout@v2}{%
-  \bxjs@layout@buggyhmarginfalse}
+\bxjs@force@chapterabstractfalse
+}
 \define@key{bxjs}{layout}{%
   \bxjs@set@keyval{layout}{#1}{}}
 \define@key{bxjs}{textwidth-limit}{%
@@ -500,10 +506,6 @@
 \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
@@ -914,12 +916,14 @@
   \ifx\bxjs@geometry@driver\relax\else
     \let\Gm@driver\bxjs@geometry@driver
   \fi
-  \@tempdimb=\textwidth
-  \if@twocolumn \@tempdima=2\Cwd \else \@tempdima=1\Cwd \fi
-  \divide\textwidth\@tempdima \multiply\textwidth\@tempdima
-  \advance\@tempdimb-\textwidth
-  \advance\oddsidemargin 0.5\@tempdimb
-  \advance\evensidemargin 0.5\@tempdimb
+  \ifbxjs@whole@zw@lines
+    \@tempdimb=\textwidth
+    \if@twocolumn \@tempdima=2\Cwd \else \@tempdima=1\Cwd \fi
+    \divide\textwidth\@tempdima \multiply\textwidth\@tempdima
+    \advance\@tempdimb-\textwidth
+    \advance\oddsidemargin 0.5\@tempdimb
+    \advance\evensidemargin 0.5\@tempdimb
+  \fi
   \fullwidth=\textwidth
   \@tempdimb=\textheight
   \advance\textheight-\topskip
@@ -934,7 +938,9 @@
   \setlength\marginparpush{\baselineskip}
   \setlength\marginparwidth{\paperwidth-\oddsidemargin-1truein%
       -\textwidth-10\jsc@mmm-\marginparsep}
-  \divide\marginparwidth\Cwd \multiply\marginparwidth\Cwd
+  \ifbxjs@whole@zw@lines
+    \divide\marginparwidth\Cwd \multiply\marginparwidth\Cwd
+  \fi
   \maxdepth=.5\topskip
   \stockwidth=\paperwidth
   \stockheight=\paperheight
@@ -1033,6 +1039,23 @@
 \setlength\@dblfptop{0\p@? \@plus 1fil}
 \setlength\@dblfpsep{8\p@? \@plus 2fil}
 \setlength\@dblfpbot{0\p@? \@plus 1fil}
+\def\pltx@cleartooddpage{\clearpage\if@twoside
+  \ifodd\c@page\else
+    \hbox{}\thispagestyle{empty}\newpage
+    \if@twocolumn\hbox{}\newpage\fi
+  \fi\fi}
+\def\pltx@cleartoevenpage{\clearpage\if@twoside
+  \ifodd\c@page
+    \hbox{}\thispagestyle{empty}\newpage
+    \if@twocolumn\hbox{}\newpage\fi
+  \fi\fi}
+\let\pltx@cleartorightpage\pltx@cleartooddpage
+\let\pltx@cleartoleftpage\pltx@cleartoevenpage
+\if@openleft
+  \let\cleardoublepage\pltx@cleartoleftpage
+\else\if@openright
+  \let\cleardoublepage\pltx@cleartorightpage
+\fi\fi
 \def\ps@plainfoot{%
   \let\@mkboth\@gobbletwo
   \let\@oddhead\@empty
@@ -1343,31 +1366,30 @@
    \theparagraph.\@arabic\c@subparagraph}
 \newcommand{\@chapapp}{\prechaptername}
 \newcommand{\@chappos}{\postchaptername}
-\newcommand\frontmatter{%
-  \if@openright
-    \cleardoublepage
-  \else
-    \clearpage
-  \fi
+  \pltx@cleartooddpage
   \@mainmatterfalse
   \pagenumbering{roman}}
 \newcommand\mainmatter{%
-    \cleardoublepage
+  \pltx@cleartooddpage
   \@mainmattertrue
   \pagenumbering{arabic}}
 \newcommand\backmatter{%
-  \if@openright
+  \if@openleft
+    \cleardoublepage
+  \else\if@openright
     \cleardoublepage
   \else
     \clearpage
-  \fi
+  \fi\fi
   \@mainmatterfalse}
 \newcommand\part{%
-  \if@openright
+  \if@openleft
+    \cleardoublepage
+  \else\if@openright
     \cleardoublepage
   \else
     \clearpage
-  \fi
+  \fi\fi
   \thispagestyle{empty}% 欧文用標準スタイルでは plain
   \if@twocolumn
     \onecolumn
@@ -1403,17 +1425,18 @@
   \@endpart}
 \def\@endpart{\vfil\newpage
   \if@twoside
-   \if@openright %% added (2016/12/13)
-    \null
-    \thispagestyle{empty}%
-    \newpage
-   \fi %% added (2016/12/13)
+   \if@openleft %% added (2017/02/24)
+    \null\thispagestyle{empty}\newpage
+   \else\if@openright %% added (2016/12/13)
+    \null\thispagestyle{empty}\newpage
+   \fi\fi %% added (2016/12/13, 2017/02/24)
   \fi
   \if@restonecol
     \twocolumn
   \fi}
 \newcommand{\chapter}{%
-  \if@openright\cleardoublepage\else\clearpage\fi
+  \if@openleft\cleardoublepage\else
+  \if@openright\cleardoublepage\else\clearpage\fi\fi
   \plainifnotempty % 元: \thispagestyle{plain}
   \global\@topnum\z@
   \if@english \@afterindentfalse \else \@afterindenttrue \fi
@@ -1503,9 +1526,11 @@
     {\normalfont\normalsize\headfont}}
 \fi
 \newcommand\jsParagraphMark{\jsJaChar{■}}
-\ifx\bxjs@paragraph@mark\@undefined\else
+\ifx\bxjs@paragraph@mark\@empty
+  \let\jsParagraphMark\@empty
+\else\ifx\bxjs@paragraph@mark\@undefined\else
   \long\edef\jsParagraphMark{\noexpand\jsJaChar{\bxjs@paragraph@mark}}
-\fi
+\fi\fi
 \let\jsJaChar\@empty
 \if@twocolumn
   \newcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
@@ -1605,12 +1630,65 @@
     \advance \labelwidth by -\labelsep
     \let \makelabel=\descriptionlabel}}{\endlist}
 \newcommand*\descriptionlabel[1]{\normalfont\headfont #1\hfil}
-\newenvironment{abstract}{%
+\newenvironment{chapterabstract}{%
   \begin{list}{}{%
     \listparindent=1\jsZw
     \itemindent=\listparindent
     \rightmargin=\z@
     \leftmargin=5\jsZw}\item[]}{\end{list}\vspace{\baselineskip}}
+\newbox\@abstractbox
+\if@titlepage
+  \newenvironment{abstract}{%
+    \titlepage
+    \null\vfil
+    \@beginparpenalty\@lowpenalty
+    \begin{center}%
+      \headfont \abstractname
+      \@endparpenalty\@M
+    \end{center}%
+    \par}%
+  {\par\vfil\null\endtitlepage}
+\else
+  \newenvironment{abstract}{%
+    \if@twocolumn
+      \ifx\maketitle\relax
+        \section*{\abstractname}%
+      \else
+        \global\setbox\@abstractbox\hbox\bgroup
+        \begin{minipage}[b]{\textwidth}
+          \small\parindent1\jsZw
+          \begin{center}%
+            {\headfont \abstractname\vspace{-.5em}\vspace{\z@}}%
+          \end{center}%
+          \list{}{%
+            \listparindent\parindent
+            \itemindent \listparindent
+            \rightmargin \leftmargin}%
+          \item\relax
+      \fi
+    \else
+      \small
+      \begin{center}%
+        {\headfont \abstractname\vspace{-.5em}\vspace{\z@}}%
+      \end{center}%
+      \list{}{%
+        \listparindent\parindent
+        \itemindent \listparindent
+        \rightmargin \leftmargin}%
+      \item\relax
+    \fi}{\if@twocolumn
+      \ifx\maketitle\relax
+      \else
+        \endlist\end{minipage}\egroup
+      \fi
+    \else
+      \endlist
+    \fi}
+\fi
+\ifbxjs@force@chapterabstract
+  \let\abstract\chapterabstract
+  \let\endabstract\endchapterabstract
+\fi
 \newenvironment{verse}{%
   \let \\=\@centercr
   \list{}{%
@@ -1633,14 +1711,13 @@
 \def\@opargbegintheorem#1#2#3{\trivlist\labelsep=1\jsZw
       \item[\hskip \labelsep{\headfont #1\ #2（#3）}]}
 \newenvironment{titlepage}{%
-    \cleardoublepage
     \if@twocolumn
       \@restonecoltrue\onecolumn
     \else
       \@restonecolfalse\newpage
     \fi
     \thispagestyle{empty}%
-    \setcounter{page}\@ne
+    \ifodd\c@page\setcounter{page}\@ne\else\setcounter{page}\z@\fi %% 2017-02-24
   }%
   {\if@restonecol\twocolumn \else \newpage \fi
     \if@twoside\else
@@ -2005,8 +2082,8 @@
 \def\@@inhibitglue{%
   \expandafter\expandafter\expandafter\jsc@inhibitglue\expandafter\meaning\expandafter\@let@token\KANJI@CHARACTER\relax\jsc@end}
 \expandafter\def\expandafter\jsc@inhibitglue\expandafter#\expandafter1\KANJI@CHARACTER#2#3\jsc@end{%
-  \def\bxjs@ig@temp{#1}%
-  \ifx\bxjs@ig@temp\@empty
+  \def\jsc@ig@temp{#1}%
+  \ifx\jsc@ig@temp\@empty
     \ifnum\the\inhibitxspcode`#2=2\relax
       \inhibitglue
     \fi
@@ -2125,6 +2202,7 @@
 \newcommand{\figurename}{\if@english Fig.~\else 図\fi}
 \newcommand{\tablename}{\if@english Table~\else 表\fi}
 \newcommand{\appendixname}{\if@english \else 付録\fi}
+\newcommand{\abstractname}{\if@english Abstract\else 概要\fi}
 \@tempswafalse
 \if p\jsEngine \@tempswatrue \fi
 \if n\jsEngine \@tempswatrue \fi
-- 
cgit v1.2.3

