Method: Tex2id::Converter#process_number

Defined in:
lib/tex2id/converter.rb

#process_number(s) ⇒ Object



124
125
126
127
128
129
130
131
132
# File 'lib/tex2id/converter.rb', line 124

def process_number(s)
  # TODO: generalize the following
  s.gsub!(/[-\u{2212}]\\infty/) {|x| "<ctk:-150>\u{2212}<ctk:><F031>" }
  s.gsub!(/\\infty/) {|x| '<F031>' }
  if s[0] == '-' || s[0] == "\u{2212}"
    s[0,1] = "<ctk:-300>\u{2212}<ctk:>"
  end
  "<cstyle:数式>#{s}<cstyle:>"
end