TransWikia.com

Is there a valid source to read about the description and examples of an arbitrary TEX command such as ifnum?

TeX - LaTeX Asked on March 19, 2021

When I encounter a new TEX command to learn for the first time such as ifnum, I do not know where to start to read about the description and examples. I know ctan.org is full of TEX packages but is not easily searchable. Is there a valid source to read about the description and examples of an arbitrary TEX command such as ifnum?

One Answer

The “official” source for TeX primitive commands is the TeXbook, whose TeX source is available online (even on CTAN), but not for making the printed copy.

The source starts with

% This manual is copyright (C) 1984 by the American Mathematical Society.
% All rights are reserved!
% The file is distributed only for people to see its examples of TeX input,
% not for use in the preparation of books like The TeXbook.
% Permission for any other use of this file must be obtained in writing
% from the copyright holder and also from the publisher (Addison-Wesley).

which means that the file should not even be used for reading the book. Of course, it is allowed to quote small parts of it for the purpose of documentation or description, by citing the source. For longer parts, permission from the publisher has to be obtained.

Here's the description of ifnum (The TeXbook, page 209)

ifnum⟨number1⟩⟨relation⟩⟨number2⟩ (compare two integers)

The ⟨relation⟩ must be either ‘<12’ or ‘=12’ or ’>12’. The two integer numbers are compared to each other in the usual way, and the result is true or false accordingly.

You can instead consult “TeX by Topic”, by Victor Eijkhout, which is freely available on CTAN and included in full versions of TeX Live (texdoc texbytopic). On page 85 you read

enter image description here

The book has also several examples of usage and covers all the TeX primitives.

Correct answer by egreg on March 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP