texprintf - Man Page

Extended formatted output functions

Synopsis

#include <texprintf.h>

int texprintf(const char *format, ...);
char * stexprintf(const char *format, ...);
int ftexprintf(const char *format, ...);
void texlistsymbols();
void texboxtree(const char *format, ...);
void texlistsymbols();
void texerrors();

In adition to the above functions <texprintf.h> defines several variables:

int TEXPRINTF_LW;
char * TEXPRINTF_FONT;
int TEXPRINTF_ERR;

Description

The functions in the texprintf family provide formatted output like the printf family of functions extended with a tex-like syntax. The functions generate UTF-8 encoded strings and assume that monospace fonts are used (also for symbols, beware of non-monospace fallback fonts).

Please refer to the utftex man page for details on the tex-like syntax provided by these functions. Refer to the man page of printf for a description of the format.

Upon successful return the functions texprintf, and ftexprintf return the number of characters printed (excluding the null byte used to end output to strings). The stexprintf function returns an allocated string containing the result.

With the integer TEXPRINTF_LW, the line width may be limited. Per default the line width is not limited  (TEXPRINTF_LW=0). If TEXPRINTF_LW is set to a positive integer, the texprintf functions will try to limit the line width to this number of characters, i.e., tt tries to break up the equation  over more than one line. To this end the texprinf engine must find suitable places to break the equation. As it is not guaranteed a suitable location is found, the line width is not guaranteed.

The string TEXPRINTF_FONT can be used to specify the default font. The available fonts are

mathsfbfit
mathsfbf
mathfrak
mathbfit
mathsfit
mathcal
mathscr
mathbf
mathbb
mathsf
mathtt
mathnormal
text (default)

The integer TEXPRINTF_ERR is an error flag. If its value is non zero after a call to any of the texprintf functions, an error has occurred in parsing the input. A call to texerrors() will print the corresponding error messages.  A call to texerrors() will print the related error messages.
The function texlistsymbols() prints all symbols the texprintf system knows.
The texboxtree(const char *format, ...) is for debugginbg purposes. It takes the same arguments as texprintf, however, its output is a description of the resulting internal box datastructures.  

See Also

printf(3), utftex(1)

Info

05 Jul 2022