class JsonResume::FormatterLatex
Public Instance Methods
format()
click to toggle source
Calls superclass method
JsonResume::Formatter#format
# File lib/json_resume/formatter_latex.rb, line 47 def format super self end
format_autolink(str)
click to toggle source
# File lib/json_resume/formatter_latex.rb, line 15 def format_autolink(str) str.gsub!(/<<(\S*?)>>/, '{\color{see} \url{\1}}') end
format_emphasis(str)
click to toggle source
# File lib/json_resume/formatter_latex.rb, line 19 def format_emphasis(str) str.gsub!(/\b_(.+?)_\b/, '\textit{\1}') str.gsub!(/\*\*(.+?)\*\*/, '\textbf{\1}') end
format_link(str)
click to toggle source
# File lib/json_resume/formatter_latex.rb, line 11 def format_link(str) str.gsub!(/\[(.*?)\]\((.*?)\)/, '{\color{see} \href{\2}{\1}}') end
format_slashes(str)
click to toggle source
# File lib/json_resume/formatter_latex.rb, line 5 def format_slashes(str) str.gsub!(/\\/, '\textbackslash') str.gsub!(/\{/, '\{') str.gsub!(/\}/, '\}') end
format_string(str)
click to toggle source
# File lib/json_resume/formatter_latex.rb, line 38 def format_string(str) format_slashes str format_link str format_autolink str format_emphasis str format_symbols str format_superscripts str end
format_superscripts(str)
click to toggle source
# File lib/json_resume/formatter_latex.rb, line 24 def format_superscripts(str) str.gsub!(/<sup>(.*?)<\/sup>/, '$^{\1}$') str.gsub!(/<sub>(.*?)<\/sub>/, '$_{\1}$') end
format_symbols(str)
click to toggle source
# File lib/json_resume/formatter_latex.rb, line 29 def format_symbols(str) str.gsub!(/#/, '\#') str.gsub!(/\$/, '\$') str.gsub!(/&/, '\\\\&') str.gsub!(/\|/, '\textbar') str.gsub!(/%/, '\%') str.gsub!(/_/, '\_') end