Module: ArTeX::Framework::Rails::HelperMethods

Defined in:
lib/artex/framework/rails.rb

Instance Method Summary collapse

Instance Method Details

#latex_escape(*args) ⇒ Object Also known as: l

Similar to h()



13
14
15
16
17
18
19
20
21
22
# File 'lib/artex/framework/rails.rb', line 13

def latex_escape(*args)
  # Since Rails' I18n implementation aliases l() to localize(), LaTeX
  # escaping should only be done if ArTeX is doing the rendering.
  # Otherwise, control should be be passed to localize().
  if Thread.current[:_rendering_rtex]
    ArTeX::Document.escape(*args)
  else
    localize(*args)
  end
end