review 2.5.0 → 3.0.0.preview1

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.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +28 -10
  3. data/.travis.yml +11 -2
  4. data/NEWS.ja.md +89 -17
  5. data/NEWS.md +92 -0
  6. data/README.md +1 -1
  7. data/Rakefile +0 -13
  8. data/bin/review-catalog-converter +83 -37
  9. data/bin/review-check +17 -5
  10. data/bin/review-compile +1 -1
  11. data/bin/review-index +6 -0
  12. data/bin/review-init +3 -155
  13. data/bin/review-preproc +0 -5
  14. data/bin/review-validate +21 -7
  15. data/bin/review-vol +13 -5
  16. data/doc/config.yml.sample +12 -7
  17. data/doc/config.yml.sample-simple +1 -1
  18. data/doc/format.ja.md +39 -3
  19. data/doc/format.md +39 -3
  20. data/doc/format_idg.ja.md +0 -4
  21. data/doc/pdfmaker.ja.md +1 -1
  22. data/doc/pdfmaker.md +1 -1
  23. data/doc/sample.css +7 -0
  24. data/lib/epubmaker/content.rb +31 -12
  25. data/lib/epubmaker/epubcommon.rb +10 -3
  26. data/lib/epubmaker/epubv2.rb +11 -3
  27. data/lib/epubmaker/epubv3.rb +11 -3
  28. data/lib/epubmaker/producer.rb +55 -20
  29. data/lib/review/book/base.rb +63 -48
  30. data/lib/review/book/chapter.rb +19 -7
  31. data/lib/review/book/compilable.rb +5 -20
  32. data/lib/review/book/image_finder.rb +10 -3
  33. data/lib/review/book/index.rb +30 -9
  34. data/lib/review/book/part.rb +9 -6
  35. data/lib/review/book.rb +0 -14
  36. data/lib/review/builder.rb +110 -18
  37. data/lib/review/catalog.rb +24 -4
  38. data/lib/review/compiler.rb +3 -1
  39. data/lib/review/configure.rb +43 -9
  40. data/lib/review/epubmaker/reviewheaderlistener.rb +57 -0
  41. data/lib/review/epubmaker.rb +129 -85
  42. data/lib/review/htmlbuilder.rb +76 -58
  43. data/lib/review/htmlutils.rb +20 -13
  44. data/lib/review/i18n.rb +6 -2
  45. data/lib/review/idgxmlbuilder.rb +52 -41
  46. data/lib/review/init.rb +194 -0
  47. data/lib/review/latexbuilder.rb +118 -34
  48. data/lib/review/latexutils.rb +5 -5
  49. data/lib/review/logger.rb +2 -1
  50. data/lib/review/makerhelper.rb +1 -1
  51. data/lib/review/markdownbuilder.rb +66 -6
  52. data/lib/review/md2inaobuilder.rb +2 -2
  53. data/lib/review/pdfmaker.rb +74 -22
  54. data/lib/review/plaintextbuilder.rb +8 -4
  55. data/lib/review/preprocessor.rb +14 -17
  56. data/lib/review/sec_counter.rb +8 -2
  57. data/lib/review/textmaker.rb +2 -2
  58. data/lib/review/textutils.rb +9 -2
  59. data/lib/review/tocparser.rb +7 -4
  60. data/lib/review/tocprinter.rb +3 -1
  61. data/lib/review/version.rb +1 -1
  62. data/lib/review/webmaker.rb +19 -7
  63. data/lib/review/webtocprinter.rb +8 -4
  64. data/review.gemspec +4 -3
  65. data/templates/latex/config.erb +84 -0
  66. data/templates/latex/layout.tex.erb +76 -361
  67. data/templates/latex/review-jlreq/README.md +22 -0
  68. data/templates/latex/review-jlreq/review-base.sty +178 -0
  69. data/templates/latex/review-jlreq/review-custom.sty +1 -0
  70. data/templates/latex/review-jlreq/review-jlreq.cls +141 -0
  71. data/templates/latex/review-jlreq/review-style.sty +149 -0
  72. data/templates/latex/review-jlreq/reviewmacro.sty +8 -0
  73. data/templates/latex/review-jsbook/jumoline.sty +310 -0
  74. data/templates/latex/review-jsbook/plistings.sty +326 -0
  75. data/templates/latex/review-jsbook/review-base.sty +405 -0
  76. data/templates/latex/review-jsbook/review-custom.sty +1 -0
  77. data/templates/latex/review-jsbook/review-style.sty +38 -0
  78. data/templates/latex/review-jsbook/reviewmacro.sty +8 -0
  79. data/templates/latex-compat2/layout.tex.erb +387 -0
  80. data/test/assets/test_template.tex +105 -235
  81. data/test/assets/test_template_backmatter.tex +133 -14
  82. data/test/book_test_helper.rb +1 -1
  83. data/test/run_test.rb +2 -0
  84. data/test/sample-book/src/Rakefile +11 -6
  85. data/test/sample-book/src/config.yml +2 -2
  86. data/test/sample-book/src/sty/reviewmacro.sty +1 -39
  87. data/test/sample-book/src/style.css +6 -0
  88. data/test/syntax-book/config.yml +1 -1
  89. data/test/test_book.rb +13 -16
  90. data/test/test_book_chapter.rb +4 -10
  91. data/test/test_book_part.rb +4 -3
  92. data/test/test_catalog.rb +15 -4
  93. data/test/test_helper.rb +2 -2
  94. data/test/test_htmlbuilder.rb +78 -10
  95. data/test/test_htmlutils.rb +12 -5
  96. data/test/test_idgxmlbuilder.rb +1 -1
  97. data/test/test_latexbuilder.rb +94 -49
  98. data/test/test_latexbuilder_v2.rb +1077 -0
  99. data/test/test_logger.rb +20 -0
  100. data/test/test_markdownbuilder.rb +10 -0
  101. data/test/test_pdfmaker.rb +6 -7
  102. data/test/test_plaintextbuilder.rb +1 -1
  103. data/test/test_review_ext.rb +0 -1
  104. data/test/test_rstbuilder.rb +1 -1
  105. data/test/test_topbuilder.rb +19 -7
  106. data/test/test_webtocprinter.rb +14 -14
  107. data/{test/sample-book/src/vendor → vendor}/jumoline/README +0 -0
  108. data/{test/sample-book/src/vendor → vendor}/jumoline/jumoline.dtx +0 -0
  109. data/{test/sample-book/src/vendor → vendor}/jumoline/jumoline.ins +0 -0
  110. data/{test/sample-book/src/vendor → vendor}/jumoline/lppl.txt +0 -0
  111. data/vendor/plistings/.gitignore +9 -0
  112. data/vendor/plistings/LICENSE +21 -0
  113. data/vendor/plistings/README.md +18 -0
  114. data/vendor/plistings/plistings.sty +326 -0
  115. data/vendor/plistings/test1.tex +174 -0
  116. data/vendor/plistings/test2.tex +54 -0
  117. metadata +48 -19
  118. data/lib/review/unfold.rb +0 -129
  119. data/test/CHAPS +0 -2
  120. data/test/bib.re +0 -13
  121. data/test/test.re +0 -43
