From 406eed70e10a8414fd18b9c5c8a260673bb344c5 Mon Sep 17 00:00:00 2001
From: Ralph Amissah
Date: Wed, 13 Oct 2010 10:30:46 -0400
Subject: texpdf, first space following a bullet should be fixed width, fix
(requested fix and suggested solution, Ben Armstrong)
---
lib/sisu/v2/texpdf.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'lib')
diff --git a/lib/sisu/v2/texpdf.rb b/lib/sisu/v2/texpdf.rb
index 32b0d2ff..144ee67a 100644
--- a/lib/sisu/v2/texpdf.rb
+++ b/lib/sisu/v2/texpdf.rb
@@ -343,7 +343,7 @@ module SiSU_TeX
end
if dob.is=='para' \
and dob.bullet_
- dob.tmp='$\txtbullet$~~' + dob.tmp
+ dob.tmp='$\txtbullet$\hspace{\enspace}' + dob.tmp
end
elsif dob.is =='break'
if dob.obj==Mx[:br_page]; dob.tmp='\newpage'
--
cgit v1.2.3
From 9314a7a39594771f4af18448fa053b158237a2b6 Mon Sep 17 00:00:00 2001
From: Ralph Amissah
Date: Wed, 13 Oct 2010 10:46:24 -0400
Subject: texpdf, first space following a bullet should be fixed width (also),
fix
---
lib/sisu/v2/texpdf.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'lib')
diff --git a/lib/sisu/v2/texpdf.rb b/lib/sisu/v2/texpdf.rb
index 144ee67a..9f59032b 100644
--- a/lib/sisu/v2/texpdf.rb
+++ b/lib/sisu/v2/texpdf.rb
@@ -406,7 +406,7 @@ module SiSU_TeX
@lineone=case dob.is
when /alt|group|verse/
dob.tmp.gsub!(/#{Mx[:nbsp]}/m,'{~}')
- dob.tmp.gsub!(/#{Mx[:gl_bullet]}/m,'$\txtbullet$~~')
+ dob.tmp.gsub!(/#{Mx[:gl_bullet]}/m,'$\txtbullet$\hspace{\enspace}')
dob.tmp.gsub!(/#{Mx[:br_nl]}+/m,"\n\n") #match not ideal, but currently not inserting extra newlines anyway
ocn=SiSU_TeX_Pdf::Format_text_object.new(@md).ocn_display(dob)
dob.tmp=if dob.is=='group' \
--
cgit v1.2.3
From 2956c8fa6331ba1a1ec8534a710ac512b44213b7 Mon Sep 17 00:00:00 2001
From: Ralph Amissah
Date: Thu, 14 Oct 2010 14:45:46 -0400
Subject: dal_endnotes, cosmetic code arrangement
---
lib/sisu/v2/dal_endnotes.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'lib')
diff --git a/lib/sisu/v2/dal_endnotes.rb b/lib/sisu/v2/dal_endnotes.rb
index 0ea1d148..95176516 100644
--- a/lib/sisu/v2/dal_endnotes.rb
+++ b/lib/sisu/v2/dal_endnotes.rb
@@ -74,7 +74,9 @@ module SiSU_endnotes
if @md.mod.inspect =~/--no-dagger|--no-annotate/
dob.obj.gsub!(/#{Mx[:en_b_o]}[+]\s.+?#{Mx[:en_b_c]}/,'')
end
- if defined? dob.obj and defined? dob.is and dob.is !~/^code/
+ if defined? dob.obj \
+ and defined? dob.is \
+ and dob.is !~/^code/
case dob.obj # auto-numbered endnotes -->
when /#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}[*+]\s+.+?#{Mx[:en_b_c]}/
dob.obj.gsub!(/\s*(#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/,' \1') # required 2003w31
--
cgit v1.2.3
From dc6f4fbafdd3d296597e799c94c05187e6ad5b7f Mon Sep 17 00:00:00 2001
From: Ralph Amissah
Date: Thu, 14 Oct 2010 14:48:26 -0400
Subject: documentation related minor updates and fixes
---
lib/sisu/v2/cgi_sql_common.rb | 11 ++++++++++-
lib/sisu/v2/defaults.rb | 15 ++++++++++-----
2 files changed, 20 insertions(+), 6 deletions(-)
(limited to 'lib')
diff --git a/lib/sisu/v2/cgi_sql_common.rb b/lib/sisu/v2/cgi_sql_common.rb
index 56f6cb37..1b043f00 100644
--- a/lib/sisu/v2/cgi_sql_common.rb
+++ b/lib/sisu/v2/cgi_sql_common.rb
@@ -569,9 +569,18 @@ module SiSU_CGI_sql
w3 since October 3 1993
-
+
ralph@amissah.com
+
+ mailing list subscription
+
+ http://lists.sisudoc.org/listinfo/sisu
+
+
+
+ sisu@lists.sisudoc.org
+
diff --git a/lib/sisu/v2/defaults.rb b/lib/sisu/v2/defaults.rb
index 188b1869..362b67e5 100644
--- a/lib/sisu/v2/defaults.rb
+++ b/lib/sisu/v2/defaults.rb
@@ -1595,7 +1595,7 @@ WOK
w3 since October 3 1993
-
+
ralph@amissah.com
@@ -1989,7 +1989,7 @@ SiSU is a comprehensive future-proofing electronic document management system.
Potential users of SiSU include individual authors who want to publish their books or articles electronically to reach a broad audience, web publishers who want to provide multiple channels of access to their electronic documents, or any organizations which centrally manage a medium or large set of electronic documents, especially governmental organizations which may prefer to keep their documents in easily accessible yet non-proprietary formats.
-SiSU is an Open Source project initiated and led by Ralph Amissah (ralph.amissah@gmail.com) and can be contacted at sisu@lists.sisudoc.org. SiSU is licensed under the GNU General Public License.
+SiSU is an Open Source project initiated and led by Ralph Amissah (ralph.amissah@gmail.com) and can be contacted via mailing list http://lists.sisudoc.org/listinfo/sisu at sisu@lists.sisudoc.org. SiSU is licensed under the GNU General Public License.
For less markup than the most elementary HTML you can have more.
@@ -2151,21 +2151,26 @@ SiSU was developed in relation to legal documents, and is strong across a wide v
SiSU has been developed and has been in use for several years. Requirements to cover a wide range of documents within its use domain have been explored.
-
+
ralph@amissah.com
-
+
ralph.amissah@gmail.com
-
+
sisu@lists.sisudoc.org.
+
+http://lists.sisudoc.org/listinfo/sisu
+
+
+
#{@date.year_static}
--
cgit v1.2.3
From 9a32a0743767b16456fee98354f269ba6a29efdf Mon Sep 17 00:00:00 2001
From: Ralph Amissah
Date: Thu, 14 Oct 2010 14:51:14 -0400
Subject: codeblocks, numbered markup option, fix
(requested fix needed by debian-live:live-manual,
Ben Armstrong & Mark Schneider)
* numbered codeblocks, , where codeblock opens with code{#
* dal changes as required, flag markup request and number
* constants, provide vertical line symbol, use to separate numbered
codeblock from code
* texpdf substitute \vline for numbered codeblock line separator
---
lib/sisu/v2/constants.rb | 1 +
lib/sisu/v2/dal_doc_objects.rb | 117 +++++++++++++++++++++--------------------
lib/sisu/v2/dal_doc_str.rb | 3 +-
lib/sisu/v2/dal_syntax.rb | 23 ++++++--
lib/sisu/v2/texpdf.rb | 4 +-
5 files changed, 84 insertions(+), 64 deletions(-)
(limited to 'lib')
diff --git a/lib/sisu/v2/constants.rb b/lib/sisu/v2/constants.rb
index 7fe795da..9367e9cd 100644
--- a/lib/sisu/v2/constants.rb
+++ b/lib/sisu/v2/constants.rb
@@ -103,6 +103,7 @@ Mx[:rel_o]='⌈'; Mx[:rel_c]='⌋'
Mx[:tag_o]='⌊'; Mx[:tag_c]='⌉'
Mx[:sm_set_o]='《'; Mx[:sm_set_c]='》'
Mx[:sm_subset_o]='《 '; Mx[:sm_subset_c]='》'
+Mx[:vline]='┆' # ¦ |
#Mx[:sm_set_o]='∈ '; Mx[:sm_set_c]='∋ '
#Mx[:sm_subset_o]='∈ '; Mx[:sm_subset_c]='∋ '
Rx[:mx_fa_clean]= /#{Mx[:fa_o]}.+?#{Mx[:fa_c]}|#{Mx[:pa_o]}.+?#{Mx[:pa_c]}|#{Mx[:mk_o]}.+?#{Mx[:mk_c]}/
diff --git a/lib/sisu/v2/dal_doc_objects.rb b/lib/sisu/v2/dal_doc_objects.rb
index 0102ff94..bc0020b2 100644
--- a/lib/sisu/v2/dal_doc_objects.rb
+++ b/lib/sisu/v2/dal_doc_objects.rb
@@ -221,84 +221,85 @@ module SiSU_document_structure
end
end
class Object_group
- attr_accessor :obj,:is,:of,:tags,:idx,:ocn,:odv,:osp,:parent,:note_,:ocn_,:digest,:tmp
+ attr_accessor :obj,:is,:of,:tags,:idx,:ocn,:odv,:osp,:parent,:note_,:number_,:ocn_,:digest,:tmp
def initialize
@of='group'
- @is=@obj=@idx=@ocn=@odv=@osp=@parent=@note_=@ocn_=@digest=@tmp=nil
+ @is=@obj=@idx=@ocn=@odv=@osp=@parent=@note_=@number_=@ocn_=@digest=@tmp=nil
@tags=[]
end
def code(h,o=nil)
- of= @of #String, classification - group #alt 'code'
- is= 'code' #String, classification - specific type
- tags= h[:tags] || ((defined? o.tags) ? o.tags : []) #Array, associated object tags, names if any
- obj= h[:obj] || ((defined? o.obj) ? o.obj : nil) #String, text content
- idx= h[:idx] || ((defined? o.idx) ? o.idx : nil) #String, book index provided?
- ocn= h[:ocn] || ((defined? o.ocn) ? o.ocn : nil) #Integer, sequential on substantive-content objects
- odv= h[:odv] || ((defined? o.odv) ? o.odv : nil)
- osp= h[:osp] || ((defined? o.osp) ? o.osp : nil)
- parent= h[:parent] || ((defined? o.parent) ? o.parent : nil) #[Node parent]
- note_= h[:note_] || ((defined? o.note_) ? o.note_ : false) #Bool, endnotes/footnotes? (processing optimization)
- ocn_=if h[:ocn_].nil?; ((defined? o.ocn_) ? o.ocn_ : true) #Bool? no ocn, non-substantive content, do not include in toc #consider
- else h[:ocn_]
+ of= @of #String, classification - group #alt 'code'
+ is= 'code' #String, classification - specific type
+ tags= h[:tags] || ((defined? o.tags) ? o.tags : []) #Array, associated object tags, names if any
+ obj= h[:obj] || ((defined? o.obj) ? o.obj : nil) #String, text content
+ idx= h[:idx] || ((defined? o.idx) ? o.idx : nil) #String, book index provided?
+ ocn= h[:ocn] || ((defined? o.ocn) ? o.ocn : nil) #Integer, sequential on substantive-content objects
+ odv= h[:odv] || ((defined? o.odv) ? o.odv : nil)
+ osp= h[:osp] || ((defined? o.osp) ? o.osp : nil)
+ parent= h[:parent] || ((defined? o.parent) ? o.parent : nil) #[Node parent]
+ number_= h[:number_] || ((defined? o.number_) ? o.number_ : false) #Bool, numbered or not?
+ note_= h[:note_] || ((defined? o.note_) ? o.note_ : false) #Bool, endnotes/footnotes? (processing optimization)
+ ocn_= if h[:ocn_].nil?; ((defined? o.ocn_) ? o.ocn_ : true) #Bool? no ocn, non-substantive content, do not include in toc #consider
+ else h[:ocn_]
end
- digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5
- tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use
- @of,@is,@tags,@obj,@idx,@ocn,@odv,@osp,@parent,@note_,@ocn_,@digest,@tmp=of,is,tags,obj,idx,ocn,odv,osp,parent,note_,ocn_,digest,tmp
+ digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5
+ tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use
+ @of,@is,@tags,@obj,@idx,@ocn,@odv,@osp,@parent,@number_,@note_,@ocn_,@digest,@tmp=of,is,tags,obj,idx,ocn,odv,osp,parent,number_,note_,ocn_,digest,tmp
self
end
def group(h,o=nil)
- of= @of #String, classification - group
- is= 'group' #String, classification - specific type
- tags= h[:tags] || ((defined? o.tags) ? o.tags : []) #Array, associated object tags, names if any
- obj= h[:obj] || ((defined? o.obj) ? o.obj : nil) #String, text content
- idx= h[:idx] || ((defined? o.idx) ? o.idx : nil) #String, book index provided?
- ocn= h[:ocn] || ((defined? o.ocn) ? o.ocn : nil) #Integer, sequential on substantive-content objects
- odv= h[:odv] || ((defined? o.odv) ? o.odv : nil)
- osp= h[:osp] || ((defined? o.osp) ? o.osp : nil)
- parent= h[:parent] || ((defined? o.parent) ? o.parent : nil) #[Node parent]
- note_= h[:note_] || ((defined? o.note_) ? o.note_ : false) #Bool, endnotes/footnotes? (processing optimization)
- ocn_=if h[:ocn_].nil?; ((defined? o.ocn_) ? o.ocn_ : true) #Bool? no ocn, non-substantive content, do not include in toc #consider
- else h[:ocn_]
+ of= @of #String, classification - group
+ is= 'group' #String, classification - specific type
+ tags= h[:tags] || ((defined? o.tags) ? o.tags : []) #Array, associated object tags, names if any
+ obj= h[:obj] || ((defined? o.obj) ? o.obj : nil) #String, text content
+ idx= h[:idx] || ((defined? o.idx) ? o.idx : nil) #String, book index provided?
+ ocn= h[:ocn] || ((defined? o.ocn) ? o.ocn : nil) #Integer, sequential on substantive-content objects
+ odv= h[:odv] || ((defined? o.odv) ? o.odv : nil)
+ osp= h[:osp] || ((defined? o.osp) ? o.osp : nil)
+ parent= h[:parent] || ((defined? o.parent) ? o.parent : nil) #[Node parent]
+ note_= h[:note_] || ((defined? o.note_) ? o.note_ : false) #Bool, endnotes/footnotes? (processing optimization)
+ ocn_= if h[:ocn_].nil?; ((defined? o.ocn_) ? o.ocn_ : true) #Bool? no ocn, non-substantive content, do not include in toc #consider
+ else h[:ocn_]
end
- digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5
- tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use
+ digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5
+ tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use
@of,@is,@tags,@obj,@idx,@ocn,@odv,@osp,@parent,@note_,@ocn_,@digest,@tmp=of,is,tags,obj,idx,ocn,odv,osp,parent,note_,ocn_,digest,tmp
self
end
def alt(h,o=nil) #see group
- of= @of #String, classification - group
- is= 'alt' #String, classification - specific type
- tags= h[:tags] || ((defined? o.tags) ? o.tags : []) #Array, associated object tags, names if any
- obj= h[:obj] || ((defined? o.obj) ? o.obj : nil) #String, text content
- idx= h[:idx] || ((defined? o.idx) ? o.idx : nil) #String, book index provided?
- ocn= h[:ocn] || ((defined? o.ocn) ? o.ocn : nil) #Integer, sequential on substantive-content objects
- odv= h[:odv] || ((defined? o.odv) ? o.odv : nil)
- osp= h[:osp] || ((defined? o.osp) ? o.osp : nil)
- parent= h[:parent] || ((defined? o.parent) ? o.parent : nil) #[Node parent]
- note_= h[:note_] || ((defined? o.note_) ? o.note_ : false) #Bool, endnotes/footnotes? (processing optimization)
- ocn_=if h[:ocn_].nil?; ((defined? o.ocn_) ? o.ocn_ : true) #Bool? no ocn, non-substantive content, do not include in toc #consider
- else h[:ocn_]
+ of= @of #String, classification - group
+ is= 'alt' #String, classification - specific type
+ tags= h[:tags] || ((defined? o.tags) ? o.tags : []) #Array, associated object tags, names if any
+ obj= h[:obj] || ((defined? o.obj) ? o.obj : nil) #String, text content
+ idx= h[:idx] || ((defined? o.idx) ? o.idx : nil) #String, book index provided?
+ ocn= h[:ocn] || ((defined? o.ocn) ? o.ocn : nil) #Integer, sequential on substantive-content objects
+ odv= h[:odv] || ((defined? o.odv) ? o.odv : nil)
+ osp= h[:osp] || ((defined? o.osp) ? o.osp : nil)
+ parent= h[:parent] || ((defined? o.parent) ? o.parent : nil) #[Node parent]
+ note_= h[:note_] || ((defined? o.note_) ? o.note_ : false) #Bool, endnotes/footnotes? (processing optimization)
+ ocn_= if h[:ocn_].nil?; ((defined? o.ocn_) ? o.ocn_ : true) #Bool? no ocn, non-substantive content, do not include in toc #consider
+ else h[:ocn_]
end
- digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5
- tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use
+ digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5
+ tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use
@of,@is,@tags,@obj,@idx,@ocn,@odv,@osp,@parent,@note_,@ocn_,@digest,@tmp=of,is,tags,obj,idx,ocn,odv,osp,parent,note_,ocn_,digest,tmp
self
end
def verse(h,o=nil) #part of poem decide how you deal with this
- of= @of #String, classification - group
- is= 'verse' #String, classification - specific type
- tags= h[:tags] || ((defined? o.tags) ? o.tags : []) #Array, associated object tags, names if any
- obj= h[:obj] || ((defined? o.obj) ? o.obj : nil) #String, text content
- idx= h[:idx] || ((defined? o.idx) ? o.idx : nil) #String, book index provided?
- ocn= h[:ocn] || ((defined? o.ocn) ? o.ocn : nil) #Integer, sequential on substantive-content objects
- odv= h[:odv] || ((defined? o.odv) ? o.odv : nil)
- osp= h[:osp] || ((defined? o.osp) ? o.osp : nil)
- parent= h[:parent] || ((defined? o.parent) ? o.parent : nil) #[Node parent]
- ocn_=if h[:ocn_].nil?; ((defined? o.ocn_) ? o.ocn_ : true) #Bool? no ocn, non-substantive content, do not include in toc #consider
- else h[:ocn_]
+ of= @of #String, classification - group
+ is= 'verse' #String, classification - specific type
+ tags= h[:tags] || ((defined? o.tags) ? o.tags : []) #Array, associated object tags, names if any
+ obj= h[:obj] || ((defined? o.obj) ? o.obj : nil) #String, text content
+ idx= h[:idx] || ((defined? o.idx) ? o.idx : nil) #String, book index provided?
+ ocn= h[:ocn] || ((defined? o.ocn) ? o.ocn : nil) #Integer, sequential on substantive-content objects
+ odv= h[:odv] || ((defined? o.odv) ? o.odv : nil)
+ osp= h[:osp] || ((defined? o.osp) ? o.osp : nil)
+ parent= h[:parent] || ((defined? o.parent) ? o.parent : nil) #[Node parent]
+ ocn_= if h[:ocn_].nil?; ((defined? o.ocn_) ? o.ocn_ : true) #Bool? no ocn, non-substantive content, do not include in toc #consider
+ else h[:ocn_]
end
- digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5
- tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use
+ digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5
+ tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use
@of,@is,@tags,@obj,@idx,@ocn,@odv,@osp,@parent,@note_,@ocn_,@digest,@tmp=of,is,tags,obj,idx,ocn,odv,osp,parent,note_,ocn_,digest,tmp
@h=nil
self
diff --git a/lib/sisu/v2/dal_doc_str.rb b/lib/sisu/v2/dal_doc_str.rb
index 2d4ee192..6eb2ee69 100644
--- a/lib/sisu/v2/dal_doc_str.rb
+++ b/lib/sisu/v2/dal_doc_str.rb
@@ -198,6 +198,7 @@ module SiSU_document_structure_extract
if t_o =~/^code\{/
@@flag['code']=true
@@counter=1
+ @codeblock_numbered=(t_o =~/^code\{#/) ? true : false
h={:obj=>'code block start'} #introduce a counter
t_o=SiSU_document_structure::Object_comment.new.comment(h) #t_o=SiSU_document_structure::Object_layout.new.insert(h)
elsif t_o =~/^poem\{/
@@ -314,7 +315,7 @@ module SiSU_document_structure_extract
if t_o =~/^\}code/
@@flag['code']=false
obj,tags=extract_tags(@tuned_code.join("\n"))
- h={:obj=>obj,:tags=>tags}
+ h={:obj=>obj,:tags=>tags,:number_=>@codeblock_numbered}
t_o=SiSU_document_structure::Object_group.new.code(h)
@tuned_code=[]
tuned_file << t_o
diff --git a/lib/sisu/v2/dal_syntax.rb b/lib/sisu/v2/dal_syntax.rb
index 2f78fbe6..fbc62158 100644
--- a/lib/sisu/v2/dal_syntax.rb
+++ b/lib/sisu/v2/dal_syntax.rb
@@ -427,14 +427,31 @@ module SiSU_Syntax
"#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}\\2") #linked image
elsif dob.is=='table'
dob=fontface(dob)
- elsif dob.is =='code' # /^<:code>/ #should be enough # underscore used as escape for angle brackets
+ elsif dob.is =='code'
+#p dob.obj
dob.obj.gsub!(/#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}\s*/,'@\1: ')
dob.obj.gsub!(/([<>])/,'_\1')
dob.obj.gsub!(/_<:(\S+?)_>/,'<:\1>') #convert <:\S+> back, clumsy
dob.obj.gsub!(/_<(br(?: \/)?)_>/,'<\1>') #convert back, clumsy
dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s)<(br(?: \/)?)>([\s,.]|$)/,'\1<\2>\3') #convert back, clumsy
- dob.obj.gsub!(/#{Mx[:gr_o]}codeline#{Mx[:gr_c]}/,
- "\n#{Mx[:nbsp]}#{Mx[:nbsp]}") #temporary fix, prefer: #line.gsub!(/<:codeline>/,"\n")
+ if dob.number_
+ codeline=[]
+ ln=1
+ dob.obj.split(/#{Mx[:gr_o]}codeline#{Mx[:gr_c]}| |\n/).each_with_index do |cl,i|
+ unless i == 0
+ cl.gsub!(Mx[:br_nl],'')
+ w=3-ln.to_s.length
+ cl = "#{ln}#{Mx[:nbsp]*w}#{Mx[:vline]}#{Mx[:nbsp]}#{Mx[:nbsp]}#{cl}#{Mx[:br_nl]}"
+ ln +=1
+ end
+ codeline << cl
+ end
+ codeline= codeline.join("")
+ dob.obj=codeline
+ else
+ dob.obj.gsub!(/#{Mx[:gr_o]}codeline#{Mx[:gr_c]}/,
+ "\n#{Mx[:nbsp]}#{Mx[:nbsp]}") #temporary fix, prefer: #line.gsub!(/<:codeline>/,"\n")
+ end
dob
else # @\S+?:
end
diff --git a/lib/sisu/v2/texpdf.rb b/lib/sisu/v2/texpdf.rb
index 9f59032b..92f8e0ba 100644
--- a/lib/sisu/v2/texpdf.rb
+++ b/lib/sisu/v2/texpdf.rb
@@ -436,8 +436,8 @@ module SiSU_TeX
when /code/
sp_char=SiSU_TeX_Pdf::Special_characters.new(@md,dob.tmp,dob.is)
dob.tmp=sp_char.special_characters_safe
- dob.tmp.gsub!(/#{Mx[:nbsp]}/,'{~}')
- #dob.tmp.gsub!(/#{Mx[:nbsp]}\s*/,'{~}')
+ dob.tmp.gsub!(/#{Mx[:nbsp]}/,'{~}') #dob.tmp.gsub!(/#{Mx[:nbsp]}\s*/,'{~}')
+ dob.tmp.gsub!(/#{Mx[:vline]}/m,'\vline')
dob.tmp.gsub!(/ \\( |#{Mx[:br_nl]})/,' {\textbackslash}\1')
dob.tmp.gsub!(/(?:#{Mx[:br_nl]}\s*)+/,' \\\\\\ ') #watch
dob.tmp.gsub!(/\n\n\n/m," \\newline\n\n") #watch
--
cgit v1.2.3
From 1f20600f772b6006b8a87a7883a098d258bb2277 Mon Sep 17 00:00:00 2001
From: Ralph Amissah
Date: Thu, 14 Oct 2010 14:56:47 -0400
Subject: texpdf, bullet text, hanging indent, fix (works for regular text (not
grouped text)
(requested fix, Ben Armstrong)
---
lib/sisu/v2/texpdf.rb | 10 ++++------
lib/sisu/v2/texpdf_format.rb | 33 ++++++++++++++++++++++++++++++++-
2 files changed, 36 insertions(+), 7 deletions(-)
(limited to 'lib')
diff --git a/lib/sisu/v2/texpdf.rb b/lib/sisu/v2/texpdf.rb
index 92f8e0ba..363cfc8c 100644
--- a/lib/sisu/v2/texpdf.rb
+++ b/lib/sisu/v2/texpdf.rb
@@ -341,10 +341,6 @@ module SiSU_TeX
if dob.tmp =~/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}/
dob.tmp=SiSU_TeX_Pdf::Format_text_object.new(@md,dob.tmp).url_str_internal(dob.tmp)
end
- if dob.is=='para' \
- and dob.bullet_
- dob.tmp='$\txtbullet$\hspace{\enspace}' + dob.tmp
- end
elsif dob.is =='break'
if dob.obj==Mx[:br_page]; dob.tmp='\newpage'
elsif dob.obj==Mx[:br_page_new]; dob.tmp='\clearpage'
@@ -406,7 +402,7 @@ module SiSU_TeX
@lineone=case dob.is
when /alt|group|verse/
dob.tmp.gsub!(/#{Mx[:nbsp]}/m,'{~}')
- dob.tmp.gsub!(/#{Mx[:gl_bullet]}/m,'$\txtbullet$\hspace{\enspace}')
+ dob.tmp.gsub!(/#{Mx[:gl_bullet]}/m,'$\txtbullet$\hspace{\enspace}') #Bullet environment not used for grouped text, ∴ no hanging indent here
dob.tmp.gsub!(/#{Mx[:br_nl]}+/m,"\n\n") #match not ideal, but currently not inserting extra newlines anyway
ocn=SiSU_TeX_Pdf::Format_text_object.new(@md).ocn_display(dob)
dob.tmp=if dob.is=='group' \
@@ -506,7 +502,9 @@ module SiSU_TeX
else dob.tmp='' # dob.tmp={:l =>'',:p =>''}
end
when 'para'
- if dob.indent \
+ if dob.bullet_
+ dob.tmp=tst.bullet
+ elsif dob.indent \
and dob.indent =~/[1-9]/
dob.tmp=tst.indent
else
diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb
index 36366c9b..9ebef9dc 100644
--- a/lib/sisu/v2/texpdf_format.rb
+++ b/lib/sisu/v2/texpdf_format.rb
@@ -295,7 +295,27 @@ module SiSU_TeX_Pdf
when /8/; '70mm'
when /9/; '80mm'
end
- "\\begin{ParagraphIndent}{#{indent}}#{@dob.tmp} \\end{ParagraphIndent}}" #"\\begin{ParagraphIndent}{#{indent}}#{@dob.tmp}\\end{ParagraphIndent}}"
+ "\\begin{ParagraphIndent}{#{indent}}#{@dob.tmp} \\end{ParagraphIndent}}"
+ end
+ def bullet
+ blt=if @dob.indent
+ indent=case @dob.indent
+ when /1/; '0em'
+ when /2/; '1.0em'
+ when /3/; '2.0em'
+ when /4/; '3.0em'
+ when /5/; '4.0em'
+ when /6/; '5.0em'
+ when /7/; '6.0em'
+ when /8/; '7.0em'
+ when /9/; '8.0em'
+ else '-1.0em'
+ end
+ "\\begin{Bullet}{#{indent}}$\\txtbullet$\\hspace{\\enspace}#{@dob.tmp}\\end{Bullet}"
+ else
+ "\\begin{Bullet}{-5mm}$\\txtbullet$\\hspace{\\enspace}#{@dob.tmp}\\end{Bullet}"
+ end
+ blt
end
def symbol_graphic
dir=SiSU_Env::Info_env.new(@md.fns)
@@ -918,6 +938,17 @@ WOK
\\item[]
}
{\\end{list}}
+\\newenvironment{Bullet}[1]%
+{
+\\begin{list}{}{%
+\\setlength\\topsep{0pt}%
+\\addtolength{\\leftmargin}{#1}
+\\itemindent=-1em
+\\setlength\\parsep{0pt plus 1pt}%
+}
+\\item[]
+}
+{\\end{list}}
\\usepackage{fancyhdr}
\\lhead{}
\\renewcommand{\\part}{\\\@startsection
--
cgit v1.2.3
From 505c66abbbdc8f9f8f9930cacec751e6a886d8d9 Mon Sep 17 00:00:00 2001
From: Ralph Amissah
Date: Fri, 15 Oct 2010 16:22:07 -0400
Subject: texpdf, codeblocks do not permit empty lines, fix
---
lib/sisu/v2/texpdf.rb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'lib')
diff --git a/lib/sisu/v2/texpdf.rb b/lib/sisu/v2/texpdf.rb
index 363cfc8c..3a868cd8 100644
--- a/lib/sisu/v2/texpdf.rb
+++ b/lib/sisu/v2/texpdf.rb
@@ -435,8 +435,10 @@ module SiSU_TeX
dob.tmp.gsub!(/#{Mx[:nbsp]}/,'{~}') #dob.tmp.gsub!(/#{Mx[:nbsp]}\s*/,'{~}')
dob.tmp.gsub!(/#{Mx[:vline]}/m,'\vline')
dob.tmp.gsub!(/ \\( |#{Mx[:br_nl]})/,' {\textbackslash}\1')
- dob.tmp.gsub!(/(?:#{Mx[:br_nl]}\s*)+/,' \\\\\\ ') #watch
- dob.tmp.gsub!(/\n\n\n/m," \\newline\n\n") #watch
+ dob.tmp.gsub!(/#{Mx[:br_nl]}\s*\Z/m,'')
+ dob.tmp.gsub!(/#{Mx[:br_nl]}{2}/,'\newline \\\\\\ ')
+ dob.tmp.gsub!(/#{Mx[:br_nl]}/,' \\\\\\ ')
+ dob.tmp.gsub!(/\n\n\n/m," \\newline\n\n")
ocn=SiSU_TeX_Pdf::Format_text_object.new(@md).ocn_display(dob)
dob.tmp = ocn \
+ @tex_ml.paraskip_small \
--
cgit v1.2.3
|