3

I'm trying to develop a set of custom classes. They are all very similar, but each do slightly different things (a custom letter, article and report for example. Since they share things in common, I thought that to cut down on repeated code, I could have a 'base' class, which would define everything they have in common, and then I would have the specific classes, with their individual code.

That base class is called frigaard-base.cls, and then I have a class for essays, called frigaard-essay.cls. The structure is that frigaard-base loads the default article and then frigaard-essay loads frigaard-base. However in a document when I load frigaard-essay.cls, I get the following error:

File `frigaard-base.cls' not found. \LoadClass{frigaard-base}

Normally though, it should be found since frigaard-base and frigaard-essay are in the same folder, and here is their declarations:

\NeedsTeXFormat{LaTeX2e}[2011/06/27]
\ProvidesClass{frigaard-base}[2013/07/24]
\LoadClass[a4paper, 12pt]{article}

\NeedsTeXFormat{LaTeX2e}[2011/06/27]
\ProvidesClass{frigaard-essay}[2013/07/24]
\LoadClass{frigaard-base}[2013/07/24]

What is happening here? Should I not be using \LoadClass twice within the same hierarchy and change frigaard-base into some other file type, such as a .def (if this is the case, please explain how).

More Info

It has been worked out that when frigaard-base.cls, frigaard-essay.cls, and a test document are in the same folder, then it works fine, but when say the test document is in a folder, frigaard-essay.cls is in a subfolder, and frigaard-base.cls is in a subfolder of that, it gives the same error.

dcaf
  • 103
  • 6
  • Welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. ps. You can separate two consecutive code blocks with an HTML comment <!--> like I did in my edit … – Tobi Jul 25 '13 at 10:07
  • This scenario works fine for me with both frigaard-<name>.cls files in the same folder as my test file. – cgnieder Jul 25 '13 at 10:29
  • @cgnieder Just checked, and it does for me too. However it does not work when the two classes are in a seperate file. Is that the same for you? – dcaf Jul 25 '13 at 10:46
  • 2
    Do you mean separate folder? That would need to be a folder that TeX can find (supposedly somewhere in your local TeX tree) and you'd need to make the files known to TeX by running texhash or mktexlsr (assuming TeX Live here, I know nothing about MiKTeX) – cgnieder Jul 25 '13 at 10:53
  • @cgnieder Yeah sorry, I meant folder. My current folder structure looks a like this X:\latex\classes for where frigaard-base and frigaard-essay, and x:\latex\documents for where my test file is. I'm using MiKTeX, but this structure has previously worked in the past, which is why I put the problem down to using \LoadClass to load a class (which has already loaded article into another class. – dcaf Jul 25 '13 at 22:34
  • Have you seen the question How can I manually install a package on MiKTeX? It's the same for classes. – cgnieder Jul 26 '13 at 08:44

0 Answers0