Class

SM::ToLaTeX

Inheritance
< Object

Convert SimpleMarkup to basic LaTeX report format

Constants

Name   Description
BACKQUOTE = "#{BS}symbol#{OB}0#{CB}"
BACKSLASH = "#{BS}symbol#{OB}92#{CB}"
BS = "\020"
CB = "\022"
DL = "\023"
GREATERTHAN = "#{DL}>#{DL}"
HAT = "#{BS}symbol#{OB}94#{CB}"
InlineTag = Struct.new(:bit, :on, :off)
LESSTHAN = "#{DL}<#{DL}"
LIST_TYPE_TO_LATEX = { ListBase::BULLET => [ l("\\begin{itemize}"), l("\\end{itemize}") ], ListBase::NUMBER => [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\arabic" ], ListBase::UPPERALPHA => [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\Alph" ], ListBase::LOWERALPHA => [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\alph" ], ListBase::LABELED => [ l("\\begin{description}"), l("\\end{description}") ], ListBase::NOTE => [ l("\\begin{tabularx}{\\linewidth}{@{} l X @{}}"), l("\\end{tabularx}") ], }
TILDE = "#{DL}#{BS}sim#{DL}"

Methods

Class

Visibility Signature
public l (str)
public new ()

Instance

Visibility Signature
public accept_blank_line (am, fragment)
public accept_heading (am, fragment)
public accept_list_end (am, fragment)
public accept_list_item (am, fragment)
public accept_list_start (am, fragment)
public accept_paragraph (am, fragment)
public accept_rule (am, fragment)
public accept_verbatim (am, fragment)
public add_tag (name, start, stop)
public end_accepting ()
public escape (str)
public init_tags ()
public l (arg)
public start_accepting ()
public wrap (txt, line_len = 76)

Class Method Detail

l(str)

new()

Instance Method Detail

accept_blank_line(am, fragment)

accept_heading(am, fragment)

accept_list_end(am, fragment)

accept_list_item(am, fragment)

accept_list_start(am, fragment)

accept_paragraph(am, fragment)

accept_rule(am, fragment)

accept_verbatim(am, fragment)

add_tag(name, start, stop)

Add a new set of LaTeX tags for an attribute. We allow separate start and end tags for flexibility

end_accepting()

escape(str)

Escape a LaTeX string

init_tags()

Set up the standard mapping of attributes to LaTeX

l(arg)

start_accepting()

Here‘s the client side of the visitor pattern

wrap(txt, line_len = 76)

This is a higher speed (if messier) version of wrap