Sha256: ae2afbc4ee65029c5cbddfb3c1d102162b077bf0b6884b428156c528ea0fa6e4

Contents?: true

Size: 1.55 KB

Versions: 12

Compression:

Stored size: 1.55 KB

Contents

#--
# LaTeX::Decode
# Copyright (C) 2011-2013 Sylvester Keil <sylvester.keil.or.at>
# Copyright (C) 2010 François Charette
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#++

require 'latex/decode/version'
require 'latex/decode/compatibility'
require 'latex/decode/base'

require 'latex/decode/accents'
require 'latex/decode/diacritics'
require 'latex/decode/maths'
require 'latex/decode/punctuation'
require 'latex/decode/symbols'
require 'latex/decode/greek'

module LaTeX

  class << self
    def decode (string)
      return string unless string.respond_to?(:to_s)

      string = string.is_a?(String) ? string.dup : string.to_s

      Decode::Base.normalize(string)

      Decode::Maths.decode!(string)

      Decode::Accents.decode!(string)
      Decode::Diacritics.decode!(string)
      Decode::Punctuation.decode!(string)
      Decode::Symbols.decode!(string)
      Decode::Greek.decode!(string)

      Decode::Base.strip_braces(string)

      LaTeX.normalize_C(string)
    end
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/latex-decode-0.3.1/lib/latex/decode.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/latex-decode-0.3.1/lib/latex/decode.rb
latex-decode-0.3.1 lib/latex/decode.rb
latex-decode-0.3.0 lib/latex/decode.rb
bibtex_to_scrapbox-0.2.0 gems/gems/latex-decode-0.2.2/lib/latex/decode.rb
bibtex_to_scrapbox-0.1.0 gems/gems/latex-decode-0.2.2/lib/latex/decode.rb
latex-decode-0.2.2-java lib/latex/decode.rb
latex-decode-0.2.2 lib/latex/decode.rb
latex-decode-0.2.1-java lib/latex/decode.rb
latex-decode-0.2.1 lib/latex/decode.rb
latex-decode-0.2.0-java lib/latex/decode.rb
latex-decode-0.2.0 lib/latex/decode.rb