LaTeXML(3)
π NAME π
okay bestie, this is the manual page for LaTeXML β that's LaTeXML(3) β and it comes from the User Contributed Perl Documentation manual. It's a converter that transforms TeX and LaTeX into XML/HTML/MathML, no cap. π¦
β¨ SYNOPSIS β¨
Here's the whole vibe in code form, exactly as written:
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);
That # SHOULD BE INTERNAL comment? Bestie, respect it. It's literally right there. π
πΈ DESCRIPTION πΈ
LaTeXML is a converter that transforms TeX and LaTeX into XML/HTML/MathML and other formats. Iconic. π
A LaTeXML object represents a converter instance and can convert files on demand, until dismissed. Main character energy: it hangs around and does the work when you ask. π
π METHODS π
my $converter = LaTeXML->new($config);β creates a shiny new converter object for a givenLaTeXML::Common::Configobject,$config. πmy $converter = LaTeXML->get_converter($config);β either creates a converter, or looks up a cached one, for the$configconfiguration object. Caching? We love to see it. β¨$converter->prepare_session($opts);β the top-level preparation routine, bestie. It prepares both a correct options object and an initializedLaTeXMLobject, using theinitialize_optionsandinitialize_sessionroutines, when needed. It contains optimization checks that skip initializations unless necessary. It also adds support for partial option specifications during daemon runtime, falling back on the option defaults given when the converter object was created. Lowkey efficient. πmy ($result,$status,$log) = $converter->convert($tex);β converts a TeX input string$texinto theLaTeXML::Core::Documentobject$result. It supplies detailed information of the conversion log ($log), as well as a brief conversion status summary ($status). Get you a method that does both. π«Ά
π§ INTERNAL ROUTINES π§
$converter->initialize_session($opts);β given an options hash reference$opts, initializes a session by creating a newLaTeXMLobject with initialized state and loading a daemonized preamble (if any). It sets thereadyflag to true, making a subsequentconvertcall immediately possible. So ready. βmy $latexml = new_latexml($opts);β creates a newLaTeXMLobject and initializes its state. Fresh object, fresh state. π¦my $postdoc = $converter->convert_post($dom);β post-processes aLaTeXML::Core::Documentobject$dominto a final format, based on the preferences specified in$$self{opts}. Typically used only internally byconvert. Behind-the-scenes queen. π$converter->bind_log;β bindsSTDERRto alogfield in the$converterobject. Catching those logs. πmy $log = $converter->flush_log;β flushes out the accumulated conversion log into$log, resettingSTDERRto its usual stream. Cleanup slay. β¨
πΈ AUTHOR πΈ
Bruce Miller <bruce.miller@nist.gov> and Deyan Ginev <deyan.ginev@nist.gov>. Legends, fr fr. π
π 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. Periodt. π«Ά
Catch you later, bestie β this page is from perl v5.42.3, dated 2024-02-26, and it's the manual for LaTeXML(3) π
β¨
π¦ where this page comes from
- nixos 26.05: perl5.42.3-LaTeXML 0.8.8
- nixpkgs unstable: perl5.42.3-LaTeXML 0.8.8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms