diff --git a/lib/review/latexbuilder.rb b/lib/review/latexbuilder.rb index fca6062e5..7761a87b6 100644 --- a/lib/review/latexbuilder.rb +++ b/lib/review/latexbuilder.rb @@ -96,6 +96,13 @@ def puts(*s) end private :puts + def result + if @chapter.is_a?(ReVIEW::Book::Part) && !@book.config.check_version('2', exception: false) + puts '\end{reviewpart}' + end + @output.string + end + HEADLINE = { 1 => 'chapter', 2 => 'section', @@ -108,8 +115,13 @@ def puts(*s) def headline(level, label, caption) _, anchor = headline_prefix(level) headline_name = HEADLINE[level] - if @chapter.is_a? ReVIEW::Book::Part - headline_name = 'part' + if @chapter.is_a?(ReVIEW::Book::Part) + if @book.config.check_version('2', exception: false) + headline_name = 'part' + elsif level == 1 + headline_name = 'part' + puts '\begin{reviewpart}' + end end prefix = '' if level > @book.config['secnolevel'] || (@chapter.number.to_s.empty? && level > 1) diff --git a/templates/latex/review-jlreq/review-base.sty b/templates/latex/review-jlreq/review-base.sty index e5a04f104..b15865a5a 100644 --- a/templates/latex/review-jlreq/review-base.sty +++ b/templates/latex/review-jlreq/review-base.sty @@ -106,6 +106,10 @@ \renewcommand{\contentsname}{\review@toctitle} +\newenvironment{reviewpart}{% +\renewcommand{\thesection}{\thepart.\@arabic\c@section}% +}{} + % 囲み記事 \newenvironment{reviewnote}[1][]{% \begin{tcolorbox}[skin=enhanced jigsaw,breakable,empty,coltitle=black,title={\sffamily\bfseries NOTE #1},borderline horizontal={0.5mm}{0pt}{black!50}, left=1mm, right=1mm, left skip=6mm]} diff --git a/templates/latex/review-jsbook/review-base.sty b/templates/latex/review-jsbook/review-base.sty index 3dba1c55a..e26caf63a 100644 --- a/templates/latex/review-jsbook/review-base.sty +++ b/templates/latex/review-jsbook/review-base.sty @@ -197,6 +197,10 @@ \newcommand{\reviewcolumnref}[2]{\review@intn@columnname #1} \newcommand{\reviewsecref}[2]{#1} +\newenvironment{reviewpart}{% +\renewcommand{\thesection}{\thepart.\@arabic\c@section}% +}{} + \newcommand{\reviewminicolumntitle}[1]{% \review@ifempty{#1}{}{% {\large \review@intn@memohead{}: #1}\\}}