LaTeXML(3pm)

🌸 NAME 🌸

LaTeXML(3pm) β€” okay so this is the User Contributed Perl Documentation page for LaTeXML, and LaTeXML is a converter that transforms TeX and LaTeX into XML/HTML/MathML. That's the whole vibe, bestie. ✨

πŸŽ€ SYNOPSIS πŸŽ€

Here's the group-chat cheat sheet, literally:

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);
sidebar: the synopsis itself says # SHOULD BE INTERNAL next to initialize_session, so don't go treating it like a normal main-character call, okay? 😭

πŸ’œ DESCRIPTION πŸ’œ

LaTeXML is a converter that transforms TeX and LaTeX into XML/HTML/MathML and other formats. No cap, that's the whole iconic job. πŸ’…

A LaTeXML object represents a converter instance and can convert files on demand, until dismissed. It's giving "your own little convert-y bestie that hangs around until you're done with it." πŸ¦‹

πŸ¦‹ METHODS πŸ¦‹

  • my $converter = LaTeXML->new($config); β€” Creates a new converter object for a given LaTeXML::Common::Config object, $config. Fresh converter, just dropped. ✨
  • my $converter = LaTeXML->get_converter($config); β€” Either creates, or looks up a cached converter for the $config configuration object. It's very "have we already made this one? bet." πŸ’…
  • $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.

Contains optimization checks that skip initializations unless necessary.

Also adds support for partial option specifications during daemon runtime, falling back on the option defaults given when converter object was created.

  • my ($result,$status,$log) = $converter->convert($tex); β€” Converts a TeX input string $tex into the LaTeXML::Core::Document object $result.

Supplies detailed information of the conversion log ($log), as well as a brief conversion status summary ($status).

πŸ”₯ 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).

Sets the "ready" flag to true, making a subsequent convert call immediately possible.

  • my $latexml = new_latexml($opts); β€” Creates a new LaTeXML object and initializes its 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.

  • $converter->bind_log; β€” Binds STDERR to a "log" field in the $converter object.
  • my $log = $converter->flush_log; β€” Flushes out the accumulated conversion log into $log, resetting STDERR to its usual stream.

πŸ‘‘ 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.

So yeah β€” public domain, government-made, CC0 License vibes. Periodt. πŸ’–


okay bye bestie β€” this was the LaTeXML(3pm) page, from perl v5.40.1, dated 2025-11-16. mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from