review-retrovert 0.3.3 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/retrovert.yml +39 -0
  3. data/.gitignore +2 -2
  4. data/.ruby-version +1 -0
  5. data/Gemfile +1 -0
  6. data/Gemfile.lock +67 -1
  7. data/README.md +6 -3
  8. data/lib/review/retrovert/converter.rb +231 -6
  9. data/lib/review/retrovert/version.rb +1 -1
  10. data/review-retrovert.gemspec +1 -1
  11. data/testdata/mybook/.gitignore +7 -0
  12. data/testdata/mybook/README.md +43 -0
  13. data/testdata/mybook/Rakefile +16 -0
  14. data/testdata/mybook/catalog.yml +33 -0
  15. data/testdata/mybook/config-starter.yml +139 -0
  16. data/testdata/mybook/config.yml +375 -0
  17. data/testdata/mybook/contents/00-preface.re +83 -0
  18. data/testdata/mybook/contents/01-install.re +272 -0
  19. data/testdata/mybook/contents/02-tutorial.re +1008 -0
  20. data/testdata/mybook/contents/03-syntax.re +2613 -0
  21. data/testdata/mybook/contents/04-customize.re +728 -0
  22. data/testdata/mybook/contents/05-faq.re +328 -0
  23. data/testdata/mybook/contents/06-bestpractice.re +971 -0
  24. data/testdata/mybook/contents/91-compare.re +18 -0
  25. data/testdata/mybook/contents/92-filelist.re +119 -0
  26. data/testdata/mybook/contents/93-background.re +267 -0
  27. data/testdata/mybook/contents/99-postface.re +38 -0
  28. data/testdata/mybook/css/normalize.css +349 -0
  29. data/testdata/mybook/css/webstyle.css +514 -0
  30. data/testdata/mybook/images/03-syntax/favicon-16x16.png +0 -0
  31. data/testdata/mybook/images/03-syntax/figure_heretop.png +0 -0
  32. data/testdata/mybook/images/03-syntax/tw-icon1.jpg +0 -0
  33. data/testdata/mybook/images/03-syntax/tw-icon2.jpg +0 -0
  34. data/testdata/mybook/images/03-syntax/tw-icon3.jpg +0 -0
  35. data/testdata/mybook/images/03-syntax/tw-icon4.jpg +0 -0
  36. data/testdata/mybook/images/04-customize/caption_pagebreak.png +0 -0
  37. data/testdata/mybook/images/04-customize/chaptitlepage_sample.png +0 -0
  38. data/testdata/mybook/images/05-faq/codeblock_rpadding1.png +0 -0
  39. data/testdata/mybook/images/05-faq/codeblock_rpadding2.png +0 -0
  40. data/testdata/mybook/images/06-bestpractice/figure_heretop.png +0 -0
  41. data/testdata/mybook/images/06-bestpractice/font_beramono.png +0 -0
  42. data/testdata/mybook/images/06-bestpractice/heading_design1.png +0 -0
  43. data/testdata/mybook/images/06-bestpractice/heading_design2.png +0 -0
  44. data/testdata/mybook/images/06-bestpractice/margin_book.png +0 -0
  45. data/testdata/mybook/images/06-bestpractice/multiline-title.png +0 -0
  46. data/testdata/mybook/images/06-bestpractice/preface_numbered.png +0 -0
  47. data/testdata/mybook/images/06-bestpractice/program_border.png +0 -0
  48. data/testdata/mybook/images/06-bestpractice/sechead_design_4.png +0 -0
  49. data/testdata/mybook/images/06-bestpractice/titlepage-samples.png +0 -0
  50. data/testdata/mybook/images/93-background/bug913.png +0 -0
  51. data/testdata/mybook/images/93-background/slide2.png +0 -0
  52. data/testdata/mybook/images/cover_a5.pdf +0 -0
  53. data/testdata/mybook/images/cover_b5.pdf +0 -0
  54. data/testdata/mybook/images/tw-icon.jpg +0 -0
  55. data/testdata/mybook/layouts/layout.epub.erb +29 -0
  56. data/testdata/mybook/layouts/layout.html5.erb +106 -0
  57. data/testdata/mybook/layouts/layout.tex.erb +546 -0
  58. data/testdata/mybook/lib/hooks/beforetexcompile.rb +55 -0
  59. data/testdata/mybook/lib/ruby/review-builder.rb +503 -0
  60. data/testdata/mybook/lib/ruby/review-cli.rb +58 -0
  61. data/testdata/mybook/lib/ruby/review-compiler.rb +523 -0
  62. data/testdata/mybook/lib/ruby/review-epubmaker.rb +606 -0
  63. data/testdata/mybook/lib/ruby/review-htmlbuilder.rb +661 -0
  64. data/testdata/mybook/lib/ruby/review-latexbuilder.rb +782 -0
  65. data/testdata/mybook/lib/ruby/review-maker.rb +235 -0
  66. data/testdata/mybook/lib/ruby/review-monkeypatch.rb +91 -0
  67. data/testdata/mybook/lib/ruby/review-pdfmaker.rb +468 -0
  68. data/testdata/mybook/lib/ruby/review-textbuilder.rb +36 -0
  69. data/testdata/mybook/lib/ruby/review-tocparser.rb +285 -0
  70. data/testdata/mybook/lib/ruby/review-webmaker.rb +433 -0
  71. data/testdata/mybook/lib/tasks/mytasks.rake +31 -0
  72. data/testdata/mybook/lib/tasks/review.rake +142 -0
  73. data/testdata/mybook/lib/tasks/review.rake.orig +72 -0
  74. data/testdata/mybook/lib/tasks/starter.rake +326 -0
  75. data/testdata/mybook/locale.yml +6 -0
  76. data/testdata/mybook/review-ext.rb +206 -0
  77. data/testdata/mybook/sty/jumoline.sty +310 -0
  78. data/testdata/mybook/sty/mycolophon.sty +81 -0
  79. data/testdata/mybook/sty/mystyle.sty +8 -0
  80. data/testdata/mybook/sty/mytextsize.sty +61 -0
  81. data/testdata/mybook/sty/mytitlepage.sty +103 -0
  82. data/testdata/mybook/sty/reviewmacro.sty +60 -0
  83. data/testdata/mybook/sty/starter-codeblock.sty +332 -0
  84. data/testdata/mybook/sty/starter-color.sty +79 -0
  85. data/testdata/mybook/sty/starter-font.sty +112 -0
  86. data/testdata/mybook/sty/starter-heading.sty +514 -0
  87. data/testdata/mybook/sty/starter-note.sty +127 -0
  88. data/testdata/mybook/sty/starter-section.sty +262 -0
  89. data/testdata/mybook/sty/starter-toc.sty +72 -0
  90. data/testdata/mybook/sty/starter.sty +554 -0
  91. data/testdata/mybook/style.css +597 -0
  92. metadata +100 -3
