Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save aspose-com-gists/deadfd7c29ffe40024a9b6d12f0ed18a to your computer and use it in GitHub Desktop.

Select an option

Save aspose-com-gists/deadfd7c29ffe40024a9b6d12f0ed18a to your computer and use it in GitHub Desktop.
Manage TeX engine options: interaction modes, job names, date/time, packages, fonts with .NET

Aspose.TeX for .NET – Other Managing TeX Options Examples

These snippets demonstrate various TeX options that control the behavior of the TeX engine in Aspose.TeX for .NET. Learn how to customize interaction modes, job names, date/time, package handling, and output formatting.

Key Use Cases

Basic Options

  • How to set the interaction mode
  • How to set the job name
  • How to "stop time" (freeze date in document title)

Package and Font Options

  • How to ignore missing packages
  • How to avoid building ligatures
  • How to subset fonts (reduce output file size)

Advanced Processing

  • How to repeat the job (for labels and references)
  • How to turn math formulas into raster images
  • How to turn graphics into raster images

How to Run Examples

  1. Reference Aspose.TeX for .NET: Aspose.TeX on Windows; Aspose.TeX.Drawing on non‑Windows.
  2. Copy a snippet into your project.
  3. Apply a temporary license as described in the licensing guide.
  4. Build and run.

Restrictions

In evaluation mode, the output may contain watermarks and limitations. Apply a valid license to unlock full features.

Related Documentation

More about managing TeX options:

Related Resources

Requirements

  • .NET 6.0+, .NET Core, or .NET Framework
  • Aspose.TeX for .NET library

Examples Overview

1. Interaction Mode

Control how the TeX engine behaves when it encounters errors. NonstopMode makes the engine continue processing without stopping for user input.

2. Job Name

Override the default job name (which comes from the input file name). Useful when processing from streams or when you want custom output file names.

3. Date and Time

Freeze the date used in LaTeX document titles. Useful for reproducible builds and version control.

4. Ignore Missing Packages

Allow the TeX engine to skip over missing packages instead of halting with an error. Helpful when working with partially supported LaTeX files.

5. No Ligatures

Prevent the TeX engine from building ligatures (like "fi" or "fl"). Useful for certain fonts or when ligatures are not desired.

6. Repeat Job

Run the same TeX job twice. Necessary for properly resolving cross-references, labels, and table of contents in LaTeX documents.

7. Rasterize Formulas

Convert math formulas to raster images instead of using vector fonts. Can improve compatibility with certain viewers.

8. Rasterize Included Graphics

Convert included vector graphics (PS, EPS, XPS) to raster images. Useful for creating fully rasterized output documents.

9. Subset Fonts

Include only the glyphs actually used in the document, reducing the output file size. Particularly useful for large documents with limited character usage.

Aspose.TeX for .NET – Other Managing TeX Options Examples
// How to "stop time"
// Learn more: https://docs.aspose.com/tex/net/other-options/
// Create conversion options instance.
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectTeX());
// ...
// Force the TeX engine to output the specified date in the title.
options.DateTime = new System.DateTime(2022, 12, 18);
// How to ignore missing packages
// Learn more: https://docs.aspose.com/tex/net/other-options/
// Create conversion options instance.
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectTeX());
// ...
// Set to true to make the engine skip missing packages (when your file references one) without errors.
options.IgnoreMissingPackages = true;
// How to set the interaction mode
// Learn more: https://docs.aspose.com/tex/net/other-options/
// Create conversion options instance.
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectTeX());
// ...
// Set the interaction mode.
options.Interaction = Interaction.NonstopMode;
// How to set the job name
// Learn more: https://docs.aspose.com/tex/net/other-options/
// Create conversion options instance.
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectTeX());
// ...
// Set the job name.
options.JobName = "my-job-name";
// How to avoid building ligatures
// Learn more: https://docs.aspose.com/tex/net/other-options/
// Create conversion options instance.
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectTeX());
// ...
// Set to true to make the engine not construct ligatures where normally it would.
options.NoLigatures = true;
// How to turn math formulas to raster images
// Learn more: https://docs.aspose.com/tex/net/other-options/
// Create conversion options instance.
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectTeX());
// ...
// Create and assign saving options instance if needed.
options.SaveOptions = new PdfSaveOptions();
// ...
// Set to true if you want math formulas to be converted to raster images.
options.SaveOptions.RasterizeFormulas = true;
// How to turn graphics to raster images
// Learn more: https://docs.aspose.com/tex/net/other-options/
// Create conversion options instance.
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectTeX());
// ...
// Create and assign saving options instance if needed.
options.SaveOptions = new PdfSaveOptions();
// ...
// Set to true if you want included graphics (if it contains vector elements) to be converted to raster images.
options.SaveOptions.RasterizeIncludedGraphics = true;
// How to repeat the job
// Learn more: https://docs.aspose.com/tex/net/other-options/
// Create conversion options instance.
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectTeX());
// ...
// Ask the engine to repeat the job.
options.Repeat = true;
// How to subset fonts
// Learn more: https://docs.aspose.com/tex/net/other-options/
// Create conversion options instance.
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectTeX());
// ...
// Create and assign saving options instance if needed.
options.SaveOptions = new PdfSaveOptions();
// ...
// Set to true to make the device subset fonts used in the document.
options.SaveOptions.SubsetFonts = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment