aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/texpdf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v0/texpdf.rb')
-rw-r--r--lib/sisu/v0/texpdf.rb27
1 files changed, 15 insertions, 12 deletions
diff --git a/lib/sisu/v0/texpdf.rb b/lib/sisu/v0/texpdf.rb
index c2a6b14f..989899cf 100644
--- a/lib/sisu/v0/texpdf.rb
+++ b/lib/sisu/v0/texpdf.rb
@@ -236,7 +236,7 @@ module SiSU_TeX
@@tex_backslash ||="\\\\"
@@tilde='\\\\\\~' #?? debug crazy
@@tex_head_portrait,@@tex_head_landscape=nil,nil
- @@flag_group,@@flag_code=false,false
+ @@flag_alt,@@flag_group,@@flag_code=false,false,false
@@dp,@@prefix_b=nil,nil
def initialize(data,md,orientation)
@data,@md,@orientation=data,md,orientation
@@ -428,7 +428,7 @@ WOK
@group_collect=[]
data.each do |para| #% case follows with levels 1-6 indents & graphics
mono=SiSU_TeX_Pdf::Format_text_object.new(@md,para)
- if para =~/<:(code|alt|verse|group)>/ or @@flag_group==true
+ if para =~/<:(code|alt|verse|group)>/ or @@flag_alt
if para =~/<:(code|alt|verse|group)>/
@lineone=case para
when /<:(alt|verse|group)>/; para
@@ -440,16 +440,22 @@ WOK
do_mono=SiSU_TeX_Pdf::Format_text_object.new(@md,para)
para=do_mono.special_characters_curly(para)
end
- regx=/<:((?:code|alt|verse|group)(?:-end)?)>/
+ regx=/<:((?:code|alt|verse|group)(?:-end)?)>/m
x=regx.match(para)[1] if para =~regx
x=$1
para.gsub!(/\n<:(?:code|alt|verse|group)>\n/m,'')
para=enclose(para,'code') unless para =~/^$/
- if x =~/(?:alt|verse|group)/; @@flag_group=true
- elsif x =~/code/; @@flag_group,@@flag_code=true,true
- elsif @@flag_group==true; @group_collect << para #<< "\n\n"
+ if x =~/(?:alt|verse|group)/; @@flag_alt=true
+ if x =~/group/; @@flag_group=true
+ end
+ elsif x =~/code/; @@flag_alt,@@flag_code=true,true
+ elsif @@flag_alt;
+ if para =~ /\}(?:https?|file|ftp)/m
+ para=mono.http(@orientation)
+ end
+ @group_collect << para #<< "\n\n"
end
- if x =~/(?:code|alt|verse|group)-end/
+ if x =~/(?:code|alt|verse|group)-end/m
regx=/(\\+marginpar\{\\+begin\{tiny\}\d+\\+end\{tiny\}\})/
y=if para =~regx
regx.match(para)[1]
@@ -470,14 +476,11 @@ WOK
#@group_collect.each{ |x| x.gsub!(/(.#{@@tilde}\S*\s*|<:\S+>|<!.*?!>|<!>)/,' ') }
#@lineone.gsub!(/(.#{@@tilde}\S*\s*|<:\S+>|<!.*?!>|<!>)/,' ')
insert=[]
- if para =~/<:code-end>/
+ if para =~/<:code-end>/m
insert << y + @lineone << @group_collect << ' \end{scriptsize}' << " #{@tex.paraskip_normal}"
- #insert << y + @lineone << @group_collect << ' \end{footnotesize}' << " #{@tex.paraskip_normal}"
- #insert << y + @lineone << @group_collect << ' \end{texttt}' << " #{@tex.paraskip_normal}"
- #insert << y + @lineone << @group_collect << ' \end{ttfamily} \end{small}' << " #{@tex.paraskip_normal}"
else insert << y + @lineone << @group_collect
end
- @@flag_group,@@flag_code=false,false
+ @@flag_alt,@@flag_group,@@flag_code=false,false,false
@group_collect=[]
para.gsub!(/(<:\S+>|<!.*?!>|<!>)/,' ')
#para.gsub!(/(.#{@@tilde}\S*\s*|<:\S+>|<!.*?!>|<!>)/,' ')