review-retrovert 0.9.11 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +1 -1
- data/Rakefile +15 -0
- data/lib/review/retrovert/cli.rb +6 -0
- data/lib/review/retrovert/converter.rb +38 -0
- data/lib/review/retrovert/version.rb +1 -1
- data/lib/review/retrovert/yamlconfig.rb +38 -1
- metadata +49 -146
- data/.dockerignore +0 -9
- data/.editorconfig +0 -16
- data/.gitattributes +0 -5
- data/.github/FUNDING.yml +0 -4
- data/.github/workflows/docker-build.yml +0 -26
- data/.github/workflows/release.yml +0 -26
- data/.github/workflows/retrovert.yml +0 -91
- data/.gitignore +0 -15
- data/.rspec +0 -3
- data/.ruby-version +0 -1
- data/.vscode/launch.json +0 -48
- data/Dockerfile +0 -5
- data/Gemfile +0 -8
- data/Gemfile.lock +0 -118
- data/Makefile +0 -31
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/docker/review.Dockerfile +0 -10
- data/hooks/post_push +0 -8
- data/package-lock.json +0 -6
- data/package.json +0 -1
- data/review-retrovert.code-workspace +0 -8
- data/review-retrovert.gemspec +0 -37
- data/testdata/mybook/.gitignore +0 -13
- data/testdata/mybook/.textlintrc +0 -11
- data/testdata/mybook/README.md +0 -43
- data/testdata/mybook/Rakefile +0 -24
- data/testdata/mybook/catalog.yml +0 -60
- data/testdata/mybook/config-noretrovert.yml +0 -404
- data/testdata/mybook/config-retrovert.yml +0 -16
- data/testdata/mybook/config-starter.yml +0 -264
- data/testdata/mybook/config.yml +0 -404
- data/testdata/mybook/contents/00-preface.re +0 -129
- data/testdata/mybook/contents/01-install.re +0 -305
- data/testdata/mybook/contents/02-tutorial.re +0 -1228
- data/testdata/mybook/contents/03-syntax.re +0 -4610
- data/testdata/mybook/contents/04-customize.re +0 -1064
- data/testdata/mybook/contents/05-faq.re +0 -606
- data/testdata/mybook/contents/06-bestpractice.re +0 -1343
- data/testdata/mybook/contents/91-compare.re +0 -418
- data/testdata/mybook/contents/92-filelist.re +0 -125
- data/testdata/mybook/contents/93-background.re +0 -267
- data/testdata/mybook/contents/99-postface.re +0 -39
- data/testdata/mybook/contents/r0-inner.re +0 -2
- data/testdata/mybook/contents/r0-root.re +0 -49
- data/testdata/mybook/contents/table.csv +0 -4
- data/testdata/mybook/contents/test.txt +0 -1
- data/testdata/mybook/contents/ut.re +0 -5
- data/testdata/mybook/css/normalize.css +0 -349
- data/testdata/mybook/css/webstyle.css +0 -692
- data/testdata/mybook/data/terms.txt +0 -3
- data/testdata/mybook/data/words.txt +0 -15
- data/testdata/mybook/images/03-syntax/favicon-16x16.png +0 -0
- data/testdata/mybook/images/03-syntax/figure_heretop.png +0 -0
- data/testdata/mybook/images/03-syntax/index-page.png +0 -0
- data/testdata/mybook/images/03-syntax/order-detail.png +0 -0
- data/testdata/mybook/images/03-syntax/tw-icon1.jpg +0 -0
- data/testdata/mybook/images/03-syntax/tw-icon2.jpg +0 -0
- data/testdata/mybook/images/03-syntax/tw-icon3.jpg +0 -0
- data/testdata/mybook/images/03-syntax/tw-icon4.jpg +0 -0
- data/testdata/mybook/images/04-customize/caption_pagebreak.png +0 -0
- data/testdata/mybook/images/04-customize/chaptitlepage_sample.png +0 -0
- data/testdata/mybook/images/04-customize/section_decoration_samples.png +0 -0
- data/testdata/mybook/images/05-faq/codeblock_rpadding1.png +0 -0
- data/testdata/mybook/images/05-faq/codeblock_rpadding2.png +0 -0
- data/testdata/mybook/images/05-faq/dummy-image.png +0 -0
- data/testdata/mybook/images/06-bestpractice/figure_heretop.png +0 -0
- data/testdata/mybook/images/06-bestpractice/font_beramono.png +0 -0
- data/testdata/mybook/images/06-bestpractice/heading_design1.png +0 -0
- data/testdata/mybook/images/06-bestpractice/heading_design2.png +0 -0
- data/testdata/mybook/images/06-bestpractice/margin_book.png +0 -0
- data/testdata/mybook/images/06-bestpractice/multiline-title.png +0 -0
- data/testdata/mybook/images/06-bestpractice/preface_numbered.png +0 -0
- data/testdata/mybook/images/06-bestpractice/program_border.png +0 -0
- data/testdata/mybook/images/06-bestpractice/sechead_design_4.png +0 -0
- data/testdata/mybook/images/06-bestpractice/section_title_wlines.png +0 -0
- data/testdata/mybook/images/06-bestpractice/titlepage-samples.png +0 -0
- data/testdata/mybook/images/93-background/bug913.png +0 -0
- data/testdata/mybook/images/93-background/slide2.png +0 -0
- data/testdata/mybook/images/avatar-b.png +0 -0
- data/testdata/mybook/images/avatar-g.png +0 -0
- data/testdata/mybook/images/avatar-r.png +0 -0
- data/testdata/mybook/images/caution-icon.png +0 -0
- data/testdata/mybook/images/cover_a5.pdf +0 -0
- data/testdata/mybook/images/cover_b5.pdf +0 -0
- data/testdata/mybook/images/info-icon.png +0 -0
- data/testdata/mybook/images/tw-icon.jpg +0 -0
- data/testdata/mybook/images/warning-icon.png +0 -0
- data/testdata/mybook/layouts/layout.epub.erb +0 -29
- data/testdata/mybook/layouts/layout.html5.erb +0 -108
- data/testdata/mybook/layouts/layout.tex.erb +0 -432
- data/testdata/mybook/layouts/layout.tex.erb.orig +0 -386
- data/testdata/mybook/lib/hooks/beforetexcompile.rb +0 -55
- data/testdata/mybook/lib/ruby/review-book.rb +0 -64
- data/testdata/mybook/lib/ruby/review-builder.rb +0 -1342
- data/testdata/mybook/lib/ruby/review-cli.rb +0 -58
- data/testdata/mybook/lib/ruby/review-compiler.rb +0 -1176
- data/testdata/mybook/lib/ruby/review-epubbuilder.rb +0 -33
- data/testdata/mybook/lib/ruby/review-epubmaker.rb +0 -609
- data/testdata/mybook/lib/ruby/review-htmlbuilder.rb +0 -949
- data/testdata/mybook/lib/ruby/review-latexbuilder.rb +0 -1065
- data/testdata/mybook/lib/ruby/review-maker.rb +0 -346
- data/testdata/mybook/lib/ruby/review-markdownbuilder.rb +0 -945
- data/testdata/mybook/lib/ruby/review-markdownmaker.rb +0 -91
- data/testdata/mybook/lib/ruby/review-monkeypatch.rb +0 -93
- data/testdata/mybook/lib/ruby/review-pdfmaker.rb +0 -546
- data/testdata/mybook/lib/ruby/review-textbuilder.rb +0 -36
- data/testdata/mybook/lib/ruby/review-tocparser.rb +0 -285
- data/testdata/mybook/lib/ruby/review-webmaker.rb +0 -448
- data/testdata/mybook/lib/tasks/mytasks.rake +0 -31
- data/testdata/mybook/lib/tasks/review.rake +0 -156
- data/testdata/mybook/lib/tasks/review.rake.orig +0 -72
- data/testdata/mybook/lib/tasks/starter.rake +0 -470
- data/testdata/mybook/locale.yml +0 -6
- data/testdata/mybook/review-ext.rb +0 -206
- data/testdata/mybook/sty/indexstyle.ist +0 -25
- data/testdata/mybook/sty/jumoline.sty +0 -310
- data/testdata/mybook/sty/mycolophon.sty +0 -81
- data/testdata/mybook/sty/mystyle.sty +0 -8
- data/testdata/mybook/sty/mytextsize.sty +0 -94
- data/testdata/mybook/sty/mytitlepage.sty +0 -126
- data/testdata/mybook/sty/review-base.sty +0 -276
- data/testdata/mybook/sty/reviewmacro.sty +0 -60
- data/testdata/mybook/sty/starter-codeblock.sty +0 -463
- data/testdata/mybook/sty/starter-color.sty +0 -134
- data/testdata/mybook/sty/starter-font.sty +0 -112
- data/testdata/mybook/sty/starter-heading.sty +0 -561
- data/testdata/mybook/sty/starter-misc.sty +0 -894
- data/testdata/mybook/sty/starter-note.sty +0 -180
- data/testdata/mybook/sty/starter-section.sty +0 -262
- data/testdata/mybook/sty/starter-talklist.sty +0 -105
- data/testdata/mybook/sty/starter-toc.sty +0 -72
- data/testdata/mybook/sty/starter-util.sty +0 -39
- data/testdata/mybook/sty/starter.sty +0 -36
- data/testdata/mybook/sty/ut.sty +0 -26
- data/testdata/mybook/style.css +0 -597
- data/testdata/mybook/ut-catalog.yml +0 -61
- data/testdata/mybook/ut-config-starter.yml +0 -3
- data/testdata/mybook/ut-config.yml +0 -404
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
use_html5 = @config['htmlversion'].to_i == 5
|
|
3
|
-
%><?xml version="1.0" encoding="UTF-8"?>
|
|
4
|
-
<% if use_html5 %>
|
|
5
|
-
<!DOCTYPE html>
|
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:ops="http://www.idpf.org/2007/ops" xml:lang="<%= @language %>">
|
|
7
|
-
<% else %>
|
|
8
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
|
9
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ops="http://www.idpf.org/2007/ops" xml:lang="<%= @language %>">
|
|
10
|
-
<% end %>
|
|
11
|
-
<head>
|
|
12
|
-
<% if use_html5 %>
|
|
13
|
-
<meta charset="UTF-8" />
|
|
14
|
-
<% else %>
|
|
15
|
-
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
|
16
|
-
<meta http-equiv="Content-Style-Type" content="text/css"/>
|
|
17
|
-
<% end %>
|
|
18
|
-
<% if @stylesheets.present? %>
|
|
19
|
-
<% @stylesheets.each do |style| %>
|
|
20
|
-
<link rel="stylesheet" type="text/css" href="<%= style %>" />
|
|
21
|
-
<% end %>
|
|
22
|
-
<% end%>
|
|
23
|
-
<meta name="generator" content="Re:VIEW" />
|
|
24
|
-
<title><%= @title %></title>
|
|
25
|
-
</head>
|
|
26
|
-
<body<%= @body_ext %>>
|
|
27
|
-
<%= @body %>
|
|
28
|
-
</body>
|
|
29
|
-
</html>
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
<% # -*- coding: utf-8 -*-
|
|
2
|
-
|
|
3
|
-
prev_page = @prev ? "#{@prev.id}.#{@book.config['htmlext']}" : nil
|
|
4
|
-
next_page = @next ? "#{@next.id}.#{@book.config['htmlext']}" : nil
|
|
5
|
-
|
|
6
|
-
rebuild_js = ENV['STARTER_REBUILD_JS']
|
|
7
|
-
|
|
8
|
-
body_ext = @body_ext || (@error ? ' class="has-compile-error"' : nil)
|
|
9
|
-
|
|
10
|
-
%>
|
|
11
|
-
<!doctype html>
|
|
12
|
-
<html lang="<%=h @language %>">
|
|
13
|
-
<head>
|
|
14
|
-
<meta charset="utf-8">
|
|
15
|
-
<meta name="viewport" content="width=device-width">
|
|
16
|
-
<title><%=h @title %> | <%=h @book.config.name_of("booktitle")%></title>
|
|
17
|
-
<% @stylesheets.each do |style| %>
|
|
18
|
-
<link rel="stylesheet" type="text/css" href="css/<%=h style %>" />
|
|
19
|
-
<% end if @stylesheets.present? %>
|
|
20
|
-
<% if next_page %>
|
|
21
|
-
<link rel="next" title="<%=h @next_title %>" href="<%=h next_page %>">
|
|
22
|
-
<% end %>
|
|
23
|
-
<% if prev_page %>
|
|
24
|
-
<link rel="prev" title="<%=h @prev_title %>" href="<%=h prev_page %>">
|
|
25
|
-
<% end %>
|
|
26
|
-
<meta name="generator" content="Re:VIEW Starter">
|
|
27
|
-
</head>
|
|
28
|
-
<body<%= body_ext %>>
|
|
29
|
-
<div class="page-outer">
|
|
30
|
-
<% if @chapter || @error %>
|
|
31
|
-
<nav class="side-content">
|
|
32
|
-
<% if rebuild_js %>
|
|
33
|
-
<div class="rebuild">
|
|
34
|
-
<a href="javascript:void(0)" onclick="rebuildAndReloadForcedly()">Rebuild and Reload</a>
|
|
35
|
-
</div>
|
|
36
|
-
<% end %>
|
|
37
|
-
<a class="nav-title" href="index.html"><%=h @book.config.name_of("booktitle") %></a>
|
|
38
|
-
<%= @toc %>
|
|
39
|
-
</nav>
|
|
40
|
-
<% end %>
|
|
41
|
-
<div class="page-inner">
|
|
42
|
-
<header class="page-header">
|
|
43
|
-
</header>
|
|
44
|
-
<main class="page-main">
|
|
45
|
-
<% if @chapter %>
|
|
46
|
-
<%= @body %>
|
|
47
|
-
|
|
48
|
-
<% elsif @error %>
|
|
49
|
-
<h2>Error</h2>
|
|
50
|
-
<div class="compile-error-message">
|
|
51
|
-
<dl>
|
|
52
|
-
<dt>File:</dt>
|
|
53
|
-
<dd><%= @textfile ? h(@textfile) : ' ' %></dd>
|
|
54
|
-
<dt>Error:</dt>
|
|
55
|
-
<dd><%=h @error.message %>
|
|
56
|
-
<i>(<%=h @error.class.name %>)</i>
|
|
57
|
-
</dd>
|
|
58
|
-
</dl>
|
|
59
|
-
</div>
|
|
60
|
-
<p>Traceback:</p>
|
|
61
|
-
<pre class="compile-error-backtrace"><% @error.backtrace.each do |x| %><%=h x %><%= "\n" %><% end %></pre>
|
|
62
|
-
|
|
63
|
-
<% elsif @toc %>
|
|
64
|
-
<h1><%=h @book.config.name_of("booktitle") %></h1>
|
|
65
|
-
<%= @toc %>
|
|
66
|
-
<% else %>
|
|
67
|
-
<%= @body %>
|
|
68
|
-
<% end %>
|
|
69
|
-
</main>
|
|
70
|
-
<nav class="page-navi">
|
|
71
|
-
<% if prev_page %>
|
|
72
|
-
<a href="<%=h prev_page %>" class="page-prev">◀</a>
|
|
73
|
-
<% end %>
|
|
74
|
-
<% if next_page %>
|
|
75
|
-
<a href="<%=h next_page %>" class="page-next">▶</a>
|
|
76
|
-
<% end %>
|
|
77
|
-
</nav>
|
|
78
|
-
<footer>
|
|
79
|
-
<% if @book.config["copyright"].present? %>
|
|
80
|
-
<p class="copyright"><%=h @config["copyright"] %></p>
|
|
81
|
-
<% end %>
|
|
82
|
-
</footer>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
<% @javascripts.each do |script| %>
|
|
86
|
-
<script src="<%=h script %>"></script>
|
|
87
|
-
<% end if @javascripts.present? %>
|
|
88
|
-
<% ##### %>
|
|
89
|
-
<% if rebuild_js %>
|
|
90
|
-
<script>
|
|
91
|
-
function rebuildAndReloadForcedly() {
|
|
92
|
-
fetch('<%= rebuild_js %>').then((resp)=>{
|
|
93
|
-
resp.text().then((text)=>{ eval(text); });
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
</script>
|
|
97
|
-
<% #textfile = @textfile || @chapter.name #=> NoMethodError (why?) %>
|
|
98
|
-
<% textfile = @textfile || @chapter.instance_eval { @name } %>
|
|
99
|
-
<% if textfile && !textfile.empty? %>
|
|
100
|
-
<script src="<%=h rebuild_js %>?file=<%= textfile %>"></script>
|
|
101
|
-
<% else %>
|
|
102
|
-
<!--script src="<%=h rebuild_js %>?file=<%= textfile %>"></script-->
|
|
103
|
-
<% end %>
|
|
104
|
-
<% end %>
|
|
105
|
-
<% ##### %>
|
|
106
|
-
</body>
|
|
107
|
-
</html>
|
|
108
|
-
<!-- layout.html5.erb -->
|
|
@@ -1,432 +0,0 @@
|
|
|
1
|
-
<% # -*- coding: utf-8 -*-
|
|
2
|
-
|
|
3
|
-
## based on Re:VIEW 2.5
|
|
4
|
-
|
|
5
|
-
def xelatex?()
|
|
6
|
-
@texcompiler == 'xelatex'
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
## I18n用文字列
|
|
10
|
-
i18n = proc {|key, *args| escape_latex(I18n.t(key, *args)) }
|
|
11
|
-
i18n_t = proc {|key, *args| I18n.t(key, *args) }
|
|
12
|
-
|
|
13
|
-
## dviコマンド
|
|
14
|
-
case @dvicommand
|
|
15
|
-
when 'dvipdfmx'
|
|
16
|
-
dvipdfmx = 'dvipdfmx'
|
|
17
|
-
when nil, ''
|
|
18
|
-
dvipdfmx = ''
|
|
19
|
-
else
|
|
20
|
-
dvipdfmx = 'dvipdfmx'
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
pagesize = @config['starter']['pagesize'] # A5 or B5
|
|
24
|
-
fontsize = @config['starter']['fontsize'] # 9pt or 10pt
|
|
25
|
-
docopts = [@documentclassoption]
|
|
26
|
-
docopts << "#{pagesize.downcase}paper" # a5paper or b5paper
|
|
27
|
-
docopts << fontsize # 9pt or 10pt
|
|
28
|
-
|
|
29
|
-
%>
|
|
30
|
-
\documentclass[<%= docopts.join(',') %>]{<%= @documentclass %>}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
%% copy values from 'config-starter.yml'
|
|
34
|
-
<%-
|
|
35
|
-
def to_val(v)
|
|
36
|
-
case v
|
|
37
|
-
when nil ; ''
|
|
38
|
-
when true ; 'Y'
|
|
39
|
-
when false ; ''
|
|
40
|
-
when Numeric ; v.to_s
|
|
41
|
-
when /\A(\d+(?:\.\d+)?)(mm|cm|pt)\z/ ; "#{$1}true#{$2}"
|
|
42
|
-
when /\A(\d+(?:\.\d+)?)(zw|zh)\z/ ; xelatex?() ? "#{$1}\\#{$2}" : v
|
|
43
|
-
else ; escape(v.to_s)
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
-%>
|
|
47
|
-
\makeatletter
|
|
48
|
-
<%-
|
|
49
|
-
length_keys = ['caption_needspace', 'program_widen', 'terminal_widen', 'output_widen']
|
|
50
|
-
@config['starter'].each do |k, v|
|
|
51
|
-
x = k.gsub('_', '@')
|
|
52
|
-
if k =~ /_default_options\z/
|
|
53
|
-
x = $`.gsub('_', '@')
|
|
54
|
-
dict = v
|
|
55
|
-
dict.each do |k_, v_|
|
|
56
|
-
-%>
|
|
57
|
-
\def\starter@<%= x %>@<%= k_.gsub('_', '@') %>{<%= to_val(v_) %>}
|
|
58
|
-
<%-
|
|
59
|
-
end
|
|
60
|
-
elsif v.is_a?(Hash) || v.is_a?(Array)
|
|
61
|
-
next
|
|
62
|
-
elsif length_keys.include?(k)
|
|
63
|
-
#v = v.sub(/\b(z[wh])$/, '\\zw')
|
|
64
|
-
-%>
|
|
65
|
-
%\def\<%= x %>{<%= v %>}
|
|
66
|
-
\newlength{\starter@<%= x %>}
|
|
67
|
-
\setlength{\starter@<%= x %>}{<%= to_val(v) %>}
|
|
68
|
-
<%-
|
|
69
|
-
else
|
|
70
|
-
-%>
|
|
71
|
-
\def\starter@<%= x %>{<%= to_val(v) %>}
|
|
72
|
-
<%-
|
|
73
|
-
end#if
|
|
74
|
-
end#each
|
|
75
|
-
-%>
|
|
76
|
-
\makeatother
|
|
77
|
-
|
|
78
|
-
%% environment values for Starter
|
|
79
|
-
\makeatletter
|
|
80
|
-
<%-
|
|
81
|
-
ENV.each do |k, v|
|
|
82
|
-
if k =~ /^STARTER_\w+$/
|
|
83
|
-
-%>
|
|
84
|
-
\def\<%= k.gsub('_', '@') %>{<%= v %>}%
|
|
85
|
-
<%-
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
##
|
|
89
|
-
target = ENV['STARTER_TARGET']
|
|
90
|
-
if target && !target.strip.empty?
|
|
91
|
-
-%>
|
|
92
|
-
\def\starter@target{<%= target.strip %>} % $STARTER_TARGET=<%- target -%>
|
|
93
|
-
<%-
|
|
94
|
-
end
|
|
95
|
-
##
|
|
96
|
-
case ENV['STARTER_EXCLUDE_MOUSESELECT']
|
|
97
|
-
when 'on'
|
|
98
|
-
-%>
|
|
99
|
-
\def\starter@exclude@mouseselect{Y} % $STARTER_EXCLUDE_MOUSESELECT=on
|
|
100
|
-
<%-
|
|
101
|
-
when 'off'
|
|
102
|
-
-%>
|
|
103
|
-
\def\starter@exclude@mouseselect{} % $STARTER_EXCLUDE_MOUSESELECT=off
|
|
104
|
-
<%-
|
|
105
|
-
end
|
|
106
|
-
-%>
|
|
107
|
-
\makeatother
|
|
108
|
-
|
|
109
|
-
\usepackage{mytextsize} % 本文の幅と高さを設定
|
|
110
|
-
|
|
111
|
-
<%- if @texcompiler == "uplatex" -%>
|
|
112
|
-
\usepackage[deluxe,uplatex]{otf}
|
|
113
|
-
<%- elsif @texcompiler == "xelatex" -%>
|
|
114
|
-
%\usepackage[deluxe]{otf}
|
|
115
|
-
<%- else -%>
|
|
116
|
-
\usepackage[deluxe]{otf}
|
|
117
|
-
<%- end -%>
|
|
118
|
-
|
|
119
|
-
<%- case ENV['STARTER_DRAFT'] -%>
|
|
120
|
-
<%- when nil, '', 'off', 'false' -%>
|
|
121
|
-
\usepackage{graphicx}
|
|
122
|
-
<%- else -%>
|
|
123
|
-
\usepackage[draft]{graphicx}
|
|
124
|
-
<%- end -%>
|
|
125
|
-
\usepackage[table]{xcolor}%requires colortbl, array
|
|
126
|
-
|
|
127
|
-
\usepackage[bookmarks=true,bookmarksnumbered=true,colorlinks=true,%
|
|
128
|
-
pdftitle={<%= escape_latex(@config.name_of("booktitle")) %>},%
|
|
129
|
-
pdfauthor={<%= escape_latex(@config.names_of("aut").join(i18n_t.('names_splitter'))) %>}]{hyperref}
|
|
130
|
-
<%- p = xelatex?() ? '%' : '' -%>
|
|
131
|
-
<%= p %>\usepackage{pxjahyper} % Bookmarkの文字化け対策(日本語向け)
|
|
132
|
-
|
|
133
|
-
<%- p = ["utbook", "tbook"].include?(@documentclass) ? '' : '%' -%>
|
|
134
|
-
<%= p %>\usepackage{plext} % 縦書き用のパッケージ
|
|
135
|
-
|
|
136
|
-
%% コードハイライト用の設定情報
|
|
137
|
-
\makeatletter
|
|
138
|
-
<%- yes = @config["highlight"] && @config["highlight"]["latex"] == "listings" -%>
|
|
139
|
-
\def\config@highlight@listings{<%= yes ? 'Y' : '' %>}
|
|
140
|
-
<%- yes = @config["language"] == "ja" -%>
|
|
141
|
-
\def\config@language@ja{<%= yes ? 'Y' : '' %>}
|
|
142
|
-
\def\review@t@list{<%= i18n.('list') %>}
|
|
143
|
-
\makeatother
|
|
144
|
-
|
|
145
|
-
%% Re:VIEW用のスタイルファイル
|
|
146
|
-
\usepackage{review-base}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
%% I18N辞書のデータ
|
|
150
|
-
\newcommand{\reviewcolumnhead}[2]{%
|
|
151
|
-
{\noindent\large <%= i18n.('column_head') %>: #2}}
|
|
152
|
-
|
|
153
|
-
\newcommand{\reviewimageref}[2]{<%= i18n.('image') %> #1}
|
|
154
|
-
\newcommand{\reviewtableref}[2]{<%= i18n.('table') %> #1}
|
|
155
|
-
\newcommand{\reviewlistref}[1]{<%= i18n.('list') %> #1}
|
|
156
|
-
\newcommand{\reviewbibref}[2]{#1}
|
|
157
|
-
\newcommand{\reviewcolumnref}[2]{<%= i18n.('columnname') %> #1}
|
|
158
|
-
\newcommand{\reviewsecref}[2]{#1}
|
|
159
|
-
|
|
160
|
-
\newcommand{\reviewminicolumntitle}[1]{%
|
|
161
|
-
{\large <%= i18n.('memo_head') %>: #1}\\}
|
|
162
|
-
|
|
163
|
-
<%- if @config["toctitle"].present? -%>
|
|
164
|
-
\renewcommand{\contentsname}{<%= escape_latex(@config["toctitle"]) %>}
|
|
165
|
-
<%- elsif i18n_t.('toctitle') -%>
|
|
166
|
-
\renewcommand{\contentsname}{<%= i18n.('toctitle') %>}
|
|
167
|
-
<%- end -%>
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
%% ロケールに関する文字列
|
|
171
|
-
<%-
|
|
172
|
-
locale = proc {|key| escape_latex(@locale_latex[key]) }
|
|
173
|
-
-%>
|
|
174
|
-
\newcommand{\reviewprepartname}{<%= locale.('prepartname') %>}
|
|
175
|
-
\newcommand{\reviewpostpartname}{<%= locale.('postpartname') %>}
|
|
176
|
-
\newcommand{\reviewprechaptername}{<%= locale.('prechaptername') %>}
|
|
177
|
-
\newcommand{\reviewpostchaptername}{<%= locale.('postchaptername') %>}
|
|
178
|
-
\newcommand{\reviewfigurename}{<%= i18n.('image') %>}
|
|
179
|
-
\newcommand{\reviewtablename}{<%= i18n.('table') %>}
|
|
180
|
-
\newcommand{\reviewappendixname}{<%= locale.('preappendixname') %>}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
\makeatletter
|
|
184
|
-
|
|
185
|
-
%% true between '\appendix' and ''
|
|
186
|
-
\newif\if@appendix % true なら付録を処理中である
|
|
187
|
-
\@appendixfalse
|
|
188
|
-
|
|
189
|
-
\makeatother
|
|
190
|
-
|
|
191
|
-
<%- [@config["texstyle"]].flatten.compact.each do |x| -%>
|
|
192
|
-
\usepackage{<%= x %>}
|
|
193
|
-
<%- end -%>
|
|
194
|
-
|
|
195
|
-
<%- if @config["makeindex"] -%>
|
|
196
|
-
\usepackage{makeidx}
|
|
197
|
-
\makeindex
|
|
198
|
-
<%- end -%>
|
|
199
|
-
|
|
200
|
-
<%- if @config['secnolevel'] -%>
|
|
201
|
-
\setcounter{secnumdepth}{<%= @config['secnolevel'] - 1 %>}
|
|
202
|
-
<%- end -%>
|
|
203
|
-
|
|
204
|
-
<%- if (n = @config['starter']['part_startnumber']) -%>
|
|
205
|
-
\setcounter{part}{<%= n - 1 %>}
|
|
206
|
-
<%- end -%>
|
|
207
|
-
<%- if (n = @config['starter']['chapter_startnumber']) -%>
|
|
208
|
-
\setcounter{chapter}{<%= n - 1 %>}
|
|
209
|
-
<%- end -%>
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
\begin{document}
|
|
213
|
-
|
|
214
|
-
\reviewmainfont
|
|
215
|
-
|
|
216
|
-
<%-
|
|
217
|
-
## PDFファイルを読み込む
|
|
218
|
-
include_pdffiles = proc do |pdf_files, except: nil, incrpagenum: false|
|
|
219
|
-
next if ENV['STARTER_CHAPTER'].present?
|
|
220
|
-
target = ENV['STARTER_TARGET'].to_s.strip
|
|
221
|
-
target = (@config['starter'] || {})['target'] if target.empty?
|
|
222
|
-
p = except && except == target ? '%' : ''
|
|
223
|
-
imagedir = @config['imagedir']
|
|
224
|
-
pdf_option = @config['starter']['includepdf_option']
|
|
225
|
-
offset = pdf_option =~ /\Aoffset=(.*)/ ? $1 : nil
|
|
226
|
-
[pdf_files].flatten.compact.each do |pdf_file|
|
|
227
|
-
pdf_file = pdf_file.sub(/(?:<(.*?)>)?(\*)?\z/, '')
|
|
228
|
-
pagenum = $1; star = $2
|
|
229
|
-
pdf_filepath = "./#{imagedir}/#{pdf_file}"
|
|
230
|
-
-%>
|
|
231
|
-
\begingroup
|
|
232
|
-
<%= p %>\makeatletter\def\starter@includepdf@pagenum{<%= pagenum %>}\makeatother
|
|
233
|
-
<%= p %>\starterincludepdf<%= star %>[<%= offset %>]{<%= pdf_filepath %>}
|
|
234
|
-
\endgroup
|
|
235
|
-
<%- if ! incrpagenum -%>
|
|
236
|
-
<%= p %>\addtocounter{page}{-1}
|
|
237
|
-
<%-
|
|
238
|
-
end
|
|
239
|
-
end
|
|
240
|
-
end
|
|
241
|
-
|
|
242
|
-
## 表紙用PDFファイルを読み込む
|
|
243
|
-
include_pdffiles.(@config['starter']['frontcover_pdffile'], except: 'pbook')
|
|
244
|
-
-%>
|
|
245
|
-
%
|
|
246
|
-
|
|
247
|
-
<%-
|
|
248
|
-
## 表紙と奥付用の各種データ
|
|
249
|
-
maintitle = escape_latex(@config.name_of("booktitle").to_s)
|
|
250
|
-
maintitle = maintitle.gsub(/\n/) { "\\\\\n" } # '\n' -> '\\'
|
|
251
|
-
#
|
|
252
|
-
subtitle = escape_latex(@config.name_of("subtitle").to_s)
|
|
253
|
-
rexp = /([!?])$/
|
|
254
|
-
if subtitle =~ rexp
|
|
255
|
-
subtitle = subtitle.gsub(rexp) { "\\mbox{#{$1}}" }
|
|
256
|
-
elsif !subtitle.empty?
|
|
257
|
-
subtitle += " "
|
|
258
|
-
end
|
|
259
|
-
subtitle = subtitle.gsub(/\n/) { "\\\\\n" } # '\n' -> '\\'
|
|
260
|
-
#
|
|
261
|
-
pubevent = escape_latex(@config["pubevent_name"].to_s)
|
|
262
|
-
pubhistory = escape_latex(@config["pubhistory"].to_s)
|
|
263
|
-
pubdate = escape_latex(@config["date"].to_s)
|
|
264
|
-
pubedition = i18n.('edition')
|
|
265
|
-
publisher = @config.names_of("pbl").join(I18n.t("names_splitter"))
|
|
266
|
-
published_by = i18n.('published_by', publisher)
|
|
267
|
-
#
|
|
268
|
-
latest_pubhist = pubhistory.lines[-1]
|
|
269
|
-
if latest_pubhist
|
|
270
|
-
if latest_pubhist =~ /\s*(.*)\z/
|
|
271
|
-
latest_pubhist = $`
|
|
272
|
-
end
|
|
273
|
-
end
|
|
274
|
-
-%>
|
|
275
|
-
%%%
|
|
276
|
-
\makeatletter
|
|
277
|
-
\title{<%= maintitle %>}
|
|
278
|
-
\def\@maintitle{<%= maintitle %>}
|
|
279
|
-
\def\@subtitle{<%= subtitle %>}
|
|
280
|
-
\def\@pubevent{<%= pubevent %>}
|
|
281
|
-
\def\@latestpubhistory{<%= latest_pubhist %>}
|
|
282
|
-
\author{<%= @authors %>}
|
|
283
|
-
\date{<%= pubdate %> <%= pubedition %>\hspace{2zw}<%= published_by %>}
|
|
284
|
-
\def\book@author{<%= escape(@book_author||'') %>}
|
|
285
|
-
\def\book@supervisor{<%= escape(@book_supervisor||'') %>}
|
|
286
|
-
\def\book@translator{<%= escape(@book_translator||'') %>}
|
|
287
|
-
\makeatother
|
|
288
|
-
%%%
|
|
289
|
-
<%-
|
|
290
|
-
## 大扉(タイトルページ)を表示
|
|
291
|
-
if ! @config['titlepage']
|
|
292
|
-
# nothing
|
|
293
|
-
elsif @custom_titlepage
|
|
294
|
-
-%>
|
|
295
|
-
<%= @custom_titlepage %>
|
|
296
|
-
<%-
|
|
297
|
-
elsif @config['starter']['titlepage_pdffile'].present?
|
|
298
|
-
## 大扉用PDFファイルを読み込む
|
|
299
|
-
include_pdffiles.(@config['starter']['titlepage_pdffile'], incrpagenum: true)
|
|
300
|
-
else
|
|
301
|
-
-%>
|
|
302
|
-
\begin{titlepage}
|
|
303
|
-
<%- if @config["coverimage"] -%>
|
|
304
|
-
<%- image_filepath = "./#{@config['imagedir']}/#{@config['coverimage']}" -%>
|
|
305
|
-
\begin{center}
|
|
306
|
-
\includegraphics[<%= @coverimageoption %>]{<%= image_filepath %>}
|
|
307
|
-
\end{center}
|
|
308
|
-
\clearpage
|
|
309
|
-
<%- end -%>
|
|
310
|
-
\ifdefined\mytitlepage
|
|
311
|
-
\mytitlepage % defined in 'sty/mytitlepage.sty'
|
|
312
|
-
\else
|
|
313
|
-
\reviewtitlepage % defined in 'sty/review-base.sty'
|
|
314
|
-
\fi
|
|
315
|
-
\end{titlepage}
|
|
316
|
-
<%-
|
|
317
|
-
end#if
|
|
318
|
-
#
|
|
319
|
-
if @config['titlepage']
|
|
320
|
-
-%>
|
|
321
|
-
\ifdefined\mytitlenextpage
|
|
322
|
-
\mytitlenextpage % defined in 'sty/mytitlepage.sty'
|
|
323
|
-
\fi
|
|
324
|
-
<%-
|
|
325
|
-
end
|
|
326
|
-
-%>
|
|
327
|
-
|
|
328
|
-
%\renewcommand{\chaptermark}[1]{{}}
|
|
329
|
-
\frontmatter
|
|
330
|
-
|
|
331
|
-
%%% originaltitle
|
|
332
|
-
<%- if @config["originaltitlefile"] -%>
|
|
333
|
-
<%= @custom_originaltitlepage %>
|
|
334
|
-
<%- end -%>
|
|
335
|
-
|
|
336
|
-
%%% credit
|
|
337
|
-
<%- if @config["creditfile"] -%>
|
|
338
|
-
<%= @custom_creditpage %>
|
|
339
|
-
<%- end -%>
|
|
340
|
-
|
|
341
|
-
%% preface
|
|
342
|
-
<%= @input_files["PREDEF"] %>
|
|
343
|
-
|
|
344
|
-
<%- if @config["toc"] -%>
|
|
345
|
-
\setcounter{tocdepth}{<%= @config["toclevel"] - 1 %>}
|
|
346
|
-
\tableofcontents
|
|
347
|
-
<%- end -%>
|
|
348
|
-
|
|
349
|
-
%\renewcommand{\chaptermark}[1]{\markboth{\prechaptername\thechapter\postchaptername~#1}{}}
|
|
350
|
-
\mainmatter
|
|
351
|
-
<%= @input_files["CHAPS"] %>
|
|
352
|
-
%\renewcommand{\chaptermark}[1]{\markboth{\appendixname\thechapter~#1}{}}
|
|
353
|
-
\reviewappendix
|
|
354
|
-
\makeatletter\@appendixtrue\makeatother
|
|
355
|
-
<%= @input_files["APPENDIX"] %>
|
|
356
|
-
\makeatletter\@appendixfalse\makeatother
|
|
357
|
-
|
|
358
|
-
%% backmatter begins
|
|
359
|
-
<%- if @input_files["POSTDEF"].present? # or @config["colophon"] -%>
|
|
360
|
-
\backmatter
|
|
361
|
-
<%- end -%>
|
|
362
|
-
|
|
363
|
-
<%- if @input_files["POSTDEF"] -%>
|
|
364
|
-
<%= @input_files["POSTDEF"] %>
|
|
365
|
-
<%- end -%>
|
|
366
|
-
<%- if @config["pdfmaker"]["makeindex"] -%>
|
|
367
|
-
\printindex
|
|
368
|
-
<%- end -%>
|
|
369
|
-
|
|
370
|
-
%%% profile
|
|
371
|
-
<%- if @config["profile"] -%>
|
|
372
|
-
<%= @custom_profilepage %>
|
|
373
|
-
<%- end -%>
|
|
374
|
-
|
|
375
|
-
%%% advfile
|
|
376
|
-
<%- if @config["advfile"] -%>
|
|
377
|
-
<%= @custom_advfilepage %>
|
|
378
|
-
<%- end -%>
|
|
379
|
-
|
|
380
|
-
%%% colophon
|
|
381
|
-
<%- ## 奥付に必要なデータ -%>
|
|
382
|
-
\title{<%= escape_latex(@config.name_of("booktitle")) %>} % 2行にしない
|
|
383
|
-
\def\@subtitle{<%= escape_latex(@config.name_of("subtitle")) %>} % 2行にしない
|
|
384
|
-
\def\colophonpubhistory{%
|
|
385
|
-
<%= @config["pubhistory"].to_s.gsub(/\n/){ "\n\n\\noindent\n" } %>%
|
|
386
|
-
}
|
|
387
|
-
\def\colophonokuduke{%
|
|
388
|
-
<%= @okuduke %>%
|
|
389
|
-
}
|
|
390
|
-
\def\colophonrights{%
|
|
391
|
-
<%- @config.names_of("rights").each do |s| -%>
|
|
392
|
-
<%= escape_latex(s).sub(/^\(C\)/i, '{\textcopyright}') %>\\
|
|
393
|
-
<%- end if @config["rights"] -%>
|
|
394
|
-
}
|
|
395
|
-
<%-
|
|
396
|
-
## 奥付を表示
|
|
397
|
-
if ! @config['colophon']
|
|
398
|
-
# nothing
|
|
399
|
-
elsif @custom_colophonpage
|
|
400
|
-
-%>
|
|
401
|
-
<%= @custom_colophonpage %>
|
|
402
|
-
<%-
|
|
403
|
-
elsif @config['starter']['colophon_pdffile'].present?
|
|
404
|
-
## 奥付のPDFファイルを読み込む
|
|
405
|
-
-%>
|
|
406
|
-
\reviewcolophon % 偶数ページに移動
|
|
407
|
-
<%-
|
|
408
|
-
include_pdffiles.(@config['starter']['colophon_pdffile'], incrpagenum: true)
|
|
409
|
-
else
|
|
410
|
-
-%>
|
|
411
|
-
\ifdefined\mycolophon
|
|
412
|
-
\mycolophon % defined in 'sty/mycolophon.sty'
|
|
413
|
-
\else
|
|
414
|
-
\reviewcolophonpage % defined in 'sty/review-base.sty'
|
|
415
|
-
\fi
|
|
416
|
-
<%-
|
|
417
|
-
end#if
|
|
418
|
-
-%>
|
|
419
|
-
|
|
420
|
-
%%% backcover
|
|
421
|
-
<%-
|
|
422
|
-
if @config['backcover']
|
|
423
|
-
-%>
|
|
424
|
-
<%= @custom_backcoverpage %>
|
|
425
|
-
<%-
|
|
426
|
-
elsif @config['starter']['backcover_pdffile'].present?
|
|
427
|
-
## 裏表紙用PDFファイルを読み込む
|
|
428
|
-
include_pdffiles.(@config['starter']['backcover_pdffile'], except: 'pbook')
|
|
429
|
-
end
|
|
430
|
-
-%>
|
|
431
|
-
|
|
432
|
-
\end{document}
|