Detect LaTeX class name
Posted
by Matthew Leingang
on Stack Overflow
See other posts from Stack Overflow
or by Matthew Leingang
Published on 2010-03-26T15:52:39Z
Indexed on
2010/04/17
11:13 UTC
Read the original article
Hit count: 275
latex
|introspection
I'm working on a LaTeX package which might need to do some things differently depending on the class that's being used. I'm wondering if there's a way to auto-detect or test the document class.
One could certainly look up the class files and test for the existence of a specific macro defined by that class, but is there a smarter way? I looked at the definition of the \ProvidesClass
macro and can't see if it saves the class name anywhere except \@currname
. I believe \@currname
is just the name of the current package or class being read.
Basically I want to execute
\author{\longauthorname}
in the article
class but
\author[\shortauthorname]{\longauthorname}
in the beamer
class.
© Stack Overflow or respective owner