[texhax] A Comprehensive list of TeX primitives and Plain TeX macros

Heiko Oberdiek heiko.oberdiek at googlemail.com
Thu Oct 11 03:14:50 CEST 2012

On Thu, Oct 11, 2012 at 12:50:12AM +0100, Paul Stanley wrote:

> I'm looking for the above in order to create a pronunciation
> dictionary for my speech synth.

The following Perl script generates a list of command names that
are used in plain.tex. The list does not include active characters
and primitives that are not used in plain.tex explicitly.

%%% plaincmds.pl %%%
#!/usr/bin/env perl
use strict;

my %cmd;

chomp(my $file_plain = `kpsewhich plain.tex`);
open(IN, '<', $file_plain) or die "!!! Error: Cannot open `$file_plain`!\n";
while (<IN>) {
    # s/(^|[^\\])%.*/$1/;

sub addcmd ($) {
    my $cmd = shift;
    $cmd{$cmd} = 1;
    return $cmd;

map { print "$_\n"; } (sort keys %cmd);

%%% plaincmds.pl %%%

Call: plaincmds.pl >plaincmds.txt

At last the list of commands follows (893 commands):

%%% plaincmds.txt
\c at ncel
\ch at ck
\dimen at i
\dimen at ii
\displ at y
\dt at pfalse
\dt at ptrue
\f at t
\finph at nt
\finsm at sh
\fo at t
\getf at ctor
\h at false
\h at true
\if at cr
\if at mid
\ifdt at p
\ifp at ge
\ifr at ggedbottom
\insc at unt
\m at g
\m at ketabbox
\m at ne
\m at th
\makeph at nt
\makesm at sh
\mathph at nt
\mathsm at sh
\n at space
\o at lign
\p at gefalse
\p at getrue
\p at renwd
\ph at nt
\pr at m@s
\prim at s
\r at ggedbottomfalse
\r at ggedbottomtrue
\s at tcols
\s at tt@b
\sett at b
\sh at ft
\sp at n
\t at bb@x
\t at bbox
\us at false
\us at true
\v at false
\v at true
\voidb at x
\z at skip
%%% plaincmds.txt

Yours sincerely
  Heiko Oberdiek

More information about the texhax mailing list