review 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +15 -7
- data/NEWS.ja.md +58 -0
- data/NEWS.md +57 -0
- data/README.md +2 -2
- data/bin/review-preproc +1 -6
- data/doc/LICENSE +1 -1
- data/doc/config.yml.sample +3 -1
- data/doc/config.yml.sample-simple +2 -1
- data/doc/quickstart.ja.md +2 -2
- data/doc/quickstart.md +2 -2
- data/lib/epubmaker/epubcommon.rb +9 -3
- data/lib/epubmaker/producer.rb +2 -1
- data/lib/review/catalog.rb +1 -1
- data/lib/review/epubmaker.rb +2 -0
- data/lib/review/htmlbuilder.rb +28 -23
- data/lib/review/i18n.yml +9 -0
- data/lib/review/idgxmlbuilder.rb +3 -3
- data/lib/review/latexbuilder.rb +15 -6
- data/lib/review/preprocessor.rb +17 -4
- data/lib/review/topbuilder.rb +1 -1
- data/lib/review/version.rb +1 -1
- data/review.gemspec +1 -1
- data/samples/sample-book/src/lib/tasks/z01_copy_sty.rake +2 -2
- data/samples/syntax-book/lib/tasks/z01_copy_sty.rake +2 -2
- data/templates/latex/config.erb +6 -0
- data/templates/latex/layout.tex.erb +3 -0
- data/templates/latex/review-jlreq/review-base.sty +7 -13
- data/templates/latex/review-jlreq/review-jlreq.cls +59 -8
- data/templates/latex/review-jsbook/review-base.sty +10 -2
- data/templates/latex/review-jsbook/review-jsbook.cls +20 -1
- data/test/assets/test_template.tex +9 -0
- data/test/assets/test_template_backmatter.tex +9 -0
- data/test/test_htmlbuilder.rb +39 -4
- data/test/test_idgxmlbuilder.rb +4 -2
- data/test/test_latexbuilder.rb +10 -8
- data/test/test_topbuilder.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e84bcc2665b217e208b209c794a7d4e4a71440f8094cb32e969e294ef49b525b
|
4
|
+
data.tar.gz: 5a27039b3a6fa44437786debfc54fa2fe24213fdb497a84d4a483bb590fd1118
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cadd2c9a936fd38bd84f15d9b06fd0e85cd1df1b32e8116e165f4dd67801cdef887ca0e1c788ed8d5c3cc3b9979d729eb886149b7c188d2d461f459d6da36923
|
7
|
+
data.tar.gz: ce5a14cc670d7c57ce8fb6b7c2a885dc9bdef074da06eaa3a83d1bca5eeaa4196d42f60763d86e0aa2afe8a2115ad38f3e6e43ef69aaedd930dd938eefb50bd5
|
data/.travis.yml
CHANGED
@@ -11,16 +11,24 @@ addons:
|
|
11
11
|
- dvipng
|
12
12
|
|
13
13
|
before_install:
|
14
|
-
-
|
15
|
-
|
14
|
+
- |-
|
15
|
+
RUBY_VER=`ruby -e "print RUBY_VERSION"`
|
16
|
+
if [ "$RUBY_VER" = "2.1.10" ]; then
|
17
|
+
gem install bundler -v '< 2'
|
18
|
+
elif [ "$RUBY_VER" = "2.2.10" ]; then
|
19
|
+
gem install bundler -v '< 2'
|
20
|
+
else
|
21
|
+
gem update --system
|
22
|
+
gem install bundler
|
23
|
+
fi
|
16
24
|
|
17
25
|
rvm:
|
18
|
-
## - 2.0
|
19
26
|
- 2.1
|
20
|
-
- 2.2.
|
21
|
-
- 2.3.
|
22
|
-
- 2.4.
|
23
|
-
- 2.5.
|
27
|
+
- 2.2.10
|
28
|
+
- 2.3.8
|
29
|
+
- 2.4.5
|
30
|
+
- 2.5.3
|
31
|
+
- 2.6.0
|
24
32
|
## - ruby-head
|
25
33
|
|
26
34
|
branches:
|
data/NEWS.ja.md
CHANGED
@@ -1,3 +1,61 @@
|
|
1
|
+
# Version 3.1.0
|
2
|
+
|
3
|
+
## 非互換の変更
|
4
|
+
* PDFMaker: 図版のキャプションとして `\reviewimagecaption` マクロを導入しました ([#1254])。Re:VIEW 3 を使っているプロジェクトでは、`review-update` コマンドを実行して review-base.sty ファイルを更新することを推奨します。
|
5
|
+
* `review-preproc` コマンドから、文書化されておらず正しく動作しない `--strip` オプションを除去しました ([#1257])
|
6
|
+
|
7
|
+
## バグ修正
|
8
|
+
* PDFMaker: 部の中の節番号が前の章の節番号を継続してしまう問題を修正しました ([#1225],[#1226])
|
9
|
+
* samples 内で gentombow.sty ファイルのコピーが正しくできていないのを修正しました ([#1229])
|
10
|
+
* PDFMaker: review-jsbook 利用時、numer_of_lines ドキュメントオプションで指定した行数より1行減ってしまうのを修正しました ([#1235])
|
11
|
+
* PDFMaker: review-jlreq が LuaLaTeX で動作するように修正しました ([#1243])
|
12
|
+
* EPUBMaker: 部があるときに目次の階層がおかしくなる問題を修正しました ([#1262])
|
13
|
+
* `//comment` の内容が正しくエスケープされないことがある問題を修正しました ([#1264])
|
14
|
+
* PDFMaker: 奥付の左列が長いときにあふれるのを修正しました ([#1252])
|
15
|
+
* CHAPS: が空のときにエラーになるのを修正しました ([#1273])
|
16
|
+
|
17
|
+
## 機能強化
|
18
|
+
* PDFMaker: 数式表現の拡張としてよく使われる amssymb, amsthm, bm パッケージを標準で読み込むようにしました ([#1224])
|
19
|
+
* HTMLBuilder: emlist, listnum 命令の挙動をほかのコードリスト命令に合わせ、highlight メソッドを必ず経由するようにしました ([#1231])
|
20
|
+
* EPUBMaker: 脚注から本文に戻るリンクを表現できるようにしました ([#1233])。`epubmaker` パラメータの `back_footnote` サブパラメータを true にすると利用できます。
|
21
|
+
* PDFMaker: ダミーの行を作成する `\makelines` マクロを追加しました ([#1240])
|
22
|
+
* `#@warn` 命令を正しく実装しました ([#1258])
|
23
|
+
* `#@mapfile` 命令に re 拡張子のファイルが指定されたときにはタブなどを整形せずそのまま取り込むようにしました ([#1247])
|
24
|
+
* Ruby 2.6 をテスト対象にしました ([#1242])
|
25
|
+
* PDFMaker: review-jlreq で `zw` を使っている箇所を `\zw` に置き換えました。コラム内の段落は字下げするようにしました ([#1250])
|
26
|
+
* PDFMaker: [#1254] で導入した `\reviewimagecaption` が定義されていないときにはデフォルトのマクロを提供するようにしました ([#1267])
|
27
|
+
|
28
|
+
## ドキュメント
|
29
|
+
* README.md: jsbook.cls のファイル名が誤っていたのを修正しました ([#1239])
|
30
|
+
* config.yml.sample に back_footnote の説明を追加し、その他いくつかドキュメントに些末な更新を行いました ([#1268])
|
31
|
+
|
32
|
+
## コントリビューターのみなさん
|
33
|
+
* [@doublemarket](https://github.com/doublemarket)
|
34
|
+
* [@munepi](https://github.com/munepi)
|
35
|
+
|
36
|
+
[#1224]: https://github.com/kmuto/review/issues/1224
|
37
|
+
[#1225]: https://github.com/kmuto/review/pull/1225
|
38
|
+
[#1226]: https://github.com/kmuto/review/pull/1226
|
39
|
+
[#1229]: https://github.com/kmuto/review/pull/1229
|
40
|
+
[#1231]: https://github.com/kmuto/review/issues/1231
|
41
|
+
[#1233]: https://github.com/kmuto/review/issues/1233
|
42
|
+
[#1235]: https://github.com/kmuto/review/issues/1235
|
43
|
+
[#1239]: https://github.com/kmuto/review/pull/1239
|
44
|
+
[#1240]: https://github.com/kmuto/review/pull/1240
|
45
|
+
[#1242]: https://github.com/kmuto/review/pull/1242
|
46
|
+
[#1243]: https://github.com/kmuto/review/issues/1243
|
47
|
+
[#1247]: https://github.com/kmuto/review/issues/1247
|
48
|
+
[#1250]: https://github.com/kmuto/review/pull/1250
|
49
|
+
[#1252]: https://github.com/kmuto/review/issues/1252
|
50
|
+
[#1254]: https://github.com/kmuto/review/issues/1254
|
51
|
+
[#1257]: https://github.com/kmuto/review/issues/1257
|
52
|
+
[#1258]: https://github.com/kmuto/review/issues/1258
|
53
|
+
[#1262]: https://github.com/kmuto/review/issues/1262
|
54
|
+
[#1264]: https://github.com/kmuto/review/issues/1264
|
55
|
+
[#1267]: https://github.com/kmuto/review/issues/1267
|
56
|
+
[#1268]: https://github.com/kmuto/review/issues/1268
|
57
|
+
[#1273]: https://github.com/kmuto/review/issues/1273
|
58
|
+
|
1
59
|
# Version 3.0.0
|
2
60
|
|
3
61
|
## バグ修正
|
data/NEWS.md
CHANGED
@@ -1,3 +1,60 @@
|
|
1
|
+
# Version 3.1.0
|
2
|
+
## Breaking Changes
|
3
|
+
* PDFMaker: introduce `\reviewimagecaption` macro for the caption of figure ([#1254]). Please update your review-base.sty by `review-update` command on your Re:VIEW 3 project.
|
4
|
+
* remove `--strip` option which is undocumented and doesn't work correctly from `review-preproc command` ([#1257])
|
5
|
+
|
6
|
+
## Bug Fixes
|
7
|
+
* PDFMaker: fix a problem that the section number of the part continues the section number in the previous chapter ([#1225],[#1226])
|
8
|
+
* fix copying of gentombow.sty in samples folder ([#1229])
|
9
|
+
* PDFMaker: fix that the number of lines specified by `number_of_lines` document option decrease by 1 line than originally on review-jsbook ([#1235])
|
10
|
+
* PDFMaker: fix review-jlreq to work with LuaLaTeX ([#1243])
|
11
|
+
* EPUBMaker: fix a problem that the hierachy of the table of contents become strange when there is a part ([#1262])
|
12
|
+
* fix escaping of `//comment` ([#1264])
|
13
|
+
* PDFMaker: fix overflowing when the left column of colophon is long ([#1252])
|
14
|
+
* fix an error when CHAPS: is empty ([#1273])
|
15
|
+
|
16
|
+
## Enhancements
|
17
|
+
* PDFMaker: load amssymb, amsthm, and bm packages which are often used as extension of mathematical expression ([#1224])
|
18
|
+
* HTMLBuilder: `emlist` and `listnum` now always pass `highlight` method as well as others ([#1231])
|
19
|
+
* EPUBMaker: implement a back-link to the text from the footnote ([#1233])
|
20
|
+
* PDFMaker: add `\makelines` macro to create a dummy line ([#1240])
|
21
|
+
* implement `#@warn` correctly ([#1258])
|
22
|
+
* `#@mapfile` now imports as is (keep tabs etc.) when imported file has `.re` extension ([#1247])
|
23
|
+
* add Ruby 2.6 for the test coverage ([#1242])
|
24
|
+
* PDFMaker: replace `zw` with `\zw` in review-jlreq. add a indent to paragraphs in the column ([#1250])
|
25
|
+
* PDFMaker: when `\reviewimagecaption` is undefined (implemented in [#1254]), define it ([#1267])
|
26
|
+
|
27
|
+
## Docs
|
28
|
+
* README.md: fix the filename of jsbook.cls ([#1239])
|
29
|
+
* add the note about `back_footnote` into config.yml.sample and update documents a little ([#1268])
|
30
|
+
|
31
|
+
## Contributors
|
32
|
+
* [@doublemarket](https://github.com/doublemarket)
|
33
|
+
* [@munepi](https://github.com/munepi)
|
34
|
+
|
35
|
+
[#1224]: https://github.com/kmuto/review/issues/1224
|
36
|
+
[#1225]: https://github.com/kmuto/review/pull/1225
|
37
|
+
[#1226]: https://github.com/kmuto/review/pull/1226
|
38
|
+
[#1229]: https://github.com/kmuto/review/pull/1229
|
39
|
+
[#1231]: https://github.com/kmuto/review/issues/1231
|
40
|
+
[#1233]: https://github.com/kmuto/review/issues/1233
|
41
|
+
[#1235]: https://github.com/kmuto/review/issues/1235
|
42
|
+
[#1239]: https://github.com/kmuto/review/pull/1239
|
43
|
+
[#1240]: https://github.com/kmuto/review/pull/1240
|
44
|
+
[#1242]: https://github.com/kmuto/review/pull/1242
|
45
|
+
[#1243]: https://github.com/kmuto/review/issues/1243
|
46
|
+
[#1247]: https://github.com/kmuto/review/issues/1247
|
47
|
+
[#1250]: https://github.com/kmuto/review/pull/1250
|
48
|
+
[#1252]: https://github.com/kmuto/review/issues/1252
|
49
|
+
[#1254]: https://github.com/kmuto/review/issues/1254
|
50
|
+
[#1257]: https://github.com/kmuto/review/issues/1257
|
51
|
+
[#1258]: https://github.com/kmuto/review/issues/1258
|
52
|
+
[#1262]: https://github.com/kmuto/review/issues/1262
|
53
|
+
[#1264]: https://github.com/kmuto/review/issues/1264
|
54
|
+
[#1267]: https://github.com/kmuto/review/issues/1267
|
55
|
+
[#1268]: https://github.com/kmuto/review/issues/1268
|
56
|
+
[#1273]: https://github.com/kmuto/review/issues/1273
|
57
|
+
|
1
58
|
# Version 3.0.0
|
2
59
|
|
3
60
|
## Bug Fixes
|
data/README.md
CHANGED
@@ -108,8 +108,8 @@ Exception:
|
|
108
108
|
* jumoline.sty, vendor/jumoline: The LaTeX Project Public License. See [LPPL](https://github.com/kmuto/review/blob/master/vendor/jumoline/lppl.txt) file.
|
109
109
|
* plistings.sty, vendor/plistings: MIT License. See [LICENSE](https://github.com/kmuto/review/blob/master/vendor/plistings/LICENSE) file.
|
110
110
|
* gentombow.sty, vendor/gentombow: BSD License. See [LICENSE](https://github.com/kmuto/review/blob/master/vendor/gentombow/LICENSE) file.
|
111
|
-
* jsbook.
|
111
|
+
* jsbook.cls, vendor/jsclasses: BSD License. See [LICENSE](https://github.com/kmuto/review/blob/master/vendor/jsclasses/LICENSE) file.
|
112
112
|
|
113
113
|
## Copyright
|
114
114
|
|
115
|
-
Copyright (c) 2006-
|
115
|
+
Copyright (c) 2006-2019 Minero Aoki, Kenshi Muto, Masayoshi Takahashi, Masanori Kado.
|
data/bin/review-preproc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
#
|
3
|
-
# Copyright (c) 2010-
|
3
|
+
# Copyright (c) 2010-2019 Minero Aoki, Kenshi Muto
|
4
4
|
# 1999-2007 Minero Aoki
|
5
5
|
#
|
6
6
|
# This program is free software.
|
@@ -52,7 +52,6 @@ def main
|
|
52
52
|
opts.on('-c', '--check', 'Check if preprocess is needed.') { mode = :check }
|
53
53
|
opts.on('-d', '--diff', 'Show diff from current file.') { mode = :diff }
|
54
54
|
opts.on('--replace', 'Replace file by preprocessed one.') { mode = :replace }
|
55
|
-
opts.on('-s', '--strip', 'Strip preprocessor tags.') { mode = :strip }
|
56
55
|
opts.on('--tabwidth=WIDTH', "Replace tabs with space characters. (0: don't replace)") { |width| param['tabwidth'] = width.to_i }
|
57
56
|
opts.on('--help', 'Print this message and quit.') do
|
58
57
|
puts opts.help
|
@@ -88,10 +87,6 @@ def main
|
|
88
87
|
ensure
|
89
88
|
FileUtils.rm_f tmp
|
90
89
|
end
|
91
|
-
when :strip
|
92
|
-
File.open(path) do |f|
|
93
|
-
ReVIEW::Preprocessor::Strip.new(f).each { |line| puts line }
|
94
|
-
end
|
95
90
|
else
|
96
91
|
raise "must not happen: #{mode}"
|
97
92
|
end
|
data/doc/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2006-
|
1
|
+
Copyright (c) 2006-2019 Minero Aoki, Kenshi Muto, Masayoshi Takahashi, Masanori Kado.
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
of this software and associated documentation files (the "Software"), to deal
|
data/doc/config.yml.sample
CHANGED
@@ -72,7 +72,7 @@ aut: ["青木峰郎", "武藤健志", "高橋征義", "角征典"]
|
|
72
72
|
# 日付の後ろを空白文字で区切り、任意の文字列を置くことも可能。
|
73
73
|
# history: [["2016-04-20 v1.0.0版発行", "2018-11-11 v3.0.0版発行"]]
|
74
74
|
# 権利表記(配列で複数指定可)
|
75
|
-
# rights: (C) 2016-
|
75
|
+
# rights: (C) 2016-2019 Re:VIEW Developers
|
76
76
|
# description: 説明
|
77
77
|
# subject: 短い説明用タグ(配列で複数指定可)
|
78
78
|
# type: 書籍のカテゴリーなど(配列で複数指定可)
|
@@ -306,6 +306,8 @@ epubmaker:
|
|
306
306
|
# @<href>タグでの外部リンクを禁止し、地の文にする(falseで禁止する)
|
307
307
|
# externallink: true
|
308
308
|
#
|
309
|
+
# 脚注に「戻る」リンクを追加する(trueで追加)。脚注の記号および戻るリンクの記号はlocale.ymlで変更可能
|
310
|
+
# back_footnote: null
|
309
311
|
# epubmaker:階層を使うものはここまで
|
310
312
|
|
311
313
|
# LaTeX用のスタイルファイル(styディレクトリ以下に置くこと)
|
@@ -22,7 +22,7 @@ pbl: "Re:VIEW Publishing inc."
|
|
22
22
|
prt: "Re:VIEW Printing inc."
|
23
23
|
date: 2018-11-11
|
24
24
|
history: [["2012-01-30"],["2016-04-20","2016-05-03"],["2018-11-11"]]
|
25
|
-
rights: (C) 2016-
|
25
|
+
rights: (C) 2016-2019 Re:VIEW Commiters, some rights reserved.
|
26
26
|
description: sample config.yml file for Re:VIEW book
|
27
27
|
urnid: urn:uid:http://reviewml.org/review-sample-book
|
28
28
|
# isbn: null
|
@@ -65,6 +65,7 @@ epubmaker:
|
|
65
65
|
htmlext: xhtml
|
66
66
|
cover_linear: true
|
67
67
|
externallink: true
|
68
|
+
# back_footnote: true
|
68
69
|
|
69
70
|
## for LaTeX
|
70
71
|
|
data/doc/quickstart.ja.md
CHANGED
@@ -223,13 +223,13 @@ INFO: 新しいファイル /.../sty/review-custom.sty が作成されました
|
|
223
223
|
INFO: 新しいファイル /.../sty/review-jsbook.cls が作成されました。
|
224
224
|
INFO: 新しいファイル /.../sty/review-style.sty が作成されました。
|
225
225
|
INFO: 新しいファイル /.../sty/review-base.sty が作成されました。
|
226
|
-
INFO: 新しいファイル /.../sty/
|
226
|
+
INFO: 新しいファイル /.../sty/gentombow.sty が作成されました。
|
227
227
|
完了しました。
|
228
228
|
```
|
229
229
|
|
230
230
|
## クレジット
|
231
231
|
|
232
|
-
Re:VIEW は、青木峰郎によって最初に作成されました。武藤健志がこの開発・保守を引き継ぎ、
|
232
|
+
Re:VIEW は、青木峰郎によって最初に作成されました。武藤健志がこの開発・保守を引き継ぎ、2019年2月時点では、武藤健志、高橋征義、角征典が開発・保守を継続しています。
|
233
233
|
|
234
234
|
バグ・パッチの報告、開発者用メーリングリストなどについての情報は、
|
235
235
|
|
data/doc/quickstart.md
CHANGED
@@ -225,13 +225,13 @@ INFO: new file /.../sty/review-custom.sty is created.
|
|
225
225
|
INFO: new file /.../sty/review-jsbook.cls is created.
|
226
226
|
INFO: new file /.../sty/review-style.sty is created.
|
227
227
|
INFO: new file /.../sty/review-base.sty is created.
|
228
|
-
INFO: new file /.../sty/
|
228
|
+
INFO: new file /.../sty/gentombow.sty is created.
|
229
229
|
Finished.
|
230
230
|
```
|
231
231
|
|
232
232
|
## Copyright
|
233
233
|
|
234
|
-
The original author of Re:VIEW is Minero Aoki. The current maintainer is Kenshi Muto(@kmuto), and committers are Masayoshi Takahashi and Masanori Kado (
|
234
|
+
The original author of Re:VIEW is Minero Aoki. The current maintainer is Kenshi Muto(@kmuto), and committers are Masayoshi Takahashi and Masanori Kado (February 2019).
|
235
235
|
|
236
236
|
If you want to report bugs and patches, or to get more information, see:
|
237
237
|
|
data/lib/epubmaker/epubcommon.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# = epubcommon.rb -- super class for EPUBv2 and EPUBv3
|
2
2
|
#
|
3
|
-
# Copyright (c) 2010-
|
3
|
+
# Copyright (c) 2010-2019 Kenshi Muto and Masayoshi Takahashi
|
4
4
|
#
|
5
5
|
# This program is free software.
|
6
6
|
# You can distribute or modify this program under the terms of
|
@@ -327,8 +327,14 @@ EOT
|
|
327
327
|
|
328
328
|
if has_part
|
329
329
|
@producer.contents.each do |item|
|
330
|
-
|
331
|
-
|
330
|
+
if item.chaptype == 'part' && item.level > 0
|
331
|
+
# sections in part
|
332
|
+
item.level -= 1
|
333
|
+
end
|
334
|
+
# down level for part and chaps. pre, appendix, post are preserved
|
335
|
+
if item.chaptype == 'part' || item.chaptype == 'body'
|
336
|
+
item.level += 1
|
337
|
+
end
|
332
338
|
end
|
333
339
|
toclevel += 1
|
334
340
|
end
|
data/lib/epubmaker/producer.rb
CHANGED
@@ -269,7 +269,8 @@ module EPUBMaker
|
|
269
269
|
'rename_for_legacy' => nil,
|
270
270
|
'verify_target_images' => nil,
|
271
271
|
'force_include_images' => [],
|
272
|
-
'cover_linear' => nil
|
272
|
+
'cover_linear' => nil,
|
273
|
+
'back_footnote' => nil
|
273
274
|
},
|
274
275
|
'externallink' => true,
|
275
276
|
'contentdir' => '.',
|
data/lib/review/catalog.rb
CHANGED
data/lib/review/epubmaker.rb
CHANGED
data/lib/review/htmlbuilder.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2008-
|
1
|
+
# Copyright (c) 2008-2019 Minero Aoki, Kenshi Muto, Masayoshi Takahashi,
|
2
2
|
# KADO Masanori
|
3
3
|
# 2002-2007 Minero Aoki
|
4
4
|
#
|
@@ -435,20 +435,20 @@ module ReVIEW
|
|
435
435
|
end
|
436
436
|
|
437
437
|
def listnum_body(lines, lang)
|
438
|
+
body = lines.inject('') { |i, j| i + detab(j) + "\n" }
|
439
|
+
lexer = lang
|
440
|
+
first_line_number = line_num
|
441
|
+
hs = highlight(body: body, lexer: lexer, format: 'html', linenum: true,
|
442
|
+
options: { linenostart: first_line_number })
|
443
|
+
|
438
444
|
if highlight?
|
439
|
-
|
440
|
-
lexer = lang
|
441
|
-
first_line_number = line_num
|
442
|
-
puts highlight(body: body, lexer: lexer, format: 'html', linenum: true,
|
443
|
-
options: { linenostart: first_line_number })
|
445
|
+
puts hs
|
444
446
|
else
|
445
447
|
class_names = ['list']
|
446
448
|
class_names.push("language-#{lang}") unless lang.blank?
|
447
|
-
class_names.push('highlight') if highlight?
|
448
449
|
print %Q(<pre class="#{class_names.join(' ')}">)
|
449
|
-
|
450
|
-
|
451
|
-
puts detab((i + first_line_num).to_s.rjust(2) + ': ' + line)
|
450
|
+
hs.split("\n").each_with_index do |line, i|
|
451
|
+
puts detab((i + first_line_number).to_s.rjust(2) + ': ' + line)
|
452
452
|
end
|
453
453
|
puts '</pre>'
|
454
454
|
end
|
@@ -476,20 +476,20 @@ module ReVIEW
|
|
476
476
|
puts %Q(<p class="caption">#{compile_inline(caption)}</p>)
|
477
477
|
end
|
478
478
|
|
479
|
+
body = lines.inject('') { |i, j| i + detab(j) + "\n" }
|
480
|
+
lexer = lang
|
481
|
+
first_line_number = line_num
|
482
|
+
hs = highlight(body: body, lexer: lexer, format: 'html', linenum: true,
|
483
|
+
options: { linenostart: first_line_number })
|
479
484
|
if highlight?
|
480
|
-
|
481
|
-
lexer = lang
|
482
|
-
first_line_number = line_num
|
483
|
-
puts highlight(body: body, lexer: lexer, format: 'html', linenum: true,
|
484
|
-
options: { linenostart: first_line_number })
|
485
|
+
puts hs
|
485
486
|
else
|
486
487
|
class_names = ['emlist']
|
487
488
|
class_names.push("language-#{lang}") unless lang.blank?
|
488
489
|
class_names.push('highlight') if highlight?
|
489
490
|
print %Q(<pre class="#{class_names.join(' ')}">)
|
490
|
-
|
491
|
-
|
492
|
-
puts detab((i + first_line_num).to_s.rjust(2) + ': ' + line)
|
491
|
+
hs.split("\n").each_with_index do |line, i|
|
492
|
+
puts detab((i + first_line_number).to_s.rjust(2) + ': ' + line)
|
493
493
|
end
|
494
494
|
puts '</pre>'
|
495
495
|
end
|
@@ -748,16 +748,21 @@ module ReVIEW
|
|
748
748
|
end
|
749
749
|
|
750
750
|
def comment(lines, comment = nil)
|
751
|
-
lines ||= []
|
752
|
-
lines.unshift comment unless comment.blank?
|
753
751
|
return unless @book.config['draft']
|
752
|
+
lines ||= []
|
753
|
+
lines.unshift escape(comment) unless comment.blank?
|
754
754
|
str = lines.join('<br />')
|
755
|
-
puts %Q(<div class="draft-comment">#{
|
755
|
+
puts %Q(<div class="draft-comment">#{str}</div>)
|
756
756
|
end
|
757
757
|
|
758
758
|
def footnote(id, str)
|
759
759
|
if @book.config['epubversion'].to_i == 3
|
760
|
-
|
760
|
+
back = ''
|
761
|
+
if @book.config['epubmaker'] && @book.config['epubmaker']['back_footnote']
|
762
|
+
back = %Q(<a href="#fnb-#{normalize_id(id)}">#{I18n.t('html_footnote_backmark')}</a>)
|
763
|
+
end
|
764
|
+
# XXX: back link must be located at first of p for Kindle.
|
765
|
+
puts %Q(<div class="footnote" epub:type="footnote" id="fn-#{normalize_id(id)}"><p class="footnote">#{back}#{I18n.t('html_footnote_textmark', @chapter.footnote(id).number)}#{compile_inline(str)}</p></div>)
|
761
766
|
else
|
762
767
|
puts %Q(<div class="footnote" id="fn-#{normalize_id(id)}"><p class="footnote">[<a href="#fnb-#{normalize_id(id)}">*#{@chapter.footnote(id).number}</a>] #{compile_inline(str)}</p></div>)
|
763
768
|
end
|
@@ -862,7 +867,7 @@ module ReVIEW
|
|
862
867
|
|
863
868
|
def inline_fn(id)
|
864
869
|
if @book.config['epubversion'].to_i == 3
|
865
|
-
%Q(<a id="fnb-#{normalize_id(id)}" href="#fn-#{normalize_id(id)}" class="noteref" epub:type="noteref"
|
870
|
+
%Q(<a id="fnb-#{normalize_id(id)}" href="#fn-#{normalize_id(id)}" class="noteref" epub:type="noteref">#{I18n.t('html_footnote_refmark', @chapter.footnote(id).number)}</a>)
|
866
871
|
else
|
867
872
|
%Q(<a id="fnb-#{normalize_id(id)}" href="#fn-#{normalize_id(id)}" class="noteref">*#{@chapter.footnote(id).number}</a>)
|
868
873
|
end
|
data/lib/review/i18n.yml
CHANGED
@@ -29,6 +29,9 @@ ja:
|
|
29
29
|
ruby_postfix: ")"
|
30
30
|
external_link: "%s(%s)"
|
31
31
|
label_marker: "●● "
|
32
|
+
html_footnote_refmark: "*%s"
|
33
|
+
html_footnote_textmark: "[*%s] "
|
34
|
+
html_footnote_backmark: "⏎"
|
32
35
|
aut: "著 者"
|
33
36
|
csl: "監 修"
|
34
37
|
dsr: "デザイン"
|
@@ -114,6 +117,9 @@ en:
|
|
114
117
|
ruby_prefix: "("
|
115
118
|
ruby_postfix: ")"
|
116
119
|
label_marker: "●● "
|
120
|
+
html_footnote_refmark: "*%s"
|
121
|
+
html_footnote_textmark: "[*%s] "
|
122
|
+
html_footnote_backmark: "⏎"
|
117
123
|
aut: "Author"
|
118
124
|
csl: "Consultant"
|
119
125
|
dsr: "Design"
|
@@ -179,6 +185,9 @@ zh-TW:
|
|
179
185
|
ruby_postfix: ")"
|
180
186
|
external_link: "%s (%s)"
|
181
187
|
label_marker: "●● "
|
188
|
+
html_footnote_refmark: "*%s"
|
189
|
+
html_footnote_textmark: "[*%s] "
|
190
|
+
html_footnote_backmark: "⏎"
|
182
191
|
aut: "著作人"
|
183
192
|
csl: "監 修"
|
184
193
|
dsr: "美術編輯"
|
data/lib/review/idgxmlbuilder.rb
CHANGED
@@ -581,11 +581,11 @@ module ReVIEW
|
|
581
581
|
end
|
582
582
|
|
583
583
|
def comment(lines, comment = nil)
|
584
|
-
return
|
584
|
+
return unless @book.config['draft']
|
585
585
|
lines ||= []
|
586
|
-
lines.unshift comment unless comment.blank?
|
586
|
+
lines.unshift escape(comment) unless comment.blank?
|
587
587
|
str = lines.join("\n")
|
588
|
-
print "<msg>#{
|
588
|
+
print "<msg>#{str}</msg>"
|
589
589
|
end
|
590
590
|
|
591
591
|
def inline_comment(str)
|
data/lib/review/latexbuilder.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Copyright (c) 2002-2007 Minero Aoki
|
2
2
|
# 2008-2009 Minero Aoki, Kenshi Muto
|
3
|
-
# 2010-
|
3
|
+
# 2010-2019 Minero Aoki, Kenshi Muto, TAKAHASHI Masayoshi
|
4
4
|
#
|
5
5
|
# This program is free software.
|
6
6
|
# You can distribute or modify this program under the terms of
|
@@ -477,7 +477,12 @@ module ReVIEW
|
|
477
477
|
puts "\\includegraphics[width=\\maxwidth]{#{@chapter.image(id).path}}"
|
478
478
|
end
|
479
479
|
@doc_status[:caption] = true
|
480
|
-
|
480
|
+
|
481
|
+
if @book.config.check_version('2', exception: false)
|
482
|
+
puts macro('caption', compile_inline(caption)) if caption.present?
|
483
|
+
else
|
484
|
+
puts macro('reviewimagecaption', compile_inline(caption)) if caption.present?
|
485
|
+
end
|
481
486
|
@doc_status[:caption] = nil
|
482
487
|
puts macro('label', image_label(id))
|
483
488
|
puts '\end{reviewimage}'
|
@@ -493,7 +498,11 @@ module ReVIEW
|
|
493
498
|
end
|
494
499
|
puts macro('label', image_label(id))
|
495
500
|
@doc_status[:caption] = true
|
496
|
-
|
501
|
+
if @book.config.check_version('2', exception: false)
|
502
|
+
puts macro('caption', compile_inline(caption)) if caption.present?
|
503
|
+
else
|
504
|
+
puts macro('reviewimagecaption', compile_inline(caption)) if caption.present?
|
505
|
+
end
|
497
506
|
@doc_status[:caption] = nil
|
498
507
|
puts '\end{reviewdummyimage}'
|
499
508
|
end
|
@@ -853,13 +862,13 @@ module ReVIEW
|
|
853
862
|
end
|
854
863
|
|
855
864
|
def comment(lines, comment = nil)
|
865
|
+
return true unless @book.config['draft']
|
856
866
|
lines ||= []
|
857
867
|
unless comment.blank?
|
858
|
-
lines.unshift comment
|
868
|
+
lines.unshift escape(comment)
|
859
869
|
end
|
860
|
-
return true unless @book.config['draft']
|
861
870
|
str = lines.join('\par ')
|
862
|
-
puts macro('pdfcomment',
|
871
|
+
puts macro('pdfcomment', str)
|
863
872
|
end
|
864
873
|
|
865
874
|
def hr
|
data/lib/review/preprocessor.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2010-
|
1
|
+
# Copyright (c) 2010-2019 Minero Aoki, Kenshi Muto
|
2
2
|
# 2002-2009 Minero Aoki
|
3
3
|
#
|
4
4
|
# This program is free software.
|
@@ -69,6 +69,7 @@ module ReVIEW
|
|
69
69
|
@repository = repo
|
70
70
|
@config = param
|
71
71
|
@logger = ReVIEW.logger
|
72
|
+
@leave_content = nil
|
72
73
|
end
|
73
74
|
|
74
75
|
def process(inf, outf)
|
@@ -106,6 +107,7 @@ module ReVIEW
|
|
106
107
|
when /\A\#@mapfile/
|
107
108
|
direc = parse_directive(line, 1, 'eval')
|
108
109
|
path = expand(direc.arg)
|
110
|
+
@leave_content = File.extname(path) == '.re'
|
109
111
|
if direc['eval']
|
110
112
|
ent = evaluate(path, ent)
|
111
113
|
else
|
@@ -116,6 +118,7 @@ module ReVIEW
|
|
116
118
|
when /\A\#@map(?:range)?/
|
117
119
|
direc = parse_directive(line, 2, 'unindent')
|
118
120
|
path = expand(direc.args[0])
|
121
|
+
@leave_content = File.extname(path) == '.re'
|
119
122
|
ent = @repository.fetch_range(path, direc.args[1]) or
|
120
123
|
error "unknown range: #{path}: #{direc.args[1]}"
|
121
124
|
ent = (direc['unindent'] ? unindent(ent, direc['unindent']) : ent)
|
@@ -127,6 +130,9 @@ module ReVIEW
|
|
127
130
|
when /\A\#@/
|
128
131
|
op = line.slice(/@(\w+)/, 1)
|
129
132
|
warn "unknown directive: #{line.strip}" unless known_directive?(op)
|
133
|
+
if op == 'warn'
|
134
|
+
warn line.strip.sub(/\#@warn\((.+)\)/, '\1')
|
135
|
+
end
|
130
136
|
@f.print line
|
131
137
|
|
132
138
|
when /\A\s*\z/ # empty line
|
@@ -166,9 +172,11 @@ module ReVIEW
|
|
166
172
|
@f.print line
|
167
173
|
return nil
|
168
174
|
when %r{\A//\}}
|
169
|
-
|
170
|
-
|
171
|
-
|
175
|
+
unless @leave_content
|
176
|
+
warn '//} seen in list'
|
177
|
+
@f.print line
|
178
|
+
return nil
|
179
|
+
end
|
172
180
|
when /\A\#@\w/
|
173
181
|
warn "#{line.slice(/\A\#@\w+/)} seen in list"
|
174
182
|
@f.print line
|
@@ -357,6 +365,7 @@ module ReVIEW
|
|
357
365
|
private
|
358
366
|
|
359
367
|
def file_descripter(fname)
|
368
|
+
@leave_content = File.extname(fname) == '.re'
|
360
369
|
return @repository[fname] if @repository[fname]
|
361
370
|
|
362
371
|
@repository[fname] = git?(fname) ? parse_git_blob(fname) : parse_file(fname)
|
@@ -455,6 +464,10 @@ module ReVIEW
|
|
455
464
|
end
|
456
465
|
|
457
466
|
def canonical(line)
|
467
|
+
if @leave_content
|
468
|
+
return line
|
469
|
+
end
|
470
|
+
|
458
471
|
tabwidth = @config['tabwidth'] || 8
|
459
472
|
if tabwidth > 0
|
460
473
|
detab(line, tabwidth).rstrip + "\n"
|
data/lib/review/topbuilder.rb
CHANGED
data/lib/review/version.rb
CHANGED
data/review.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.summary = 'Re:VIEW: a easy-to-use digital publishing system'
|
13
13
|
gem.description = 'Re:VIEW is a digital publishing system for books and ebooks. It supports InDesign, EPUB and LaTeX.'
|
14
14
|
gem.required_rubygems_version = Gem::Requirement.new('>= 0') if gem.respond_to? :required_rubygems_version=
|
15
|
-
gem.date = '
|
15
|
+
gem.date = '2019-02-28'
|
16
16
|
|
17
17
|
gem.files = `git ls-files`.split("\n")
|
18
18
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -9,9 +9,9 @@ task :copy_sty do
|
|
9
9
|
Dir.glob(File.join(jsbook_dir, 'review-*.sty')) do |file|
|
10
10
|
FileUtils.cp file, 'sty'
|
11
11
|
end
|
12
|
-
FileUtils.cp File.join(gentombow_dir, 'gentombow.sty'), 'sty/
|
12
|
+
FileUtils.cp File.join(gentombow_dir, 'gentombow.sty'), 'sty/gentombow.sty'
|
13
13
|
end
|
14
14
|
|
15
|
-
CLEAN.include([Dir.glob('sty/review-*.sty'), 'sty/review-jsbook.cls', 'sty/
|
15
|
+
CLEAN.include([Dir.glob('sty/review-*.sty'), 'sty/review-jsbook.cls', 'sty/gentombow.sty'])
|
16
16
|
|
17
17
|
Rake::Task[BOOK_PDF].enhance([:copy_sty])
|
@@ -9,9 +9,9 @@ task :copy_sty do
|
|
9
9
|
Dir.glob(File.join(jsbook_dir, 'review-*.sty')) do |file|
|
10
10
|
FileUtils.cp file, 'sty'
|
11
11
|
end
|
12
|
-
FileUtils.cp File.join(gentombow_dir, 'gentombow.sty'), 'sty/
|
12
|
+
FileUtils.cp File.join(gentombow_dir, 'gentombow.sty'), 'sty/gentombow.sty'
|
13
13
|
end
|
14
14
|
|
15
|
-
CLEAN.include([Dir.glob('sty/review-*.sty'), 'sty/review-jsbook.cls', 'sty/
|
15
|
+
CLEAN.include([Dir.glob('sty/review-*.sty'), 'sty/review-jsbook.cls', 'sty/gentombow.sty'])
|
16
16
|
|
17
17
|
Rake::Task[BOOK_PDF].enhance([:copy_sty])
|
data/templates/latex/config.erb
CHANGED
@@ -59,11 +59,12 @@
|
|
59
59
|
\begin{reviewtablesetup}\begin{tabular}{#1}}%
|
60
60
|
{\end{tabular}\end{reviewtablesetup}}
|
61
61
|
|
62
|
+
\newcommand\reviewimagecaption[1]{\caption{#1}}
|
62
63
|
\newcommand*\reviewimgtablecaption[1]{\caption{#1}}
|
63
64
|
|
64
65
|
% コラム
|
65
66
|
\newenvironment{reviewcolumn}[1][COLUMN]{%
|
66
|
-
\begin{tcolorbox}[skin=enhanced jigsaw,breakable,boxrule=0.2mm,arc=2mm,colback=white,colframe=black!100!white,title={\sffamily\bfseries #1}]\par}
|
67
|
+
\begin{tcolorbox}[skin=enhanced jigsaw,breakable,boxrule=0.2mm,arc=2mm,colback=white,colframe=black!100!white,before upper={\parindent1\zw},title={\sffamily\bfseries #1}]\par}
|
67
68
|
{\end{tcolorbox}}
|
68
69
|
|
69
70
|
\newcommand{\reviewbackslash}[0]{\textbackslash{}}
|
@@ -107,6 +108,7 @@
|
|
107
108
|
\renewcommand{\contentsname}{\review@toctitle}
|
108
109
|
|
109
110
|
\newenvironment{reviewpart}{%
|
111
|
+
\setcounter{section}{0}%
|
110
112
|
\renewcommand{\thesection}{\thepart.\@arabic\c@section}%
|
111
113
|
}{}
|
112
114
|
|
@@ -246,11 +248,7 @@
|
|
246
248
|
\thispagestyle{empty}
|
247
249
|
\begin{center}%
|
248
250
|
\mbox{}%
|
249
|
-
\
|
250
|
-
\vskip5\zw
|
251
|
-
\else
|
252
|
-
\vskip5zw
|
253
|
-
\fi
|
251
|
+
\vskip5\zw
|
254
252
|
\reviewtitlefont%
|
255
253
|
{\Huge\review@booktitlename\par}%
|
256
254
|
\ifdefined\review@subtitlename
|
@@ -265,11 +263,7 @@
|
|
265
263
|
\end{tabular}\par}%
|
266
264
|
\vfill
|
267
265
|
{\large\review@date \review@intn@edition%
|
268
|
-
\
|
269
|
-
\hspace{2\zw}%
|
270
|
-
\else
|
271
|
-
\hspace{2zw}%
|
272
|
-
\fi
|
266
|
+
\hspace{2\zw}%
|
273
267
|
\review@intn@publishedby\par}%
|
274
268
|
\vskip4\zw\mbox{}
|
275
269
|
\end{center}%
|
@@ -314,9 +308,9 @@
|
|
314
308
|
\rule[8pt]{\textwidth}{1pt} \\
|
315
309
|
{\noindent\review@pubhistories}
|
316
310
|
|
317
|
-
\begin{
|
311
|
+
\begin{tabularx}{\dimexpr\textwidth-0.5em}{lX}
|
318
312
|
\review@colophonnames
|
319
|
-
\end{
|
313
|
+
\end{tabularx}
|
320
314
|
\\
|
321
315
|
\rule[0pt]{\textwidth}{1pt} \\
|
322
316
|
\ifdefined\review@rights
|
@@ -1,5 +1,5 @@
|
|
1
1
|
%#!ptex2pdf -l -u -ot '-synctex=1' test-rejlreqbk
|
2
|
-
% Copyright (c) 2018 Kenshi Muto.
|
2
|
+
% Copyright (c) 2018-2019 Kenshi Muto.
|
3
3
|
%
|
4
4
|
% Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
5
|
% of this software and associated documentation files (the "Software"), to deal
|
@@ -20,7 +20,7 @@
|
|
20
20
|
% THE SOFTWARE.
|
21
21
|
|
22
22
|
\NeedsTeXFormat{LaTeX2e}
|
23
|
-
\ProvidesClass{review-jlreq}[
|
23
|
+
\ProvidesClass{review-jlreq}[2019/01/01 Re:VIEW pLaTeX class modified for jlreq.
|
24
24
|
cls]
|
25
25
|
|
26
26
|
%% hook at end of reviewmacro
|
@@ -92,7 +92,7 @@ cls]
|
|
92
92
|
\edef\recls@tmp{\thepage}%
|
93
93
|
\lower\dimexpr4pt+\recls@tombobleed+.5\paperheight+5\p@\hbox{%
|
94
94
|
\vbox{\expandafter\@tfor\expandafter\recls@x\expandafter:\expandafter=\recls@tmp\do{%
|
95
|
-
\hbox to
|
95
|
+
\hbox to 1\zw{\hss\recls@x\hss}}}}}%
|
96
96
|
\ifodd\c@page
|
97
97
|
\rlap{\recls@hiddfolio}%
|
98
98
|
\else
|
@@ -161,7 +161,7 @@ cls]
|
|
161
161
|
\def\recls@engine{}
|
162
162
|
\def\recls@driver{}
|
163
163
|
\ifdefined\jlreq@trimmarks@engine
|
164
|
-
\ifx l\jlreq@trimmarks@engine\def\recls@engine{lualatex}\fi
|
164
|
+
\ifx l\jlreq@trimmarks@engine\def\recls@engine{lualatex}\def\recls@driver{luatex}\fi
|
165
165
|
\ifx u\jlreq@trimmarks@engine\def\recls@engine{uplatex}\fi
|
166
166
|
\ifx p\jlreq@trimmarks@engine\def\recls@engine{platex}\fi
|
167
167
|
\else% jlreqから持ってくる
|
@@ -194,14 +194,22 @@ cls]
|
|
194
194
|
\RequirePackage[\recls@driver]{graphicx}
|
195
195
|
\RequirePackage[\recls@driver,table]{xcolor}
|
196
196
|
|
197
|
-
|
197
|
+
% luatex固有
|
198
|
+
\def\recls@tmp{luatex}\ifx\recls@tmp\recls@driver
|
199
|
+
\DeclareGraphicsRule{.ai}{pdf}{.ai}{}
|
200
|
+
\usepackage[no-math]{fontspec}
|
201
|
+
\else
|
202
|
+
\RequirePackage[T1]{fontenc}
|
203
|
+
\RequirePackage{lmodern}%\ttdefault: lmtt
|
204
|
+
\fi
|
205
|
+
|
198
206
|
\RequirePackage{textcomp}%T1/TS1
|
199
|
-
\RequirePackage{lmodern}%\ttdefault: lmtt
|
200
207
|
\RequirePackage{tikz}
|
201
208
|
\usetikzlibrary{calc}
|
202
209
|
\RequirePackage{multirow}
|
203
210
|
\RequirePackage{amsmath}
|
204
211
|
\RequirePackage{amssymb}
|
212
|
+
\RequirePackage{amsthm}
|
205
213
|
\RequirePackage{needspace}
|
206
214
|
\RequirePackage{alltt}
|
207
215
|
\RequirePackage{float}
|
@@ -211,14 +219,20 @@ cls]
|
|
211
219
|
\RequirePackage{tcolorbox}
|
212
220
|
\tcbuselibrary{xparse,hooks,skins,breakable}
|
213
221
|
\RequirePackage{ulem}
|
222
|
+
\RequirePackage{tabularx}
|
214
223
|
|
215
|
-
\
|
224
|
+
\def\recls@tmp{luatex}
|
225
|
+
\RequirePackage[\recls@driver, \if@pdfhyperlink\else draft,\fi
|
226
|
+
\ifx\recls@tmp\recls@driver unicode,\fi
|
216
227
|
bookmarks=true,
|
217
228
|
bookmarksnumbered=true,
|
218
229
|
hidelinks,
|
219
230
|
setpagesize=false,
|
220
231
|
]{hyperref}
|
221
|
-
|
232
|
+
|
233
|
+
\def\recls@tmp{uplatex}\ifx\recls@tmp\recls@engine
|
234
|
+
\RequirePackage[\recls@driver]{pxjahyper}
|
235
|
+
\fi
|
222
236
|
|
223
237
|
%% include fullpage graphics
|
224
238
|
\edef\grnchry@head{\dimexpr\topmargin+1in+\headheight+\headsep}
|
@@ -259,6 +273,25 @@ cls]
|
|
259
273
|
\hbox{}\thispagestyle{empty}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
|
260
274
|
\let\clearoddpage\cleardoublepage@left
|
261
275
|
|
276
|
+
%% 行のサンプル。\makelines{行数} で「■□■□…」からなる行を指定行数配置する
|
277
|
+
\def\makelines#1{%
|
278
|
+
\@tempcnta\z@\relax
|
279
|
+
\def\@makeline@f@size{\f@size}%
|
280
|
+
\@whilenum\@tempcnta<#1\do{%
|
281
|
+
\advance\@tempcnta\@ne\relax
|
282
|
+
\noindent\rlap{\the\@tempcnta}\nobreak
|
283
|
+
\makelines@neline\par}%
|
284
|
+
}
|
285
|
+
\def\makelines@unit@#10#2\relax{%
|
286
|
+
\ifx!#2!\relax □\else\relax ■\fi}%
|
287
|
+
\newcounter{makelines@unit}
|
288
|
+
\def\makelines@neline{%
|
289
|
+
\c@makelines@unit\@ne
|
290
|
+
\@whilenum\c@makelines@unit<\dimexpr(\textwidth + \Cwd)/\Cwd\do{%
|
291
|
+
\expandafter\makelines@unit@\the\c@makelines@unit0\relax
|
292
|
+
\advance\c@makelines@unit\@ne}%
|
293
|
+
}
|
294
|
+
|
262
295
|
% シンプルな通しノンブル
|
263
296
|
\ifrecls@serialpage
|
264
297
|
\jlreqsetup{frontmatter_pagination=continuous}
|
@@ -283,5 +316,23 @@ cls]
|
|
283
316
|
\if@restonecol\twocolumn\else\newpage\fi
|
284
317
|
}
|
285
318
|
|
319
|
+
% pdfpagesのトンボずれへの対処
|
320
|
+
\if@pdftombo
|
321
|
+
\def\recls@patch@pdfpages{%
|
322
|
+
\patchcmd{\AM@output}{%
|
323
|
+
\setlength{\@tempdima}{\AM@xmargin}%
|
324
|
+
\edef\AM@xmargin{\the\@tempdima}%
|
325
|
+
\setlength{\@tempdima}{\AM@ymargin}%
|
326
|
+
\edef\AM@ymargin{\the\@tempdima}%
|
327
|
+
}{%
|
328
|
+
\setlength{\@tempdima}{\AM@xmargin+1in}%
|
329
|
+
\edef\AM@xmargin{\the\@tempdima}%
|
330
|
+
\setlength{\@tempdima}{\AM@ymargin-1in}%
|
331
|
+
\edef\AM@ymargin{\the\@tempdima}%
|
332
|
+
}%
|
333
|
+
}{\message{patch for pdfpages applied}}{}
|
334
|
+
\AtBeginDocument{\@ifpackageloaded{pdfpages}{\recls@patch@pdfpages}{}}
|
335
|
+
\fi
|
336
|
+
|
286
337
|
\listfiles
|
287
338
|
\endinput
|
@@ -34,6 +34,10 @@
|
|
34
34
|
\RequirePackage{float}
|
35
35
|
\RequirePackage{alltt}
|
36
36
|
\RequirePackage{amsmath}
|
37
|
+
\RequirePackage{amssymb}
|
38
|
+
\RequirePackage{amsthm}
|
39
|
+
\RequirePackage{bm}
|
40
|
+
\RequirePackage{tabularx}
|
37
41
|
|
38
42
|
%% if you use @<u>{} (underline), use jumoline.sty
|
39
43
|
\IfFileExists{jumoline.sty}{
|
@@ -165,6 +169,9 @@
|
|
165
169
|
\WithSuffix\newcommand\reviewtablecaption*[1]{%
|
166
170
|
\caption*{#1}}
|
167
171
|
|
172
|
+
\newcommand\reviewimagecaption[1]{%
|
173
|
+
\caption{#1}}
|
174
|
+
|
168
175
|
\newcommand{\reviewimgtablecaption}[1]{%
|
169
176
|
\caption{#1}\vspace{-3mm}}
|
170
177
|
|
@@ -198,6 +205,7 @@
|
|
198
205
|
\newcommand{\reviewsecref}[2]{#1}
|
199
206
|
|
200
207
|
\newenvironment{reviewpart}{%
|
208
|
+
\setcounter{section}{0}%
|
201
209
|
\renewcommand{\thesection}{\thepart.\@arabic\c@section}%
|
202
210
|
}{}
|
203
211
|
|
@@ -414,9 +422,9 @@
|
|
414
422
|
\rule[8pt]{\textwidth}{1pt} \\
|
415
423
|
{\noindent\review@pubhistories}
|
416
424
|
|
417
|
-
\begin{
|
425
|
+
\begin{tabularx}{\dimexpr\textwidth-0.5em}{lX}
|
418
426
|
\review@colophonnames
|
419
|
-
\end{
|
427
|
+
\end{tabularx}
|
420
428
|
\\
|
421
429
|
\rule[0pt]{\textwidth}{1pt} \\
|
422
430
|
\ifdefined\review@rights
|
@@ -331,7 +331,7 @@
|
|
331
331
|
\ifx\recls@number@of@lines\@empty\else
|
332
332
|
\setlength\textheight{\recls@number@of@lines\Cvs}
|
333
333
|
\addtolength\textheight{-\Cvs}\addtolength\textheight{\Cwd}
|
334
|
-
\addtolength\textheight{
|
334
|
+
\addtolength\textheight{\dimexpr\topskip-\Cht}%%adjustment for jsbook.cls's \topskip
|
335
335
|
\fi
|
336
336
|
|
337
337
|
%% ノド、小口
|
@@ -429,6 +429,25 @@
|
|
429
429
|
\hbox{}\thispagestyle{empty}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
|
430
430
|
\let\clearoddpage\cleardoublepage@left
|
431
431
|
|
432
|
+
%% 行のサンプル。\makelines{行数} で「■□■□…」からなる行を指定行数配置する
|
433
|
+
\def\makelines#1{%
|
434
|
+
\@tempcnta\z@\relax
|
435
|
+
\def\@makeline@f@size{\f@size}%
|
436
|
+
\@whilenum\@tempcnta<#1\do{%
|
437
|
+
\advance\@tempcnta\@ne\relax
|
438
|
+
\noindent\rlap{\the\@tempcnta}\nobreak
|
439
|
+
\makelines@neline\par}%
|
440
|
+
}
|
441
|
+
\def\makelines@unit@#10#2\relax{%
|
442
|
+
\ifx!#2!\relax □\else\relax ■\fi}%
|
443
|
+
\newcounter{makelines@unit}
|
444
|
+
\def\makelines@neline{%
|
445
|
+
\c@makelines@unit\@ne
|
446
|
+
\@whilenum\c@makelines@unit<\dimexpr(\textwidth + \Cwd)/\Cwd\do{%
|
447
|
+
\expandafter\makelines@unit@\the\c@makelines@unit0\relax
|
448
|
+
\advance\c@makelines@unit\@ne}%
|
449
|
+
}
|
450
|
+
|
432
451
|
%% coverオプションによる表紙判定の上書き
|
433
452
|
\def\recls@tmp{true}\ifx\recls@forcecover\recls@tmp
|
434
453
|
\@reclscovertrue
|
@@ -44,9 +44,18 @@
|
|
44
44
|
\def\reviewappendixfiles{}
|
45
45
|
\def\reviewpostdeffiles{}
|
46
46
|
|
47
|
+
\def\reviewbackcompatibilityhook{
|
48
|
+
\@ifundefined{reviewimagecaption}{% for 3.0.0 compatibility
|
49
|
+
\newcommand{\reviewimagecaption}[1]{\caption{##1}}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
47
53
|
\makeatother
|
48
54
|
|
49
55
|
|
56
|
+
%% backward compatibility (defined in config.erb)
|
57
|
+
\reviewbackcompatibilityhook
|
58
|
+
|
50
59
|
\begin{document}
|
51
60
|
|
52
61
|
%% begindocument hook
|
@@ -55,9 +55,18 @@ some ad content
|
|
55
55
|
\def\reviewappendixfiles{}
|
56
56
|
\def\reviewpostdeffiles{}
|
57
57
|
|
58
|
+
\def\reviewbackcompatibilityhook{
|
59
|
+
\@ifundefined{reviewimagecaption}{% for 3.0.0 compatibility
|
60
|
+
\newcommand{\reviewimagecaption}[1]{\caption{##1}}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
58
64
|
\makeatother
|
59
65
|
|
60
66
|
|
67
|
+
%% backward compatibility (defined in config.erb)
|
68
|
+
\reviewbackcompatibilityhook
|
69
|
+
|
61
70
|
\begin{document}
|
62
71
|
|
63
72
|
%% begindocument hook
|
data/test/test_htmlbuilder.rb
CHANGED
@@ -13,6 +13,7 @@ class HTMLBuidlerTest < Test::Unit::TestCase
|
|
13
13
|
@config['secnolevel'] = 2
|
14
14
|
@config['stylesheet'] = nil
|
15
15
|
@config['htmlext'] = 'html'
|
16
|
+
@config['epubmaker'] = {}
|
16
17
|
@book = Book::Base.new('.')
|
17
18
|
@book.config = @config
|
18
19
|
@compiler = ReVIEW::Compiler.new(@builder)
|
@@ -1590,17 +1591,33 @@ EOS
|
|
1590
1591
|
assert_equal expected, actual
|
1591
1592
|
end
|
1592
1593
|
|
1593
|
-
def
|
1594
|
+
def test_footnote
|
1594
1595
|
fn = Book::FootnoteIndex.parse(['//footnote[foo][bar\\a\\$buz]'])
|
1595
1596
|
@chapter.instance_eval { @footnote_index = fn }
|
1596
1597
|
actual = compile_block("//footnote[foo][bar\\a\\$buz]\n")
|
1597
1598
|
expected = <<-'EOS'
|
1598
1599
|
<div class="footnote" epub:type="footnote" id="fn-foo"><p class="footnote">[*1] bar\a\$buz</p></div>
|
1600
|
+
EOS
|
1601
|
+
assert_equal expected, actual
|
1602
|
+
|
1603
|
+
@book.config['epubmaker'] ||= {}
|
1604
|
+
@book.config['epubmaker']['back_footnote'] = true
|
1605
|
+
actual = compile_block("//footnote[foo][bar\\a\\$buz]\n")
|
1606
|
+
expected = <<-'EOS'
|
1607
|
+
<div class="footnote" epub:type="footnote" id="fn-foo"><p class="footnote"><a href="#fnb-foo">⏎</a>[*1] bar\a\$buz</p></div>
|
1608
|
+
EOS
|
1609
|
+
assert_equal expected, actual
|
1610
|
+
|
1611
|
+
I18n.set('html_footnote_textmark', '+%s:')
|
1612
|
+
I18n.set('html_footnote_backmark', '←')
|
1613
|
+
actual = compile_block("//footnote[foo][bar\\a\\$buz]\n")
|
1614
|
+
expected = <<-'EOS'
|
1615
|
+
<div class="footnote" epub:type="footnote" id="fn-foo"><p class="footnote"><a href="#fnb-foo">←</a>+1:bar\a\$buz</p></div>
|
1599
1616
|
EOS
|
1600
1617
|
assert_equal expected, actual
|
1601
1618
|
end
|
1602
1619
|
|
1603
|
-
def
|
1620
|
+
def test_footnote_with_tricky_id
|
1604
1621
|
fn = Book::FootnoteIndex.parse(['//footnote[123 あ_;][bar\\a\\$buz]'])
|
1605
1622
|
@chapter.instance_eval { @footnote_index = fn }
|
1606
1623
|
actual = compile_block("//footnote[123 あ_;][bar\\a\\$buz]\n")
|
@@ -1610,6 +1627,22 @@ EOS
|
|
1610
1627
|
assert_equal expected, actual
|
1611
1628
|
end
|
1612
1629
|
|
1630
|
+
def test_inline_fn
|
1631
|
+
book = ReVIEW::Book::Base.load
|
1632
|
+
book.catalog = ReVIEW::Catalog.new('CHAPS' => %w[ch1.re])
|
1633
|
+
io1 = StringIO.new("//footnote[foo][bar]\n")
|
1634
|
+
chap1 = ReVIEW::Book::Chapter.new(book, 1, 'ch1', 'ch1.re', io1)
|
1635
|
+
book.parts = [ReVIEW::Book::Part.new(self, nil, [chap1])]
|
1636
|
+
builder = ReVIEW::HTMLBuilder.new
|
1637
|
+
comp = ReVIEW::Compiler.new(builder)
|
1638
|
+
builder.bind(comp, chap1, nil)
|
1639
|
+
fn = builder.inline_fn('foo')
|
1640
|
+
assert_equal '<a id="fnb-foo" href="#fn-foo" class="noteref" epub:type="noteref">*1</a>', fn
|
1641
|
+
I18n.set('html_footnote_refmark', '+%s')
|
1642
|
+
fn = builder.inline_fn('foo')
|
1643
|
+
assert_equal '<a id="fnb-foo" href="#fn-foo" class="noteref" epub:type="noteref">+1</a>', fn
|
1644
|
+
end
|
1645
|
+
|
1613
1646
|
def test_inline_hd
|
1614
1647
|
book = ReVIEW::Book::Base.load
|
1615
1648
|
book.catalog = ReVIEW::Catalog.new('CHAPS' => %w[ch1.re ch2.re])
|
@@ -1725,8 +1758,10 @@ EOS
|
|
1725
1758
|
|
1726
1759
|
def test_comment_for_draft
|
1727
1760
|
@config['draft'] = true
|
1728
|
-
actual = compile_block('//comment[
|
1729
|
-
assert_equal %Q(<div class="draft-comment"
|
1761
|
+
actual = compile_block('//comment[コメント<]')
|
1762
|
+
assert_equal %Q(<div class="draft-comment">コメント<</div>\n), actual
|
1763
|
+
actual = compile_block("//comment{\nA<>\nB&\n//}")
|
1764
|
+
assert_equal %Q(<div class="draft-comment">A<><br />B&</div>\n), actual
|
1730
1765
|
end
|
1731
1766
|
|
1732
1767
|
def test_inline_comment
|
data/test/test_idgxmlbuilder.rb
CHANGED
@@ -721,8 +721,10 @@ EOS
|
|
721
721
|
|
722
722
|
def test_comment_for_draft
|
723
723
|
@config['draft'] = true
|
724
|
-
actual = compile_block('//comment[
|
725
|
-
assert_equal '<msg
|
724
|
+
actual = compile_block('//comment[コメント<]')
|
725
|
+
assert_equal '<msg>コメント<</msg>', actual
|
726
|
+
actual = compile_block("//comment{\nA<>\nB&\n//}")
|
727
|
+
assert_equal %Q(<msg>A<>\nB&</msg>), actual
|
726
728
|
end
|
727
729
|
|
728
730
|
def test_inline_comment
|
data/test/test_latexbuilder.rb
CHANGED
@@ -450,7 +450,7 @@ class LATEXBuidlerTest < Test::Unit::TestCase
|
|
450
450
|
end
|
451
451
|
|
452
452
|
actual = compile_block("//image[sampleimg][sample photo]{\n//}\n")
|
453
|
-
assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[width=\\maxwidth]{./images/chap1-sampleimg.png}\n\\
|
453
|
+
assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[width=\\maxwidth]{./images/chap1-sampleimg.png}\n\\reviewimagecaption{sample photo}\n\\label{image:chap1:sampleimg}\n\\end{reviewimage}\n), actual
|
454
454
|
end
|
455
455
|
|
456
456
|
def test_image_with_metric
|
@@ -461,7 +461,7 @@ class LATEXBuidlerTest < Test::Unit::TestCase
|
|
461
461
|
end
|
462
462
|
|
463
463
|
actual = compile_block("//image[sampleimg][sample photo][scale=1.2]{\n//}\n")
|
464
|
-
assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[scale=1.2]{./images/chap1-sampleimg.png}\n\\
|
464
|
+
assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[scale=1.2]{./images/chap1-sampleimg.png}\n\\reviewimagecaption{sample photo}\n\\label{image:chap1:sampleimg}\n\\end{reviewimage}\n), actual
|
465
465
|
end
|
466
466
|
|
467
467
|
def test_image_with_metric_width
|
@@ -473,7 +473,7 @@ class LATEXBuidlerTest < Test::Unit::TestCase
|
|
473
473
|
|
474
474
|
@config['image_scale2width'] = true
|
475
475
|
actual = compile_block("//image[sampleimg][sample photo][scale=1.2]{\n//}\n")
|
476
|
-
assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[width=1.2\\maxwidth]{./images/chap1-sampleimg.png}\n\\
|
476
|
+
assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[width=1.2\\maxwidth]{./images/chap1-sampleimg.png}\n\\reviewimagecaption{sample photo}\n\\label{image:chap1:sampleimg}\n\\end{reviewimage}\n), actual
|
477
477
|
end
|
478
478
|
|
479
479
|
def test_image_with_metric2
|
@@ -484,7 +484,7 @@ class LATEXBuidlerTest < Test::Unit::TestCase
|
|
484
484
|
end
|
485
485
|
|
486
486
|
actual = compile_block("//image[sampleimg][sample photo][scale=1.2,html::class=sample,latex::ignore=params]{\n//}\n")
|
487
|
-
assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[scale=1.2,ignore=params]{./images/chap1-sampleimg.png}\n\\
|
487
|
+
assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[scale=1.2,ignore=params]{./images/chap1-sampleimg.png}\n\\reviewimagecaption{sample photo}\n\\label{image:chap1:sampleimg}\n\\end{reviewimage}\n), actual
|
488
488
|
end
|
489
489
|
|
490
490
|
def test_image_with_metric2_width
|
@@ -496,7 +496,7 @@ class LATEXBuidlerTest < Test::Unit::TestCase
|
|
496
496
|
|
497
497
|
@config['image_scale2width'] = true
|
498
498
|
actual = compile_block("//image[sampleimg][sample photo][scale=1.2,html::class=sample,latex::ignore=params]{\n//}\n")
|
499
|
-
assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[width=1.2\\maxwidth,ignore=params]{./images/chap1-sampleimg.png}\n\\
|
499
|
+
assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[width=1.2\\maxwidth,ignore=params]{./images/chap1-sampleimg.png}\n\\reviewimagecaption{sample photo}\n\\label{image:chap1:sampleimg}\n\\end{reviewimage}\n), actual
|
500
500
|
end
|
501
501
|
|
502
502
|
def test_indepimage
|
@@ -993,8 +993,10 @@ EOS
|
|
993
993
|
|
994
994
|
def test_comment_for_draft
|
995
995
|
@config['draft'] = true
|
996
|
-
actual = compile_block('//comment[
|
997
|
-
assert_equal %Q(\\pdfcomment{
|
996
|
+
actual = compile_block('//comment[コメント<]')
|
997
|
+
assert_equal %Q(\\pdfcomment{コメント\\textless{}}\n), actual
|
998
|
+
actual = compile_block("//comment{\nA<>\nB&\n//}")
|
999
|
+
assert_equal %Q(\\pdfcomment{A\\textless{}\\textgreater{}\\par B\\&}\n), actual
|
998
1000
|
end
|
999
1001
|
|
1000
1002
|
def test_inline_comment
|
@@ -1132,7 +1134,7 @@ EOS
|
|
1132
1134
|
|
1133
1135
|
\\begin{reviewimage}%%sampleimg
|
1134
1136
|
\\includegraphics[width=\\maxwidth]{./images/chap1-sampleimg.png}
|
1135
|
-
\\
|
1137
|
+
\\reviewimagecaption{FOO}
|
1136
1138
|
\\label{image:chap1:sampleimg}
|
1137
1139
|
\\end{reviewimage}
|
1138
1140
|
EOS
|
data/test/test_topbuilder.rb
CHANGED
@@ -182,8 +182,10 @@ class TOPBuidlerTest < Test::Unit::TestCase
|
|
182
182
|
|
183
183
|
def test_comment_for_draft
|
184
184
|
@config['draft'] = true
|
185
|
-
actual = compile_block('//comment[
|
186
|
-
assert_equal %Q(
|
185
|
+
actual = compile_block('//comment[コメント<]')
|
186
|
+
assert_equal %Q(◆→コメント<←◆\n), actual
|
187
|
+
actual = compile_block("//comment{\nA<>\nB&\n//}")
|
188
|
+
assert_equal %Q(◆→A<>\nB&←◆\n), actual
|
187
189
|
end
|
188
190
|
|
189
191
|
def test_list
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: review
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kmuto
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-02-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: image_size
|