From: gotoken@... (GOTO Kentaro) Date: 1999-08-15T23:37:31+09:00 Subject: [ruby-list:16161] Re: rdtool-0.2.1 --Multipart_Sun_Aug_15_23:36:58_1999-1 Content-Type: text/plain; charset=ISO-2022-JP ごとけんです In message "[ruby-list:16157] rdtool-0.2.1" on 99/08/15, Toshiro Kuwabara writes: >Toshです。 > >rdtool-0.2.1.tar.gzをin.commingに置きました。 \footnote のような fragile は \protect する必要があります。 スタイルも気に入らない所があるけど、いま時間がないのでとりあ えずlatexに通るようにだけしました。 -- gotoken --Multipart_Sun_Aug_15_23:36:58_1999-1 Content-Type: application/octet-stream Content-Disposition: attachment; filename="rdtool-0.2.1.patch0.txt" Content-Transfer-Encoding: 7bit --- rd2latex-lib.rb.orig Sun Aug 15 18:12:57 1999 +++ rd2latex-lib.rb Sun Aug 15 23:27:13 1999 @@ -16,3 +16,3 @@ class DocumentElement < RDElement - def translate + def translate(opt = {}) content = [] @@ -28,5 +28,5 @@ class HeadlineElement < BlockElement - def translate + def translate(opt = {}) content = [] - @children.each do |i| content.push(i.translate) end + @children.each do |i| content.push(i.translate(:protect => true)) end content = content.join("") @@ -51,3 +51,3 @@ class TextElement < BlockElement - def translate + def translate(opt = {}) content = [] @@ -60,3 +60,3 @@ class VerbatimElement < BlockElement - def translate + def translate(opt = {}) content = @children.join("\n") @@ -67,3 +67,3 @@ class ItemListElement < ListElement - def translate + def translate(opt = {}) content = [] @@ -76,3 +76,3 @@ class ListItem < BlockElement - def translate + def translate(opt = {}) content = [] @@ -85,3 +85,3 @@ class EnumListElement < ListElement - def translate + def translate(opt = {}) content = [] @@ -94,3 +94,3 @@ class DescListElement < ListElement - def translate + def translate(opt = {}) content = [] @@ -103,3 +103,3 @@ class DescListItem < ListItem - def translate + def translate(opt = {}) content = [] @@ -112,5 +112,9 @@ class FootnoteElement < InlineElement - def translate + def translate(opt = {}) @content.translate - "\\footnote{@content}" + if opt[:protect] + "{\\protect \\footnote{#{@content}}}" + else + "\\footnote{#{@content}}" + end end @@ -129,3 +133,3 @@ - def translate + def translate(opt = {}) if IndexElement.list.index(@content) @@ -134,3 +138,3 @@ IndexElement.list.push(@content) - "\\index{@content}" + "\\index{#{@content}}" end @@ -151,3 +155,3 @@ - def translate + def translate(opt = {}) self.metacharescape --Multipart_Sun_Aug_15_23:36:58_1999-1--