[pdftex] translating data to macros

George N. White III gnwiii at gmail.com
Tue Dec 8 13:44:35 CET 2009

On Mon, Dec 7, 2009 at 6:49 PM, E R <pc88mxer at gmail.com> 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.

GNU recode supports (La)TeX encodings.  I think it uses the iconv
library as well as some addtitions implemented in C using flex.
There is also a perl iconv tool.  See (esp. table 11.1):


> 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.)
> Note that my data will contain non-ASCII characters such as characters
> in the Latin1 and Cyrillic code-point space.
> Thanks,
> ER

George N. White III <aa056 at chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia

More information about the pdftex mailing list