Discussion:
modifying a .cls file
(too old to reply)
Phillip Helbig (undress to reply)
2020-05-05 07:00:04 UTC
Permalink
I made some changes to article.cls, all of which work fine. I also have
some commands in the preamble which I would like to be in the modified
.cls file. I just stuck them at the bottom, but that doesn't seem to
work. Here they are:

\usepackage{footnpag}

\usepackage{indentfirst}

\usepackage[compress]{natbib}
\setcitestyle{super,open={},close={},comma}
\makeatletter \renewcommand \@biblabel[1]{(#1)} \makeatother

\renewcommand*{\thefootnote}{\fnsymbol{footnote}}

\setcounter{secnumdepth}{0}

\pagestyle{myheadings}

If I try to put them in the .cls, I get a really bizarre message
referring to one of my own macros which I load later with \input.

I must be missing something obvious.
Peter Flynn
2020-05-05 09:44:00 UTC
Permalink
Post by Phillip Helbig (undress to reply)
I made some changes to article.cls, all of which work fine. I also have
some commands in the preamble which I would like to be in the modified
.cls file. I just stuck them at the bottom, but that doesn't seem to
work.
A class file has to follow a very specific structure, explained in
clsguide.pdf which should be in the latex/base subdirectory of your
installation. There's a good summary at
http://joshua.smcvt.edu/latex2e/Class-and-package-structure.html
Post by Phillip Helbig (undress to reply)
\usepackage{footnpag}
\usepackage{indentfirst}
\usepackage[compress]{natbib}
\setcitestyle{super,open={},close={},comma}
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}
\setcounter{secnumdepth}{0}
\pagestyle{myheadings}
If I try to put them in the .cls, I get a really bizarre message
referring to one of my own macros which I load later with \input.
I must be missing something obvious.
RTFM, I'm afraid.

Peter
Ulrike Fischer
2020-05-05 12:49:30 UTC
Permalink
Am Tue, 5 May 2020 07:00:04 +0000 (UTC) schrieb
using \makeatletter in a cls is unnecessary.
using \makeatother in a cls a very bad idea.
--
Ulrike Fischer
http://www.troubleshooting-tex.de/
Phillip Helbig (undress to reply)
2020-05-05 13:15:21 UTC
Permalink
Post by Ulrike Fischer
Am Tue, 5 May 2020 07:00:04 +0000 (UTC) schrieb
using \makeatletter in a cls is unnecessary.
using \makeatother in a cls a very bad idea.
That was a cut-and-paste example from the preamble which, at some point,
I want to move into a class file, but I need to learn how to do that
first. Of course, \makeatletter isn't needed in the class file.

Loading...