.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "LaTeXML::Core 3pm" .TH LaTeXML::Core 3pm 2024-02-27 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME "LaTeXML" \- transforms TeX into XML. .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 3 \& use LaTeXML::Core; \& my $latexml = LaTeXML::Core\->new(); \& $latexml\->convertAndWrite("adocument"); .Ve .PP But also see the convenient command line script latexml which suffices for most purposes. .SH DESCRIPTION .IX Header "DESCRIPTION" .SS METHODS .IX Subsection "METHODS" .ie n .IP """my $latexml = LaTeXML::Core\->new(%options);""" 4 .el .IP "\f(CWmy $latexml = LaTeXML::Core\->new(%options);\fR" 4 .IX Item "my $latexml = LaTeXML::Core->new(%options);" Creates a new LaTeXML object for transforming TeX files into XML. .Sp .Vb 10 \& verbosity : Controls verbosity; higher is more verbose, \& smaller is quieter. 0 is the default. \& strict : If true, undefined control sequences and \& invalid document constructs give fatal \& errors, instead of warnings. \& includecomments : If false, comments will be excluded \& from the result document. \& preload : an array of modules to preload \& searchpath : an array of paths to be searched for Packages \& and style files. .Ve .Sp (these generally set config variables in the LaTeXML::Core::State object) .ie n .IP """$latexml\->convertAndWriteFile($file);""" 4 .el .IP \f(CW$latexml\->convertAndWriteFile($file);\fR 4 .IX Item "$latexml->convertAndWriteFile($file);" Reads the TeX file \f(CW$file\fR.tex, digests and converts it to XML, and saves it in \f(CW$file\fR.xml. .ie n .IP """$doc = $latexml\->convertFile($file);""" 4 .el .IP "\f(CW$doc = $latexml\->convertFile($file);\fR" 4 .IX Item "$doc = $latexml->convertFile($file);" Reads the TeX file \f(CW$file\fR, digests and converts it to XML and returns the resulting XML::LibXML::Document. .ie n .IP """$doc = $latexml\->convertString($string);""" 4 .el .IP "\f(CW$doc = $latexml\->convertString($string);\fR" 4 .IX Item "$doc = $latexml->convertString($string);" \&\fBOBSOLETE\fR Use \f(CW\*(C`$latexml\-\*(C'\fRconvertFile("literal:$string");> instead. .ie n .IP """$latexml\->writeDOM($doc,$name);""" 4 .el .IP \f(CW$latexml\->writeDOM($doc,$name);\fR 4 .IX Item "$latexml->writeDOM($doc,$name);" Writes the XML document to \f(CW$name\fR.xml. .ie n .IP """$box = $latexml\->digestFile($file);""" 4 .el .IP "\f(CW$box = $latexml\->digestFile($file);\fR" 4 .IX Item "$box = $latexml->digestFile($file);" Reads the TeX file \f(CW$file\fR, and digests it returning the LaTeXML::Core::Box representation. .ie n .IP """$box = $latexml\->digestString($string);""" 4 .el .IP "\f(CW$box = $latexml\->digestString($string);\fR" 4 .IX Item "$box = $latexml->digestString($string);" \&\fBOBSOLETE\fR Use \f(CW\*(C`$latexml\-\*(C'\fRdigestFile("literal:$string");> instead. .ie n .IP """$doc = $latexml\->convertDocument($digested);""" 4 .el .IP "\f(CW$doc = $latexml\->convertDocument($digested);\fR" 4 .IX Item "$doc = $latexml->convertDocument($digested);" Converts \f(CW$digested\fR (the LaTeXML::Core::Box reprentation) into XML, returning the XML::LibXML::Document. .SS Customization .IX Subsection "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 \&\fIdoc.tex\fR, LaTeXML reads the file \fIdoc.latexml\fR, if present. Likewise, the LaTeXML implementation of a TeX style file, say \&\fIstyle.sty\fR is provided by a file \fIstyle.ltxml\fR. .PP See LaTeXML::Package for documentation of these customization and implementation files. .SH "SEE ALSO" .IX Header "SEE ALSO" See latexml for a simple command line script. .PP See LaTeXML::Package for documentation of these customization and implementation files. .PP For cases when the high-level declarations described in LaTeXML::Package are not enough, or for understanding more of LaTeXML's internals, see .IP LaTeXML::Core::State 2 .IX Item "LaTeXML::Core::State" maintains the current state of processing, bindings or variables, definitions, etc. .IP "LaTeXML::Core::Token, LaTeXML::Core::Mouth and LaTeXML::Core::Gullet" 2 .IX Item "LaTeXML::Core::Token, LaTeXML::Core::Mouth and LaTeXML::Core::Gullet" deal with tokens, tokenization of strings and files, and basic TeX sequences such as arguments, dimensions and so forth. .IP "LaTeXML::Core::Box and LaTeXML::Core::Stomach" 2 .IX Item "LaTeXML::Core::Box and LaTeXML::Core::Stomach" deal with digestion of tokens into boxes. .IP "LaTeXML::Core::Document, LaTeXML::Common::Model, LaTeXML::Core::Rewrite" 2 .IX Item "LaTeXML::Core::Document, LaTeXML::Common::Model, LaTeXML::Core::Rewrite" dealing with conversion of the digested boxes into XML. .IP "LaTeXML::Core::Definition and LaTeXML::Core::Parameters" 2 .IX Item "LaTeXML::Core::Definition and LaTeXML::Core::Parameters" representation of LaTeX macros, primitives, registers and constructors. .IP LaTeXML::MathParser 2 .IX Item "LaTeXML::MathParser" the math parser. .IP "LaTeXML::Global, LaTeXML::Common::Error, LaTeXML::Common::Object" 2 .IX Item "LaTeXML::Global, LaTeXML::Common::Error, LaTeXML::Common::Object" other random modules. .SH AUTHOR .IX Header "AUTHOR" Bruce Miller .SH COPYRIGHT .IX Header "COPYRIGHT" Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.