X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fltjtbook.cls;h=03279bdacfb25de1b719a64b21d0a0f3fd7d09b2;hb=cfee177443f3a2ffd5c2aa1c5774405b6f4ce6fe;hp=36d9a46d476f2529ba9bea4e177fd7b069ec2315;hpb=bfbf87c9d6d7bc788c62034f28530067622cbabd;p=luatex-ja%2Fluatexja.git diff --git a/src/ltjtbook.cls b/src/ltjtbook.cls index 36d9a46..03279bd 100644 --- a/src/ltjtbook.cls +++ b/src/ltjtbook.cls @@ -21,25 +21,9 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% File: ltjclasses.dtx -%% \CharacterTable -%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -%% Digits \0\1\2\3\4\5\6\7\8\9 -%% Exclamation \! Double quote \" Hash (number) \# -%% Dollar \$ Percent \% Ampersand \& -%% Acute accent \' Left paren \( Right paren \) -%% Asterisk \* Plus \+ Comma \, -%% Minus \- Point \. Solidus \/ -%% Colon \: Semicolon \; Less than \< -%% Equals \= Greater than \> Question mark \? -%% Commercial at \@ Left bracket \[ Backslash \\ -%% Right bracket \] Circumflex \^ Underscore \_ -%% Grave accent \` Left brace \{ Vertical bar \| -%% Right brace \} Tilde \~} -%% \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjtbook} - [2015/10/18 v1.6-ltj-10 + [2019/11/23 v1.8d-ltj-17 Standard LuaLaTeX-ja class] \RequirePackage{luatexja} \newcounter{@paper} @@ -49,6 +33,7 @@ \newif\if@titlepage \@titlepagetrue \newif\if@openright +\newif\if@openleft \newif\if@mainmatter \@mainmattertrue \hour\time \divide\hour by 60\relax \@tempcnta\hour \multiply\@tempcnta 60\relax @@ -106,8 +91,8 @@ \tombowtrue \tombowdatetrue \setlength{\@tombowwidth}{.1\p@}% \@bannertoken{% - \jobname\space:\space\number\year/\number\month/\number\day - (\number\hour:\number\minute)} + \jobname\space(\number\year-\two@digits\month-\two@digits\day + \space\two@digits\hour:\two@digits\minute)}% \maketombowbox} \DeclareOption{tombo}{% \tombowtrue \tombowdatefalse @@ -140,8 +125,9 @@ \if@compatibility \@openrighttrue \else -\DeclareOption{openright}{\@openrighttrue} -\DeclareOption{openany}{\@openrightfalse} +\DeclareOption{openright}{\@openrighttrue\@openleftfalse} +\DeclareOption{openleft}{\@openlefttrue\@openrightfalse} +\DeclareOption{openany}{\@openrightfalse\@openleftfalse} \fi \DeclareOption{leqno}{\input{leqno.clo}} \DeclareOption{fleqn}{\input{fleqn.clo}} @@ -157,8 +143,6 @@ \if@compatibility \@mathrmmctrue \else - \DeclareOption{disablejfam}{% - \ClassWarningNoLine{\@currname}{The class option 'disablejfam' is obsolete}} \DeclareOption{mathrmmc}{\@mathrmmctrue} \fi \DeclareOption{draft}{\setlength\overfullrule{5pt}} @@ -172,28 +156,40 @@ \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.962216] \ltj@stdgtfont:jfm=min;jfmvar=goth}{} \ltjglobalsetparameter{differentjfm=both} \directlua{luatexbase.remove_from_callback('luatexja.load_jfm', 'ltj.jclasses_load_jfm')} +\DeclareOption{disablejfam}{} \ExecuteOptions{a4paper,10pt,twoside,onecolumn,final,openright,tate} \ProcessOptions\relax \input{ltjtbk1\@ptsize.clo} \RequirePackage{lltjext} +\def\Cjascale{0.962216} \if@stysize \setlength\columnsep{3\Cwd} \else \setlength\columnsep{10\p@} \fi \setlength\columnseprule{0\p@} -\setlength{\@tempdima}{\paperwidth} -\setlength{\@tempdimb}{\paperheight} \iftombow - \advance \@tempdima 2in - \advance \@tempdimb 2in -\fi -\ifdefined\pdfpagewidth - \setlength{\pdfpagewidth}{\@tempdima} - \setlength{\pdfpageheight}{\@tempdimb} + \newlength{\stockwidth} + \newlength{\stockheight} + \setlength{\stockwidth}{\paperwidth} + \setlength{\stockheight}{\paperheight} + \advance \stockwidth 2in + \advance \stockheight 2in + \ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\stockwidth} + \setlength{\pdfpageheight}{\stockheight} + \else + \setlength{\pagewidth}{\stockwidth} + \setlength{\pageheight}{\stockheight} + \fi \else - \setlength{\pagewidth}{\@tempdima} - \setlength{\pageheight}{\@tempdimb} + \ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\paperwidth} + \setlength{\pdfpageheight}{\paperheight} + \else + \setlength{\pagewidth}{\paperwidth} + \setlength{\pageheight}{\paperheight} + \fi \fi \setlength\lineskip{1\p@} \setlength\normallineskip{1\p@} @@ -213,6 +209,31 @@ \renewcommand{\floatpagefraction}{.5} \renewcommand{\dbltopfraction}{.7} \renewcommand{\dblfloatpagefraction}{.5} +\def\pltx@cleartorightpage{\clearpage\if@twoside + \unless\ifodd\numexpr\c@page+\ltjgetparameter{direction}\relax + \hbox{}\thispagestyle{empty}\newpage + \if@twocolumn\hbox{}\newpage\fi + \fi\fi} +\def\pltx@cleartoleftpage{\clearpage\if@twoside + \ifodd\numexpr\c@page+\ltjgetparameter{direction}\relax + \hbox{}\thispagestyle{empty}\newpage + \if@twocolumn\hbox{}\newpage\fi + \fi\fi} +\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} +\if@openleft + \let\cleardoublepage\pltx@cleartoleftpage +\else\if@openright + \let\cleardoublepage\pltx@cleartorightpage +\fi\fi \def\ps@plain{\let\@mkboth\@gobbletwo \let\ps@jpl@in\ps@plain \let\@oddhead\@empty @@ -238,9 +259,9 @@ \let\@mkboth\markboth \def\chaptermark##1{\markboth{% \ifnum \c@secnumdepth >\m@ne - \if@mainmatter + \if@mainmatter \@chapapp\thechapter\@chappos\hskip1\zw - \fi + \fi \fi ##1}{}}% \def\sectionmark##1{\markright{% @@ -254,9 +275,9 @@ \let\@mkboth\markboth \def\chaptermark##1{\markright{% \ifnum \c@secnumdepth >\m@ne - \if@mainmatter + \if@mainmatter \@chapapp\thechapter\@chappos\hskip1\zw - \fi + \fi \fi ##1}}% } @@ -270,9 +291,9 @@ \let\@mkboth\markboth \def\chaptermark##1{\markboth{% \ifnum \c@secnumdepth >\m@ne - \if@mainmatter + \if@mainmatter \@chapapp\thechapter\@chappos\hskip1\zw - \fi + \fi \fi ##1}{}}% \def\sectionmark##1{\markright{% @@ -286,9 +307,9 @@ \let\@mkboth\markboth \def\chaptermark##1{\markright{% \ifnum \c@secnumdepth >\m@ne - \if@mainmatter + \if@mainmatter \@chapapp\thechapter\@chappos\hskip1\zw - \fi + \fi \fi ##1}}% } @@ -304,7 +325,7 @@ \if@compatibility \newenvironment{titlepage} {% - \cleardoublepage + \cleardoublepage \if@twocolumn\@restonecoltrue\onecolumn \else\@restonecolfalse\newpage\fi \thispagestyle{empty}% @@ -315,14 +336,14 @@ \else \newenvironment{titlepage} {% - \cleardoublepage + \pltx@cleartooddpage %% 2017/02/15 \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/15 }% {\if@restonecol\twocolumn \else \newpage \fi \if@twoside\else @@ -332,7 +353,7 @@ \fi \def\p@thanks#1{\footnotemark \protected@xdef\@thanks{\@thanks - \protect{\noindent$\m@th^\thefootnote$~#1\protect\par}}} + \protect{\noindent\hbox{\yoko$\m@th^\thefootnote$}#1\protect\par}}} \if@titlepage \newcommand{\maketitle}{\begin{titlepage}% \let\footnotesize\small @@ -376,7 +397,7 @@ \def\@makefnmark{\hbox{\unless\ifnum\ltjgetparameter{direction}=3 $\m@th^{\@thefnmark}$ \else\hbox{\yoko$\m@th^{\@thefnmark}$}\fi}}% \long\def\@makefntext##1{\parindent 1\zw\noindent - \hbox to 2\zw{\hss\@makefnmark}##1}% + \hb@xt@ 2\zw{\hss\@makefnmark}##1}% \if@twocolumn \ifnum \col@number=\@ne \@maketitle \else \twocolumn[\@maketitle]% @@ -391,6 +412,7 @@ \setcounter{footnote}{0}% \global\let\thanks\relax \global\let\maketitle\relax + \global\let\@maketitle\relax \global\let\p@thanks\relax \global\let\@thanks\@empty \global\let\@author\@empty @@ -439,17 +461,19 @@ \theparagraph・\rensuji{\@arabic\c@subparagraph}} \newcommand{\@chapapp}{\prechaptername} \newcommand{\@chappos}{\postchaptername} -\newcommand\frontmatter{% - \if@openright \cleardoublepage \else \clearpage \fi +\newcommand{\frontmatter}{% + \pltx@cleartooddpage \@mainmatterfalse\pagenumbering{roman}} \newcommand{\mainmatter}{% - \if@openright \cleardoublepage \else \clearpage \fi + \pltx@cleartooddpage \@mainmattertrue\pagenumbering{arabic}} \newcommand{\backmatter}{% - \if@openright \cleardoublepage \else \clearpage \fi + \if@openleft \cleardoublepage \else + \if@openright \cleardoublepage \else \clearpage \fi \fi \@mainmatterfalse} \newcommand{\part}{% - \if@openright \cleardoublepage \else \clearpage \fi + \if@openleft \cleardoublepage \else + \if@openright \cleardoublepage \else \clearpage \fi \fi \thispagestyle{empty}% \if@twocolumn\onecolumn\@tempswatrue\else\@tempswafalse\fi \null\vfil @@ -464,7 +488,7 @@ \fi \markboth{}{}% {\centering - \interlinepenalty\@M\reset@font + \interlinepenalty\@M\normalfont \ifnum \c@secnumdepth >-2\relax \huge\bfseries\prepartname\thepart\postpartname \par\vskip20\p@ @@ -473,14 +497,21 @@ \@endpart} \def\@spart#1{{% \centering - \interlinepenalty\@M\reset@font + \interlinepenalty\@M\normalfont \Huge\bfseries#1\par}% \@endpart} \def\@endpart{\vfil\newpage - \if@twoside\null\thispagestyle{empty}\newpage\fi + \if@twoside + \if@openleft %% \if@openleft added (2017/02/15) + \null\thispagestyle{empty}\newpage + \else\if@openright %% \if@openright added (2016/12/18) + \null\thispagestyle{empty}\newpage + \fi\fi %% added (2016/12/18, 2017/02/15) + \fi \if@tempswa\twocolumn\fi} \newcommand{\chapter}{% - \if@openright\cleardoublepage\else\clearpage\fi + \if@openleft \cleardoublepage \else + \if@openright \cleardoublepage \else \clearpage \fi \fi \thispagestyle{jpl@in}% \global\@topnum\z@ \@afterindenttrue @@ -504,7 +535,7 @@ \vskip2\Cvs {\parindent\z@ \raggedright - \reset@font\huge\bfseries + \normalfont\huge\bfseries \leavevmode \ifnum \c@secnumdepth >\m@ne \setlength\@tempdima{\linewidth}% @@ -524,30 +555,30 @@ \vskip2\Cvs {\parindent\z@ \raggedright - \reset@font\huge\bfseries + \normalfont\huge\bfseries \leavevmode \setlength\@tempdima{\linewidth}% \vtop{\hsize\@tempdima#1}}\vskip3\Cvs} \newcommand{\section}{\@startsection{section}{1}{\z@}% {1.5\Cvs \@plus.5\Cvs \@minus.2\Cvs}% {.5\Cvs \@plus.3\Cvs}% - {\reset@font\Large\bfseries}} + {\normalfont\Large\bfseries}} \newcommand{\subsection}{\@startsection{subsection}{2}{\z@}% {1.5\Cvs \@plus.5\Cvs \@minus.2\Cvs}% {.5\Cvs \@plus.3\Cvs}% - {\reset@font\large\bfseries}} + {\normalfont\large\bfseries}} \newcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}% {1.5\Cvs \@plus.5\Cvs \@minus.2\Cvs}% {.5\Cvs \@plus.3\Cvs}% - {\reset@font\normalsize\bfseries}} + {\normalfont\normalsize\bfseries}} \newcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}% {3.25ex \@plus 1ex \@minus .2ex}% {-1em}% - {\reset@font\normalsize\bfseries}} + {\normalfont\normalsize\bfseries}} \newcommand{\subparagraph}{\@startsection{subparagraph}{5}{\z@}% {3.25ex \@plus 1ex \@minus .2ex}% {-1em}% - {\reset@font\normalsize\bfseries}} + {\normalfont\normalsize\bfseries}} \newcommand{\appendix}{\par \setcounter{chapter}{0}% \setcounter{section}{0}% @@ -590,7 +621,7 @@ {\ifnum \@enumdepth >\thr@@\@toodeep\else \advance\@enumdepth\@ne \edef\@enumctr{enum\romannumeral\the\@enumdepth}% - \list{\csname label\@enumctr\endcsname}{% + \expandafter \list \csname label\@enumctr\endcsname{% \ifnum\ltjgetparameter{direction}=3 \ifnum \@listdepth=\@ne \topsep.5\normalbaselineskip \else\topsep\z@\fi @@ -617,8 +648,7 @@ {\ifnum \@itemdepth >\thr@@\@toodeep\else \advance\@itemdepth\@ne \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% - \expandafter - \list{\csname \@itemitem\endcsname}{% + \expandafter \list \csname \@itemitem\endcsname{% \ifnum\ltjgetparameter{direction}=3 \ifnum \@listdepth=\@ne \topsep.5\normalbaselineskip \else\topsep\z@\fi @@ -696,7 +726,7 @@ \else #1: #2\relax\par\fi \else \global \@minipagefalse - \hbox to\hsize{\hfil\box\@tempboxa\hfil}% + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% \fi \vskip\belowcaptionskip} \setlength\arraycolsep{5\p@} @@ -710,6 +740,7 @@ \@addtoreset{equation}{chapter} \renewcommand{\theequation}{% \ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@equation} +\unless\ifltj@disablejfam \if@compatibility\else \DeclareSymbolFont{mincho}{JY3}{mc}{m}{n} \DeclareSymbolFontAlphabet{\mathmc}{mincho} @@ -723,6 +754,7 @@ \reDeclareMathAlphabet{\mathbf}{\mathbf}{\mathgt} }% \fi +\fi \DeclareOldFontCommand{\mc}{\normalfont\mcfamily}{\mathmc} \DeclareOldFontCommand{\gt}{\normalfont\gtfamily}{\mathgt} \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} @@ -741,7 +773,7 @@ \newdimen\toclineskip \setlength\toclineskip{2\p@} \newdimen\@lnumwidth -\def\numberline#1{\hbox to\@lnumwidth{#1\hfil}} +\def\numberline#1{\hb@xt@\@lnumwidth{#1\hfil}} \def\@dottedtocline#1#2#3#4#5{% \ifnum #1>\c@tocdepth \else \vskip\toclineskip \@plus.2\p@ @@ -750,19 +782,21 @@ \interlinepenalty\@M \leavevmode \@lnumwidth #3\relax - \advance\leftskip \@lnumwidth \hbox{}\hskip -\leftskip + \advance\leftskip \@lnumwidth \null\nobreak\hskip -\leftskip {#4}\nobreak \leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern \@dotsep mu$}% \hfill\nobreak \hb@xt@\@pnumwidth{\hss\normalfont \normalcolor #5}% \par}% \fi} +\providecommand*\protected@file@percent{} \def\addcontentsline#1#2#3{% \protected@write\@auxout {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble -\@temptokena{\rensuji{\thepage}}}% + \@temptokena{\rensuji{\thepage}}}% {\string\@writefile{#1}% - {\protect\contentsline{#2}{#3}{\the\@temptokena}}}% + {\protect\contentsline{#2}{#3}{\the\@temptokena}% +\protected@file@percent}}% } \newcommand{\tableofcontents}{% \if@twocolumn\@restonecoltrue\onecolumn @@ -782,7 +816,7 @@ {\leavevmode\large\bfseries \setlength\@lnumwidth{4\zw}% #1\hfil\nobreak - \hbox to\@pnumwidth{\hss#2}}\par + \hb@xt@\@pnumwidth{\hss#2}}\par \nobreak \global\@nobreaktrue \everypar{\global\@nobreakfalse\everypar{}}% @@ -797,7 +831,7 @@ \leavevmode\bfseries \setlength\@lnumwidth{4\zw}% \advance\leftskip\@lnumwidth \hskip-\leftskip - #1\nobreak\hfil\nobreak\hbox to\@pnumwidth{\hss#2}\par + #1\nobreak\hfil\nobreak\hb@xt@\@pnumwidth{\hss#2}\par \penalty\@highpenalty \endgroup \fi} @@ -809,8 +843,8 @@ \newcommand{\listoffigures}{% \if@twocolumn\@restonecoltrue\onecolumn \else\@restonecolfalse\fi - \chapter*{\listfigurename - \@mkboth{\listfigurename}{\listfigurename}}% + \chapter*{\listfigurename}% + \@mkboth{\listfigurename}{\listfigurename}% \@starttoc{lof}% \if@restonecol\twocolumn\fi } @@ -818,8 +852,8 @@ \newcommand{\listoftables}{% \if@twocolumn\@restonecoltrue\onecolumn \else\@restonecolfalse\fi - \chapter*{\listtablename - \@mkboth{\listtablename}{\listtablename}}% + \chapter*{\listtablename}% + \@mkboth{\listtablename}{\listtablename}% \@starttoc{lot}% \if@restonecol\twocolumn\fi } @@ -828,7 +862,7 @@ \setlength\bibindent{1.5em} \newcommand{\newblock}{\hskip .11em\@plus.33em\@minus.07em} \newenvironment{thebibliography}[1] -{\chapter*{\bibname\@mkboth{\bibname}{\bibname}}% +{\chapter*{\bibname}\@mkboth{\bibname}{\bibname}% \list{\@biblabel{\@arabic\c@enumiv}}% {\settowidth\labelwidth{\@biblabel{#1}}% \leftmargin\labelwidth @@ -848,11 +882,11 @@ \let\@openbib@code\@empty \newenvironment{theindex} {\if@twocolumn\@restonecolfalse\else\@restonecoltrue\fi - \columnseprule\z@ \columnsep 35\p@ \twocolumn[\@makeschapterhead{\indexname}]% \@mkboth{\indexname}{\indexname}% \thispagestyle{jpl@in}\parindent\z@ \parskip\z@ \@plus .3\p@\relax + \columnseprule\z@ \columnsep 35\p@ \let\item\@idxitem} {\if@restonecol\onecolumn\else\clearpage\fi} \newcommand{\@idxitem}{\par\hangindent 40\p@} @@ -861,36 +895,45 @@ \newcommand{\indexspace}{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax} \renewcommand{\footnoterule}{% \kern-3\p@ - \hrule width .4\columnwidth - \kern 2.6\p@} + \hrule\@width.4\columnwidth + \kern2.6\p@} \@addtoreset{footnote}{chapter} \newcommand\@makefntext[1]{\parindent 1\zw - \noindent\hbox to 2\zw{\hss\@makefnmark}#1} -\newif\if西暦 \西暦false + \noindent\hb@xt@ 2\zw{\hss\@makefnmark}#1} +\newif\if西暦 \西暦true \def\西暦{\西暦true} \def\和暦{\西暦false} \newcount\heisei \heisei\year \advance\heisei-1988\relax -\def\today{{% - \ifnum\ltjgetparameter{direction}=3 - \if西暦 - \kansuji\year 年 - \kansuji\month 月 - \kansuji\day 日 +\def\pltx@today@year@#1{% + \ifnum\numexpr\year-#1=1 元\else + \ifnum\ltjgetparameter{direction}=3 + \kansuji\numexpr\year-#1\relax \else - 平成\ifnum\heisei=1 元年\else\kansuji\heisei 年\fi - \kansuji\month 月 - \kansuji\day 日 + \number\numexpr\year-#1\relax\nobreak \fi + \fi 年 +} +\def\pltx@today@year{% + \ifnum\numexpr\year*10000+\month*100+\day<19890108 + 昭和\pltx@today@year@{1925}% + \else\ifnum\numexpr\year*10000+\month*100+\day<20190501 + 平成\pltx@today@year@{1988}% \else - \if西暦 - \number\year~年 - \number\month~月 - \number\day~日 - \else - 平成\ifnum\heisei=1 元年\else\number\heisei~年\fi - \number\month~月 - \number\day~日 - \fi + 令和\pltx@today@year@{2018}% + \fi\fi} +\def\today{{% + \if西暦 + \ifnum\ltjgetparameter{direction}=3 \kansuji\year + \else\number\year\nobreak\fi 年 + \else + \pltx@today@year + \fi + \ifnum\ltjgetparameter{direction}=3 + \kansuji\month 月 + \kansuji\day 日 + \else + \number\month\nobreak 月 + \number\day\nobreak 日 \fi}} \newcommand{\prepartname}{第} \newcommand{\postpartname}{部} @@ -907,6 +950,8 @@ \pagestyle{headings} \pagenumbering{arabic} \raggedbottom +\fnfixbottomtrue % 2017-02-19 +\IfFileExists{stfloats.sty}{\RequirePackage{stfloats}\fnbelowfloat}{} \if@twocolumn \twocolumn \sloppy @@ -915,6 +960,8 @@ \fi \normalmarginpar \@mparswitchfalse +\AtBeginOfPackageFile*{ftnright}{\let\ltjt@orig@@makefntext=\@makefntext} +\AtEndOfPackageFile*{ftnright}{\let\@makefntext=\ltjt@orig@@makefntext} \endinput %% %% End of file `ltjtbook.cls'.