Create custom TeX format
Make a file of custom TeX format via C# .NET
TeX is known as one of the data markup languages. It is the main core of the publication set system (computer typesetting). It is questionable to consider TeX as a file format, because it is a programming language. And on the other hand, it is an interpreter engine that understands this language. Anyway, in short, its main purpose is to help with the creation of mathematical or technical text writing. Many different packets have been created on the basis of ΤeΧ. They are aimed to make it easier to process the documents, especially when they have formulas or math equations.
Aspose.TeX API solution among the different other features allows creating your own featured TeX files. Here you will find information that explains how to create files of such a customized format. Such a file will have the customized engine options. For this we need:
Aspose.TeX for .NET API which is a feature-rich, powerful and easy-to-use document manipulation and conversion API for C# platform.
Open the NuGet package manager, and search for Aspose.TeX and install. You may also use the following command from the Package Manager Console.
Package Manager Console Command
PM> Install-Package Aspose.TeX
Steps to create a custom TeX file C#.
- Using ConsoleAppOptions() Method of TeXOptions Class, create TeX engine options for no format upon ObjectTeX engine extension.
- Using InputFileSystemDirectory Class, specify a file system working directory for the input.
- Use OutputFileSystemDirectory Class to specify a file system working directory for the output.
- Create the format using TeXJob.CreateFormat() Method.
- Refine the output.
C# Code to customize TeX files
using Aspose.TeX.IO; using Aspose.TeX;
// Create the TeX engine options for no format upon ObjectTeX engine extension. TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectIniTeX); // Specify a file system working directory for the input. options.InputWorkingDirectory = new InputFileSystemDirectory(RunExamples.InputDirectory); // Specify a file system working directory for the output. options.OutputWorkingDirectory = new OutputFileSystemDirectory(RunExamples.OutputDirectory); // Run the format creation. TeXJob.CreateFormat("customtex", options); // For further output to look fine. options.TerminalOut.Writer.WriteLine();
1. What is a LaTeX template?
Template is a saved set of properties, settings or structure that can be applied to a newly created document to save time. For LaTeX it can be a file that contains information of page format, fonts, document class, included packages, etc.
2. How do I use LaTeX templates?
If you do not use any additional software and the template is just a .tex file, just open it and start working. Just keep in mind that you do not save the changes right in this document but use Save as option instead.
3. How to set the type of LaTeX document?
To specify the type of document in LaTeX such as an article, book, or presentation, use the command
4. How to create a custom TeX format?
To create a custom TeX format using Aspose.TeX API Solution you need to create TeX engine options. Then specify a file system working directory for the input and output and create the format using TeXJob.CreateFormat() Method.
TEX What is TEX File Format
TeX is not actually a format. It is at the same time a programming language and also an interpreter engine that understands this language. A TeX file is a document created in LaTeX. This document can include graphics, tables, symbols, lists, formulas, and equations.