def _handler(env) : get_counter("subsubsection").increment() id = generate_id("subsubsection", get_counter("page"), get_counter("section"), get_counter("subsection"), get_counter("subsubsection")) set_anchor_reference(token_env, id, text) return (ParagraphToken() + InhibitParagraphToken() + get_anchor_by_id(id) + InhibitParagraphToken() + StringToken("<H4>"+counters_to_string("section", "subsection", "subsubsection")+". ") + text + StringToken("</H4>") + ParagraphToken())
def _handler(env) : get_counter("figure").increment() id = generate_id("figure", get_counter("page"), get_counter("figure")) set_anchor_reference(outer_token_env, id, StringToken(str(counters_to_string("figure")))) p = escape_env["_figure_placement"].eval(env) if type(p) is not StringToken : p.fail("Figure placement must be a string.") o = (ParagraphToken() + InhibitParagraphToken() + get_anchor_by_id(id) + InhibitParagraphToken() + StringToken("<div class=\"figure figure_"+p.s+"\">") + out + StringToken("</div>") + ParagraphToken()) return o
def _handler(env) : teval = text.eval(env) return (StringToken("<div class=\"caption\"><b>Figure "+counters_to_string("figure")+".</b> ")+teval +StringToken("</div>"))