[pdftex] translating data to macros

Reinhard Kotucha reinhard.kotucha at web.de
Tue Dec 8 01:23:01 CET 2009

On 7 December 2009 E R wrote:

 > Hi,
 > I have a problem which can be described as a "mail merge" application.
 > That is, I have data in an external file, and I need an algorithm to
 > create TeX macros which will faithfully represent that data in a LaTeX
 > document. For instance, my data may have characters which TeX normally
 > interprets in a special way (dollar signs, less-than, greater-than,
 > etc), and I need to disable any special interpretation. The algorithm
 > does not have to be in TeX - I'm envisioning a perl script to
 > translate the data to the appropriate TeX macros.
 > Is there a robust way to create a macro definition which, when
 > expanded, will print a specific character devoid of any special
 > interpretation by TeX?
 > (I figure if I can do it for just one character I can figure out how
 > to do it for an entire string.)

You can either quote these characters or put the whole stuff into a
verbatim environment.
 > Note that my data will contain non-ASCII characters such as characters
 > in the Latin1 and Cyrillic code-point space.

Seems that you need an engine which supports UTF-8 natively, like

However, if you know about the language in advance, you can look at
the example I provided in the VnTeX documentation.


The example is on page 4.


Reinhard Kotucha			              Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha at web.de
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.

More information about the pdftex mailing list