Skip to content

Commit

Permalink
preserve default documentclass for review 2
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuto committed Oct 4, 2018
1 parent 562d3ad commit 430a91a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/review/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def self.values
'footnotetext' => nil,
'texcommand' => 'uplatex',
'texoptions' => '-interaction=nonstopmode -file-line-error',
'texdocumentclass' => ['review-jsbook', 'uplatex,twoside'],
'_texdocumentclass' => ['review-jsbook', 'uplatex,twoside'],
'dvicommand' => 'dvipdfmx',
'dvioptions' => '-d 5 -z 9',
# for PDFMaker
Expand Down
10 changes: 10 additions & 0 deletions lib/review/pdfmaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def execute(*args)
rescue => e
error "yaml error #{e.message}"
end

# YAML configs will be overridden by command line options.
@config.deep_merge!(cmd_config)
I18n.setup(@config['language'])
Expand All @@ -142,6 +143,15 @@ def execute(*args)
warn e.message
end

# version 2 compatibility
unless @config['texdocumentclass']
if @config.check_version(2, exception: false)
@config['texdocumentclass'] = ['jsbook', 'uplatex,oneside']
else
@config['texdocumentclass'] = @config['_texdocumentclass']
end
end

begin
generate_pdf(yamlfile)
rescue ApplicationError => e
Expand Down

1 comment on commit 430a91a

@munepi
Copy link
Contributor

@munepi munepi commented on 430a91a Oct 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kmuto さん、

jsbook.cls: �twosideオプションをデフォルトで実行します。

jsbook.cls にも review-jsbook.cls にも、twoside オプションを与える必要はないです。
(もちろん、 twosideオプションを与えていても問題ないです。)

review-jsbook.cls: ptex, uptex 組版エンジンを自動判別

review-jsbook.cls には、 uplatex (upto jsbook.cls) を与える必要ないです。
platex で実行したか、uplatex で実行したかを判別して、
upTeXだったら、jsbook.cls 側に内部で uplatex オプションを与えるようにしています。

Please sign in to comment.