NAME
oEdtk::TexDoc - concrete LaTeX document emitter
SYNOPSIS
use oEdtk::TexDoc;
my $doc = oEdtk::TexDoc->new;
$doc->append('NOM', 'value'); # tag built by mktag -> oEdtk::TexTag
$doc->append_qr_code('qrcode', 'text'); # QR code written to the output file
print $doc->escape('50% & more');
DESCRIPTION
The concrete oEdtk::Doc subclass that produces LaTeX output. It builds oEdtk::TexTag objects for each tag, escapes the special LaTeX characters (through the LATEX dictionary), and can render a QR code as a LaTeX textblock*.
METHODS
mktag
my $tag = $doc->mktag($name, $value);
Return a new oEdtk::TexTag for $name and $value (overrides the abstract "mktag" in oEdtk::Doc).
append_table
$doc->append_table($name, @values);
Append $name with an array reference of @values, producing a LaTeX list macro. Returns the object.
append_qr_code
$doc->append_qr_code($tag, $obj, $level, $size, $unit, $hpos, $vpos);
Render $obj (a scalar, or a reference serialised to YAML) as a QR code written to the main output file as a LaTeX textblock*. $tag must be a lowercase macro name; the geometry arguments default to the module's Readonly constants. For each line it calls oEdtk::Main::oe_print_to_output_file.
Text::QRCode is an optional dependency (it builds against the native libqrencode library): it is loaded on first use and the method croaks with an explicit message when it is not installed.
line_break
my $break = $doc->line_break;
Return the LaTeX line break "%\n".
escape
my $escaped = $doc->escape($str);
Escape the characters that are special in LaTeX (backslash, braces, and % & $ _ #), then apply the LATEX dictionary substitution.
The private helpers hhline_content and is_in_list back "append_qr_code"; they are not part of the public API.
AUTHOR
The oEdtk team.