.\" -*- 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::Util::Pack 3pm" .TH LaTeXML::Util::Pack 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::Util::Pack" \- smart packing and unpacking of TeX archives .SH DESCRIPTION .IX Header "DESCRIPTION" This module provides an API and convenience methods for: 1. Unpacking Zip archives which contain a TeX manuscript. 2. Packing the files of a LaTeXML manuscript into a single archive 3. Extracting embeddable fragments, as well as single formulas from LaTeXML documents .PP All user-level methods are unconditionally exported by default. .SS METHODS .IX Subsection "METHODS" .ie n .IP """$main_tex_source = unpack_source($archive,$extraction_directory);""" 4 .el .IP "\f(CW$main_tex_source = unpack_source($archive,$extraction_directory);\fR" 4 .IX Item "$main_tex_source = unpack_source($archive,$extraction_directory);" Unpacks a given \f(CW$archive\fR into the \f(CW$extraction_directory\fR. Next, perform a heuristic analysis to determine, and return, the main file of the TeX manuscript. If the main file cannot be determined, the \f(CW$extraction_directory\fR is removed and undef is returned. .Sp In this regard, we implement a simplified form of the logic in TeX::AutoTeX and particularly arXiv::FileGuess .ie n .IP """@packed_documents = pack_collection(collection=>\e@documents, whatsout=>\*(Aqmath|fragment|archive\*(Aq, siteDirectory=>$path);""" 4 .el .IP "\f(CW@packed_documents = pack_collection(collection=>\e@documents, whatsout=>\*(Aqmath|fragment|archive\*(Aq, siteDirectory=>$path);\fR" 4 .IX Item "@packed_documents = pack_collection(collection=>@documents, whatsout=>math|fragment|archive, siteDirectory=>$path);" Packs a collection of documents using the packing method specified via the 'whatsout' option. If 'fragment' or 'math' are chosen, each input document is transformed into an embeddable fragment or a single formula, respectively. If 'archive' is chose, all input documents are written into an archive in the specified 'siteDirectory'. The name of the archive is provided by the 'destination' property of the first provided \f(CW$document\fR object. Each document is expected to be a LaTeXML::Post::Document object. .SH AUTHOR .IX Header "AUTHOR" Bruce Miller , Deyan Ginev .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.