[texhax] need name of variable containing value of documentclass

Fehd, Ronald J. (CDC/OCOO/ITSO) rjf2 at cdc.gov
Tue Oct 4 13:27:42 CEST 2011

> From: Fehd, Ronald J. (CDC/OCOO/ITSO)
> Sent: Friday, September 30, 2011 4:36 PM
> To: texhax at tug.org
> Subject: need name of variable containing value of documentclass
> Greetings:
> I am using a file in two different documents:
> the first is a stand-alone doc which is a documentclass=article
> and, after editing, proofreading, and reviewing,
> I will input that file in a larger doc with documentclass=book.
> Q: which macro variable contains the value of documentclass?
> I would like to add the chapter command to the beginning of the file
> when the doc is being input in the documentclass=book
> i.e.:
> if documentclass=book {chapter[\docTitleShort]{\docTitle}}
> thanks
> Ron Fehd  {SAS} macro maven

thank you Heiko Oberdiek for your reply.

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

My solution was relatively easy.
I am developing my suite using a Single-Sourcing model

Single sourcing: building modular documentation [Book] by Kurt Ament i

so I have only two files with documentclass.

in each I added a new variable:

- - - doc-class-article.tex - - -

- - - doc-class-book.tex - - -

added \usepackage{ifthen}

after testing this
at the beginning of the chapters


and adding this to each part:


I saw that I could make a macro:


which didn't work: \#1 does not expand correctly

final version:


Ron Fehd  {SAS} macro maven

More information about the texhax mailing list