Scroll to navigation

LaTeXML::Common::Config(3pm) User Contributed Perl Documentation LaTeXML::Common::Config(3pm)

NAME

"LaTeXML::Common::Config" - Configuration logic for LaTeXML

SYNPOSIS

    use LaTeXML::Common::Config;
    my $config = LaTeXML::Common::Config->new(
              profile=>'name',
              timeout=>number
              ... );
    $config->read(\@ARGV);
    $config->check;

    my $value = $config->get($name);
    $config->set($name,$value);
    $config->delete($name);
    my $bool = $config->exists($name);
    my @keys = $config->keys;
    my $options_hashref = $config->options;
    my $config_clone = $config->clone;

DESCRIPTION

Configuration management class for LaTeXML options. * Responsible for defining the options interface and parsing the usual Perl command-line options syntax * Provides the intuitive getters, setters, as well as hash methods for manipulating the option values. * Also supports cloning into new configuration objects.

METHODS

"my $config = LaTeXML::Common::Config->new(%options);"
Creates a new configuration object. Note that you should try not to provide your own %options hash but rather create an empty configuration and use $config->read to read in the options.
"$config->read(\@ARGV);"
This is the main method for parsing in LaTeXML options. The input array should either be @ARGV, e.g. when the options were provided from the command line using the classic Getopt::Long syntax, or any other array reference that conforms to that setup.
"$config->check;"
Ensures that the configuration obeys the given profile and performs a set of assignments of meaningful defaults (when needed) and normalizations (for relative paths, etc).
"my $value = $config->get($name);"
Classic getter for the $value of an option $name.
"$config->set($name,$value);"
Classic setter for the $value of an option $name.
"$config->delete($name);"
Deletes option $name from the configuration.
"my $bool = $config->exists($name);"
Checks whether the key $name exists in the options hash of the configuration. Similarly to Perl's "exist" for hashes, it returns true even when the option's value is undefined.
"my @keys = $config->keys;"
Similar to "keys %hash" in Perl. Returns an array of all option names.
"my $options_hashref = $config->options;"
Returns the actual hash reference that holds all options within the configuration object.
"my $config_clone = $config->clone;"
Clones $config into a new LaTeXML::Common::Config object, $config_clone.

OPTIONS

SYNOPSIS

latexmls/latexmlc [options]

 Options:
 --destination=file specifies destination file.
 --output=file      [obsolete synonym for --destination]
 --preload=module   requests loading of an optional module;
                    can be repeated
 --preamble=file    loads a tex file containing document
                    frontmatter. MUST include \begin{document}
                    or equivalent
 --postamble=file   loads a tex file containing document
                    backmatter. MUST include \end{document}
                    or equivalent
 --includestyles    allows latexml to load raw *.sty file;
                    by default it avoids this.
 --base=dir         sets the base directory that the server
                    operates in. Useful when converting
                    documents that employ relative paths.
 --path=dir         adds dir to the paths searched for files,
                    modules, etc; 
 --log=file         specifies log file (default: STDERR)
 --autoflush=count  Automatically restart the daemon after
                    "count" inputs. Good practice for vast
                    batch jobs. (default: 100)
 --timeout=secs     Timecap for conversions (default 600)
 --expire=secs      Timecap for server inactivity (default 600)
 --address=URL      Specify server address (default: localhost)
 --port=number      Specify server port (default: 3354)
 --documentid=id    assign an id to the document root.
 --quiet            suppress messages (can repeat)
 --verbose          more informative output (can repeat)
 --strict           makes latexml less forgiving of errors
 --bibtex           processes a BibTeX bibliography.
 --xml              requests xml output (default).
 --tex              requests TeX output after expansion.
 --box              requests box output after expansion
                    and digestion.
 --format=name      requests "name" as the output format.
                    Supported: tex,box,xml,html4,html5,xhtml
                    html implies html5
 --noparse          suppresses parsing math (default: off)
 --parse=name       enables parsing math (default: on)
                    and selects parser framework "name".
                    Supported: Marpa, RecDescent
 --profile=name     specify profile as defined in
                    LaTeXML::Common::Config
                    Supported: standard|math|fragment|...
                    (default: standard)
 --mode=name        Alias for profile
 --whatsin=chunk    Defines the provided input chunk,
                    choose from document (default), fragment
                    and formula
 --whatsout=chunk   Defines the expected output chunk,
                    choose from document (default), fragment
                    and formula
 --post             requests a followup post-processing
 --embed            requests an embeddable XHTML snippet
                    (requires: --post,--profile=fragment)
                    DEPRECATED: Use --whatsout=fragment
                    TODO: Remove completely
 --stylesheet       specifies a stylesheet,
                    to be used by the post-processor.
 --css=cssfile      adds a css stylesheet to html/xhtml
                    (can be repeated)
 --nodefaultresources    disables processing built-in resources
 --javscript=jsfile      adds a link to a javascript file into
                         html/html5/xhtml (can be repeated)
 --xsltparameter=name:value passes parameters to the XSLT.
 --sitedirectory=dir     sets the base directory of the site
 --sourcedirectory=dir   sets the base directory of the
                         original TeX source
 --mathimages            converts math to images
                         (default for html4 format)
 --nomathimages          disables the above
 --mathimagemagnification=mag specifies magnification factor
 --plane1           use plane-1 unicode for symbols
                    (default, if needed)
 --noplane1         do not use plane-1 unicode
 --pmml             converts math to Presentation MathML
                    (default for xhtml and html5 formats)
 --cmml             converts math to Content MathML
 --openmath         converts math to OpenMath
 --keepXMath        keeps the XMath of a formula as a MathML
                    annotation-xml element
 --nocomments       omit comments from the output
 --inputencoding=enc specify the input encoding.
 --VERSION          show version number.
 --debug=package    enables debugging output for the named
                    package
 --help             shows this help message.

