module Tex
Public Class Methods
center(latex)
click to toggle source
# File lib/rbtex.rb, line 31 def Tex.center(latex) return "\\begin{center}#{latex}\\end{center}" end
cmath(math)
click to toggle source
# File lib/rbtex.rb, line 27 def Tex.cmath(math) return "\\[#{math}\\]" end
imath(math)
click to toggle source
# File lib/rbtex.rb, line 23 def Tex.imath(math) return "$#{math}$" end
logo()
click to toggle source
# File lib/rbtex.rb, line 39 def Tex.logo return "$\\RbTeX$" end
n()
click to toggle source
# File lib/rbtex.rb, line 35 def Tex.n return "\\\\" end
print(latex, number, bundle=[])
click to toggle source
# File lib/rbtex.rb, line 19 def Tex.print(latex, number, bundle=[]) printToOutFile(latex, number, bundle) end
printToOutFile(line, number, bundle)
click to toggle source
# File lib/rbtex.rb, line 43 def Tex.printToOutFile(line, number, bundle) file = File.open($out_file, 'a') if bundle.length == 0 file.puts "#{line}#{OUT_DELIM}#{number}" else case bundle[0] when "loop" $pLoop = true file.puts LOOP_START when "nloop" $pLoop = false file.puts LOOP_END when "rbtev" file.puts RBT_ENV_BEGIN when "nrbtev" file.puts RBT_ENV_END else file.puts $pLoop ? "#{line}" : "#{line}#{OUT_DELIM}#{number}" end end file.close end