OSDN Git Service

Revised bd2tex with processing volumes and parts
authornangxiang <nangxiang@users.sourceforge.jp>
Sat, 23 Jul 2011 03:06:18 +0000 (12:06 +0900)
committernangxiang <nangxiang@users.sourceforge.jp>
Sat, 23 Jul 2011 03:06:18 +0000 (12:06 +0900)
bd2tex.rb
bd2tex.rtex

index 893899d..2d641f3 100644 (file)
--- a/bd2tex.rb
+++ b/bd2tex.rb
@@ -48,16 +48,17 @@ class TexConverter
   end
   def parse_wordnum(doc)
     if doc.has_key?('part') then
-      push_wordnum(doc['part'])
+      push_wordnum('part', doc)
     elsif doc.has_key?('volume')
-      push_wordnum(doc['volume'])
+      push_wordnum('volume', doc)
     end
   end
-  def push_wordnum(lines)
+  def push_wordnum(type, doc)
+    lines = doc[type]
     if lines then
-      @wordlist.push(['wordnum', lines])
+      @wordlist.push([type, lines])
     else
-      @wordlist.push(['wordnum', []])
+      @wordlist.push([type, []])
     end
   end
 end
index 0f824c8..8e8d145 100644 (file)
 
 <% @wordlist.each do |word| %>
    <% (char, content) = word %>%
-   <% if char != 'wordnum' then %>
-     {\HUGE\ebas <%= char %>}(<%= char %>)
+   <% if char == 'part' then %>
+     \hspace{4em}
+   <% elsif char == 'volume' then %>
+     \hspace{2em}
+   <% else %>
+     {\Huge\ebas <%= char %>}(<%= char %>)
    <% end %>%
    <% if content then %>%
    <% content.each do |line| %>%