Sha256: ef0bbc50e3c90b3f6524b34a8680d1dcf679ba4c1662e906526fc0154c3746a3
Contents?: true
Size: 476 Bytes
Versions: 6
Compression:
Stored size: 476 Bytes
Contents
require 'asciidoctor' require 'asciidoctor/extensions' require 'asciidoctor/latex/core_ext/colored_string' # Implements constructs like chem::[2H2O + O2 -> 2H2O] # Maps this to \( \ce{2H2O + O2 -> 2H2O} \) # module Asciidoctor::LaTeX class ChemInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor use_dsl named :chem def process parent, target, attributes text = attributes.values * ', ' # iky! %(\\(\\ce{ #{text} }\\)) end end end
Version data entries
6 entries across 6 versions & 1 rubygems