Karim Belabas on Tue, 05 Feb 2019 15:26:10 +0100


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

Re: texi_sign()


* Oliver Bandel [2019-02-04 21:38]:
> In
>   src/language/es.c
> there is the function texi_sign(), which creates
> TeX-output.
> 
> I used gp for some calculations and writetex()
> for putting the results into a *.tex file.
> 
> The output is ok for plain-TeX
>, but for LaTeX it should look different.
> 
> There is \pmatrix{} for TeX, but in LaTeX it would be
> \begin{array} and \end{array},
> or with amsmath-package it would be
> \begin{pmatrix} and \end{pmatrix}.

Hello Oliver,

This problem came up before and I decided NOT to add (or overload) another
obscure option. TeX or LaTeX are exceedingly (re)configurable via style
files which makes the annoyance of updating our TeX markup each time a
popular package author breaks compatibility unnecessary. For instance

  % using plain TeX: t_FRAC are typeset using \frac
  \def\frac#1#2{{#1\over#2}}

  % using LaTeX + amsmath: the package authors broke \pmatrix on purpose
  % replace by equivalent amsmath construct
  \def\pmatrix#1{\begin{pmatrix}#1\end{pmatrix}}

The printtex/writetex engine was originally written for plain TeX to ensure
maximal portability. By letting authors incorporate such fragments in their
style file, we maintain 1) a simple C code base, 2) a consistent (it outdated)
TeX/LaTeX markup for all users, 3) fully configurable output by 
separating presentation from content.

Cheers,

    K.B.

P.S. The (badly named and poorly documented) TeXstyle option is only there to
output additional markup which is likely to improve the typesetting. This
works out of the box for the gp *logfile* when log = 3 (the resulting log
is valid self-sufficient TeX), but breaks in printtex / writetex unless the
user suitably defines \PARIbreak [ I'll document that ]

--
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite de Bordeaux         Fax: (+33) (0)5 40 00 21 23
351, cours de la Liberation    http://www.math.u-bordeaux.fr/~kbelabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux.fr/  [PARI/GP]
`