Skip to content

Commit

Permalink
surround part by reviewpart, and modify thesection. Closes: #1195
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuto committed Nov 4, 2018
1 parent 204d836 commit e0fba91
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/review/latexbuilder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions templates/latex/review-jlreq/review-base.sty
Original file line number Diff line number Diff line change
Expand Up @@ -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]}
Expand Down
4 changes: 4 additions & 0 deletions templates/latex/review-jsbook/review-base.sty
Original file line number Diff line number Diff line change
Expand Up @@ -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}\\}}
Expand Down

0 comments on commit e0fba91

Please sign in to comment.