diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v0/texpdf.rb | 1 | ||||
-rw-r--r-- | lib/sisu/v0/texpdf_format.rb | 12 |
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/sisu/v0/texpdf.rb b/lib/sisu/v0/texpdf.rb index abafb30f..1cad7ca5 100644 --- a/lib/sisu/v0/texpdf.rb +++ b/lib/sisu/v0/texpdf.rb @@ -545,6 +545,7 @@ module SiSU_TeX \\makeatother \\makeatother \\chardef\\txtbullet="2022 +\\chardef\\tilde="7E % \\sloppy \\begin{document} WOK diff --git a/lib/sisu/v0/texpdf_format.rb b/lib/sisu/v0/texpdf_format.rb index 2efec5c4..e156c67a 100644 --- a/lib/sisu/v0/texpdf_format.rb +++ b/lib/sisu/v0/texpdf_format.rb @@ -1103,7 +1103,8 @@ WOK while string =~/(http:\/\/\S+?)(?:<=tilde>\S+)+/ #tilde in urls \href treated differently from text string.gsub!(/(http:\/\/\S+?)(?:<=tilde>(\S+))+/,'\1~\2') end - string.gsub!(/<=tilde>/,'{$\sim$}') + string.gsub!(/<=tilde>/,'{$\tilde$}') + #string.gsub!(/<=tilde>/,'{$\sim$}') string.gsub!(/<=pipe>/,'{\textbar}') string.gsub!(/<=caret>/,'{\^{~}}') #string.gsub!(/<=caret>/,'\^{}') @@ -1211,6 +1212,12 @@ WOK else string.gsub!(/&/,'<=amp>') #else string.gsub!(/(\s+&\s+)/,' and ') end + if @@flag_code; + string.gsub!(/\\~(\\\{)/,'{$\tilde$}\1') + string.gsub!(/(\\\})\\~/,'\1{$\tilde$}') + string.gsub!(/\\~(\[)/,'{$\tilde$}\1') + string.gsub!(/(\])\\~/,'\1{$\tilde$}') + end string.gsub!(/§/u,'\S') #latex: space between next character not preserved? #string.gsub!(/§ /,'\S ') string.gsub!(/£/u,'\pounds') string.gsub!(/&\S+?;/,' ') @@ -1283,7 +1290,8 @@ WOK while string =~/(http:\/\/\S+?)(?:<=tilde>\S+)+/ #tilde in urls \href treated differently from text string.gsub!(/(http:\/\/\S+?)(?:<=tilde>(\S+))+/,'\1~\2') end - string.gsub!(/<=tilde>/,'{$\sim$}') + string.gsub!(/<=tilde>/,'{$\tilde$}') + #string.gsub!(/<=tilde>/,'{$\sim$}') string.gsub!(/<=pipe>/,'{\textbar}') string.gsub!(/<=caret>/,'{\^{~}}') #string.gsub!(/<=caret>/,'\^{}') |