@@ -0,0 +1,6 @@
1
+ # -*- coding: utf-8 -*-
2
+ locale: ja
3
+ #chapter_postfix: " "
4
+ chapter_postfix: ""
5
+
6
+ equation: 式
@@ -0,0 +1,206 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ ##
4
+ ## Re:VIEWを拡張し、インライン命令とブロック命令を追加する
5
+ ##
6
+
7
+
8
+ require_relative './lib/ruby/review-monkeypatch' ## 諸々の修正(モンキーパッチ)
9
+
10
+
11
+ module ReVIEW
12
+
13
+ ## インライン命令「@<clearpage>{}」を宣言
14
+ Compiler.definline :clearpage ## 改ページ
15
+ Compiler.definline :B ## @<strong>{}のショートカット
16
+ Compiler.definline :hearts ## ハートマーク
17
+ Compiler.definline :TeX ## TeX のロゴマーク
18
+ Compiler.definline :LaTeX ## LaTeX のロゴマーク
19
+
20
+ ## ブロック命令「//textleft{ ... //}」等を宣言
21
+ ## (ここでは第2引数が「0」なので、引数なしのブロック命令になる。
22
+ ## もし第2引数が「1..3」なら、//listのように必須引数が1つで
23
+ ## 非必須引数が2という意味になる。)
24
+ Compiler.defblock :textleft, 0 ## 左寄せ
25
+ Compiler.defblock :textright, 0 ## 右寄せ
26
+ Compiler.defblock :textcenter, 0 ## 中央揃え
27
+ Compiler.defsingle :clearpage, 0 ## 改ページ (\clearpage)
28
+ Compiler.defsingle :sampleoutputbegin, 0..1 ## (出力結果開始部、Starterドキュメントで使用)
29
+ Compiler.defsingle :sampleoutputend, 0 ## (出力結果終了部、Starterドキュメントで使用)
30
+
31
+
32
+ ## LaTeX用の定義
33
+ class LATEXBuilder
34
+
35
+ ## 改ページ(インライン命令)
36
+ def inline_clearpage(str)
37
+ '\clearpage'
38
+ end
39
+
40
+ ## 改ページ(ブロック命令)
41
+ def clearpage()
42
+ puts ''
43
+ puts '\\clearpage'
44
+ puts ''
45
+ end
46
+
47
+ ## @<strong>{} のショートカット
48
+ def inline_B(str)
49
+ inline_strong(str)
50
+ end
51
+ def on_inline_B(&b) # nestable
52
+ on_inline_strong(&b)
53
+ end
54
+
55
+ ## ハートマーク
56
+ def inline_hearts(str)
57
+ '$\heartsuit$'
58
+ end
59
+
60
+ ## TeXのロゴマーク
61
+ def inline_TeX(str)
62
+ '\TeX{}'
63
+ end
64
+
65
+ ## LaTeXのロゴマーク
66
+ def inline_LaTeX(str)
67
+ '\LaTeX{}'
68
+ end
69
+
70
+ ## 左寄せ
71
+ def textleft(lines)
72
+ puts '\begin{flushleft}'
73
+ puts lines
74
+ puts '\end{flushleft}'
75
+ end
76
+
77
+ ## 右寄せ
78
+ ## (注:Re:VIEWにはすでに //flushright{ ... //} があったので、今後はそちらを推奨)
79
+ def textright(lines)
80
+ puts '\begin{flushright}'
81
+ puts lines
82
+ puts '\end{flushright}'
83
+ end
84
+
85
+ ## 中央揃え
86
+ ## (注:Re:VIEWにはすでに //centering{ ... //} があったので、今後はそちらを推奨)
87
+ def textcenter(lines)
88
+ puts '\begin{center}'
89
+ puts lines
90
+ puts '\end{center}'
91
+ end
92
+
93
+ ## 出力結果の開始部と終了部(Starterのドキュメントで使用)
94
+ ## (Re:VIEWではブロックの入れ子も「===[xxx]」の入れ子もできないため)
95
+ def sampleoutputbegin(caption=nil)
96
+ #puts "\\begin{startersampleoutput}" # error in note block
97
+ s = caption ? compile_inline(caption) : nil
98
+ puts "\\startersampleoutput{#{s}}"
99
+ end
100
+ def sampleoutputend()
101
+ #puts "\\end{startersampleoutput}" # error in note block
102
+ puts "\\endstartersampleoutput"
103
+ end
104
+
105
+ end
106
+
107
+
108
+ ## HTML(ePub)用の定義
109
+ class HTMLBuilder
110
+
111
+ ## 改ページはHTMLにはない
112
+ def inline_clearpage(str) # インライン命令
113
+ puts '<p></p>'
114
+ puts '<hr />'
115
+ puts '<p></p>'
116
+ end
117
+
118
+ def clearpage() # ブロック命令
119
+ puts '<p></p>'
120
+ puts '<hr />'
121
+ puts '<p></p>'
122
+ end
123
+
124
+ ## @<strong>{} のショートカット
125
+ def inline_B(str)
126
+ inline_strong(str)
127
+ end
128
+ def on_inline_B(&b) # nestable
129
+ on_inline_strong(&b)
130
+ end
131
+
132
+ ## ハートマーク
133
+ def inline_hearts(str)
134
+ #'&hearts;'
135
+ '&#9829;'
136
+ end
137
+
138
+ ## TeXのロゴマーク
139
+ def inline_TeX(str)
140
+ 'TeX'
141
+ end
142
+
143
+ ## LaTeXのロゴマーク
144
+ def inline_LaTeX(str)
145
+ 'LaTeX'
146
+ end
147
+
148
+ ## 左寄せ
149
+ def textleft(lines)
150
+ puts '<div style="text-align:left">'
151
+ puts lines
152
+ puts '</div>'
153
+ end
154
+
155
+ ## 右寄せ
156
+ def textright(lines)
157
+ puts '<div style="text-align:right">'
158
+ puts lines
159
+ puts '</div>'
160
+ end
161
+
162
+ ## 中央揃え
163
+ def textcenter(lines)
164
+ puts '<div style="text-align:center">'
165
+ puts lines
166
+ puts '</div>'
167
+ end
168
+
169
+ ## 出力結果の開始部と終了部(Starterのドキュメントで使用)
170
+ ## (Re:VIEWではブロックの入れ子も「===[xxx]」の入れ子もできないため)
171
+ def sampleoutputbegin(caption=nil)
172
+ puts "<div class=\"sampleoutput\">"
173
+ if caption
174
+ s = compile_inline(caption)
175
+ puts "<span class=\"caption\">#{caption}</span>"
176
+ end
177
+ puts "<div class=\"sampleoutput-inner\">"
178
+ end
179
+ def sampleoutputend()
180
+ puts "</div></div>"
181
+ end
182
+
183
+ end
184
+
185
+
186
+ class TEXTBuilder
187
+
188
+ ## TeXのロゴマーク
189
+ def inline_TeX(str)
190
+ 'TeX'
191
+ end
192
+
193
+ ## LaTeXのロゴマーク
194
+ def inline_LaTeX(str)
195
+ 'LaTeX'
196
+ end
197
+
198
+ ## ハートマーク
199
+ def inline_hearts(str)
200
+ '&hearts;'
201
+ end
202
+
203
+ end
204
+
205
+
206
+ end
@@ -0,0 +1,310 @@
1
+ %%
2
+ %% This is file `jumoline.sty',
3
+ %% generated with the docstrip utility.
4
+ %%
5
+ %% The original source files were:
6
+ %%
7
+ %% jumoline.dtx (with options: `package')
8
+ %%
9
+ %% IMPORTANT NOTICE:
10
+ %%
11
+ %% For the copyright see the source file.
12
+ %%
13
+ %% Any modified versions of this file must be renamed
14
+ %% with new filenames distinct from jumoline.sty.
15
+ %%
16
+ %% For distribution of the original source see the terms
17
+ %% for copying and modification in the file jumoline.dtx.
18
+ %%
19
+ %% This generated file may be distributed as long as the
20
+ %% original source files, as listed above, are part of the
21
+ %% same distribution. (The sources need not necessarily be
22
+ %% in the same archive or directory.)
23
+ %% Style file `jumoline'.
24
+ %% Copyright (C) 1999-2001 Hiroshi Nakashima
25
+ %% (Toyohashi Univ. of Tech.)
26
+ %%
27
+ %% This program can be redistributed and/or modified under the terms
28
+ %% of the LaTeX Project Public License distributed from CTAN
29
+ %% archives in directory macros/latex/base/lppl.txt; either
30
+ %% version 1 of the License, or any later version.
31
+ %%
32
+ %% \CharacterTable
33
+ %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
34
+ %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
35
+ %% Digits \0\1\2\3\4\5\6\7\8\9
36
+ %% Exclamation \! Double quote \" Hash (number) \#
37
+ %% Dollar \$ Percent \% Ampersand \&
38
+ %% Acute accent \' Left paren \( Right paren \)
39
+ %% Asterisk \* Plus \+ Comma \,
40
+ %% Minus \- Point \. Solidus \/
41
+ %% Colon \: Semicolon \; Less than \<
42
+ %% Equals \= Greater than \> Question mark \?
43
+ %% Commercial at \@ Left bracket \[ Backslash \\
44
+ %% Right bracket \] Circumflex \^ Underscore \_
45
+ %% Grave accent \` Left brace \{ Vertical bar \|
46
+ %% Right brace \} Tilde \~}
47
+ %%
48
+ %%
49
+ \def\next{LaTeX2e}
50
+ \ifx\fmtname\next
51
+ \def\next{
52
+ \NeedsTeXFormat{LaTeX2e}[1994/12/01]
53
+ \ProvidesPackage{jumoline}}
54
+ \else\def\next[#1]{}\fi
55
+ \next
56
+ [2001/05/31 v1.2 ]
57
+
58
+ \ifx\PackageError\undefined
59
+ \def\PackageError#1#2#3{\@latexerr{#1:#2}{#3^^J\@ehc}}
60
+ \fi
61
+
62
+ %%^L
63
+
64
+ %% Register Declaration
65
+
66
+ \newdimen\UnderlineDepth \UnderlineDepth-\maxdimen
67
+ \newdimen\MidlineHeight \MidlineHeight-\maxdimen
68
+ \newdimen\OverlineHeight \OverlineHeight-\maxdimen
69
+ \newdimen\UMOlineThickness \UMOlineThickness.4pt
70
+
71
+ \newdimen\UMO@height \newdimen\UMO@depth
72
+ \newdimen\UMO@dqspace \newdimen\UMO@tempdim
73
+
74
+ \newskip\UMO@prejfmglue \newskip\UMO@postjfmglue
75
+
76
+ \newcount\UMO@mode
77
+ \let\UMO@afterblock\z@
78
+ \let\UMO@afterword\@ne
79
+ \let\UMO@afterchar\tw@
80
+
81
+ \newcount\UMO@spacefactor
82
+ \newcount\UMO@firstxspcode
83
+ \newcount\UMO@lastxspcode
84
+ \newcount\UMO@inhibitxspcode
85
+ \newcount\UMO@prebreakpenalty
86
+ \newcount\UMO@postbreakpenalty
87
+ \newcount\UMO@kpostbreakpenalty
88
+
89
+ \newif\ifUMO@nospace \newif\ifUMO@firstelem
90
+
91
+ %%^L
92
+
93
+ %% User Interface and Initialization
94
+
95
+ \def\Underline{\UMO@line\UnderlineDepth{-\UnderlineDepth}{-\dp\strutbox}}
96
+ \def\Midline{\setbox\@tempboxa\hbox{あ}%
97
+ \UMO@line\MidlineHeight\MidlineHeight{.5\ht\@tempboxa}}
98
+ \def\Overline{\UMO@line\OverlineHeight\OverlineHeight{\ht\strutbox}}
99
+ \def\UMOline{\UMO@line{-\maxdimen}\z@}
100
+
101
+ \def\UMO@line#1#2#3#4{\begingroup \let\\\UMOnewline
102
+ \relax\ifdim#1<\z@ \UMO@height#3\relax
103
+ \else \UMO@height#2\relax \fi
104
+ \UMO@depth-\UMO@height
105
+ \ifdim\UMO@height<\z@ \advance\UMO@depth\UMOlineThickness
106
+ \else \advance\UMO@height\UMOlineThickness \fi
107
+ \settowidth\UMO@dqspace{“}\advance\UMO@dqspace-1zw
108
+ \UMO@dqspace-\UMO@dqspace \divide\UMO@dqspace\tw@
109
+ \UMO@nospacetrue \UMO@firstelemtrue
110
+ \UMO@mode\UMO@afterblock
111
+ \ifvmode\leavevmode\fi
112
+ \def\@tempa{#4 }\edef\@tempb{\noexpand\@nil\space}%
113
+ \expandafter\expandafter\expandafter\UMO@wordloop
114
+ \expandafter\@tempa\@tempb
115
+ \endgroup \UMO@aftergroup}
116
+
117
+ %%^L
118
+
119
+ %% Processing Word Elements
120
+
121
+ \def\UMO@wordloop{\UMO@ifbgroup\UMO@wordblock\UMO@iwordloop}
122
+ \def\UMO@ifbgroup#1#2{\let\@tempa#1\let\@tempb#2\futurelet\@tempc\UMO@ifnc}
123
+ \def\UMO@ifnc{\ifx\@tempc\bgroup \let\next\@tempa \else\let\next\@tempb \fi
124
+ \next}
125
+ \def\UMO@wordblock#1{\UMO@spaceskip
126
+ \UMO@putbox\relax{#1}\UMO@nospacetrue \UMO@mode\UMO@afterblock
127
+ \UMO@spacefactor\@m \UMO@wordloop}
128
+ \def\UMO@iwordloop#1 {\def\@tempa{#1}\ifx\@tempa\@nnil \let\next\UMO@end
129
+ \else
130
+ \ifx\@tempa\empty \UMO@nospacefalse
131
+ \else
132
+ \UMO@spaceskip \UMO@mode\UMO@afterblock
133
+ \def\UMO@theword{}\UMO@firstxspcode\m@ne
134
+ \UMO@charloop#1\@nil \fi
135
+ \let\next\UMO@wordloop \fi
136
+ \next}
137
+
138
+ %%^L
139
+
140
+ %% Interword Spacing
141
+
142
+ \def\UMO@spaceskip{\ifUMO@nospace \UMO@nospacefalse \else
143
+ \ifdim\spaceskip=\z@
144
+ \@tempdima\fontdimen3\font\relax
145
+ \multiply\@tempdima\UMO@spacefactor \divide\@tempdima\@m
146
+ \@tempdimb\fontdimen4\font\relax \multiply\@tempdimb\@m
147
+ \divide\@tempdimb\UMO@spacefactor
148
+ \@tempskipa\fontdimen2\font plus\@tempdima minus\@tempdimb\relax
149
+ \else
150
+ \edef\@tempa{\the\spaceskip\space @ @ @ @ }%
151
+ \expandafter\UMO@setspaceskip\@tempa\@nil
152
+ \fi
153
+ \ifnum\UMO@spacefactor<2000\else
154
+ \ifdim\xspaceskip=\z@ \advance\@tempskipa\fontdimen7\font
155
+ \else \@tempskipa\xspaceskip
156
+ \fi\fi
157
+ \UMO@skip\@tempskipa \fi}
158
+ \def\UMO@setspaceskip#1 #2 #3 #4 #5 #6\@nil{\@tempdima\z@ \@tempdimb\z@
159
+ \def\@tempa{#2}\def\@tempb{#3}%
160
+ \ifx\@tempa\UMO@plus \@tempdima#3\def\@tempa{#4}\def\@tempb{#5}\fi
161
+ \ifx\@tempa\UMO@minus \@tempdimb\@tempb\relax\fi
162
+ \multiply\@tempdima\UMO@specefactor \divide\@tempdima\@m
163
+ \multiply\@tempdimb\@m \divide\UMO@spacefactor
164
+ \@tempskipa#1 plus\@tempdima minus\@tempdimb\relax}
165
+ \def\@tempa#1 #2 #3 #4 #5\@nil{\def\UMO@plus{#2}\def\UMO@minus{#4}}
166
+ \@tempskipa1pt plus 2pt minus 3pt
167
+ \expandafter\@tempa\the\@tempskipa\@nil
168
+
169
+ %%^L
170
+
171
+ %% Processing Characters
172
+
173
+ \def\UMO@charloop{\UMO@ifbgroup\UMO@charblock\UMO@icharloop}
174
+ \def\UMO@charblock#1{\UMO@putword
175
+ \UMO@putbox\relax{#1}\UMO@mode\UMO@afterblock \UMO@spacefactor\@m
176
+ \UMO@charloop}
177
+ \def\UMO@icharloop#1{\def\@tempa{#1}%
178
+ \ifx\@tempa\@nnil \UMO@putword \let\next\relax
179
+ \else\ifx\UMOspace#1\relax \UMO@putword \let\next\UMO@space
180
+ \else\ifx\UMOnewline#1\relax \UMO@putword \let\next\UMO@newline
181
+ \else
182
+ \ifnum`#1<256\relax \edef\UMO@theword{\UMO@theword#1}%
183
+ \ifnum\UMO@firstxspcode<\z@
184
+ \UMO@firstxspcode\xspcode`#1\relax
185
+ \UMO@prebreakpenalty\prebreakpenalty`#1\relax
186
+ \fi
187
+ \UMO@lastxspcode\xspcode`#1\relax
188
+ \UMO@postbreakpenalty\postbreakpenalty`#1\relax
189
+ \else \UMO@putword \UMO@putchar{#1}\UMO@spacefactor\@m\fi
190
+ \let\next\UMO@charloop \fi\fi\fi \next}
191
+ \def\UMOspace{\PackageError{jumoline}%
192
+ {\string\UMOspace\space cannot be used here.}%
193
+ {\string\UMOspace\space can be used only in the argument of
194
+ \string\Underline\space and its relatives.}}
195
+ \def\UMOnewline{\PackageError{jumoline}%
196
+ {\string\UMOnewline\space cannot be used here.}%
197
+ {\string\UMOnewline\space can be used only in the argument of
198
+ \string\Underline\space and its relatives.}}
199
+
200
+ %%^L
201
+
202
+ %% Put ASCII String
203
+
204
+ \def\UMO@putword{\ifx\UMO@theword\empty\else
205
+ \ifnum\UMO@mode=\UMO@afterchar
206
+ \advance\UMO@kpostbreakpenalty\UMO@prebreakpenalty
207
+ \penalty\UMO@kpostbreakpenalty
208
+ \ifdim\UMO@postjfmglue>\z@ \UMO@skip\UMO@postjfmglue
209
+ \else\ifodd\UMO@inhibitxspcode \ifodd\UMO@firstxspcode
210
+ \UMO@skip\xkanjiskip \fi\fi\fi\fi
211
+ \setbox\@tempboxa\hbox{%
212
+ \UMO@theword\global\UMO@spacefactor\spacefactor}%
213
+ \UMO@putbox\relax\UMO@theword \UMO@mode\UMO@afterword
214
+ \def\UMO@theword{}\fi \UMO@firstxspcode\m@ne}
215
+
216
+ %%^L
217
+
218
+ %% Put Kanji Letter
219
+
220
+ \def\UMO@putchar#1{%
221
+ \ifnum\UMO@mode=\UMO@afterchar \UMO@prejfmglue\UMO@postjfmglue
222
+ \else \UMO@prejfmglue\z@ \fi
223
+ \UMO@postjfmglue\z@
224
+ \ifnum`#1<\kuten"1001\relax\UMO@setjfmglue{#1}\fi
225
+ \@tempskipa\UMO@prejfmglue
226
+ \UMO@inhibitxspcode\inhibitxspcode`#1\relax
227
+ \@tempcnta\prebreakpenalty`#1\relax
228
+ \ifnum\UMO@mode=\UMO@afterchar
229
+ \advance\@tempcnta\UMO@kpostbreakpenalty
230
+ \ifdim\UMO@prejfmglue=\z@ \@tempskipa\kanjiskip \fi
231
+ \else\ifnum\UMO@mode=\UMO@afterword
232
+ \advance\@tempcnta\UMO@postbreakpenalty
233
+ \ifdim\UMO@prejfmglue=\z@
234
+ \ifnum\UMO@lastxspcode>\@ne \ifnum\UMO@inhibitxspcode>\@ne
235
+ \@tempskipa\xkanjiskip \fi\fi\fi\fi\fi
236
+ \penalty\@tempcnta
237
+ \edef\@tempa{\the\@tempskipa}\ifx\@tempa\UMO@zskip\else
238
+ \UMO@skip\@tempskipa \fi
239
+ \UMO@putbox\inhibitglue{#1}%
240
+ \UMO@kpostbreakpenalty\postbreakpenalty`#1\relax
241
+ \UMO@mode\UMO@afterchar}
242
+ \@tempskipa\z@
243
+ \edef\UMO@zskip{\the\@tempskipa}
244
+ \def\UMO@setjfmglue#1{%
245
+ \settowidth\@tempdima{あ#1}\settowidth\@tempdimb{あ\inhibitglue#1}%
246
+ \advance\@tempdima-\@tempdimb
247
+ \settowidth\UMO@tempdim{#1あ}\settowidth\@tempdimb{#1\inhibitglue あ}%
248
+ \advance\UMO@tempdim-\@tempdimb
249
+ \ifdim\@tempdima>\z@
250
+ \ifdim\UMO@tempdim>\z@
251
+ \@tempskipa\@tempdima minus\@tempdima\relax
252
+ \UMO@postjfmglue\UMO@tempdim minus\UMO@tempdim\relax
253
+ \else \@tempskipa\@tempdima minus\UMO@dqspace\relax \fi
254
+ \advance\UMO@prejfmglue\@tempskipa
255
+ \else \UMO@postjfmglue\UMO@tempdim minus\UMO@dqspace \fi}
256
+
257
+ %%^L
258
+
259
+ %% Draw Under/Mid/Overline
260
+
261
+ \def\UMO@putbox#1#2{\setbox\@tempboxa\hbox{#1#2#1}\@tempdima\wd\@tempboxa
262
+ \ifUMO@firstelem\else
263
+ \rlap{\vrule\@height\UMO@height\@depth\UMO@depth\@width\@tempdima}\fi
264
+ \box\@tempboxa
265
+ \ifUMO@firstelem \UMO@firstelemfalse
266
+ \llap{\vrule\@height\UMO@height\@depth\UMO@depth\@width\@tempdima}\fi}
267
+ \def\UMO@skip#1{%
268
+ \leaders\hrule\@height\UMO@height\@depth\UMO@depth\hskip#1\relax}
269
+
270
+ %%^L
271
+
272
+ %% Explicit Spacing and Line Breaking
273
+
274
+ \def\UMO@space{\UMO@mode\UMO@afterblock
275
+ \@ifstar\UMO@sspace\UMO@ispace}
276
+ \def\UMO@sspace#1{\vrule width\z@\nobreak\UMO@skip{#1}\UMO@charloop}
277
+ \def\UMO@ispace#1{\@tempskipa#1\relax
278
+ \@ifstar{\@tempswafalse\UMO@iispace}{\@tempswatrue\UMO@iispace}}
279
+ \def\UMO@iispace{\@ifnextchar[%]
280
+ {\UMO@penalty}%
281
+ {\UMO@skip\@tempskipa \UMO@charloop}}
282
+ \def\UMO@penalty[#1]{\@tempcnta#1\relax
283
+ \if@tempswa
284
+ \ifnum\@tempcnta<\z@ \@tempcnta-\@tempcnta \fi
285
+ \ifcase\@tempcnta \or
286
+ \@tempcnta\@lowpenalty \or
287
+ \@tempcnta\@medpenalty \or
288
+ \@tempcnta\@highpenalty \else
289
+ \@tempcnta\@M \fi
290
+ \ifnum#1<\z@ \@tempcnta-\@tempcnta \fi \fi
291
+ \penalty\@tempcnta \UMO@skip\@tempskipa \UMO@charloop}
292
+
293
+ \def\UMO@newline{\UMO@mode\UMO@afterblock
294
+ \@ifstar{\UMO@skip{0pt plus1fil}\break \UMO@charloop}%
295
+ {\hfil \break \UMO@charloop}}
296
+
297
+ %%^L
298
+
299
+ %% Finalization
300
+
301
+ \def\UMO@end{\ifnum\UMO@mode=\UMO@afterchar
302
+ \ifnum\UMO@kpostbreakpenalty>\z@
303
+ \penalty\UMO@kpostbreakpenalty \fi
304
+ \ifdim\UMO@postjfmglue>\z@
305
+ \UMO@skip\UMO@postjfmglue\fi \fi
306
+ \xdef\UMO@aftergroup{\ifnum\UMO@mode=\UMO@afterword
307
+ \spacefactor\number\UMO@spacefactor\fi}}
308
+ \endinput
309
+ %%
310
+ %% End of file `jumoline.sty'.