Top Level Namespace
Defined Under Namespace
Modules: Linkedin2CV, Logging
Instance Method Summary collapse
-
#clean_latex(s) ⇒ Object
Public: Prepare a string for LaTeX rendering.
Instance Method Details
#clean_latex(s) ⇒ Object
Public: Prepare a string for LaTeX rendering.
Escapes special chars, replaces etc.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/linkedin2cv/renderer/latex_renderer.rb', line 52 def clean_latex(s) # Clean & s = s.gsub(/(?<!\\)\&(?!\\)/, '\\\&') # Clean $ s = s.gsub(/(?<!\\)\$(?!\\)/, '\\\$') # Clean % s = s.gsub(/(?<!\\)%(?!\\)/, '\\\%') # # Clean ~ s = s.gsub(/\~/, '\\\textasciitilde') # # Clean > s = s.gsub(/\>/, '\\\textgreater') # # Clean < s = s.gsub(/\</, '\\\textless') s end |