1LaTeXML(3) User Contributed Perl Documentation LaTeXML(3)
2
3
4
6 "LaTeXML" - A converter that transforms TeX and LaTeX into
7 XML/HTML/MathML
8
10 use LaTeXML;
11 my $converter = LaTeXML->get_converter($config);
12 my $converter = LaTeXML->new($config);
13 $converter->prepare_session($opts);
14 $converter->initialize_session; # SHOULD BE INTERNAL
15 $hashref = $converter->convert($tex);
16 my ($result,$log,$status)
17 = map {$hashref->{$_}} qw(result log status);
18
20 LaTeXML is a converter that transforms TeX and LaTeX into
21 XML/HTML/MathML and other formats.
22
23 A LaTeXML object represents a converter instance and can convert files
24 on demand, until dismissed.
25
26 METHODS
27 "my $converter = LaTeXML->new($config);"
28 Creates a new converter object for a given LaTeXML::Common::Config
29 object, $config.
30
31 "my $converter = LaTeXML->get_converter($config);"
32 Either creates, or looks up a cached converter for the $config
33 configuration object.
34
35 "$converter->prepare_session($opts);"
36 Top-level preparation routine that prepares both a correct options
37 object
38 and an initialized LaTeXML object,
39 using the "initialize_options" and "initialize_session"
40 routines, when needed.
41
42 Contains optimization checks that skip initializations unless
43 necessary.
44
45 Also adds support for partial option specifications during daemon
46 runtime,
47 falling back on the option defaults given when converter
48 object was created.
49
50 "my ($result,$status,$log) = $converter->convert($tex);"
51 Converts a TeX input string $tex into the LaTeXML::Core::Document
52 object $result.
53
54 Supplies detailed information of the conversion log ($log),
55 as well as a brief conversion status summary ($status).
56
57 INTERNAL ROUTINES
58 "$converter->initialize_session($opts);"
59 Given an options hash reference $opts, initializes a session by
60 creating a new LaTeXML object
61 with initialized state and loading a daemonized preamble (if
62 any).
63
64 Sets the "ready" flag to true, making a subsequent "convert" call
65 immediately possible.
66
67 "my $latexml = new_latexml($opts);"
68 Creates a new LaTeXML object and initializes its state.
69
70 "my $postdoc = $converter->convert_post($dom);"
71 Post-processes a LaTeXML::Core::Document object $dom into a final
72 format,
73 based on the preferences specified in $$self{opts}.
74
75 Typically used only internally by "convert".
76
77 "$converter->bind_log;"
78 Binds STDERR to a "log" field in the $converter object
79
80 "my $log = $converter->flush_log;"
81 Flushes out the accumulated conversion log into $log,
82 reseting STDERR to its usual stream.
83
85 Bruce Miller <bruce.miller@nist.gov> Deyan Ginev <deyan.ginev@nist.gov>
86
88 Public domain software, produced as part of work done by the United
89 States Government & not subject to copyright in the US. You may
90 consider this as released under the CC0 License.
91
92
93
94perl v5.28.0 2018-08-07 LaTeXML(3)