Class: Plurimath::Math::Function::Text

Inherits:
UnaryFunction show all
Defined in:
lib/plurimath/math/function/text.rb

Constant Summary collapse

PARSER_REGEX =
%r{unicode\[:(?<unicode>\w{1,})\]}.freeze

Instance Attribute Summary

Attributes inherited from UnaryFunction

#parameter_one

Instance Method Summary collapse

Methods inherited from UnaryFunction

#==, #class_name, #initialize

Constructor Details

This class inherits a constructor from Plurimath::Math::Function::UnaryFunction

Instance Method Details

#to_asciimathObject



12
13
14
# File 'lib/plurimath/math/function/text.rb', line 12

def to_asciimath
  "\"#{parse_text('asciimath') || parameter_one}\""
end

#to_htmlObject



26
27
28
# File 'lib/plurimath/math/function/text.rb', line 26

def to_html
  parse_text("html") || parameter_one
end

#to_latexObject



21
22
23
24
# File 'lib/plurimath/math/function/text.rb', line 21

def to_latex
  text_value = parse_text("latex") || parameter_one
  "\\text{#{text_value}}"
end

#to_mathml_without_math_tagObject



16
17
18
19
# File 'lib/plurimath/math/function/text.rb', line 16

def to_mathml_without_math_tag
  text = Utility.ox_element("mtext")
  text << (parse_text("mathml") || parameter_one) if parameter_one
end

#to_omml_without_math_tagObject



30
31
32
33
# File 'lib/plurimath/math/function/text.rb', line 30

def to_omml_without_math_tag
  text = Utility.ox_element("t", namespace: "m")
  text << (parse_text("omml") || parameter_one)
end