[texhax] need name of variable containing value of documentclass

Heiko Oberdiek heiko.oberdiek at googlemail.com
Tue Oct 4 16:33:48 CEST 2011


On Tue, Oct 04, 2011 at 11:27:42AM +0000, Fehd, Ronald J. (CDC/OCOO/ITSO) wrote:

> I was surprised by the answer that the value of documentclass is not in
> some variable somewhere.

A document class can load another document class that can load another
documentclass that can load another document class that can load ...
Therefore the documentclass is not one class name but a list
of class names.

There is a package `classlist' that records the main (first) class
and the class list. The package needs to be loaded before \documentclass:

\RequirePackage{classlist}
\documentclass{foobar}% that loads article, for instance

Then \MainClass contains "foobar" and \ClassList contains
  \ClassListEntry{foobar}{}{}%
  \ClassListEntry{article}{}{}%

Yours sincerely
  Heiko Oberdiek


More information about the texhax mailing list