Load TeX source files from ZIP

C++ API Solution to load TeX/LaTeX files from a ZIP archive

 

The TeX language is a typesetting tool that allows you to create professional documents without bothering about formatting. With TeX, you enter plain text containing text fragments of a document along with commands that control the output. At the output you will get a formatted file in the desired (specified) format. For a better understanding of TeX input and output, refer to the TeX documentation .

The code here explains loading TeX input from a ZIP archive. For this purpose, you can use this Aspose.TeX API for C++, which is a feature-rich, powerful, and easy-to-use tool for coding document manipulation and conversion. To install the API, open the NuGet package manager and search for Aspose.TeX.Cpp. Alternatively, you can use the following command in the Package Manager Console:

Package Manager Console Command

PM> Install-Package Aspose.TeX.Cpp

Instructions for loading TeX from a ZIP archive in C++:

Here we assume that all files (except perhaps the main input TeX file) are packaged in a ZIP archive.

  1. Open a stream containing a ZIP archive that will serve as the input working directory for TeX input files.
  2. Create an instance of the TeXOptions class to specify the conversion options.
  3. Create an instance of the InputZipDirectory class with the ZIP-containing stream and assign it to the InputWorkingDirectory property of the conversion options.
  4. Finally, you may run the conversion job.

C++ code example: Loading TeX from ZIP

using Aspose.TeX.IO;
using System.IO;
// Open a stream for the ZIP archive that will serve as the input working directory.
System::SharedPtr<System::IO::Stream> inZipStream = System::IO::File::Open(System::IO::Path::Combine(RunExamples::InputDirectory, u"zip-in.zip"), System::IO::FileMode::Open);

// Create conversion options instance.
...
// Specify the ZIP archive working directory for the input.
options->set_InputWorkingDirectory(System::MakeObject<OutputZipDirectory>(inZipStream));
...
// Run the conversion.

TeX What is TeX File Format

TeX is not actually a format. It is both a programming language and also an interpreter engine that understands this language. A TeX file is a plain text file created using TeX syntax to be converted to some target format by being processed by a TeX engine. This output document may include graphics, tables, lists, formulas, and equations.