LaTeXML(3)

πŸ“¦ version 0.8.8, in nixos 26.05, nixpkgs unstable

πŸ’– 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 given LaTeXML::Common::Config object, $config. πŸŽ€
  • my $converter = LaTeXML->get_converter($config); β€” either creates a converter, or looks up a cached one, for the $config configuration 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 initialized LaTeXML object, using the initialize_options and initialize_session routines, 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 $tex into the LaTeXML::Core::Document object $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 new LaTeXML object with initialized state and loading a daemonized preamble (if any). It sets the ready flag to true, making a subsequent convert call immediately possible. So ready. ⭐
  • my $latexml = new_latexml($opts); β€” creates a new LaTeXML object and initializes its state. Fresh object, fresh state. πŸ¦‹
  • my $postdoc = $converter->convert_post($dom); β€” post-processes a LaTeXML::Core::Document object $dom into a final format, based on the preferences specified in $$self{opts}. Typically used only internally by convert. Behind-the-scenes queen. πŸ‘‘
  • $converter->bind_log; β€” binds STDERR to a log field in the $converter object. Catching those logs. πŸŽ€
  • my $log = $converter->flush_log; β€” flushes out the accumulated conversion log into $log, resetting STDERR to its usual stream. Cleanup slay. ✨

🌸 AUTHOR 🌸

Bruce Miller <bruce.miller@nist.gov> and Deyan Ginev <deyan.ginev@nist.gov>. Legends, fr fr. πŸ‘‘

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