Hi all,

we are using txt2tags to automatically extract descriptions from an xml 
file. After parsing we have a t2t file with a long definition list.
We automatically build a manual (in tex) from it, put it on a wiki and 
and publish it as html site and manpage. That is what txt2tags was made 
for ;-)

As an extension we added anchors in the list. For that we add the 
following lines to config.t2t:
% for media wiki
%!postproc(wiki): 'anchor\((.*?)\)' '<span id="\1"></span>'
% for html
%!postproc(html): 'anchor\((.*?)\)' '<a name="\1"></a>'
% for tex
%!postproc(tex): 'anchor\((.*?)\)' '\label{\1}'
%For the rest is replaced by nothing.
%!postproc: 'anchor\(.*?\)' ''

Works perfect, but here comes the problem:
In the case of tex target, if the anchor contains a "_" it is replaced 
by "\_" which is not allowed in the \label command in tex.

We solved this problem by running:
sed -i '/\label{.*}/s/\_/_/g' *.tex

Is there a way to solve this internally in txt2tags?
Either by protecting the "_" from txt2tags or by a special %!postproc 
rules which only acts on line matching a /label/?

Cheers,

Christoph

-- 
Dipl.-Phys. Christoph Junghans
Max Planck Institute for Polymer Research
Theory Group
POBox 3148
D 55021 Mainz, Germany

Phone: +49 6131 379 335
Web: http://www.mpip-mainz.mpg.de/~junghans


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list

Reply via email to