Note that the profiles come with a variety of preset options. To customize your own conversion setup, use --whatsin=math|fragment|document instead, respectively, as well as --whatsout=math|fragment|document.

If you want to provide a TeX snippet directly on input, rather than supply a filename, use the "literal:" protocol to prefix your snippet.

For reliable communication and a stable conversion experience, invoke latexmls only through the latexmlc client (you need to set --expire to a positive value, in order to request auto-spawning of a dedicated conversion server).

DETAILS

"--destination"=file
Specifies the destination file; by default the XML is written to STDOUT.
"--preload"=module
Requests the loading of an optional module or package. This may be useful if the TeX code does not specificly require the module (eg. through input or usepackage). For example, use "--preload=LaTeX.pool" to force LaTeX mode.
"--preamble"=file
Requests the loading of a tex file with document frontmatter, to be read in before the converted document, but after all --preload entries.

Note that the given file MUST contain \begin{document} or an equivalent environment start, when processing LaTeX documents.

If the file does not contain content to appear in the final document, but only macro definitions and setting of internal counters, it is more appropriate to use --preload instead.

"--postamble"=file
Requests the loading of a tex file with document backmatter, to be read in after the converted document.

Note that the given file MUST contain \end{document} or an equivalent environment end, when processing LaTeX documents.

"--includestyles"
This optional allows processing of style files (files with extensions "sty", "cls", "clo", "cnf"). By default, these files are ignored unless a latexml implementation of them is found (with an extension of "ltxml").

These style files generally fall into two classes: Those that merely affect document style are ignorable in the XML. Others define new markup and document structure, often using deeper LaTeX macros to achieve their ends. Although the omission will lead to other errors (missing macro definitions), it is unlikely that processing the TeX code in the style file will lead to a correct document.

"--path"=dir
Add dir to the search paths used when searching for files, modules, style files, etc; somewhat like TEXINPUTS. This option can be repeated.
"--log"=file
Specifies the log file; be default any conversion messages are printed to STDERR.
"--autoflush"=count
Automatically restart the daemon after converting "count" inputs. Good practice for vast batch jobs. (default: 100)
"--expire"=secs
Set an inactivity timeout value in seconds. If the daemon is not given any input for the timeout period it will automatically self-destruct. The default value is 600 seconds, set to 0 to never expire, -1 to entirely opt out of using a server.
"--timeout"=secs
Set time cap for conversion jobs, in seconds. Any job failing to convert in the time range would return with a Fatal error of timing out. Default value is 600, set to 0 to disable.
"--address"=URL
Specify server address (default: localhost)
"--port"=number
Specify server port (default: 3334 for math, 3344 for fragment and 3354 for standard)
"--documentid"=id
Assigns an ID to the root element of the XML document. This ID is generally inherited as the prefix of ID's on all other elements within the document. This is useful when constructing a site of multiple documents so that all nodes have unique IDs.
"--quiet"
Reduces the verbosity of output during processing, used twice is pretty silent.
"--verbose"
Increases the verbosity of output during processing, used twice is pretty chatty. Can be useful for getting more details when errors occur.
"--strict"
Specifies a strict processing mode. By default, undefined control sequences and invalid document constructs (that violate the DTD) give warning messages, but attempt to continue processing. Using "--strict" makes them generate fatal errors.
"--bibtex"
Forces latexml to treat the file as a BibTeX bibliography. Note that the timing is slightly different than the usual case with BibTeX and LaTeX. In the latter case, BibTeX simply selects and formats a subset of the bibliographic entries; the actual TeX expansion is carried out when the result is included in a LaTeX document. In contrast, latexml processes and expands the entire bibliography; the selection of entries is done during post-processing. This also means that any packages that define macros used in the bibliography must be specified using the "--preload" option.
"--xml"
Requests XML output; this is the default.
"--tex"
Requests TeX output for debugging purposes; processing is only carried out through expansion and digestion. This may not be quite valid TeX, since Unicode may be introduced.
"--box"
Requests Box output for debugging purposes; processing is carried out through expansion and digestions, and the result is printed.
"--format=name"
Requests an explicitly provided "name" as the output format of the conversion. Currently supported: tex, box, xml, html4, html5, xhtml Tip: If you wish to apply your own custom XSLT stylesheet, select "xml" as the desired format.
"--noparse"
Suppresses parsing math (default: parsing is on)
"--parse=name"
Enables parsing math (default: parsing is on) and selects parser framework "name". Supported: Marpa, RecDescent, no Tip: --parse=no is equivalent to --noparse
"--profile"
Variety of shorthand profiles, described at "LaTeXML::Common::Config".

