From d96753b4e4b7b0f2748064bc35aeaa8418deb7fa Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 1 Oct 2012 15:17:03 -0400 Subject: v3: texpdf fixes * group text, bullet * group text, hardspaces at start of line (indent) * group text, pass through special characters safe * poem, bold etc. --- lib/sisu/v3/texpdf.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb index 4c224b22..618c891e 100644 --- a/lib/sisu/v3/texpdf.rb +++ b/lib/sisu/v3/texpdf.rb @@ -468,13 +468,14 @@ module SiSU_TeX || dob.is==:group \ || dob.is==:alt \ || dob.is==:verse - dob.tmp=dob.tmp.gsub(/#{Mx[:nbsp]}/m,'{~}'). - gsub(/#{Mx[:gl_bullet]}/m,'$\txtbullet$\hspace{\enspace}'). #Bullet environment not used for grouped text, ∴ no hanging indent here + dob.tmp=dob.tmp.gsub(/#{Mx[:nbsp]}/m,' \hardspace '). + gsub(/#{Mx[:gl_bullet]}/m,'\txtbullet \hardspace '). #Bullet environment not used for grouped text, no hanging indent here gsub(/#{Mx[:br_nl]}+/m,"\n\n") #match not ideal, but currently not inserting extra newlines anyway ocn=SiSU_TeX_Pdf::FormatTextObject.new(@md).ocn_display(dob) dob.tmp=if dob.is==:group \ || dob.is==:block \ || dob.is==:alt + dob.tmp=SiSU_TeX_Pdf::SpecialCharacters.new(@md,dob.tmp).special_characters_safe ocn \ + @tex_ml.paraskip_small \ + "\n" \ @@ -485,6 +486,9 @@ module SiSU_TeX + "\n" \ + @tex_ml.paraskip_normal elsif dob.is==:verse + dob.tmp=dob.tmp.gsub(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/m,'\begin{bfseries}\1 \end{bfseries}'). + gsub(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/m,'\emph{\1}'). + gsub(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/m,'\uline{\1}') ocn \ + @tex_ml.paraskip_tiny \ + "\n" \ -- cgit v1.2.3