LaTeXML::Core(3)
π NAME π
LaTeXML β it transforms TeX into XML. That's it, that's the whole vibe. β¨
π¦ SYNOPSIS π¦
use LaTeXML::Core;
my $latexml = LaTeXML::Core->new();
$latexml->convertAndWrite("adocument");
But bestie, real talk β also check out the convenient command line script latexml, which honestly suffices for most purposes. Like, most of the time that's all you need, no cap. π«Ά
This is page LaTeXML::Core(3) from the User Contributed Perl Documentation, and we're gonna get into it.
πΈ DESCRIPTION πΈ
π METHODS π
my $latexml = LaTeXML::Core->new(%options);β creates a fresh new LaTeXML object, main character energy, for transforming TeX files into XML. π
The %options you can pass (and yes, these generally set config variables in the LaTeXML::Core::State object, iykyk):
verbosityβ controls verbosity. Higher is more verbose, smaller is quieter.0is the default. π€«strictβ if true, undefined control sequences and invalid document constructs give fatal errors instead of warnings. So like, it stops playing around. πincludecommentsβ if false, comments will be excluded from the result document. Bye bye comments πpreloadβ an array of modules to preload.searchpathβ an array of paths to be searched for Packages and style files. π
$latexml->convertAndWriteFile($file);β reads the TeX file$file.tex, digests and converts it to XML, and saves it in$file.xml. Slay, it did both jobs in one call. β¨$doc = $latexml->convertFile($file);β reads the TeX file$file, digests and converts it to XML, and returns the resultingXML::LibXML::Document. π$doc = $latexml->convertString($string);β OBSOLETE π¨ Use this instead:
$latexml-"convertFile("literal:$string");>
$latexml->writeDOM($doc,$name);β writes the XML document to$name.xml. π$box = $latexml->digestFile($file);β reads the TeX file$file, and digests it, returning theLaTeXML::Core::Boxrepresentation. Boxed up and ready π$box = $latexml->digestString($string);β OBSOLETE π¨ Use this instead:
$latexml-"digestFile("literal:$string");>
$doc = $latexml->convertDocument($digested);β converts$digested(theLaTeXML::Core::Boxreprentation) into XML, returning theXML::LibXML::Document. π
π Customization π
In the simplest case, LaTeXML will just understand your source file and convert it automatically. Iconic. But with more complicated (realistic) documents, you will likely need to make document specific declarations so it understands local macros, your mathematical notations, and so forth. π
Before processing a file doc.tex, LaTeXML reads the file doc.latexml, if present. Likewise, the LaTeXML implementation of a TeX style file, say style.sty, is provided by a file style.ltxml. Matching set, cute. π
See LaTeXML::Package for documentation of these customization and implementation files.
π SEE ALSO π
See latexml for a simple command line script.
See LaTeXML::Package for documentation of these customization and implementation files.
For cases when the high-level declarations described in LaTeXML::Package are not enough, or for understanding more of LaTeXML's internals, see:
LaTeXML::Core::Stateβ maintains the current state of processing, bindings or variables, definitions, etc.LaTeXML::Core::Token,LaTeXML::Core::MouthandLaTeXML::Core::Gulletβ deal with tokens, tokenization of strings and files, and basic TeX sequences such as arguments, dimensions and so forth.LaTeXML::Core::BoxandLaTeXML::Core::Stomachβ deal with digestion of tokens into boxes.LaTeXML::Core::Document,LaTeXML::Common::Model,LaTeXML::Core::Rewriteβ dealing with conversion of the digested boxes into XML.LaTeXML::Core::DefinitionandLaTeXML::Core::Parametersβ representation of LaTeX macros, primitives, registers and constructors.LaTeXML::MathParserβ the math parser. π₯LaTeXML::Global,LaTeXML::Common::Error,LaTeXML::Common::Objectβ other random modules.
β¨ AUTHOR β¨
Bruce Miller <bruce.miller@nist.gov> β ty for your service π«Ά
π§ COPYRIGHT π§
Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.
And that's the whole thing, bestie β perl v5.42.3, dated 2024-02-26, page LaTeXML::Core(3). Go forth and convert that TeX, periodt. π
πβ
π¦ 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