4

While browsing through Don Knuth's publications on TeX, I was referred to the file tripman.pdf on my MacTeX distribution. As TeXnicians may know, this file explains the purpose of the TRIP test and how it is to be used, along with the provision of the source to the input files and the correct output. I decided (foolishly?) to try out the test for myself, which is where the issue begins.

I have two questions:

  1. In step 2 of Appendix A, how should I go about modifying INITEX so that the parameters are set as specified there? I have heard of 'change files' which modify the output of weave, tangle, cweave, and ctangle without changing the original WEB or CWEB file, but it is my understanding that such files cannot modify the behaviour of UNIX executables. Without modifying the source of TeX, how can this be done?
  2. In step 4, should the version of INITEX being run be the unmodified version or the modified version in step 2? I assume that, for debugging purposes, the modified version should be used, but I would just like to confirm.

Any further information regarding potential challenges in conducting this test would be very much appreciated. I am a frequent (though admittedly unskilled) user of LaTeX who has recently begun reading the works of Don Knuth on typesetting and typography and may need a little assistance in understanding such materials.

My machine is a Mac running TeXLive 2019 in the form of MacTeX. If any other required information is missing, please request them in the comments.

Thank you.


This is my first foray into TeX.SX, and so the quality of my questions may be subpar. I apologise for any faux pas I may have committed in the course of writing this question, and I welcome all suggestions as to how the above may be improved. Any suggestions as to appropriate tagging would be greatly appreciated. Please, be gentle.

  • 2
    Welcome to tex.sx, +1 for bravery. – barbara beeton Aug 10 at 14:12
  • @barbarabeeton thanks for the compliment! I did not expect you here (no offence). – Daniel Choi Aug 10 at 14:19
  • 3
    The trip test is for developers to check their change file that brings tex.web to a machine. The answer to question 1 is therefore: Yes you have to add the listed changes to your change file. And yes the modified version of INITEX is used in steps 3 and 4. texlive used to have a directory in its source tree texk/web2c/triptrap where you can find the results of trip and trap (for METAFONT). If you are able to compile the source you can try to redo the steps. – Udo Wermuth Aug 10 at 16:16
  • @UdoWermuth thanks. Could you kindly direct me to resources documenting the syntax of change files? I couldn’t locate anything of the sort on my distribution. – Daniel Choi Aug 10 at 16:30
  • Welcome! You'll have to build the TeX binaries from source — for TeX Live, see here and here. Once you've got that process working end-to-end (and have a binary to test), you can try out the trip test with change files or whatever: for change files you can see the WEB manual; the syntax is basically @x ... @y ... @z where the first ... stands for the “before” set of lines and the second ... stands for the “after” set of lines. – ShreevatsaR Aug 11 at 1:58
5

The implementation of \TeX is done in tex.web. This file is a generic implementation which must be tailored to an operating system or, in general, to a specific computer and a Pascal compiler. For example, file name conventions and the input and output procedures must be changed to meet the specifications of a particular system and if the Pascal compiler does not allow an else path in a case statement, for example, then several places in the source have to be changed.

Therefore the programs TANGLE and WEAVE do not only read a single WEB file but they can handle a change file for such a file. So to compile \TeX you need tex.web and tex.ch that contains the changes for your machine.

To check that your change file does not change \TeX in a way that makes your implementation incompatible, i.e., the same .tex file generates an output different from other \TeX implementations, one condition is that the trip test must be passed. It requires a special version of INITEX with predefined values for certain compile-time parameters to make the output of the test comparable. Thus to perform a trip test you must build a special version of \TeX and that means that you have to tangle tex.web with your change file and to compile the resulting Pascal output with your Pascal compiler.

The additional changes for your local change file are described in detail in the test procedure and there the steps for the test are explained. The results must be compared to the output generated by the default \TeX system. These results are listed in the test procedure too and they might change with every new tex.web.

On CTAN you find the relevant documents and sources:

(1) https://ctan.org/tex-archive/systems/knuth/dist/tex contains tex.web and tripman.tex and all required files for the trip test;

(2) https://ctan.org/tex-archive/systems/knuth/dist/web contains TANGLE and WEAVE source code and the WEB manual;

(3) https://ctan.org/tex-archive/systems/knuth/local/tex/initex.ch is an untested and not complete example of a change file for the trip test.

(See https://ctan.org/tex-archive/systems/unix for complete systems for different Pascal compilers; note, however, I don't recommend to use these systems.)

If you download https://ctan.org/tex-archive/systems/knuth/dist/lib/webmac.tex you can (i) run weave tex.web or weave tangle.web etc. without a change file to get a *.tex file that can be processed by plain tex and (ii) read about the generic programs. Of course, you can add a change file and see what happens then.

If you download https://ctan.org/tex-archive/systems/texlive/Source/texlive-20190408-source.tar.xz you can find the directory texk\web2c\triptrap with the trip test results for this texlive system. (You must be able to handle xz and tar files, of course.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.