Class: Coradoc::Markdown::Math

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/markdown/model/math.rb

Overview

Represents a math block (block or inline)

Block math syntax: $$…$$ on its own lines Inline math syntax: $$…$$ within text

Examples:

$$\lambda_\alpha > 5$$
$$1 + 1$$

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

visit, #visit

Class Method Details

.block(content) ⇒ Object



31
32
33
# File 'lib/coradoc/markdown/model/math.rb', line 31

def self.block(content)
  new(content: content, inline: false)
end

.inline(content) ⇒ Math

Create an inline math element

Parameters:

  • content (String)

    The math content

Returns:



27
28
29
# File 'lib/coradoc/markdown/model/math.rb', line 27

def self.inline(content)
  new(content: content, inline: true)
end

Instance Method Details

#inline?Boolean

Check if this is inline math

Returns:

  • (Boolean)


20
21
22
# File 'lib/coradoc/markdown/model/math.rb', line 20

def inline?
  inline == true
end