Karim BELABAS on Sat, 12 Dec 1998 11:35:18 +0100 (MET)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: PARI translated to C


[Ilya:]
> Which reminds me.  Due to permanent changes to the format of .tex
> files my converter of PARI docs to computer-readable format (from
> Math::Pari module) produces less and less readable output.
> 
> What is the reason for constant change of the format of documentation?
> If there is one, can one have a doc/CHANGES.macros file which
> documents such changes, so that people (I? ;-) can follow these changes?

The format has changed very little lately. Mostly it consists in removing
duplicate constructs and having "logical" macros everywhere. I don't do this
in a consistant way (takes too much time...), but to accomodate gphelp (TeX
to ASCII part) when things look like they could be improved (and modifying
the TeX is often less hackish than changing the script, though both
evolve...).


I think your converter should be based on gphelp (or both should be based on
the same master file). The presubst() subroutine is very suitable for this
for instance, no point in maintaining two different translators, one of which
will never be up to date. It's trivial to modify gphelp so that it runs as a
filter outputting special @x markers to indicate formatting/highlighting
data (say, gphelp -raw)

[ Right now, the following codes are used

# We use the special char @ to transmit special sequences
# @1=\e[1m (start bold mode)
# @4=\e[4m (start underline mode)
# @0=\e[m  (start normal mode)
# @9=\n    (start program example)
# @@=' '   (for ties a~b --> a@@b --> a b without line break)

which are translated in format_text() and TeXprint(). ]

Your tex_to_pod converter would have a much easier job working on this data
and you wouldn't have to worry about the TeX macros. Does this look suitable ?

In fact, since it's useful for debugging anyway I just did that: 

  gphelp -raw sin

now outputs

      @1sin@0(x): sine of x.

      The library syntax is @1gsin@0(x,@4prec@0).

Maybe I can release 2.0.13 today (I'll try anyway).

  Karim.

P.S: It's easy to have, e.g gphelp -rawall process the entire manual, or
(e.g. -rawallx) just a given chapter (x)
--
Karim Belabas                    email: Karim.Belabas@math.u-psud.fr
Dep. de Mathematiques, Bat. 425
Universite Paris-Sud             Tel: (00 33) 1 69 15 57 48
F-91405 Orsay (France)           Fax: (00 33) 1 69 15 60 19
--
PARI/GP Home Page: http://pari.home.ml.org