LaTeXML::Core3pm
Transforms tex into xml.
Usage
use LaTeXML::Core;my $latexml = LaTeXML::Core->new();$latexml->convertAndWrite("adocument");
But also see the convenient command line script latexml which suffices for most purposes.
Overview
Methods
- "my $latexml = LaTeXML::Core->new(%options);"
-
Creates a new LaTeXML object for transforming TeX files into XML.
verbosity : Controls verbosity; higher is more verbose,smaller is quieter. 0 is the default.strict : If true, undefined control sequences andinvalid document constructs give fatalerrors, instead of warnings.includecomments : If false, comments will be excludedfrom the result document.preload : an array of modules to preloadsearchpath : an array of paths to be searched for Packagesand style files.(these generally set config variables in the LaTeXML::Core::State object)
- "$latexml->convertAndWriteFile($file);"
-
Reads the TeX file
$file.tex, digests and converts it to XML, and saves it in$file.xml.
- "$doc = $latexml->convertFile($file);"
-
Reads the TeX file
$file, digests and converts it to XML and returns the resulting XML::LibXML::Document.
- "$doc = $latexml->convertString($string);"
-
OBSOLETE Use
"$latexml-"convertFile("literal:$string");> instead.
- "$latexml->writeDOM($doc,$name);"
-
Writes the XML document to
$name.xml.
- "$box = $latexml->digestFile($file);"
-
Reads the TeX file
$file, and digests it returning the LaTeXML::Core::Box representation.
- "$box = $latexml->digestString($string);"
-
OBSOLETE Use
"$latexml-"digestFile("literal:$string");> instead.
- "$doc = $latexml->convertDocument($digested);"
-
Converts
$digested(the LaTeXML::Core::Box reprentation) into XML, returning the XML::LibXML::Document.
Customization
In the simplest case, LaTeXML will understand your source file and convert it automatically. With more complicated (realistic) documents, you will likely need to make document specific declarations for it to understand 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.
See LaTeXML::Package for documentation of these customization and implementation files.
Releases
6 releases since Debian 8 (Jessie); the text changed 5 times.