From 45d10e08aefcce684c5fb865ae59d72b835d2f92 Mon Sep 17 00:00:00 2001 From: takahashim Date: Fri, 29 Apr 2016 01:18:29 +0900 Subject: [PATCH] LATEXBuilder: add option @config["otf"] default is true --- lib/review/configure.rb | 1 + templates/latex/layout.tex.erb | 6 ++++-- test/test_pdfmaker.rb | 10 ++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/review/configure.rb b/lib/review/configure.rb index 2b3265377..c41f228d9 100644 --- a/lib/review/configure.rb +++ b/lib/review/configure.rb @@ -57,6 +57,7 @@ def self.values "bib_file" => "bib.re", "colophon_order" => %w(aut csl trl dsr ill cov edt pbl contact prt), "externallink" => true, + "otf" => true, # for LaTeX "tableopt" => nil, # for IDGXML "listinfo" => nil, # for IDGXML "nolf" => true, # for IDGXML diff --git a/templates/latex/layout.tex.erb b/templates/latex/layout.tex.erb index bf6516ea6..72c5b4f96 100644 --- a/templates/latex/layout.tex.erb +++ b/templates/latex/layout.tex.erb @@ -1,8 +1,10 @@ \documentclass[<%= @documentclassoption %>]{<%= @documentclass %>} -<%- if @texcompiler == "uplatex" -%> +<%- if @config["otf"] -%> +<%- if @texcompiler == "uplatex" -%> \usepackage[deluxe,uplatex]{otf} -<%- else -%> +<%- else -%> \usepackage[deluxe]{otf} +<%- end -%> <%- end -%> \usepackage[dvipdfmx]{color} \usepackage[dvipdfmx]{graphicx} diff --git a/test/test_pdfmaker.rb b/test/test_pdfmaker.rb index 8b0ccc57d..2aa554c87 100644 --- a/test/test_pdfmaker.rb +++ b/test/test_pdfmaker.rb @@ -172,6 +172,16 @@ def test_gettemplate_with_backmatter end end + def test_gettemplate_disable_otf + @config["otf"] = false + Dir.mktmpdir do |dir| + @maker.basedir = Dir.pwd + tmpl = @maker.get_template + matched = (tmpl =~ /usepackage[^{]+\{otf\}/) + assert_equal(nil, matched) + end + end + def test_colophon_history @config["aut"] = ["Mr.Smith"] @config["pbl"] = ["BLUEPRINT"]