@@ -1,386 +1,101 @@
1
- \documentclass[dvipdfmx,<%= @documentclassoption %>]{<%= @documentclass %>}
2
- % %% fixes to LaTeX2e
3
- % \usepackage{fix-cm}[2006/09/13 v1.1m]
4
- % \usepackage{fixltx2e}[2006/09/13 v1.1m]
5
-
6
- <%- if @texcompiler == "uplatex" -%>
7
- \usepackage[deluxe,uplatex]{otf}
8
- <%- else -%>
9
- \usepackage[deluxe]{otf}
10
- <%- end -%>
11
- \usepackage{caption}
12
- \usepackage{suffix}
13
- \usepackage[T1]{fontenc}\usepackage{textcomp}%T1/TS1
14
- \usepackage{lmodern}
15
- \usepackage[dvipdfmx]{graphicx}
16
- \usepackage[dvipdfmx,table]{xcolor}%requires colortbl, array
17
- \usepackage{framed}
18
- \usepackage{wrapfig}
19
- \definecolor{shadecolor}{gray}{0.9}
20
- \definecolor{shadecolorb}{gray}{0.1}
21
- \definecolor{reviewgreen}{rgb}{0,0.4,0}
22
- \definecolor{reviewblue}{rgb}{0.2,0.2,0.4}
23
- \definecolor{reviewred}{rgb}{0.7,0,0}
24
- \definecolor{reviewdarkred}{rgb}{0.3,0,0}
25
- \usepackage[utf8]{inputenc}
26
- \usepackage{ascmac}
27
- \usepackage{float}
28
- \usepackage{alltt}
29
- \usepackage{amsmath}
30
-
31
- %% if you use @<u>{} (underline), use jumoline.sty
32
- \IfFileExists{jumoline.sty}{
33
- \usepackage{jumoline}
34
- }
35
-
36
- \newenvironment{shadedb}{%
37
- \def\FrameCommand{\fboxsep=\FrameSep \colorbox{shadecolorb}}%
38
- \MakeFramed {\FrameRestore}}%
39
- {\endMakeFramed}
40
-
41
- <%- unless ["utbook", "tbook"].include?(@documentclass) -%>
42
- \usepackage[top=10zw,bottom=12zw,left=10zw,right=10zw]{geometry}
43
- %\usepackage[top=5zw,bottom=5zw,left=1zw,right=1zw]{geometry}
44
- <%- end -%>
45
-
46
- \newcommand{\parasep}{\vspace*{3zh}}
47
- \setlength{\footskip}{30pt}
48
-
49
- %% Bookmarkの文字化け対策(日本語向け)
50
- \usepackage[dvipdfmx,bookmarks=true,bookmarksnumbered=true,colorlinks=true,%
51
- pdftitle={<%= escape_latex(@config.name_of("booktitle")) %>},%
52
- pdfauthor={<%= escape_latex(@config.names_of("aut").join(I18n.t("names_splitter"))) %>}]{hyperref}
53
- \usepackage[dvipdfmx]{pxjahyper}
54
-
55
- <%- if ["utbook", "tbook"].include?(@documentclass) -%>
56
- \newcommand{\headfont}{\gtfamily\sffamily\bfseries}
57
- \usepackage{plext}
58
- <%- end -%>
59
-
60
- <%- if config["highlight"] && config["highlight"]["latex"] == "listings" -%>
61
- <%- if config["language"] == "ja" -%>
62
- \usepackage{listings,jlisting}
63
- <%- else -%>
64
- \usepackage{listings}
65
- <%- end -%>
66
- \renewcommand{\lstlistingname}{<%= escape_latex(I18n.t("list")) %>}
67
- \lstset{%
68
- breaklines=true,%
69
- breakautoindent=false,%
70
- breakindent=0pt,%
71
- fontadjust=true,%
72
- backgroundcolor=\color{shadecolor},%
73
- frame=single,%
74
- framerule=0pt,%
75
- basicstyle=\ttfamily\scriptsize,%
76
- commentstyle=\color{reviewgreen},%
77
- identifierstyle=\color{reviewblue},%
78
- stringstyle=\color{reviewred},%
79
- keywordstyle=\bfseries\color{reviewdarkred},%
80
- }
81
-
82
- \lstnewenvironment{reviewemlistlst}[1][]{\lstset{#1}}{}
83
- \lstnewenvironment{reviewemlistnumlst}[1][]{\lstset{numbers=left, #1}}{}
84
- \lstnewenvironment{reviewlistlst}[1][]{\lstset{#1}}{}
85
- \lstnewenvironment{reviewlistnumlst}[1][]{\lstset{numbers=left, #1}}{}
86
- \lstnewenvironment{reviewsourcelst}[1][]{\lstset{#1}}{}
87
- \lstnewenvironment{reviewsourcenumlst}[1][]{\lstset{numbers=left, #1}}{}
88
- \lstnewenvironment{reviewcmdlst}[1][]{\lstset{backgroundcolor=\color{white}, frameround=tttt, frame=trbl, #1}}{}
89
- <%- end -%>
90
-
91
- \newenvironment{reviewimage}{%
92
- \begin{figure}[H]
93
- \begin{center}}{%
94
- \end{center}
95
- \end{figure}}
96
-
97
- \newenvironment{reviewdummyimage}{%
98
- \begin{figure}[H]
99
- \begin{center}\begin{alltt}}{%
100
- \end{alltt}\end{center}
101
- \end{figure}}
102
-
103
- \newenvironment{reviewemlist}{%
104
- \medskip\small\begin{shaded}\setlength{\baselineskip}{1.3zw}\begin{alltt}}{%
105
- \end{alltt}\end{shaded}}
106
-
107
- \newenvironment{reviewlist}{%
108
- \begin{shaded}\small\setlength{\baselineskip}{1.3zw}\begin{alltt}}{%
109
- \end{alltt}\end{shaded}\par\vspace*{0.5zw}}
110
-
111
- \newenvironment{reviewsource}{%
112
- \begin{shaded}\small\setlength{\baselineskip}{1.3zw}\begin{alltt}}{%
113
- \end{alltt}\end{shaded}\par\vspace*{0.5zw}}
114
-
115
- \newenvironment{reviewcmd}{%
116
- \color{white}\medskip\small\begin{shadedb}\setlength{\baselineskip}{1.3zw}\begin{alltt}}{%
117
- \end{alltt}\end{shadedb}}
118
-
119
- \newenvironment{reviewbox}{%
120
- \medskip\small\begin{framed}\setlength{\baselineskip}{1.3zw}\begin{alltt}}{%
121
- \end{alltt}\end{framed}}
122
-
123
- \newenvironment{reviewtable}[1]{%
124
- \begin{center}\small\setlength{\baselineskip}{1.2zw}
125
- \begin{tabular}{#1}}{%
126
- \end{tabular}
127
- \end{center}}
128
-
129
- \newenvironment{reviewcolumn}{%
130
- \begin{framed}
131
- }{%
132
- \end{framed}
133
- \vspace{2zw}}
134
-
135
- \newcommand{\reviewcolumnhead}[2]{%
136
- {\noindent\large <%= escape_latex(I18n.t("column_head"))%>: #2}}
137
-
138
- \newcommand{\reviewtablecaption}[1]{%
139
- \caption{#1}}
140
-
141
- \WithSuffix\newcommand\reviewtablecaption*[1]{%
142
- \caption*{#1}}
143
-
144
- \newcommand{\reviewimgtablecaption}[1]{%
145
- \caption{#1}\vspace{-3mm}}
146
-
147
- \newcommand{\reviewbackslash}[0]{%
148
- \textbackslash{}}
149
-
150
- \newcommand{\reviewlistcaption}[1]{%
151
- \medskip{\small\noindent #1}\vspace*{-1.3zw}}
152
-
153
- \newcommand{\reviewemlistcaption}[1]{%
154
- \medskip{\small\noindent #1}\vspace*{-1.3zw}}
155
-
156
- \newcommand{\reviewsourcecaption}[1]{%
157
- \medskip{\small\noindent #1}\vspace*{-1.3zw}}
158
-
159
- \newcommand{\reviewcmdcaption}[1]{%
160
- \medskip{\small\noindent #1}\vspace*{-1.3zw}}
161
-
162
- \newcommand{\reviewindepimagecaption}[1]{%
163
- \begin{center}#1\end{center}}
164
-
165
- \newcommand{\reviewboxcaption}[1]{%
166
- \medskip{\small\noindent #1}\vspace*{-1.3zw}}
167
-
168
- \newcommand{\reviewimageref}[2]{<%= escape_latex(I18n.t("image"))%> #1}
169
- \newcommand{\reviewtableref}[2]{<%= escape_latex(I18n.t("table"))%> #1}
170
- \newcommand{\reviewlistref}[1]{<%= escape_latex(I18n.t("list"))%> #1}
171
- \newcommand{\reviewbibref}[2]{#1}
172
- \newcommand{\reviewcolumnref}[2]{<%= escape_latex(I18n.t("columnname"))%> #1}
173
- \newcommand{\reviewsecref}[2]{#1}
174
-
175
- \newcommand{\reviewminicolumntitle}[1]{%
176
- {\large <%= escape_latex(I18n.t("memo_head"))%>: #1}\\}
177
-
178
- <%- if @config["toctitle"].present? -%>
179
- \renewcommand{\contentsname}{<%= escape_latex(@config["toctitle"]) %>}
180
- <%- elsif I18n.t("toctitle") -%>
181
- \renewcommand{\contentsname}{<%= escape_latex(I18n.t("toctitle")) %>}
182
- <%- end -%>
183
-
184
- \newenvironment{reviewminicolumn}{%
185
- \vspace{1.5zw}\begin{screen}}{%
186
- \end{screen}\vspace{2zw}}
187
-
188
- \newcommand{\reviewkw}[1]{\textbf{\textgt{#1}}}
189
- \newcommand{\reviewami}[1]{\mask{#1}{A}}
190
- \newcommand{\reviewem}[1]{\textbf{#1}}
191
- \newcommand{\reviewstrong}[1]{\textbf{#1}}
192
- \newcommand{\reviewunderline}{\Underline}
193
-
194
- %% @<del> is ignored in LaTeX with default style
195
- \newcommand{\reviewstrike}[1]{#1}
196
-
197
- %%%% for ulem.sty:
198
- %%\renewcommand{\reviewstrike}[1]{\sout{#1}}
199
- %%
200
- %%%% for jumoline.sty:
201
- %%\renewcommand{\reviewstrike}[1]{\Middleline{#1}}
202
-
203
- \newcommand{\reviewth}[1]{\textgt{#1}}
204
- \newcommand{\reviewtitlefont}[0]{\usefont{T1}{phv}{b}{n}\gtfamily}
205
- \newcommand{\reviewmainfont}[0]{}
206
- \newcommand{\reviewcolophon}[0]{\clearpage}
207
- \newcommand{\reviewappendix}[0]{\appendix}
208
-
209
- \newcommand{\reviewprepartname}{<%= escape_latex(@locale_latex["prepartname"]) %>}
210
- \newcommand{\reviewpostpartname}{<%= escape_latex(@locale_latex["postpartname"]) %>}
211
- \newcommand{\reviewprechaptername}{<%= escape_latex(@locale_latex["prechaptername"]) %>}
212
- \newcommand{\reviewpostchaptername}{<%= escape_latex(@locale_latex["postchaptername"]) %>}
213
- \newcommand{\reviewfigurename}{<%= escape_latex(I18n.t("image")) %>}
214
- \newcommand{\reviewtablename}{<%= escape_latex(I18n.t("table")) %>}
215
- \newcommand{\reviewappendixname}{<%= escape_latex(@locale_latex["preappendixname"]) %>}
216
-
217
- \ifdefined\prepartname
218
- \renewcommand{\prepartname}{\reviewprepartname}
219
- \fi
220
- \ifdefined\postpartname
221
- \renewcommand{\postpartname}{\reviewpostpartname}
222
- \fi
223
- \ifdefined\prechaptername
224
- \renewcommand{\prechaptername}{\reviewprechaptername}
225
- \fi
226
- \ifdefined\postchaptername
227
- \renewcommand{\postchaptername}{\reviewpostchaptername}
228
- \fi
229
- \ifdefined\figurename
230
- \renewcommand{\figurename}{\reviewfigurename}
231
- \fi
232
- \ifdefined\tablename
233
- \renewcommand{\tablename}{\reviewtablename}
234
- \fi
235
- \ifdefined\appendixname
236
- \renewcommand{\appendixname}{\reviewappendixname}
237
- \fi
238
-
239
-
240
- \makeatletter
241
- %% maxwidth is the original width if it is less than linewidth
242
- %% otherwise use linewidth (to make sure the graphics do not exceed the margin)
243
- \def\maxwidth{%
244
- \ifdim\Gin@nat@width>\linewidth
245
- \linewidth
246
- \else
247
- \Gin@nat@width
248
- \fi
249
- }
250
- \makeatother
251
-
252
- <%- if @config["texstyle"] -%>
253
- <%- [@config["texstyle"]].flatten.each do |x| -%>
1
+ \documentclass[<%= @documentclassoption %>]{<%= @documentclass %>}
2
+ <%= latex_config %>
3
+ <%- if @config['texstyle'] -%>
4
+ <%- [@config['texstyle']].flatten.each do |x| -%>
254
5
  \usepackage{<%= x %>}
255
6
  <%- end -%>
256
7
  <%- end -%>
257
- <%- if @config["makeindex"] -%>
258
- \usepackage{makeidx}
259
- \makeindex
260
- <%- end -%>
261
8
 
262
9
  \begin{document}
263
10
 
264
- \reviewmainfont
11
+ %% coverpage
12
+ \ifdefined\reviewcoverpagecont
13
+ \reviewcoverpagecont
14
+ \fi
265
15
 
266
- <%- if @config["titlepage"] -%>
267
- <%- if @custom_titlepage -%>
268
- <%= @custom_titlepage %>
269
- <%- else -%>
270
- \begin{titlepage}
271
- <%- if @config["coverimage"] -%>
272
- \begin{center}
273
- \includegraphics[<%= @coverimageoption%>]{./<%= @config["imagedir"] %>/<%= @config["coverimage"] %>}
274
- \end{center}
275
- \clearpage
276
- <%- end -%>
277
- \thispagestyle{empty}
278
- \begin{center}%
279
- \mbox{} \vskip5zw
280
- \reviewtitlefont%
281
- {\Huge <%= escape_latex(@config.name_of("booktitle")) %> \par}%
282
- <%- if @config["subtitle"] -%>
283
- \vskip 1em%
284
- {\Large <%= escape_latex(@config.name_of("subtitle")) %> \par}%
285
- <%- end -%>
286
- \vskip 15em%
287
- {\huge
288
- \lineskip .75em
289
- \begin{tabular}[t]{c}%
290
- <%= @authors %>
291
- \end{tabular}\par}%
292
- \vfill
293
- {\large <%= escape_latex(@config["date"].to_s) %> <%= escape_latex(I18n.t("edition")) %>\hspace{2zw}<%= escape_latex(I18n.t("published_by", @config.names_of("pbl").join(I18n.t("names_splitter"))))%>\par}%
294
- \vskip4zw\mbox{}
295
- \end{center}%
296
- \end{titlepage}
297
- <%- end -%>
298
- <%- end -%>
16
+ %% title page
17
+ \ifdefined\reviewtitlepagecont
18
+ \reviewtitlepagecont
19
+ \fi
299
20
 
300
- \renewcommand{\chaptermark}[1]{{}}
301
- \frontmatter
21
+ %% frontmatter hook
22
+ \ifdefined\reviewfrontmatterhook
23
+ \reviewfrontmatterhook
24
+ \fi
302
25
 
303
- %%% originaltitle
304
- <%- if @config["originaltitlefile"] -%>
305
- <%= @custom_originaltitlepage %>
306
- <%- end -%>
26
+ %% originaltitle
27
+ \ifdefined\revieworiginaltitlepagecont
28
+ \revieworiginaltitlepagecont
29
+ \fi
307
30
 
308
- %%% credit
309
- <%- if @config["creditfile"] -%>
310
- <%= @custom_creditpage %>
311
- <%- end -%>
31
+ %% credit
32
+ \ifdefined\reviewcreditfilecont
33
+ \reviewcreditfilecont
34
+ \fi
312
35
 
313
36
  %% preface
314
- <%= @input_files["PREDEF"] %>
37
+ \ifdefined\reviewprefacefiles
38
+ \reviewprefacefiles
39
+ \fi
315
40
 
316
- <%- if @config["toc"] -%>
317
- \setcounter{tocdepth}{<%= @config["toclevel"] - 1 %>}
318
- \tableofcontents
319
- <%- end -%>
41
+ %% toc
42
+ \ifdefined\reviewtableofcontents
43
+ \reviewtableofcontents
44
+ \fi
320
45
 
321
- \renewcommand{\chaptermark}[1]{\markboth{\prechaptername\thechapter\postchaptername~#1}{}}
322
- \mainmatter
323
- <%= @input_files["CHAPS"] %>
324
- \renewcommand{\chaptermark}[1]{\markboth{\appendixname\thechapter~#1}{}}
325
- \reviewappendix
326
- <%= @input_files["APPENDIX"] %>
46
+ %% mainmatter hook
47
+ \ifdefined\reviewmainmatterhook
48
+ \reviewmainmatterhook
49
+ \fi
327
50
 
328
- %% backmatter begins
329
- <%- if @input_files["POSTDEF"] or @config["colophon"] -%>
330
- \backmatter
331
- <%- end -%>
51
+ %% chapters body
52
+ \ifdefined\reviewchapterfiles
53
+ \reviewchapterfiles
54
+ \fi
332
55
 
333
- <%- if @input_files["POSTDEF"] -%>
334
- <%= @input_files["POSTDEF"] %>
335
- <%- end -%>
336
- <%- if @config["pdfmaker"]["makeindex"] -%>
337
- \printindex
338
- <%- end -%>
56
+ %% appendix hook
57
+ \ifdefined\reviewappendixhook
58
+ \reviewappendixhook
59
+ \fi
339
60
 
340
- %%% profile
341
- <%- if @config["profile"] -%>
342
- <%= @custom_profilepage %>
343
- <%- end -%>
61
+ %% appendix body
62
+ \ifdefined\reviewappendixfiles
63
+ \reviewappendixfiles
64
+ \fi
344
65
 
345
- %%% advfile
346
- <%- if @config["advfile"] -%>
347
- <%= @custom_advfilepage %>
348
- <%- end -%>
66
+ %% backmatter hook
67
+ \ifdefined\reviewbackmatterhook
68
+ \reviewbackmatterhook
69
+ \fi
349
70
 
350
- %%% colophon
351
- <%- if @config["colophon"] -%>
352
- <%- if @custom_colophonpage -%>
353
- <%= @custom_colophonpage %>
354
- <%- else -%>
355
- %% okuduke
356
- \reviewcolophon
357
- \thispagestyle{empty}
71
+ %% postdef body
72
+ \ifdefined\reviewpostdeffiles
73
+ \reviewpostdeffiles
74
+ \fi
358
75
 
359
- \vspace*{\fill}
76
+ %% index page
77
+ \ifdefined\reviewprintindex
78
+ \reviewprintindex
79
+ \fi
360
80
 
361
- {\noindent\reviewtitlefont\Large <%= escape_latex(@config.name_of("booktitle")) %>} \\
362
- <%- if @config["subtitle"] -%>
363
- {\noindent\reviewtitlefont\large <%= escape_latex(@config.name_of("subtitle")) %>} \\
364
- <%- end -%>
365
- \rule[8pt]{\textwidth}{1pt} \\
366
- {\noindent
367
- <%= @config["pubhistory"].to_s.gsub(/\n/){"\n\n\\noindent\n"} %>
368
- }
81
+ %% profile page
82
+ \ifdefined\reviewprofilepagecont
83
+ \reviewprofilepagecont
84
+ \fi
369
85
 
370
- \begin{tabular}{ll}
371
- <%= @okuduke %>
372
- \end{tabular}
373
-  \\
374
- \rule[0pt]{\textwidth}{1pt} \\
375
- <%- if @config["rights"] -%>
376
- <%= @config.names_of("rights").map{|s| escape_latex(s)}.join('\\' + '\\') %> \\
377
- <%- end -%>
378
- <%- end -%>
379
- <%- end -%>
86
+ %% advfile page
87
+ \ifdefined\reviewadvfilepagecont
88
+ \reviewadvfilepagecont
89
+ \fi
380
90
 
381
- %%% backcover
382
- <%- if @config["backcover"] -%>
383
- <%= @custom_backcoverpage %>
384
- <%- end -%>
91
+ %%% colophon page
92
+ \ifdefined\reviewcolophonpagecont
93
+ \reviewcolophonpagecont
94
+ \fi
95
+
96
+ %%% backcover page
97
+ \ifdefined\reviewbackcovercont
98
+ \reviewbackcovercont
99
+ \fi
385
100
 
386
101
  \end{document}
@@ -0,0 +1,22 @@
1
+ # review-jlreq テンプレート (実験版)
2
+
3
+ [jlreq](https://github.com/abenori/jlreq) は、 [日本語組版処理の要件](https://www.w3.org/TR/jlreq/ja/) の実装を試みた LaTeX クラスファイルです。
4
+
5
+ Re:VIEW 向けの本テンプレートは、この jlreq クラスを使用し、これまで広く使われてきた jsbook に代わってユーザーが比較的カスタマイズしやすいものを提供することを目的としています。
6
+
7
+ ## 注意!
8
+ - 現時点でこのテンプレートは実験段階 (experimental) です。今後の更新でファイルの内容、ファイル名、および紙面表現が大きく変わる可能性が常にあります。
9
+ - Re:VIEW の一部の命令に対応する紙面表現はまだ実装されていません。
10
+ - LaTeX の知識が十分でないと感じるなら、デフォルトの review-jsbook テンプレートあるいは [TechBoosterで利用しているRe:VIEWのテンプレート](https://github.com/TechBooster/ReVIEW-Template) を利用することをお勧めします。
11
+
12
+ ## セットアップ
13
+ 1. jlreq クラスを TeXLive 環境にインストールします。`tlmgr install jlreq` あるいはGitHub https://github.com/abenori/jlreq の clone を実行してください。jlreq 自体も開発段階であり、GitHub 上で頻繁に更新されています。
14
+ 2. `review-init --latex-template review-jlreq プロジェクト名` を実行して新しいプロジェクトを作成します。
15
+ 3. `config.yml` ファイルで review-jlreq クラスを使うよう設定します。
16
+ ```
17
+ ...
18
+ texstyle: reviewmacro
19
+ texdocumentclass: ["review-jlreq", "book"]
20
+ ```
21
+
22
+ 既存のプロジェクトを置き換えるには、プロジェクトの `sty` フォルダに `review-jlreq` フォルダ内のファイルを上書きコピーしてください。
@@ -0,0 +1,178 @@
1
+ % jlreq用基本設定
2
+ \RequirePackage{needspace}
3
+ \RequirePackage{alltt}
4
+ \RequirePackage{float}
5
+ \RequirePackage{upquote}
6
+ \RequirePackage{bm}
7
+
8
+ \IfFileExists{jumoline.sty}{
9
+ \RequirePackage{jumoline}
10
+ }
11
+
12
+ \RequirePackage{pxrubrica}
13
+ \@ifpackagelater{pxrubrica}{2017/04/20}{% true
14
+ \rubysetup{J}}{% false
15
+ \rubysetup{g}}
16
+
17
+ \long\def\review@ifempty#1{\expandafter\ifx\expandafter\relax\detokenize{#1}\relax\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
18
+
19
+ \newcommand{\reviewtitlefont}[0]{\usefont{T1}{phv}{b}{n}\gtfamily}
20
+ \newcommand{\reviewmainfont}[0]{}
21
+ \newcommand{\reviewcolophon}[0]{\clearpage}
22
+ \newcommand{\reviewappendix}[0]{\appendix}
23
+
24
+ \newcommand{\reviewprepartname}{\review@prepartname}
25
+ \newcommand{\reviewpostpartname}{\review@postpartname}
26
+ \newcommand{\reviewprechaptername}{\review@prechaptername}
27
+ \newcommand{\reviewpostchaptername}{\review@postchaptername}
28
+ \newcommand{\reviewfigurename}{\review@figurename}
29
+ \newcommand{\reviewtablename}{\review@tablename}
30
+ \newcommand{\reviewappendixname}{\review@appendixname}
31
+
32
+ \ifdefined\prepartname
33
+ \renewcommand{\prepartname}{\reviewprepartname}
34
+ \fi
35
+ \ifdefined\postpartname
36
+ \renewcommand{\postpartname}{\reviewpostpartname}
37
+ \fi
38
+ \ifdefined\prechaptername
39
+ \renewcommand{\prechaptername}{\reviewprechaptername}
40
+ \fi
41
+ \ifdefined\postchaptername
42
+ \renewcommand{\postchaptername}{\reviewpostchaptername}
43
+ \fi
44
+ \ifdefined\figurename
45
+ \renewcommand{\figurename}{\reviewfigurename}
46
+ \fi
47
+ \ifdefined\tablename
48
+ \renewcommand{\tablename}{\reviewtablename}
49
+ \fi
50
+ \ifdefined\appendixname
51
+ \renewcommand{\appendixname}{\reviewappendixname}
52
+ \fi
53
+
54
+ \def\reviewfrontmatterhook{%
55
+ \renewcommand{\chaptermark}[1]{{}}
56
+ \frontmatter
57
+ }
58
+
59
+ \def\reviewmainmatterhook{%
60
+ \renewcommand{\chaptermark}[1]{\markboth{\prechaptername\thechapter\postchaptername~##1}{}}
61
+ \mainmatter
62
+ }
63
+
64
+ \def\reviewappendixhook{%
65
+ \renewcommand{\chaptermark}[1]{\markboth{\appendixname\thechapter~##1}{}}
66
+ \reviewappendix
67
+ }
68
+
69
+ \def\reviewbackmatterhook{%
70
+ \backmatter
71
+ }
72
+
73
+ % cover
74
+ \ifdefined\review@cover
75
+ \def\reviewcoverpagecont{\review@coverfile}
76
+ \fi
77
+ \ifdefined\review@coverimage
78
+ \def\reviewcoverpagecont{%
79
+ \thispagestyle{empty}
80
+ \null\vfill
81
+ \centerline{\vbox to 0pt{\vss\hbox to 0pt{\hss
82
+ \expandafter\includegraphics\expandafter[\review@coverimageoption]{\review@coverimage}% includefullpagegraphicsを導入すべき?
83
+ \hss}\vss}}
84
+ \vfill\null
85
+ \clearpage
86
+ }
87
+ \fi
88
+
89
+ % titlepage
90
+ \ifdefined\review@titlepage
91
+ \ifthenelse{\isundefined{\review@titlefile}}{%
92
+ \def\reviewtitlepagecont{%
93
+ \begin{titlepage}
94
+ \thispagestyle{empty}
95
+ \begin{center}%
96
+ \mbox{}%
97
+ \ifx\review@jlreq@driver\review@jlreq@driver@luatex
98
+ \vskip5\zw
99
+ \else
100
+ \vskip5zw
101
+ \fi
102
+ \reviewtitlefont%
103
+ {\Huge\review@booktitlename\par}%
104
+ \ifdefined\review@subtitlename
105
+ \vskip 1em%
106
+ {\Large\review@subtitlename\par}%
107
+ \fi
108
+ \vskip 15em%
109
+ {\huge
110
+ \lineskip .75em
111
+ \begin{tabular}[t]{c}%
112
+ \review@titlepageauthors
113
+ \end{tabular}\par}%
114
+ \vfill
115
+ {\large\review@date \review@intn@edition%
116
+ \ifx\review@jlreq@driver\review@jlreq@driver@luatex
117
+ \hspace{2\zw}%
118
+ \else
119
+ \hspace{2zw}%
120
+ \fi
121
+ \review@intn@publishedby\par}%
122
+ \vskip4\zw\mbox{}
123
+ \end{center}%
124
+ \end{titlepage}\clearpage
125
+ }
126
+ }{%
127
+ \def\reviewtitlepagecont{\review@titlefile}
128
+ }
129
+ \fi
130
+
131
+ % toc
132
+ \ifdefined\review@toc
133
+ \def\reviewtableofcontents{%
134
+ \setcounter{tocdepth}{\review@tocdepth}
135
+ \tableofcontents
136
+ }
137
+ \fi
138
+
139
+ % index
140
+ \ifdefined\review@makeindex
141
+ \RequirePackage{makeidx}
142
+ \makeindex
143
+ \fi
144
+
145
+ \ifdefined\review@makeindex
146
+ \def\reviewprintindex{%
147
+ \printindex
148
+ }
149
+ \fi
150
+
151
+ % colophon
152
+ \ifdefined\review@colophon
153
+ \ifthenelse{\isundefined{\review@colophonfile}}{%
154
+ \def\reviewcolophonpagecont{%
155
+ \reviewcolophon
156
+ \thispagestyle{empty}
157
+ \vspace*{\fill}
158
+ \typeout{\review@booktitlename}
159
+ {\noindent\reviewtitlefont\Large\review@booktitlename}\\
160
+ \ifdefined\review@subtitlename
161
+ {\noindent\reviewtitlefont\large\review@subtitlename} \\
162
+ \fi
163
+ \rule[8pt]{\textwidth}{1pt} \\
164
+ {\noindent\review@pubhistories}
165
+
166
+ \begin{tabular}{ll}
167
+ \review@colophonnames
168
+ \end{tabular}
169
+  \\
170
+ \rule[0pt]{\textwidth}{1pt} \\
171
+ \ifdefined\review@rights
172
+ \review@rights
173
+ \fi
174
+ }%
175
+ }{%
176
+ \def\reviewcolophonpagecont{\review@colophonfile}
177
+ }
178
+ \fi
@@ -0,0 +1 @@
1
+ % for user-defined macro