[texhax] enviroment/ifthen

Uwe Lück uwe.lueck at web.de
Thu Feb 12 02:00:37 CET 2009

At 15:32 11.02.09, Toby Cubitt wrote:
>Uwe Lück wrote:
> >> At 13:38 08.02.09, wawan wrote:
> >>> I need help how to build sty in latex ( environment ) that can replace
> >>> squences of chars with my symbols. For example if there input chars "SU"
> >>> than replace with XY ( my symbols from metafont).
> >> [...]
> > You might reason whether your actual task is worth such efforts. If the
> > task arises all the time with new projects and with a large number of
> > different strings, this may be the case. I have made such a thing, yet I
> > can't release it as it is. This works on entire files, not environments.
>If you do want to embark on this foolish quest :-), perhaps the xstring
>package might help?

In my earlier posting, I had pointed to


-- some offers from which to choose, I choosed which worked at once; it is 
especially helpful if the string to be manipulated is not addressed by an 
explicit list but by a macro name.

>Even if the task arises frequently, a simple sed script (or similar)
>will be far quicker to write, easier to maintain, more robust...and
>generally better in almost every way. In my experience, string
>substitution is just not a task that LaTeX is well suited to. It's not
>difficult to integrate running your source through a sed script into
>your LaTeX build procedure (you could even write a quick Makefile).

I am thinking of users who don't know other program languages than TeX 
and/or for whom TeX is most easily accessible, or who rather understand 
documentations of (La)TeX packages than of other programs. ted (bytopic) is 
a "TeX substitute" for sed.



More information about the texhax mailing list