Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

review-jlreq.cls (serial_pagenation): ロジックで動くように改修 #1132

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 7 additions & 30 deletions templates/latex/review-jlreq/review-jlreq.cls
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ cls]
\DeclareOptionX{bleed_margin}[3mm]{\gdef\recls@tombobleed{#1}}
\DeclareOptionX{cover}[\@empty]{\gdef\recls@forcecover{#1}}
\DeclareOptionX{startpage}[1]{\gdef\recls@startpage{\numexpr #1-1\relax}}
\DeclareOptionX{serial_pagination}[false]{\csname recls@serialpage##1\endcsname}
\DeclareOptionX{serial_pagination}[false]{\csname recls@serialpage#1\endcsname}

% jlreqのオプションについては https://github.com/abenori/jlreq/blob/master/README-ja.md を参照
\PassOptionsToClass{book,paper=a5}{jlreq}% クラスで必ず使うオプションの指定。デフォルトをA5にしておく
Expand All @@ -88,6 +88,12 @@ cls]

\LoadClass{jlreq}

% 通しノンブル
\ifrecls@serialpage
\renewcommand*{\pagenumbering}[1]{%
\gdef\thepage{\@arabic\c@page}}
\fi

% coverオプションによる表紙判定の上書き
\def\recls@tmp{true}\ifx\recls@forcecover\recls@tmp
\@reclscovertrue
Expand Down Expand Up @@ -194,34 +200,5 @@ cls]
\clearpage
}

\renewcommand*{\frontmatter}{%
\cleardoublepage
\@mainmatterfalse
\let\jlreq@pagestyle@atmain\jlreq@current@pagestyle
\SaveHeading{chapter}{\jlreq@heading@chapter@atmain}%
\ModifyHeading{chapter}{label_format={},after_label_space=0pt}%
\pagestyle{plain}%
\ifrecls@serialpage
\pagenumbering{arabic}% 通しノンブル
\else
\pagenumbering{roman}
\fi
\setcounter{page}{\the\recls@startpage}
}
\renewcommand*{\mainmatter}{%
\cleardoublepage
\@mainmattertrue
\@ifundefined{jlreq@pagestyle@atmain}{}{%
\expandafter\pagestyle\expandafter{\jlreq@pagestyle@atmain}%
}%
\@ifundefined{jlreq@heading@chapter@atmain}{}{\jlreq@heading@chapter@atmain}
%
\setcounter{chapter}{0}%
\ifrecls@serialpage% 通しノンブル
\else
\pagenumbering{arabic}
\fi
}

\listfiles
\endinput