# What is the cross-referencing source code in plain.tex?

I'm doing macro programming, and I would like to know what is the cross-referencing source code in plain.tex, so that I can apply those source codes to my own .sty file. If anybody can give me some hints about it that will be highly appreciated.

• As far as I know there is no direct support for cross-references in Plain TeX if not other macro bundles are included. – user31729 Feb 7 '17 at 9:20
• plain tex has almost no automatic numbering the section headings and list commands use explicit numbers so there is little need for mechanised cross refs, to refer to section 2 just type "section 2" – David Carlisle Feb 7 '17 at 16:52
• there is cross-referencing applied in the texbook. it's very different from what's defined in latex. the definitions are in the file manmac.tex, which is present in tex live in the directory .../tex/plain/knuth-lib/. look for \xref, – barbara beeton Feb 7 '17 at 16:59

Of course macro packages built on plain may define a cross reference mechanism. Barbara mentions manmac, as used for the TeXBook sources, also eplain defines a cross reference mechanism similar to LaTeX's \ref system, see section 4.9 of the eplain manual.