aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v2/texpdf_format.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v2/texpdf_format.rb')
-rw-r--r--lib/sisu/v2/texpdf_format.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb
index 465d4d90..732a903e 100644
--- a/lib/sisu/v2/texpdf_format.rb
+++ b/lib/sisu/v2/texpdf_format.rb
@@ -210,8 +210,9 @@ module SiSU_TeX_Pdf
dob=@dob
title=@md.title.full
dob.tmp.strip! if dob.tmp
- dob.tmp.gsub!(/(?:\\begin\{bfseries\}|\\begin\{itshape\})(.+?)(?:\\end\{bfseries\}|\\end\{itshape\})/m,'\1')
+ dob.tmp.gsub!(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2')
cont_ln=dob.tmp.dup
+ cont_ln.gsub!(/\\begin\{(monosp)\}(.+?)\\end\{\1\}/m,'\2')
cont_ln.gsub!(@@tex_pattern_margin_number,'')
clearp=(dob.lv =~/B/ && dob.obj =='Metadata') ? "\\clearpage\n" : ''
if dob.tmp =~/\\[Ff]ootnote/ #and dob =~/^[1-6]#{Tex[:tilde]}/ # removing footnotes from headings!
@@ -227,8 +228,9 @@ module SiSU_TeX_Pdf
def level4
dob=@dob
dob.tmp.strip! if dob.tmp
- dob.tmp.gsub!(/(?:\\begin\{bfseries\}|\\begin\{itshape\})(.+?)(?:\\end\{bfseries\}|\\end\{itshape\})/m,'\1')
+ dob.tmp.gsub!(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2')
cont_ln=dob.tmp.dup
+ cont_ln.gsub!(/\\begin\{(monosp)\}(.+?)\\end\{\1\}/m,'\2')
cont_ln.gsub!(@@tex_pattern_margin_number,'')
cont_ln.gsub!(/#{Tex[:backslash]*2}/,"#{Tex[:backslash]*4}") # added w42
cont_ln.gsub!(/\\footnote\[\d+\]\{%.+?\\end\{scriptsize\}\s*\}/m,'') #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22
@@ -250,8 +252,9 @@ module SiSU_TeX_Pdf
dob=@dob
# there is a problem here with creation of headers does not do what you would want it to header starts with a * and is not in bold work on \\@txt*, same for next section 2002w46
dob.tmp.strip! if dob.tmp
- dob.tmp.gsub!(/(?:\\begin\{bfseries\}|\\begin\{itshape\})(.+?)(?:\\end\{bfseries\}|\\end\{itshape\})/m,'\1')
+ dob.tmp.gsub!(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2')
cont_ln=dob.tmp.dup
+ cont_ln.gsub!(/\\begin\{(monosp)\}(.+?)\\end\{\1\}/m,'\2')
cont_ln.gsub!(@@tex_pattern_margin_number,'')
cont_ln.gsub!(/\\footnote\[\d+\]\{%.+?\\end\{scriptsize\}\s*\}/m,'') #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22
cont_ln.gsub!(/\\Footnote[A]\{[*+]+\d*\}\{%.+?\\end\{scriptsize\}\s*\}/m,'') #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22
@@ -270,8 +273,9 @@ module SiSU_TeX_Pdf
dob=@dob
# there is a problem here with creation of headers does not do what you would want it to header starts with a * and is not in bold work on \\sub@txt*, same for previous section 2002w46
dob.tmp.strip! if dob.tmp
- dob.tmp.gsub!(/(?:\\begin\{bfseries\}|\\begin\{itshape\})(.+?)(?:\\end\{bfseries\}|\\end\{itshape\})/m,'\1')
+ dob.tmp.gsub!(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2')
cont_ln=dob.tmp.dup
+ cont_ln.gsub!(/\\begin\{(monosp)\}(.+?)\\end\{\1\}/m,'\2')
cont_ln.gsub!(@@tex_pattern_margin_number,'')
cont_ln.gsub!(/\\footnote\[\d+\]\{%.+?\\end\{scriptsize\}\s*\}/m,'') #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22
cont_ln.gsub!(/\\Footnote[A]\{[*+]+\d*\}\{%.+?\\end\{scriptsize\}\s*\}/m,'') #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22
@@ -280,7 +284,9 @@ module SiSU_TeX_Pdf
cont_ln.gsub!(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ')
end
dob.tmp.gsub!(/^(.*)?\n?$/m,
- '\subsubsection*{\1}')
+ "\\subsubsection*{\\1}
+\\addcontentsline{toc}{subsubsection}{~~~~#{cont_ln} \\\\
+}")
dob
end
def indent