Font options in TeX

API Solution to process TeX/LaTeX files. Available font options

 

Aspose.TeX has a number of options to control how the engine handles fonts. These options help achieve certain typographic effects. Let's look at some techniques below:

  • A TeX distribution includes many built-in fonts, such as the Computer Modern (CM) fonts. There is a great variety of font families and types .
  • With TeX, you can easily specify any font size using special commands. Additionally, you can set custom font sizes.
  • TeX also provides commands to modify font attributes. You can change font color, underline text, and make superscripts and subscripts.
  • There are also font style commands to emphasize or highlight text.
  • In addition to built-in fonts, TeX allows you to use custom fonts in your documents. Depending on the LaTeX distribution, you can install additional font packages and use fonts not provided by standard LaTeX.
  • Within the system, you can also find special commands and packages for typesetting mathematical symbols and equations. For math fonts, you will have to use other packages to access a wider range of mathematical symbols and alphabets.

Aspose.TeX covers rich functionality to manipulate fonts within LaTeX/TeX from managing glyph sizes to storing fonts used in a document in subsets to minimize output size. To run the examples we need:

  • The Aspose.TeX for C++ API, - a feature-rich, powerful, and easy-to-use document processing and conversion API for the C++ platform.
  • Open the NuGet package manager, search for Aspose.TeX.Cpp, and install it. You may also use the following command from the Package Manager Console:

Package Manager Console Command

PM> Install-Package Aspose.TeX.Cpp

How to work with fonts in Aspose.TeX C++

There are two examples attached here. The first one demonstrates how to skip ligature construction, and the second shows you how to enable the font subset creation for the output document. The first setting is a property of the TeXOptions class, while the second is a property of the SaveOptions class.

C++ code example: Disabling the construction of ligatures

// Create conversion options instance.
...
// Set to true to make the engine not construct ligatures where normally it would.
options->set_NoLigatures(true);

C++ code example: Storing used fonts in subsets

// Create conversion options instance.
...
// Create and assign saving options instance if needed.
...
// Set to true to make the device subset fonts used in the document.
options->get_SaveOptions()->set_SubsetFonts(true);



FAQ

1. How can I change the font in my LaTeX document?

Changing the font in a LaTeX document usually involves using font selection commands provided by LaTeX. You can specify the font family, size, weight, and style using commands like \documentclass, \usepackage, and \renewcommand. LaTeX offers various font packages that provide access to a wide range of fonts, including system fonts and custom fonts.

2. Can I use custom fonts in my LaTeX document?

LaTeX offers various font packages that provide access to a wide range of fonts, including system fonts and custom fonts.

3. How can I manage font size and style in my LaTeX document?

Managing font size and style in a LaTeX document involves using font size commands like \tiny, \small, \large, etc., to adjust the font size, and font style commands like \textbf for bold, \textit for italic, and \textsc for small caps to change the font style. Additionally, LaTeX provides commands like \fontsize and \selectfont for more precise control over font size and style. You can also define custom font styles and sizes using the \newcommand and \renewcommand commands.

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.