Example: "latexmlc --profile=math '1+2=3'"

"--post"
Request post-processing. Enabled by default is processing graphics and cross-referencing.
"--embed"
TODO: Deprecated, use --whatsout=fragment Requests an embeddable XHTML div (requires: --post --format=xhtml), respectively the top division of the document's body. Caveat: This experimental mode is enabled only for fragment profile and post-processed documents (to XHTML).
"--mathimages", "--nomathimages"
Requests or disables the conversion of math to images. Conversion is the default for html4 format.
"--mathsvg", "--nomathsvg"
Requests or disables the conversion of math to svg images.
"--mathimagemagnification="factor
Specifies the magnification used for math images, if they are made. Default is 1.75.
"--pmml"
Requests conversion of math to Presentation MathML. Presentation MathML is the default math processor for the XHTML/HTML5 formats. Will enable "--post".
"--cmml"
Requests or disables conversion of math to Content MathML. Conversion is disabled by default. Note that this conversion is only partially implemented. Will enable "--post".
"--openmath"
Requests or disables conversion of math to OpenMath. Conversion is disabled by default. Note that this conversion is not yet supported in "latexmls". Will enable "--post".
"--xmath" and "--keepXMath"
By default, when any of the MathML or OpenMath conversions are used, the intermediate math representation will be removed; Explicitly specifying --xmath|keepXMath preserves this format. Will enable "--post".
"--stylesheet"=file
Sets a stylesheet of choice to be used by the postprocessor. Will enable "--post".
"--css"=cssfile
Adds cssfile as a css stylesheet to be used in the transformed html/xhtml. Multiple stylesheets can be used; they are included in the html in the order given, following the default "core.css" (but see "--nodefaultresources"). Some stylesheets included in the distribution are --css=navbar-left Puts a navigation bar on the left. (default omits navbar) --css=navbar-right Puts a navigation bar on the left. --css=theme-blue A blue coloring theme for headings. --css=amsart A style suitable for journal articles.
"--javascript"=jsfile
Includes a link to the javascript file jsfile, to be used in the transformed html/html5/xhtml. Multiple javascript files can be included; they are linked in the html in the order given. The javascript file is copied to the destination directory, unless it is an absolute url.
"--nodefaultresources"
Disables the copying and inclusion of resources added by the binding files; This includes CSS, javascript or other files. This does not affect resources explicitly requested by the "--css" or "--javascript" options.
"--timestamp"=timestamp
Provides a timestamp (typically a time and date) to be embedded in the comments by the stock XSLT stylesheets. If you don't supply a timestamp, the current time and date will be used. (You can use "--timestamp=0" to omit the timestamp).
"--xsltparameter"=name:value
Passes parameters to the XSLT stylesheet. See the manual or the stylesheet itself for available parameters.
"--nocomments"
Normally latexml preserves comments from the source file, and adds a comment every 25 lines as an aid in tracking the source. The option --nocomments discards such comments.
"--sitedirectory="dir
Specifies the base directory of the overall web site. Pathnames in the database are stored in a form relative to this directory to make it more portable.
"--sourcedirectory"=source
Specifies the directory where the original latex source is located. Unless LaTeXML is run from that directory, or it can be determined from the xml filename, it may be necessary to specify this option in order to find graphics and style files.
"--inputencoding="encoding
Specify the input encoding, eg. "--inputencoding=iso-8859-1". The encoding must be one known to Perl's Encode package. Note that this only enables the translation of the input bytes to UTF-8 used internally by LaTeXML, but does not affect catcodes. In such cases, you should be using the inputenc package. Note also that this does not affect the output encoding, which is always UTF-8.
"--VERSION"
Shows the version number of the LaTeXML package..
"--debug"=package
Enables debugging output for the named package. The package is given without the leading LaTeXML::.
"--help"
Shows this help message.

AUTHOR

Bruce Miller <bruce.miller@nist.gov> Deyan Ginev <deyan.ginev@nist.gov>

COPYRIGHT

Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.
2015-04-03 perl v5.20.2