summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bxjscls/bxjsbook.cls
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-08-01 21:41:12 +0000
committerKarl Berry <karl@freefriends.org>2016-08-01 21:41:12 +0000
commit966b2da047b5098fa6af86d4df052b18b62ce6cb (patch)
treec24adf0b554cbea46dffb91ef0bda0e6bf04a357 /Master/texmf-dist/tex/latex/bxjscls/bxjsbook.cls
parent53b28d7a4d122e72d017097064531fb2fe162675 (diff)
bxjscls (1aug16)
git-svn-id: svn://tug.org/texlive/trunk@41783 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/bxjscls/bxjsbook.cls')
-rw-r--r--Master/texmf-dist/tex/latex/bxjscls/bxjsbook.cls204
1 files changed, 165 insertions, 39 deletions
diff --git a/Master/texmf-dist/tex/latex/bxjscls/bxjsbook.cls b/Master/texmf-dist/tex/latex/bxjscls/bxjsbook.cls
index f221563743f..43c0028cf4c 100644
--- a/Master/texmf-dist/tex/latex/bxjscls/bxjsbook.cls
+++ b/Master/texmf-dist/tex/latex/bxjscls/bxjsbook.cls
@@ -37,7 +37,7 @@
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{bxjsbook}
- [2016/07/16 v1.1f BXJS document classes]
+ [2016/08/01 v1.2 BXJS document classes]
%% このファイルは日本語文字を含みます
\RequirePackage{calc}
\RequirePackage{keyval}
@@ -103,6 +103,15 @@
\fi
\bxjs@robust@def\jsInhibitGlue{%
\ifx\inhibitglue\@undefined\else \inhibitglue \fi}
+\if@compatibility
+ \ClassError\bxjs@clsname
+ {Something went chaotic!\MessageBreak
+ I cannot go a single step further...}
+ {If the chant of \string\documentstyle\space was just a blunder
+ of yours,\MessageBreak then there'll still be hope....}
+ \expandafter\@firstofone
+\else \expandafter\@gobble
+\fi{\typeout{Farewell!}\endinput\@@end}
\newif\if@restonecol
\newif\if@titlepage
\newif\if@openright
@@ -252,7 +261,7 @@
\DeclareOption{english}{\@englishtrue}
\mathchardef\bxjs@csta=259
\def\bxjs@invscale#1#2{%
- \bgroup \@tempdima=#1\relax \@tempdimb#2\p@\relax
+ \begingroup \@tempdima=#1\relax \@tempdimb#2\p@\relax
\@tempcnta\@tempdima \multiply\@tempcnta\@cclvi
\divide\@tempcnta\@tempdimb \multiply\@tempcnta\@cclvi
\@tempcntb\p@ \divide\@tempcntb\@tempdimb
@@ -267,13 +276,15 @@
\advance\@tempcntb\m@ne \@tempdimc=\@tempcntb\@ne
\else \@tempdimb=\@tempcntb\@ne \fi}%
\xdef\bxjs@gtmpa{\the\@tempdimb}%
- \egroup #1=\bxjs@gtmpa\relax}
+ \endgroup #1=\bxjs@gtmpa\relax}
\let\bxjs@composite@proc\relax
\DeclareOption{pandoc}{%
\def\bxjs@composite@proc{%
+ \bxjs@oldfontcommandstrue
\setkeys{bxjs}{ja=pandoc}%
\let\bxjs@engine@given=*}%
- \def\bxjs@driver@opt{dvipdfmx-if-dvi}}
+ \def\bxjs@driver@opt{dvipdfmx}%
+ \bxjs@dvi@opttrue}
\DeclareOption{autodetect-engine}{%
\let\bxjs@engine@given=*}
\DeclareOption{latex}{%
@@ -320,8 +331,7 @@
\def\bxjs@driver@opt{xetex}%
\let\bxjs@driver@given\bxjs@driver@@xetex}
\DeclareOption{dvipdfmx-if-dvi}{%
- \def\bxjs@driver@opt{dvipdfmx-if-dvi}%
- \let\bxjs@driver@given\@undefined}
+ \setkeys{bxjs}{dvi=dvipdfmx}}
\newif\ifbxjs@usezw \bxjs@usezwtrue
\DeclareOption{nozw}{%
\bxjs@usezwfalse}
@@ -351,6 +361,11 @@
\bxjs@bigcodefalse}
\DeclareOption{bigcode}{%
\bxjs@bigcodetrue}
+\newif\ifbxjs@oldfontcommands
+\DeclareOption{nooldfontcommands}{%
+ \bxjs@oldfontcommandsfalse}
+\DeclareOption{oldfontcommands}{%
+ \bxjs@oldfontcommandstrue}
\def\bxjs@setkey{%
\expandafter\bxjs@setkey@a\expandafter{\CurrentOption}}
\def\bxjs@setkey@a{\bxjs@safe@setkeys{bxjs}}
@@ -412,6 +427,33 @@
{Invalid magstyle value `#1'}\@ehc
\let\bxjs@magstyle\bxjs@magstyle@default
\fi}
+\let\bxjs@geometry@class=c
+\let\bxjs@geometry@user=u
+\let\bxjs@geometry\bxjs@geometry@class
+\define@key{bxjs}{geometry}{%
+ \expandafter\let\expandafter\bxjs@geometry\csname
+ bxjs@geometry@#1\endcsname
+ \ifx\bxjs@geometry\relax
+ \ClassError\bxjs@clsname
+ {Invalid geometry value `#1'}\@ehc
+ \let\bxjs@geometry\bxjs@geometry@class
+ \fi}
+\newif\ifbxjs@dvi@opt
+\let\bxjs@dvidriver@@dvipdfmx=\bxjs@driver@@dvipdfmx
+\let\bxjs@dvidriver@@dvips=\bxjs@driver@@dvimode
+\let\bxjs@dvidriver@@dviout=\bxjs@driver@@dvimode
+\let\bxjs@dvidriver@@xdvi=\bxjs@driver@@dvimode
+\define@key{bxjs}{dvi}{%
+ \expandafter\let\expandafter\bxjs@tmpa\csname
+ bxjs@dvidriver@@#1\endcsname
+ \ifx\bxjs@tmpa\relax
+ \ClassError\bxjs@clsname
+ {Invalid dvi value `#1'}\@ehc
+ \else
+ \def\bxjs@driver@opt{#1}%
+ \let\bxjs@driver@given\@undefined
+ \bxjs@dvi@opttrue
+ \fi}
\let\bxjs@ltx@removeelement\@removeelement
\def\@removeelement#1#2#3{%
\def\reserved@a{#2}%
@@ -491,19 +533,20 @@
\fi
\ifjsInPdfMode \@tempswafalse
\else\ifx x\jsEngine \@tempswafalse
-\else\ifx\bxjs@jadriver@given\@undefined \@tempswafalse
\else \@tempswatrue
-\fi\fi\fi
+\fi\fi
\if@tempswa
- \ifx\bxjs@driver@opt\@undefined
+ \ifx\bxjs@driver@opt\@undefined \ifx\bxjs@jadriver@given\@undefined\else
\ClassWarningNoLine\bxjs@clsname
{No driver option is given}
- \fi
- \def\bxjs@tmpa{dvipdfmx-if-dvi}
- \ifx\bxjs@driver@opt\bxjs@tmpa
- \def\bxjs@driver@opt{dvipdfmx}
- \let\bxjs@driver@given\bxjs@driver@@dvipdfmx
- \g@addto@macro\@classoptionslist{,dvipdfmx}
+ \fi\fi
+ \ifbxjs@dvi@opt
+ \edef\bxjs@nxt{%
+ \let\noexpand\bxjs@driver@given
+ \csname bxjs@dvidriver@@\bxjs@driver@opt\endcsname
+ \noexpand\g@addto@macro\noexpand\@classoptionslist
+ {,\bxjs@driver@opt}%
+ }\bxjs@nxt
\fi
\fi
\def\bxjs@@minimal{minimal}
@@ -550,6 +593,9 @@
\@namedef{ver@\bxjs@js@clsname.cls}{2001/01/01 (bxjs)}
\fi
\g@addto@macro\@classoptionslist{,nosetpagesize}
+\ifbxjs@oldfontcommands
+ \jsAtEndOfClass{\allowoldfontcommands}
+\fi
\ifdim\bxjs@param@basefontsize<10pt \def\n@baseline{15}%
\else \def\n@baseline{16}\fi
\newif\ifbxjs@nfss@patch
@@ -787,7 +833,9 @@
\newdimen\fullwidth
\newcommand\jsTextWidthLimit{40}
\def\bxjs@postproc@layout{%
- \let\Gm@driver\bxjs@geometry@driver
+ \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
@@ -817,25 +865,14 @@
\stockwidth=\paperwidth
\stockheight=\paperheight
}
+\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}
-\if x\jsEngine
- \ifx\pdfpagewidth\@undefined
- \def\bxjs@Gm@driver{dvipdfm}
- \else
- \def\bxjs@Gm@driver{pdftex}
- \ifx\pdfhorigin\@undefined \newdimen\pdfhorigin \fi
- \ifx\pdfvorigin\@undefined \newdimen\pdfvorigin \fi
- \fi
- \let\bxjs@InputIfFileExists\InputIfFileExists
- \g@addto@macro\bxjs@revert{\let\InputIfFileExists\bxjs@InputIfFileExists}
- \def\InputIfFileExists#1#2#3{%
- \bxjs@InputIfFileExists{#1}{#2}{#3}%
- \edef\Gm@checkdrivers{\noexpand\Gm@setdriver{\bxjs@Gm@driver}}}%
-\fi
\ifbxjs@papersize
\ifx\bxjs@driver@given\bxjs@driver@@dvipdfmx
\PassOptionsToPackage{dvipdfm}{geometry}
@@ -846,11 +883,24 @@
\fi
\edef\bxjs@nxt{%
\noexpand\RequirePackage[\bxjs@layout@paper,\bxjs@layout]{geometry}}
+\AtBeginDocument{\bxjs@pre@geometry@hook}
\AtBeginDocument{\ImposeOldLuaTeXBehavior}
\bxjs@nxt \bxjs@revert
\AtBeginDocument{\RevokeOldLuaTeXBehavior}
\let\bxjs@geometry@driver\Gm@driver
\bxjs@postproc@layout
+\@onlypreamble\bxjs@pre@geometry@hook
+\def\bxjs@pre@geometry@hook{%
+ \@ifpackageloaded{geometry}{\@ifpackagelater{geometry}{2010/02/12}{}{%
+ \PackageWarningNoLine\bxjs@clsname
+ {The 'geometry' package installed\MessageBreak
+ is too old (< v5.0)}%
+ \if x\jsEngine \ifnum\mag=\@m\else
+ \def\bxjs@Gm@driver{pdftex}
+ \ifx\pdfhorigin\@undefined \newdimen\pdfhorigin \fi
+ \ifx\pdfvorigin\@undefined \newdimen\pdfvorigin \fi
+ \fi\fi
+ }}{}}
\def\setpagelayout{\@ifstar
{\bxjs@reset@layout}{\bxjs@modify@layout}}
\def\bxjs@modify@layout#1{%
@@ -859,6 +909,26 @@
\def\bxjs@reset@layout#1{%
\edef\bxjs@nxt{\noexpand\geometry{reset,\bxjs@layout@paper,#1,truedimen}}%
\bxjs@nxt\bxjs@postproc@layout}
+\else\ifx\bxjs@geometry\bxjs@geometry@user
+\AtBeginDocument{\bxjs@check@page@layout}
+\@onlypreamble\bxjs@check@page@layout
+\def\bxjs@check@page@layout{%
+ \ifdim\textwidth=.5\maxdimen
+ \ClassError\bxjs@clsname
+ {Page layout is not properly set}
+ \@ehd
+ \fi}
+\def\jsUseMinimalPageLayout{%
+ \setlength{\textwidth}{6.5in}%
+ \setlength{\textheight}{8in}}
+\let\bxjs@geometry@driver\relax
+\def\setpagelayout{\@ifstar
+ {\bxjs@pagelayout@a}{\bxjs@pagelayout@a}}
+\def\bxjs@pagelayout@a#1{%
+ \ClassError\bxjs@clsname
+ {Command \string\setpagelayout\space is not supported,\MessageBreak
+ because 'geometry' value is not 'class'}\@eha}
+\fi\fi
\footnotesep=11\p@? \footnotesep=0.7\footnotesep
\setlength{\skip\footins}{16\p@? \@plus 5\p@? \@minus 2\p@?}
\setcounter{topnumber}{9}
@@ -1537,15 +1607,70 @@
\ifdim \wd\@tempboxa <\hsize \centering \fi
#1\hskip1\jsZw\relax #2\par
\vskip\belowcaptionskip}}
-\DeclareOldFontCommand{\mc}{\normalfont\mcfamily}{\mathmc}
-\DeclareOldFontCommand{\gt}{\normalfont\gtfamily}{\mathgt}
-\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
-\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
-\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
-\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
-\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
-\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
-\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
+\newif\if@jsc@warnoldfontcmd
+\@jsc@warnoldfontcmdtrue
+\newif\if@jsc@warnoldfontcmdexception
+\@jsc@warnoldfontcmdexceptionfalse
+\newcommand*{\jsc@DeclareOldFontCommand}[3]{%
+ \g@addto@macro\bxjs@oldfontcmd@list{\do#1}%
+ \DeclareOldFontCommand{#1}{%
+ \bxjs@oldfontcmd{#1}#2%
+ }{%
+ \bxjs@oldfontcmd{#1}#3%
+ }%
+}
+\DeclareRobustCommand*{\jsc@warnoldfontcmd}[1]{%
+ \ClassInfo\bxjs@clsname
+ {Old font command '\string#1' is used!!\MessageBreak
+ First occurrence is}%
+}
+\newcommand*{\allowoldfontcommands}{%
+ \@jsc@warnoldfontcmdexceptiontrue}
+\newcommand*{\disallowoldfontcommands}{%
+ \@jsc@warnoldfontcmdexceptionfalse}
+\let\bxjs@oldfontcmd@list\@empty
+\def\bxjs@oldfontcmd#1{%
+ \expandafter\bxjs@oldfontcmd@a\csname bxjs@ofc/\string#1\endcsname#1}
+\def\bxjs@oldfontcmd@a#1#2{%
+ \if@jsc@warnoldfontcmdexception\else
+ \global\@jsc@warnoldfontcmdfalse
+ \ifx#1\relax
+ \global\let#1=t%
+ \jsc@warnoldfontcmd{#2}%
+ \fi
+ \fi}
+\def\bxjs@warnoldfontcmd@final{%
+ \par
+ \let\@tempa\@empty
+ \def\do##1{%
+ \expandafter\ifx\csname bxjs@ofc/\string##1\endcsname\relax\else
+ \edef\@tempa{\@tempa \space\string##1}\fi}
+ \bxjs@oldfontcmd@list
+ \ifx\@tempa\@empty\else
+ \ClassWarningNoLine\bxjs@clsname
+ {Some old font commands were used in text\MessageBreak
+ (see the log output 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}%
+ \fi}
+\AtEndDocument{\bxjs@warnoldfontcmd@final}
+\jsc@DeclareOldFontCommand{\mc}{\normalfont\mcfamily}{\mathmc}
+\jsc@DeclareOldFontCommand{\gt}{\normalfont\gtfamily}{\mathgt}
+\jsc@DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
+\jsc@DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
+\jsc@DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
+\jsc@DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
+\jsc@DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
+\jsc@DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
+\jsc@DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\DeclareRobustCommand*{\cal}{\@fontswitch\relax\mathcal}
\DeclareRobustCommand*{\mit}{\@fontswitch\relax\mathnormal}
\newcommand\@pnumwidth{1.55em}
@@ -1651,6 +1776,7 @@
\newdimen\bibindent
\setlength\bibindent{2\jsZw}
\newenvironment{thebibliography}[1]{%
+ \@jsc@warnoldfontcmdexceptiontrue
\global\let\presectionname\relax
\global\let\postsectionname\relax
\chapter*{\bibname}\@mkboth{\bibname}{}%