From d95f8574ec670222f7236033e7b188c7b5a099ab Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 26 Jun 2011 14:50:18 -0400 Subject: v3: define latex \newcommands for some special characters (for sisu code) * \newcommands for some special characters to simplify dealing with them in sisu code \hardspace \caret \pipe \curlyopen \curlyclose \lt \gt \slash \backslash \underscore \exclaim --- lib/sisu/v3/texpdf.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'lib/sisu/v3/texpdf.rb') diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb index 0f16e991..522480fd 100644 --- a/lib/sisu/v3/texpdf.rb +++ b/lib/sisu/v3/texpdf.rb @@ -462,10 +462,6 @@ module SiSU_TeX dob else 'error' #should never occur end - if dob.tmp =~/<=curly/ #takes care of escaped curly braces, expand - sp_char=SiSU_TeX_Pdf::Special_characters.new(@md,dob) - dob.tmp=sp_char.special_characters_curly(dob.tmp) - end dob=enclose(dob) unless dob.tmp =~/^$/ dob else @@ -533,10 +529,6 @@ module SiSU_TeX dob.tmp.gsub!(/\s*(?:#{Mx[:br_line]}|#{Mx[:br_nl]})\s*/,' \newline ') #% tread with care dob.tmp.gsub!(/(\.#{Tex[:tilde]}\S*\s*|<:\S+>|#{Mx[:fa_o]}.*?#{Mx[:fa_c]}|#{Mx[:gr_o]}.*?#{Mx[:gr_c]}||)/,' ') #% tread with care end - if dob.tmp =~/<=curly/ #takes care of escaped curly braces, expand - sp_char=SiSU_TeX_Pdf::Special_characters.new(@md,dob) - dob.tmp=sp_char.special_characters_curly(dob.tmp) - end dob end if dob.tmp =~/(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|image\b)/m \ @@ -586,6 +578,16 @@ module SiSU_TeX \\newcommand{\\parasep}{\\\\ \\begin{center}*\\hspace{2em}*\\hspace{2em}*\\end{center} \\\\} \\newcommand{\\hardspace}{{~}} %\\newcommand{\\hardspace}{\\hspace{.5em}} +\\newcommand{\\caret}{{\\^{~}}} +\\newcommand{\\pipe}{{\\textbar}} +\\newcommand{\\curlyopen}{\{} +\\newcommand{\\curlyclose}{\}} +\\newcommand{\\lt}{{\UseTextSymbol{OML}{<}}} +\\newcommand{\\gt}{{\UseTextSymbol{OML}{>}}} +\\newcommand{\\slash}{{/}} +\\newcommand{\\underscore}{\\_} +\\newcommand{\\exclaim}{\\Verbatim{!}} +% (tilde hash amp affected by http) % \\sloppy \\begin{document} WOK -- cgit v1.2.3