[NTG-pdftex] Version numbering

Hans Hagen pragma at wxs.nl
Wed Jun 8 09:26:12 CEST 2005


Heiko Oberdiek wrote:


>   I would dislike the idea to have a complicate algorithm only
>   to order pdfTeX versions.

indeed, all 'important' changes (primitives, features) should be reflected in on 
enumber;

> * \pdftexversion and \pdftexrevision are accessed differently:
>     \the\pdftexversion, but \pdftexrevision (expandable)
>   And \pdfversion encodes two numbers.

>   Thus having three numbers instead of the current mixup
>   improves the usage interface.
> 
> * Compatibility:
>   * \pdftexversion is used in (TL2004):
>     * ConTeXt
>     * hyperref
>     * graphicx/pdftex.def
>     * pdfcprot
>     * texinfo
>     * fontinst
>     * attachfile
>     * pdfpages
>     * thumbpdf
>     * ...
>   * \pdftexrevision is used:
>     * hyperref
>     * fontinst
>     * pdfcprot
>     * graphicx/pdftex.def
>     * thumbpdf
>     * ...
> 
>   Thus I think, it is quite too late to change this interface.

an option is to freeze the old numbers and introduce new ones

> * Suggestion for interface that respects compatibility
>   and adds an interface for three numbers:
> 
>   A.B.C
>   A \in [1..\infty]
>   B \in [0..99]
>   C \in [0..25]
> 
>   The whole version number is printed as: printf("%d.%d.%d", A, B, C)
> 
>   \pdftexmainversion:   readonly integer for A
>   \pdftexsubversion:    readonly integer for B
>   \pdftexbugfixversion: readonly integer for C
> 
>   \pdftexversion := \pdftexmainversion * 100 + \pdftexsubversion
>   \pdftexrevision := to_lowerletter(\pdftexbugfixversion)
>     to_lowerletter defines the following mapping:
>        0 -> a
>        1 -> b
>       ...
>       25 -> z
> 
>   The following conditions, expressed in TeX, hold:
> 
>     \the\pdftexversion =
>       \the\numexpr \pdftexmainversion * 100 + \pdftexsubversion\relax
> 
>     \the\pdftexbugfixversion =
>       \the\numexpr\expandafter`\pdftexrevision - `a\relax
> 
> * \pdftexmainversion, ... could be defined as macros,
>   example with e-TeX, pdfTeX versions >= 1.0:
>   
> \edef\pdftexmainversion{% avoid division with rounding
>   \number\dimexpr 0.01\dimexpr\the\pdftexversion sp\relax\relax
> }
> \edef\pdftexsubversion{%
>   \number\numexpr \the\pdftexversion - 100*\pdftexmainversion\relax
> }
> \edef\pdftexbugfixversion{%
>   \number\numexpr \expandafter`\pdftexrevision - `a\relax
> }
> 
> Thus we have already A, B, and C. What we really need is rather
> a specification:
> * data type: A, B, C are numbers (/strings), range
> * how does the version look like, formatting issues
> 
> and the definition of semantics:
> * meaning of A, B, C
> * when to increase A, B, or C

i dislike the formal version number to be calculated, so i'd opt for:

new primitives

\pdftexmainversion:   readonly integer for A
\pdftexsubversion:    readonly integer for B
\pdftexbugfixversion: readonly integer for C

backward compatibility primitives, not advertised

\pdftexversion  := \pdftexmainversion * 100 + \pdftexsubversion
\pdftexrevision := to_lowerletter(\pdftexbugfixversion)

> Next open issue of EuroTeX are feature tests. Some features cannot
> be tested by presence of pdfTeX primitives, eg. \ifeof18

actually, \ifeof18 is implemented now (at least it was the intention)

> Thus currently only the version number can be used to test
> these features.
> Conclusion:
> * The documentation must contain a section that contains
>   a mapping between a feature and the first version, where
>   the feature is available.
> * Or new interface for feature checks independent of version
>   numbers (and independent of a special TeX engine).

Thanks for the analysis -)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------



More information about the ntg-pdftex mailing list