.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "LaTeXML 3pm" .TH LaTeXML 3pm 2024-02-27 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME "LaTeXML" \- A converter that transforms TeX and LaTeX into XML/HTML/MathML .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 8 \& use LaTeXML; \& my $converter = LaTeXML\->get_converter($config); \& my $converter = LaTeXML\->new($config); \& $converter\->prepare_session($opts); \& $converter\->initialize_session; # SHOULD BE INTERNAL \& $hashref = $converter\->convert($tex); \& my ($result,$log,$status) \& = map {$hashref\->{$_}} qw(result log status); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" LaTeXML is a converter that transforms TeX and LaTeX into XML/HTML/MathML and other formats. .PP A LaTeXML object represents a converter instance and can convert files on demand, until dismissed. .SS METHODS .IX Subsection "METHODS" .ie n .IP """my $converter = LaTeXML\->new($config);""" 4 .el .IP "\f(CWmy $converter = LaTeXML\->new($config);\fR" 4 .IX Item "my $converter = LaTeXML->new($config);" Creates a new converter object for a given LaTeXML::Common::Config object, \f(CW$config\fR. .ie n .IP """my $converter = LaTeXML\->get_converter($config);""" 4 .el .IP "\f(CWmy $converter = LaTeXML\->get_converter($config);\fR" 4 .IX Item "my $converter = LaTeXML->get_converter($config);" Either creates, or looks up a cached converter for the \f(CW$config\fR configuration object. .ie n .IP """$converter\->prepare_session($opts);""" 4 .el .IP \f(CW$converter\->prepare_session($opts);\fR 4 .IX Item "$converter->prepare_session($opts);" Top-level preparation routine that prepares both a correct options object and an initialized LaTeXML object, using the "initialize_options" and "initialize_session" routines, when needed. .Sp Contains optimization checks that skip initializations unless necessary. .Sp Also adds support for partial option specifications during daemon runtime, falling back on the option defaults given when converter object was created. .ie n .IP """my ($result,$status,$log) = $converter\->convert($tex);""" 4 .el .IP "\f(CWmy ($result,$status,$log) = $converter\->convert($tex);\fR" 4 .IX Item "my ($result,$status,$log) = $converter->convert($tex);" Converts a TeX input string \f(CW$tex\fR into the LaTeXML::Core::Document object \f(CW$result\fR. .Sp Supplies detailed information of the conversion log ($log), as well as a brief conversion status summary ($status). .SS "INTERNAL ROUTINES" .IX Subsection "INTERNAL ROUTINES" .ie n .IP """$converter\->initialize_session($opts);""" 4 .el .IP \f(CW$converter\->initialize_session($opts);\fR 4 .IX Item "$converter->initialize_session($opts);" Given an options hash reference \f(CW$opts\fR, initializes a session by creating a new LaTeXML object with initialized state and loading a daemonized preamble (if any). .Sp Sets the "ready" flag to true, making a subsequent "convert" call immediately possible. .ie n .IP """my $latexml = new_latexml($opts);""" 4 .el .IP "\f(CWmy $latexml = new_latexml($opts);\fR" 4 .IX Item "my $latexml = new_latexml($opts);" Creates a new LaTeXML object and initializes its state. .ie n .IP """my $postdoc = $converter\->convert_post($dom);""" 4 .el .IP "\f(CWmy $postdoc = $converter\->convert_post($dom);\fR" 4 .IX Item "my $postdoc = $converter->convert_post($dom);" Post-processes a LaTeXML::Core::Document object \f(CW$dom\fR into a final format, based on the preferences specified in $$self{opts}. .Sp Typically used only internally by \f(CW\*(C`convert\*(C'\fR. .ie n .IP """$converter\->bind_log;""" 4 .el .IP \f(CW$converter\->bind_log;\fR 4 .IX Item "$converter->bind_log;" Binds STDERR to a "log" field in the \f(CW$converter\fR object .ie n .IP """my $log = $converter\->flush_log;""" 4 .el .IP "\f(CWmy $log = $converter\->flush_log;\fR" 4 .IX Item "my $log = $converter->flush_log;" Flushes out the accumulated conversion log into \f(CW$log\fR, resetting STDERR to its usual stream. .SH AUTHOR .IX Header "AUTHOR" Bruce Miller Deyan Ginev .SH COPYRIGHT .IX Header "COPYRIGHT" Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US. You may consider this as released under the CC0 License.