Web2c defines its format style using Pascal strings, so there are no separator characters between csnames. Is there a straightforward way of listing all csnames bound in a .fmt file?
Asked
Active
Viewed 439 times
8
1 Answers
6
In the Web2C implementation of TeX and friends, the programs come with an (apparently undocumented) option -debug-format that prints out a lot of information contained in the format file, most of which consists of the names of the control sequences (followed by a pipe sign: |).
Hence, for example:
$ tex -debug-format \\bye
This is TeX, Version 3.1415926 (TeX Live 2009)
fmtdebug:format magic number = 1462916184
fmtdebug:engine name size = 4
fmtdebug:string pool checksum = 57981441
fmtdebug:mem_bot = 0
fmtdebug:mem_top = 2999999
fmtdebug:string pool size = 29307
fmtdebug:sup strings = 2025
fmtdebug:csnames from 514 to 24525:
endlinechar|
AA|
AE|
@M|
OE|
downbracefill|
@m|
bigbreak|
Im|
bordermatrix|
Pi|
[etc.]
is the list of all control sequences defined in tex.fmt.
Arthur Reutenauer
- 2,920
- 19
- 17
-
In LaTeX I see nice font macros generated by the NFSS:
\<5><6><7><8><9>gen*cmmi<10><10.95>cmmi10<12><14.4><17.28><20.74><24.88>cmmi12:-) – Arthur Reutenauer Aug 05 '10 at 21:35 -
This is gold. It doesn't look like everything I get from
echo /dev/null|tex -fmt tex/tex.fmt -debug-format 2>&1 |fgrep "|"|sort|uniq -c(in the texmf-var directory) is a csname though: there are many occurrences of "preloaded" in the output, and several of strings like "tentt". Might you know how to filter these, other than by checking that each is a macro using a \show query? – Charles Stewart Aug 08 '10 at 09:03 -
1\preloaded is a macro that is used to preload some fonts so that they're dumped in the format; it's used several times as a font name in plain.tex, and then assigned to \undefined, which is why you don't see them when you run TeX. The point is that even if the font is not available from stock plain TeX, you can take advantage of it being embedded in the format if you want to use it. – Arthur Reutenauer Aug 08 '10 at 16:46
-
This doesn't make sense to me - format files aren't Tex programs, they're state dumps. How could a single csname have multiple contents? – Charles Stewart Aug 09 '10 at 09:08
-
1I can't claim I understand everything about it, but for all I know, csnames are only particular elements of the string pool to which elements of the hash table are mapped. Hence different macro definitions can point to copies of the same string, even if, obviously, at most one of these definitions will be accessible from inside TeX (and in this case, the control sequence is even “defined” to
\undefinedeventually). – Arthur Reutenauer Aug 09 '10 at 15:33
W2TXin ASCII (standing for “Web2C TeX” or something similar, I suppose), then you have 4 more bytes that seem to be some sort of version number, then a C string for the engine name, etc. The actual data output by TeX proper begins at about byte 0x300. – Arthur Reutenauer Aug 05 '10 at 23:27