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.
- Open a stream containing a ZIP archive that will serve as the input working directory for TeX input files.
- Create an instance of the TeXOptions class to specify the conversion options.
- Create an instance of the InputZipDirectory class with the ZIP-containing stream and assign it to the InputWorkingDirectory property of the conversion options.
- 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.
FAQ
1. What classes are used to load TeX files from ZIP?
To provide the input of TeX files from ZIP, use the InputZipDirectory class.
2. How do I install TeX Package?
To do this, open the NuGet package manager, search for Aspose.TeX and install it, or use the following command in the Package Manager Console: Install-Package Aspose.TeX
.
3. How do I load a TeX file from ZIP?
Create a stream object to read the ZIP archive for the input. Then create conversion options using ConsoleAppOptions(). Next, specify a ZIP archive working directory for the input. Specify the saving options and run the job.
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.