aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/texpdf_format.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-05-12 23:13:42 -0400
committerRalph Amissah <ralph@amissah.com>2014-05-12 23:13:42 -0400
commitcd4b4e42386f781c14e5c8c945d11e7c08cf98c5 (patch)
treeabf133b83011471982b1f8085bb25a315ea3ca0d /lib/sisu/v6/texpdf_format.rb
parentv5 v6: bin/sisu, ensure return to start dir (diff)
v6: ao, heading with no ocn, distinguish ~# from -#
* ~# is general & means no ocn (for any object to which it is applied) * -# is relevant only for 1~ dummy headings & instructs that they should be removed from output where possible * applied so far to pdf, odt & plaintext
Diffstat (limited to 'lib/sisu/v6/texpdf_format.rb')
-rw-r--r--lib/sisu/v6/texpdf_format.rb22
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb
index e680bc00..ce027718 100644
--- a/lib/sisu/v6/texpdf_format.rb
+++ b/lib/sisu/v6/texpdf_format.rb
@@ -258,20 +258,24 @@ module SiSU_TeX_Pdf
\\markboth{#{@md.title.full}}\n")
dob
end
- def heading_sublevels(dob,sublev)
- if sublev==:lev1
+ def heading_dev_null(dob)
+ dob.tmp,dob.obj='',''
+ dob
+ end
+ def heading_sublevels(dob)
+ if dob.lv=='1'
sect='section'
tocadd=%{\\addcontentsline{toc}{section}}
pre=''
post=''
headadd=%{\n\\markright{#{@md.title.full}}}
- elsif sublev==:lev2
+ elsif dob.lv=='2'
sect='subsection'
tocadd=%{\\addcontentsline{toc}{subsection}}
pre=''
post=" \\\\\n"
headadd=''
- elsif sublev==:lev3
+ elsif dob.lv=='3'
sect='subsubsection'
tocadd=%{\\addcontentsline{toc}{subsubsection}}
pre='' #pre='~~~~'
@@ -307,13 +311,17 @@ module SiSU_TeX_Pdf
section_heading_level(@dob)
end
def heading_level_1
- heading_sublevels(@dob,:lev1)
+ if not @dob.use_ == :dummy
+ heading_sublevels(@dob)
+ else
+ heading_dev_null(@dob)
+ end
end
def heading_level_2
- heading_sublevels(@dob,:lev2)
+ heading_sublevels(@dob)
end
def heading_level_3
- heading_sublevels(@dob,:lev3)
+ heading_sublevels(@dob)
end
def hang
case @dob.indent