OSDN Git Service

Merge branch 'master' into kitagawa_test
[luatex-ja/luatexja.git] / src / ltjtbook.cls
1 %%
2 %% This is file `ltjtbook.cls',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% ltjclasses.dtx  (with options: `book,tate')
8 %% 
9 %% IMPORTANT NOTICE:
10 %% 
11 %% For the copyright see the source file.
12 %% 
13 %% Any modified versions of this file must be renamed
14 %% with new filenames distinct from ltjtbook.cls.
15 %% 
16 %% For distribution of the original source see the terms
17 %% for copying and modification in the file ltjclasses.dtx.
18 %% 
19 %% This generated file may be distributed as long as the
20 %% original source files, as listed above, are part of the
21 %% same distribution. (The sources need not necessarily be
22 %% in the same archive or directory.)
23 %% File: ltjclasses.dtx
24 \NeedsTeXFormat{LaTeX2e}
25 \ProvidesClass{ltjtbook}
26   [2020/05/30 v1.8e-ltj-18
27  Standard LuaLaTeX-ja class]
28 \RequirePackage{luatexja}
29 \newcounter{@paper}
30 \newif\if@landscape \@landscapefalse
31 \newcommand{\@ptsize}{}
32 \newif\if@restonecol
33 \newif\if@titlepage
34 \@titlepagetrue
35 \newif\if@openright
36 \newif\if@openleft
37 \newif\if@mainmatter \@mainmattertrue
38 \hour\time \divide\hour by 60\relax
39 \@tempcnta\hour \multiply\@tempcnta 60\relax
40 \minute\time \advance\minute-\@tempcnta
41 \newif\if@stysize \@stysizefalse
42 \newif\if@mathrmmc \@mathrmmcfalse
43 \DeclareOption{a4paper}{\setcounter{@paper}{1}%
44   \setlength\paperheight {297mm}%
45   \setlength\paperwidth  {210mm}}
46 \DeclareOption{a5paper}{\setcounter{@paper}{2}%
47   \setlength\paperheight {210mm}
48   \setlength\paperwidth  {148mm}}
49 \DeclareOption{b4paper}{\setcounter{@paper}{3}%
50   \setlength\paperheight {364mm}
51   \setlength\paperwidth  {257mm}}
52 \DeclareOption{b5paper}{\setcounter{@paper}{4}%
53   \setlength\paperheight {257mm}
54   \setlength\paperwidth  {182mm}}
55 \DeclareOption{a4j}{\setcounter{@paper}{1}\@stysizetrue
56   \setlength\paperheight {297mm}%
57   \setlength\paperwidth  {210mm}}
58 \DeclareOption{a5j}{\setcounter{@paper}{2}\@stysizetrue
59   \setlength\paperheight {210mm}
60   \setlength\paperwidth  {148mm}}
61 \DeclareOption{b4j}{\setcounter{@paper}{3}\@stysizetrue
62   \setlength\paperheight {364mm}
63   \setlength\paperwidth  {257mm}}
64 \DeclareOption{b5j}{\setcounter{@paper}{4}\@stysizetrue
65   \setlength\paperheight {257mm}
66   \setlength\paperwidth  {182mm}}
67 \DeclareOption{a4p}{\setcounter{@paper}{1}\@stysizetrue
68   \setlength\paperheight {297mm}%
69   \setlength\paperwidth  {210mm}}
70 \DeclareOption{a5p}{\setcounter{@paper}{2}\@stysizetrue
71   \setlength\paperheight {210mm}
72   \setlength\paperwidth  {148mm}}
73 \DeclareOption{b4p}{\setcounter{@paper}{3}\@stysizetrue
74   \setlength\paperheight {364mm}
75   \setlength\paperwidth  {257mm}}
76 \DeclareOption{b5p}{\setcounter{@paper}{4}\@stysizetrue
77   \setlength\paperheight {257mm}
78   \setlength\paperwidth  {182mm}}
79 \if@compatibility
80   \renewcommand{\@ptsize}{0}
81 \else
82   \DeclareOption{10pt}{\renewcommand{\@ptsize}{0}}
83 \fi
84 \DeclareOption{11pt}{\renewcommand{\@ptsize}{1}}
85 \DeclareOption{12pt}{\renewcommand{\@ptsize}{2}}
86 \DeclareOption{landscape}{\@landscapetrue
87   \setlength\@tempdima{\paperheight}%
88   \setlength\paperheight{\paperwidth}%
89   \setlength\paperwidth{\@tempdima}}
90 \DeclareOption{tombow}{%
91   \tombowtrue \tombowdatetrue
92   \setlength{\@tombowwidth}{.1\p@}%
93   \@bannertoken{%
94      \jobname\space(\number\year-\two@digits\month-\two@digits\day
95      \space\two@digits\hour:\two@digits\minute)}%
96   \maketombowbox}
97 \DeclareOption{tombo}{%
98   \tombowtrue \tombowdatefalse
99   \setlength{\@tombowwidth}{.1\p@}%
100   \maketombowbox}
101 \DeclareOption{mentuke}{%
102   \tombowtrue \tombowdatefalse
103   \setlength{\@tombowwidth}{\z@}%
104   \maketombowbox}
105 \DeclareOption{tate}{%
106   \tate\AtBeginDocument{\message{《縦組モード》}\adjustbaseline}%
107 }
108 \DeclareOption{oneside}{\@twosidefalse}
109 \DeclareOption{twoside}{\@twosidetrue}
110 \DeclareOption{onecolumn}{\@twocolumnfalse}
111 \DeclareOption{twocolumn}{\@twocolumntrue}
112 \DeclareOption{titlepage}{\@titlepagetrue}
113 \DeclareOption{notitlepage}{\@titlepagefalse}
114 \if@compatibility
115 \@openrighttrue
116 \else
117 \DeclareOption{openright}{\@openrighttrue\@openleftfalse}
118 \DeclareOption{openleft}{\@openlefttrue\@openrightfalse}
119 \DeclareOption{openany}{\@openrightfalse\@openleftfalse}
120 \fi
121 \DeclareOption{leqno}{\input{leqno.clo}}
122 \DeclareOption{fleqn}{\input{fleqn.clo}}
123 \DeclareOption{openbib}{%
124   \AtEndOfPackage{%
125    \renewcommand\@openbib@code{%
126       \advance\leftmargin\bibindent
127       \itemindent -\bibindent
128       \listparindent \itemindent
129       \parsep \z@
130       }%
131    \renewcommand\newblock{\par}}}
132 \if@compatibility
133   \@mathrmmctrue
134 \else
135   \DeclareOption{mathrmmc}{\@mathrmmctrue}
136 \fi
137 \DeclareOption{draft}{\setlength\overfullrule{5pt}}
138 \DeclareOption{final}{\setlength\overfullrule{0pt}}
139 \newif\ifptexmin
140 \DeclareOption{ptexmin}{\ptexmintrue}%
141 \DeclareOption{disablejfam}{}
142 \ExecuteOptions{a4paper,10pt,twoside,onecolumn,final,openright,tate}
143 \ProcessOptions\relax
144 \ifptexmin
145 \directlua{luatexbase.add_to_callback('luatexja.load_jfm',
146   function (ji, jn) ji.chars['parbdd'] = 0; return ji end,
147   'ltj.jclasses_load_jfm', 1)}
148 {\jfont\g=\ltj@stdmcfont:jfm=min } % loading jfm-min.lua
149 \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
150 \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.962216] \ltj@stdmcfont:jfm=min}{}
151 \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.962216] \ltj@stdgtfont:jfm=min;jfmvar=goth}{}
152 \ltjglobalsetparameter{differentjfm=both}
153 \directlua{luatexbase.remove_from_callback('luatexja.load_jfm', 'ltj.jclasses_load_jfm')}
154 \fi
155 \input{ltjtbk1\@ptsize.clo}
156
157 \RequirePackage{lltjext}
158 \def\Cjascale{0.962216}
159 \if@stysize
160   \setlength\columnsep{3\Cwd}
161 \else
162   \setlength\columnsep{10\p@}
163 \fi
164 \setlength\columnseprule{0\p@}
165 \iftombow
166   \newlength{\stockwidth}
167   \newlength{\stockheight}
168   \setlength{\stockwidth}{\paperwidth}
169   \setlength{\stockheight}{\paperheight}
170   \advance \stockwidth 2in
171   \advance \stockheight 2in
172   \ifdefined\pdfpagewidth
173     \setlength{\pdfpagewidth}{\stockwidth}
174     \setlength{\pdfpageheight}{\stockheight}
175   \else
176     \setlength{\pagewidth}{\stockwidth}
177     \setlength{\pageheight}{\stockheight}
178   \fi
179 \else
180   \ifdefined\pdfpagewidth
181     \setlength{\pdfpagewidth}{\paperwidth}
182     \setlength{\pdfpageheight}{\paperheight}
183   \else
184     \setlength{\pagewidth}{\paperwidth}
185     \setlength{\pageheight}{\paperheight}
186   \fi
187 \fi
188 \setlength\lineskip{1\p@}
189 \setlength\normallineskip{1\p@}
190 \renewcommand{\baselinestretch}{}
191 \setlength\parskip{0\p@ \@plus \p@}
192 \setlength\parindent{1\Cwd}
193 \@lowpenalty   51
194 \@medpenalty  151
195 \@highpenalty 301
196 \setcounter{topnumber}{2}
197 \setcounter{bottomnumber}{1}
198 \setcounter{totalnumber}{3}
199 \setcounter{dbltopnumber}{2}
200 \renewcommand{\topfraction}{.7}
201 \renewcommand{\bottomfraction}{.3}
202 \renewcommand{\textfraction}{.2}
203 \renewcommand{\floatpagefraction}{.5}
204 \renewcommand{\dbltopfraction}{.7}
205 \renewcommand{\dblfloatpagefraction}{.5}
206 \def\pltx@cleartorightpage{\clearpage\if@twoside
207   \unless\ifodd\numexpr\c@page+\ltjgetparameter{direction}\relax
208     \hbox{}\thispagestyle{empty}\newpage
209     \if@twocolumn\hbox{}\newpage\fi
210   \fi\fi}
211 \def\pltx@cleartoleftpage{\clearpage\if@twoside
212   \ifodd\numexpr\c@page+\ltjgetparameter{direction}\relax
213     \hbox{}\thispagestyle{empty}\newpage
214     \if@twocolumn\hbox{}\newpage\fi
215   \fi\fi}
216 \def\pltx@cleartooddpage{\clearpage\if@twoside
217   \ifodd\c@page\else
218     \hbox{}\thispagestyle{empty}\newpage
219     \if@twocolumn\hbox{}\newpage\fi
220   \fi\fi}
221 \def\pltx@cleartoevenpage{\clearpage\if@twoside
222   \ifodd\c@page
223     \hbox{}\thispagestyle{empty}\newpage
224     \if@twocolumn\hbox{}\newpage\fi
225   \fi\fi}
226 \if@openleft
227   \let\cleardoublepage\pltx@cleartoleftpage
228 \else\if@openright
229   \let\cleardoublepage\pltx@cleartorightpage
230 \fi\fi
231 \def\ps@plain{\let\@mkboth\@gobbletwo
232    \let\ps@jpl@in\ps@plain
233    \let\@oddhead\@empty
234    \def\@oddfoot{\reset@font\hfil\thepage\hfil}%
235    \let\@evenhead\@empty
236    \let\@evenfoot\@oddfoot}
237 \let\ps@jpl@in\ps@plain
238 \def\ps@headnombre{\let\@mkboth\@gobbletwo
239     \let\ps@jpl@in\ps@headnombre
240   \def\@evenhead{\hfil\thepage}%
241   \def\@oddhead{\thepage\hfil}%
242   \let\@oddfoot\@empty\let\@evenfoot\@empty}
243 \def\ps@footnombre{\let\@mkboth\@gobbletwo
244     \let\ps@jpl@in\ps@footnombre
245   \def\@evenfoot{\hfil\thepage}%
246   \def\@oddfoot{\thepage\hfil}%
247   \let\@oddhead\@empty\let\@evenhead\@empty}
248 \if@twoside
249   \def\ps@headings{\let\ps@jpl@in\ps@headnombre
250     \let\@oddfoot\@empty\let\@evenfoot\@empty
251     \def\@evenhead{{\leftmark}\hfil\thepage}%
252     \def\@oddhead{\thepage\hfil\rightmark}%
253     \let\@mkboth\markboth
254   \def\chaptermark##1{\markboth{%
255      \ifnum \c@secnumdepth >\m@ne
256        \if@mainmatter
257          \@chapapp\thechapter\@chappos\hskip1\zw
258        \fi
259      \fi
260      ##1}{}}%
261   \def\sectionmark##1{\markright{%
262      \ifnum \c@secnumdepth >\z@ \thesection.\hskip1\zw\fi
263      ##1}}%
264   }
265 \else % if not twoside
266   \def\ps@headings{\let\ps@jpl@in\ps@headnombre
267     \let\@oddfoot\@empty
268     \def\@oddhead{\thepage\hfil\rightmark}%
269     \let\@mkboth\markboth
270 \def\chaptermark##1{\markright{%
271    \ifnum \c@secnumdepth >\m@ne
272      \if@mainmatter
273        \@chapapp\thechapter\@chappos\hskip1\zw
274      \fi
275    \fi
276    ##1}}%
277   }
278 \fi
279 \if@twoside
280   \def\ps@bothstyle{\let\ps@jpl@in\ps@footnombre
281     \def\@evenhead{\hfil\leftmark}% right page
282     \def\@evenfoot{\hfil\thepage}% right page
283     \def\@oddhead{\rightmark\hfil}% left page
284     \def\@oddfoot{\thepage\hfil}% left page
285   \let\@mkboth\markboth
286 \def\chaptermark##1{\markboth{%
287      \ifnum \c@secnumdepth >\m@ne
288        \if@mainmatter
289          \@chapapp\thechapter\@chappos\hskip1\zw
290        \fi
291      \fi
292      ##1}{}}%
293   \def\sectionmark##1{\markright{%
294      \ifnum \c@secnumdepth >\z@ \thesection.\hskip1\zw\fi
295      ##1}}%
296   }
297 \else % if one column
298   \def\ps@bothstyle{\let\ps@jpl@in\ps@footnombre
299     \def\@oddhead{\rightmark\hfil}%
300     \def\@oddfoot{\thepage\hfil}%
301     \let\@mkboth\markboth
302   \def\chaptermark##1{\markright{%
303      \ifnum \c@secnumdepth >\m@ne
304        \if@mainmatter
305          \@chapapp\thechapter\@chappos\hskip1\zw
306        \fi
307      \fi
308      ##1}}%
309   }
310 \fi
311 \def\ps@myheadings{\let\ps@jpl@in\ps@plain%
312   \let\@oddfoot\@empty\let\@evenfoot\@empty
313   \def\@evenhead{{\leftmark}\hfil\thepage}%
314   \def\@oddhead{\thepage\hfil\rightmark}%
315   \let\@mkboth\@gobbletwo
316   \let\chaptermark\@gobble
317   \let\sectionmark\@gobble
318 }
319 \if@compatibility
320 \newenvironment{titlepage}
321     {%
322      \cleardoublepage
323      \if@twocolumn\@restonecoltrue\onecolumn
324      \else\@restonecolfalse\newpage\fi
325      \thispagestyle{empty}%
326      \setcounter{page}\z@
327     }%
328     {\if@restonecol\twocolumn\else\newpage\fi
329     }
330 \else
331 \newenvironment{titlepage}
332     {%
333       \pltx@cleartooddpage %% 2017/02/15
334       \if@twocolumn
335         \@restonecoltrue\onecolumn
336       \else
337         \@restonecolfalse\newpage
338       \fi
339       \thispagestyle{empty}%
340       \ifodd\c@page\setcounter{page}\@ne\else\setcounter{page}\z@\fi %% 2017/02/15
341     }%
342     {\if@restonecol\twocolumn \else \newpage \fi
343      \if@twoside\else
344         \setcounter{page}\@ne
345      \fi
346     }
347 \fi
348 \def\p@thanks#1{\footnotemark
349   \protected@xdef\@thanks{\@thanks
350     \protect{\noindent\hbox{\yoko$\m@th^\thefootnote$}#1\protect\par}}}
351 \if@titlepage
352   \newcommand{\maketitle}{\begin{titlepage}%
353   \let\footnotesize\small
354   \let\footnoterule\relax
355   \let\thanks\p@thanks
356   \let\footnote\thanks
357   \vbox to\textheight\bgroup\tate\hsize\textwidth
358   \null\vfil
359   \vskip 60\p@
360   \begin{center}%
361     {\LARGE \@title \par}%
362     \vskip 3em%
363     {\Large
364      \lineskip .75em%
365       \begin{tabular}[t]{c}%
366         \@author
367       \end{tabular}\par}%
368       \vskip 1.5em%
369     {\large \@date \par}%       % Set date in \large size.
370   \end{center}\par
371   \vfil{\centering\@thanks}\vfil\null
372   \egroup
373   \end{titlepage}%
374   \setcounter{footnote}{0}%
375   \global\let\thanks\relax
376   \global\let\maketitle\relax
377   \global\let\p@thanks\relax
378   \global\let\@thanks\@empty
379   \global\let\@author\@empty
380   \global\let\@date\@empty
381   \global\let\@title\@empty
382   \global\let\title\relax
383   \global\let\author\relax
384   \global\let\date\relax
385   \global\let\and\relax
386   }%
387 \else
388   \newcommand{\maketitle}{\par
389   \begingroup
390     \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
391     \def\@makefnmark{\hbox{\unless\ifnum\ltjgetparameter{direction}=3 $\m@th^{\@thefnmark}$
392       \else\hbox{\yoko$\m@th^{\@thefnmark}$}\fi}}%
393     \long\def\@makefntext##1{\parindent 1\zw\noindent
394        \hb@xt@ 2\zw{\hss\@makefnmark}##1}%
395     \if@twocolumn
396       \ifnum \col@number=\@ne \@maketitle
397       \else \twocolumn[\@maketitle]%
398       \fi
399     \else
400       \newpage
401       \global\@topnum\z@   % Prevents figures from going at top of page.
402       \@maketitle
403     \fi
404      \thispagestyle{jpl@in}\@thanks
405   \endgroup
406   \setcounter{footnote}{0}%
407   \global\let\thanks\relax
408   \global\let\maketitle\relax
409   \global\let\@maketitle\relax
410   \global\let\p@thanks\relax
411   \global\let\@thanks\@empty
412   \global\let\@author\@empty
413   \global\let\@date\@empty
414   \global\let\@title\@empty
415   \global\let\title\relax
416   \global\let\author\relax
417   \global\let\date\relax
418   \global\let\and\relax
419   }
420   \def\@maketitle{%
421   \newpage\null
422   \vskip 2em%
423   \begin{center}%
424   \let\footnote\p@thanks
425     {\LARGE \@title \par}%
426     \vskip 1.5em%
427     {\large
428       \lineskip .5em%
429       \begin{tabular}[t]{c}%
430         \@author
431       \end{tabular}\par}%
432     \vskip 1em%
433     {\large \@date}%
434   \end{center}%
435   \par\vskip 1.5em}
436 \fi
437 \newcommand*{\chaptermark}[1]{}
438 \setcounter{secnumdepth}{2}
439 \newcounter{part}
440 \newcounter{chapter}
441 \newcounter{section}[chapter]
442 \newcounter{subsection}[section]
443 \newcounter{subsubsection}[subsection]
444 \newcounter{paragraph}[subsubsection]
445 \newcounter{subparagraph}[paragraph]
446 \renewcommand{\thepart}{\rensuji{\@Roman\c@part}}
447 \renewcommand{\thechapter}{\rensuji{\@arabic\c@chapter}}
448 \renewcommand{\thesection}{\thechapter・\rensuji{\@arabic\c@section}}
449 \renewcommand{\thesubsection}{\thesection・\rensuji{\@arabic\c@subsection}}
450 \renewcommand{\thesubsubsection}{%
451    \thesubsection・\rensuji{\@arabic\c@subsubsection}}
452 \renewcommand{\theparagraph}{%
453    \thesubsubsection・\rensuji{\@arabic\c@paragraph}}
454 \renewcommand{\thesubparagraph}{%
455    \theparagraph・\rensuji{\@arabic\c@subparagraph}}
456 \newcommand{\@chapapp}{\prechaptername}
457 \newcommand{\@chappos}{\postchaptername}
458 \newcommand{\frontmatter}{%
459   \pltx@cleartooddpage
460   \@mainmatterfalse\pagenumbering{roman}}
461 \newcommand{\mainmatter}{%
462   \pltx@cleartooddpage
463   \@mainmattertrue\pagenumbering{arabic}}
464 \newcommand{\backmatter}{%
465   \if@openleft \cleardoublepage \else
466   \if@openright \cleardoublepage \else \clearpage \fi \fi
467   \@mainmatterfalse}
468 \newcommand{\part}{%
469   \if@openleft \cleardoublepage \else
470   \if@openright \cleardoublepage \else \clearpage \fi \fi
471   \thispagestyle{empty}%
472   \if@twocolumn\onecolumn\@tempswatrue\else\@tempswafalse\fi
473   \null\vfil
474   \secdef\@part\@spart}
475 \def\@part[#1]#2{%
476   \ifnum \c@secnumdepth >-2\relax
477     \refstepcounter{part}%
478     \addcontentsline{toc}{part}{%
479        \prepartname\thepart\postpartname\hspace{1em}#1}%
480   \else
481     \addcontentsline{toc}{part}{#1}%
482   \fi
483   \markboth{}{}%
484   {\centering
485    \interlinepenalty\@M\normalfont
486    \ifnum \c@secnumdepth >-2\relax
487      \huge\bfseries\prepartname\thepart\postpartname
488      \par\vskip20\p@
489    \fi
490    \Huge\bfseries#2\par}%
491    \@endpart}
492 \def\@spart#1{{%
493   \centering
494   \interlinepenalty\@M\normalfont
495   \Huge\bfseries#1\par}%
496   \@endpart}
497 \def\@endpart{\vfil\newpage
498    \if@twoside
499     \if@openleft %% \if@openleft added (2017/02/15)
500      \null\thispagestyle{empty}\newpage
501     \else\if@openright %% \if@openright added (2016/12/18)
502      \null\thispagestyle{empty}\newpage
503     \fi\fi %% added (2016/12/18, 2017/02/15)
504    \fi
505    \if@tempswa\twocolumn\fi}
506 \newcommand{\chapter}{%
507   \if@openleft \cleardoublepage \else
508   \if@openright \cleardoublepage \else \clearpage \fi \fi
509   \thispagestyle{jpl@in}%
510   \global\@topnum\z@
511   \@afterindenttrue
512   \secdef\@chapter\@schapter}
513 \def\@chapter[#1]#2{%
514   \ifnum \c@secnumdepth >\m@ne
515     \if@mainmatter
516     \refstepcounter{chapter}%
517     \typeout{\@chapapp\space\thechapter\space\@chappos}%
518     \addcontentsline{toc}{chapter}%
519       {\protect\numberline{\@chapapp\thechapter\@chappos}#1}%
520     \else\addcontentsline{toc}{chapter}{#1}\fi
521   \else
522     \addcontentsline{toc}{chapter}{#1}%
523   \fi
524   \chaptermark{#1}%
525   \addtocontents{lof}{\protect\addvspace{10\p@}}%
526   \addtocontents{lot}{\protect\addvspace{10\p@}}%
527   \@makechapterhead{#2}\@afterheading}
528 \def\@makechapterhead#1{\hbox{}%
529   \vskip2\Cvs
530   {\parindent\z@
531    \raggedright
532    \normalfont\huge\bfseries
533    \leavevmode
534    \ifnum \c@secnumdepth >\m@ne
535      \setlength\@tempdima{\linewidth}%
536     \if@mainmatter
537      \setbox\z@\hbox{\@chapapp\thechapter\@chappos\hskip1\zw}%
538      \addtolength\@tempdima{-\wd\z@}%
539      \unhbox\z@\nobreak
540     \fi
541      \vtop{\hsize\@tempdima#1}%
542    \else
543      #1\relax
544    \fi}\nobreak\vskip3\Cvs}
545 \def\@schapter#1{%
546   \@makeschapterhead{#1}\@afterheading
547 }
548 \def\@makeschapterhead#1{\hbox{}%
549   \vskip2\Cvs
550   {\parindent\z@
551    \raggedright
552    \normalfont\huge\bfseries
553    \leavevmode
554    \setlength\@tempdima{\linewidth}%
555    \vtop{\hsize\@tempdima#1}}\vskip3\Cvs}
556 \newcommand{\section}{\@startsection{section}{1}{\z@}%
557    {1.5\Cvs \@plus.5\Cvs \@minus.2\Cvs}%
558    {.5\Cvs \@plus.3\Cvs}%
559    {\normalfont\Large\bfseries}}
560 \newcommand{\subsection}{\@startsection{subsection}{2}{\z@}%
561    {1.5\Cvs \@plus.5\Cvs \@minus.2\Cvs}%
562    {.5\Cvs \@plus.3\Cvs}%
563    {\normalfont\large\bfseries}}
564 \newcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}%
565    {1.5\Cvs \@plus.5\Cvs \@minus.2\Cvs}%
566    {.5\Cvs \@plus.3\Cvs}%
567    {\normalfont\normalsize\bfseries}}
568 \newcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
569    {3.25ex \@plus 1ex \@minus .2ex}%
570    {-1em}%
571    {\normalfont\normalsize\bfseries}}
572 \newcommand{\subparagraph}{\@startsection{subparagraph}{5}{\z@}%
573    {3.25ex \@plus 1ex \@minus .2ex}%
574    {-1em}%
575    {\normalfont\normalsize\bfseries}}
576 \newcommand{\appendix}{\par
577   \setcounter{chapter}{0}%
578   \setcounter{section}{0}%
579   \renewcommand{\@chapapp}{\appendixname}%
580   \renewcommand{\@chappos}\space%
581   \renewcommand{\thechapter}{\rensuji{\@Alph\c@chapter}}}
582 \if@twocolumn
583   \setlength\leftmargini {2em}
584 \else
585   \setlength\leftmargini {2.5em}
586 \fi
587 \setlength\leftmarginii  {2.2em}
588 \setlength\leftmarginiii {1.87em}
589 \setlength\leftmarginiv  {1.7em}
590 \if@twocolumn
591   \setlength\leftmarginv {.5em}
592   \setlength\leftmarginvi{.5em}
593 \else
594   \setlength\leftmarginv {1em}
595   \setlength\leftmarginvi{1em}
596 \fi
597 \setlength  \labelsep  {.5em}
598 \setlength  \labelwidth{\leftmargini}
599 \addtolength\labelwidth{-\labelsep}
600 \@beginparpenalty -\@lowpenalty
601 \@endparpenalty   -\@lowpenalty
602 \@itempenalty     -\@lowpenalty
603 \renewcommand{\theenumi}{\rensuji{\@arabic\c@enumi}}
604 \renewcommand{\theenumii}{\rensuji{(\@alph\c@enumii)}}
605 \renewcommand{\theenumiii}{\rensuji{\@roman\c@enumiii}}
606 \renewcommand{\theenumiv}{\rensuji{\@Alph\c@enumiv}}
607 \newcommand{\labelenumi}{\theenumi}
608 \newcommand{\labelenumii}{\theenumii}
609 \newcommand{\labelenumiii}{\theenumiii}
610 \newcommand{\labelenumiv}{\theenumiv}
611 \renewcommand{\p@enumii}{\theenumi}
612 \renewcommand{\p@enumiii}{\theenumi(\theenumii)}
613 \renewcommand{\p@enumiv}{\p@enumiii\theenumiii}
614 \renewenvironment{enumerate}
615   {\ifnum \@enumdepth >\thr@@\@toodeep\else
616    \advance\@enumdepth\@ne
617    \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
618    \expandafter \list \csname label\@enumctr\endcsname{%
619       \ifnum\ltjgetparameter{direction}=3
620          \ifnum \@listdepth=\@ne \topsep.5\normalbaselineskip
621            \else\topsep\z@\fi
622          \parskip\z@ \itemsep\z@ \parsep\z@
623          \labelwidth1\zw \labelsep.3\zw
624          \ifnum \@enumdepth=\@ne \leftmargin1\zw\relax
625            \else\leftmargin\leftskip\fi
626          \advance\leftmargin 1\zw
627       \fi
628          \usecounter{\@enumctr}%
629          \def\makelabel##1{\hss\llap{##1}}}%
630    \fi}{\endlist}
631 \newcommand{\labelitemi}{\labelitemfont \textbullet}
632 \newcommand{\labelitemii}{%
633   \ifnum\ltjgetparameter{direction}=3
634      {\labelitemfont \textcircled{~}}
635   \else
636      {\labelitemfont \bfseries\textendash}
637   \fi
638 }
639 \newcommand{\labelitemiii}{\labelitemfont \textasteriskcentered}
640 \newcommand{\labelitemiv}{\labelitemfont \textperiodcentered}
641 \newcommand\labelitemfont{\normalfont}
642 \renewenvironment{itemize}
643   {\ifnum \@itemdepth >\thr@@\@toodeep\else
644    \advance\@itemdepth\@ne
645    \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
646    \expandafter \list \csname \@itemitem\endcsname{%
647       \ifnum\ltjgetparameter{direction}=3
648          \ifnum \@listdepth=\@ne \topsep.5\normalbaselineskip
649            \else\topsep\z@\fi
650          \parskip\z@ \itemsep\z@ \parsep\z@
651          \labelwidth1\zw \labelsep.3\zw
652          \ifnum \@itemdepth =\@ne \leftmargin1\zw\relax
653            \else\leftmargin\leftskip\fi
654          \advance\leftmargin 1\zw
655       \fi
656          \def\makelabel##1{\hss\llap{##1}}}%
657    \fi}{\endlist}
658 \newenvironment{description}
659   {\list{}{\labelwidth\z@ \itemindent-\leftmargin
660    \ifnum\ltjgetparameter{direction}=3
661      \leftmargin\leftskip \advance\leftmargin3\Cwd
662      \rightmargin\rightskip
663      \labelsep=1\zw \itemsep\z@
664      \listparindent\z@ \topskip\z@ \parskip\z@ \partopsep\z@
665    \fi
666            \let\makelabel\descriptionlabel}}{\endlist}
667 \newcommand{\descriptionlabel}[1]{%
668    \hspace\labelsep\normalfont\bfseries #1}
669 \newenvironment{verse}
670   {\let\\\@centercr
671    \list{}{\itemsep\z@ \itemindent -1.5em%
672            \listparindent\itemindent
673            \rightmargin\leftmargin \advance\leftmargin 1.5em}%
674            \item\relax}{\endlist}
675 \newenvironment{quotation}
676   {\list{}{\listparindent 1.5em%
677            \itemindent\listparindent
678            \rightmargin\leftmargin
679            \parsep\z@ \@plus\p@}%
680            \item\relax}{\endlist}
681 \newenvironment{quote}
682   {\list{}{\rightmargin\leftmargin}%
683            \item\relax}{\endlist}
684 \newcounter{figure}[chapter]
685 \renewcommand{\thefigure}{%
686   \ifnum\c@chapter>\z@\thechapter{}・\fi\rensuji{\@arabic\c@figure}}
687 \def\fps@figure{tbp}
688 \def\ftype@figure{1}
689 \def\ext@figure{lof}
690 \def\fnum@figure{\figurename\thefigure}
691 \newenvironment{figure}
692                {\@float{figure}}
693                {\end@float}
694 \newenvironment{figure*}
695                {\@dblfloat{figure}}
696                {\end@dblfloat}
697 \newcounter{table}[chapter]
698 \renewcommand{\thetable}{%
699   \ifnum\c@chapter>\z@\thechapter{}・\fi\rensuji{\@arabic\c@table}}
700 \def\fps@table{tbp}
701 \def\ftype@table{2}
702 \def\ext@table{lot}
703 \def\fnum@table{\tablename\thetable}
704 \newenvironment{table}
705                {\@float{table}}
706                {\end@float}
707 \newenvironment{table*}
708                {\@dblfloat{table}}
709                {\end@dblfloat}
710 \newlength\abovecaptionskip
711 \newlength\belowcaptionskip
712 \setlength\abovecaptionskip{10\p@}
713 \setlength\belowcaptionskip{0\p@}
714 \long\def\@makecaption#1#2{%
715   \vskip\abovecaptionskip
716   \ifnum\ltjgetparameter{direction}=3 \sbox\@tempboxa{#1\hskip1\zw#2}%
717     \else\sbox\@tempboxa{#1: #2}%
718   \fi
719   \ifdim \wd\@tempboxa >\hsize
720     \ifnum\ltjgetparameter{direction}=3  #1\hskip1\zw#2\relax\par
721       \else #1: #2\relax\par\fi
722   \else
723     \global \@minipagefalse
724     \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
725   \fi
726   \vskip\belowcaptionskip}
727 \setlength\arraycolsep{5\p@}
728 \setlength\tabcolsep{6\p@}
729 \setlength\arrayrulewidth{.4\p@}
730 \setlength\doublerulesep{2\p@}
731 \setlength\tabbingsep{\labelsep}
732 \skip\@mpfootins = \skip\footins
733 \setlength\fboxsep{3\p@}
734 \setlength\fboxrule{.4\p@}
735 \@addtoreset{equation}{chapter}
736 \renewcommand{\theequation}{%
737   \ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@equation}
738 \unless\ifltj@disablejfam
739 \if@compatibility\else
740   \DeclareSymbolFont{mincho}{JY3}{mc}{m}{n}
741   \DeclareSymbolFontAlphabet{\mathmc}{mincho}
742   \SetSymbolFont{mincho}{bold}{JY3}{gt}{m}{n}
743   \jfam\symmincho
744   \DeclareMathAlphabet{\mathgt}{JY3}{gt}{m}{n}
745 \fi
746 \if@mathrmmc
747   \AtBeginDocument{%
748   \reDeclareMathAlphabet{\mathrm}{\mathrm}{\mathmc}
749   \reDeclareMathAlphabet{\mathbf}{\mathbf}{\mathgt}
750 }%
751 \fi
752 \fi
753 \DeclareOldFontCommand{\mc}{\normalfont\mcfamily}{\mathmc}
754 \DeclareOldFontCommand{\gt}{\normalfont\gtfamily}{\mathgt}
755 \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
756 \DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
757 \DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
758 \DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
759 \DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
760 \DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
761 \DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
762 \DeclareRobustCommand*{\cal}{\@fontswitch\relax\mathcal}
763 \DeclareRobustCommand*{\mit}{\@fontswitch\relax\mathnormal}
764 \setcounter{tocdepth}{2}
765 \newcommand{\@pnumwidth}{1.55em}
766 \newcommand{\@tocrmarg}{2.55em}
767 \newcommand{\@dotsep}{4.5}
768 \newdimen\toclineskip
769 \setlength\toclineskip{2\p@}
770 \newdimen\@lnumwidth
771 \def\numberline#1{\hb@xt@\@lnumwidth{#1\hfil}}
772 \def\@dottedtocline#1#2#3#4#5{%
773   \ifnum #1>\c@tocdepth \else
774     \vskip\toclineskip \@plus.2\p@
775     {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
776      \parindent #2\relax\@afterindenttrue
777      \interlinepenalty\@M
778      \leavevmode
779      \@lnumwidth #3\relax
780      \advance\leftskip \@lnumwidth \null\nobreak\hskip -\leftskip
781      {#4}\nobreak
782      \leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern \@dotsep mu$}%
783      \hfill\nobreak
784      \hb@xt@\@pnumwidth{\hss\normalfont \normalcolor #5}%
785      \par}%
786   \fi}
787 \providecommand*\protected@file@percent{}
788 \def\addcontentsline#1#2#3{%
789   \protected@write\@auxout
790     {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble
791      \@temptokena{\rensuji{\thepage}}}%
792     {\string\@writefile{#1}%
793        {\protect\contentsline{#2}{#3}{\the\@temptokena}%
794 \protected@file@percent}}%
795 }
796 \newcommand{\tableofcontents}{%
797   \if@twocolumn\@restonecoltrue\onecolumn
798   \else\@restonecolfalse\fi
799   \chapter*{\contentsname
800     \@mkboth{\contentsname}{\contentsname}%
801   }\@starttoc{toc}%
802   \if@restonecol\twocolumn\fi
803 }
804 \newcommand*{\l@part}[2]{%
805   \ifnum \c@tocdepth >-2\relax
806     \addpenalty{-\@highpenalty}%
807     \addvspace{2.25em \@plus\p@}%
808     \begingroup
809     \parindent\z@\rightskip\@pnumwidth
810     \parfillskip-\@pnumwidth
811     {\leavevmode\large\bfseries
812      \setlength\@lnumwidth{4\zw}%
813      #1\hfil\nobreak
814      \hb@xt@\@pnumwidth{\hss#2}}\par
815     \nobreak
816     \global\@nobreaktrue
817     \everypar{\global\@nobreakfalse\everypar{}}%
818      \endgroup
819   \fi}
820 \newcommand*{\l@chapter}[2]{%
821   \ifnum \c@tocdepth >\m@ne
822     \addpenalty{-\@highpenalty}%
823     \addvspace{1.0em \@plus\p@}%
824     \begingroup
825       \parindent\z@ \rightskip\@pnumwidth \parfillskip-\rightskip
826       \leavevmode\bfseries
827       \setlength\@lnumwidth{4\zw}%
828       \advance\leftskip\@lnumwidth \hskip-\leftskip
829       #1\nobreak\hfil\nobreak\hb@xt@\@pnumwidth{\hss#2}\par
830       \penalty\@highpenalty
831     \endgroup
832   \fi}
833 \newcommand*{\l@section}{\@dottedtocline{1}{1\zw}{4\zw}}
834 \newcommand*{\l@subsection}   {\@dottedtocline{2}{2\zw}{6\zw}}
835 \newcommand*{\l@subsubsection}{\@dottedtocline{3}{3\zw}{8\zw}}
836 \newcommand*{\l@paragraph}    {\@dottedtocline{4}{4\zw}{9\zw}}
837 \newcommand*{\l@subparagraph} {\@dottedtocline{5}{5\zw}{10\zw}}
838 \newcommand{\listoffigures}{%
839   \if@twocolumn\@restonecoltrue\onecolumn
840   \else\@restonecolfalse\fi
841   \chapter*{\listfigurename}%
842   \@mkboth{\listfigurename}{\listfigurename}%
843   \@starttoc{lof}%
844   \if@restonecol\twocolumn\fi
845 }
846 \newcommand*{\l@figure}{\@dottedtocline{1}{1\zw}{4\zw}}
847 \newcommand{\listoftables}{%
848   \if@twocolumn\@restonecoltrue\onecolumn
849   \else\@restonecolfalse\fi
850   \chapter*{\listtablename}%
851   \@mkboth{\listtablename}{\listtablename}%
852   \@starttoc{lot}%
853   \if@restonecol\twocolumn\fi
854 }
855 \let\l@table\l@figure
856 \newdimen\bibindent
857 \setlength\bibindent{1.5em}
858 \newcommand{\newblock}{\hskip .11em\@plus.33em\@minus.07em}
859 \newenvironment{thebibliography}[1]
860 {\chapter*{\bibname}\@mkboth{\bibname}{\bibname}%
861    \list{\@biblabel{\@arabic\c@enumiv}}%
862         {\settowidth\labelwidth{\@biblabel{#1}}%
863          \leftmargin\labelwidth
864          \advance\leftmargin\labelsep
865          \@openbib@code
866          \usecounter{enumiv}%
867          \let\p@enumiv\@empty
868          \renewcommand\theenumiv{\@arabic\c@enumiv}}%
869    \sloppy
870    \clubpenalty4000
871    \@clubpenalty\clubpenalty
872    \widowpenalty4000%
873    \sfcode`\.\@m}
874   {\def\@noitemerr
875     {\@latex@warning{Empty `thebibliography' environment}}%
876    \endlist}
877 \let\@openbib@code\@empty
878 \newenvironment{theindex}
879   {\if@twocolumn\@restonecolfalse\else\@restonecoltrue\fi
880    \twocolumn[\@makeschapterhead{\indexname}]%
881    \@mkboth{\indexname}{\indexname}%
882    \thispagestyle{jpl@in}\parindent\z@
883    \parskip\z@ \@plus .3\p@\relax
884    \columnseprule\z@ \columnsep 35\p@
885    \let\item\@idxitem}
886   {\if@restonecol\onecolumn\else\clearpage\fi}
887 \newcommand{\@idxitem}{\par\hangindent 40\p@}
888 \newcommand{\subitem}{\@idxitem \hspace*{20\p@}}
889 \newcommand{\subsubitem}{\@idxitem \hspace*{30\p@}}
890 \newcommand{\indexspace}{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
891 \renewcommand{\footnoterule}{%
892   \kern-3\p@
893   \hrule\@width.4\columnwidth
894   \kern2.6\p@}
895 \@addtoreset{footnote}{chapter}
896 \newcommand\@makefntext[1]{\parindent 1\zw
897   \noindent\hb@xt@ 2\zw{\hss\@makefnmark}#1}
898 \newif\if西暦 \西暦true
899 \def\西暦{\西暦true}
900 \def\和暦{\西暦false}
901 \newcount\heisei \heisei\year \advance\heisei-1988\relax
902 \def\pltx@today@year@#1{%
903   \ifnum\numexpr\year-#1=1 元\else
904     \ifnum\ltjgetparameter{direction}=3
905       \kansuji\numexpr\year-#1\relax
906     \else
907       \number\numexpr\year-#1\relax\nobreak
908     \fi
909   \fi 年
910 }
911 \def\pltx@today@year{%
912   \ifnum\numexpr\year*10000+\month*100+\day<19890108
913     昭和\pltx@today@year@{1925}%
914   \else\ifnum\numexpr\year*10000+\month*100+\day<20190501
915     平成\pltx@today@year@{1988}%
916   \else
917     令和\pltx@today@year@{2018}%
918   \fi\fi}
919 \def\today{{%
920   \if西暦
921     \ifnum\ltjgetparameter{direction}=3 \kansuji\year
922     \else\number\year\nobreak\fi 年
923   \else
924     \pltx@today@year
925   \fi
926   \ifnum\ltjgetparameter{direction}=3
927     \kansuji\month 月
928     \kansuji\day 日
929   \else
930     \number\month\nobreak 月
931     \number\day\nobreak 日
932   \fi}}
933 \newcommand{\prepartname}{第}
934 \newcommand{\postpartname}{部}
935 \newcommand{\prechaptername}{第}
936 \newcommand{\postchaptername}{章}
937 \newcommand{\contentsname}{目 次}
938 \newcommand{\listfigurename}{図 目 次}
939 \newcommand{\listtablename}{表 目 次}
940 \newcommand{\bibname}{関連図書}
941 \newcommand{\indexname}{索 引}
942 \newcommand{\figurename}{図}
943 \newcommand{\tablename}{表}
944 \newcommand{\appendixname}{付 録}
945 \pagestyle{headings}
946 \pagenumbering{arabic}
947 \raggedbottom
948 \fnfixbottomtrue % 2017-02-19
949 \IfFileExists{stfloats.sty}{\RequirePackage{stfloats}\fnbelowfloat}{}
950 \if@twocolumn
951   \twocolumn
952   \sloppy
953 \else
954   \onecolumn
955 \fi
956 \normalmarginpar
957 \@mparswitchfalse
958 \AtBeginOfPackageFile*{ftnright}{\let\ltjt@orig@@makefntext=\@makefntext}
959 \AtEndOfPackageFile*{ftnright}{\let\@makefntext=\ltjt@orig@@makefntext}
960 \endinput
961 %%
962 %% End of file `ltjtbook.cls'.