Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I created a new class file to use.

I have put the .cls file in the same directory as the original cls files (report, book etc) and im 100% sure the names match.

The directory for me is:

C:\Program Files\MiKTeX 2.8\tex\latex\base

But still, when compiling it says:

! LaTeX Error: File `myclass.cls' not found.

What am i doing wrong here? (sorry for being such a noob)

In my texteditor i use:

\documentclass[12pt,%
               %draft,%
               a4paper]{myclass}
share|improve this question
add comment

3 Answers

up vote 7 down vote accepted

This is a duplicate of the following questions:

The basic answer is you should never put your own packages/classes in the main diretories of your TeX distribution; you should always put them into a local directory. Consult the accepted answers to these questions for more details of how to do this.

share|improve this answer
add comment

Every own created packages and classes should go into a local tree, which is supported by all TeX distributions. For MiKTeX read the MiKTeX documentation, section "Walkthrough: Registering a User-Managed TEXMF Directory". It shows how a local tree can be created, if not already present.

and here

share|improve this answer
    
In Miktex, we can easily register our own packages/classes that are saved in any sub directory of tex\latex (no matter where we put the tex\latex directory) to the LaTeX system as explained in your link above. How to do the same thing in TeX Live? –  xport Jun 7 '11 at 8:13
add comment
  • I recommend to put your class file into a dedicated directory.

  • After copying the class into your texmf directory structure, refresh TeX's file name database. In MiKTeX, open MiKTeX Options/ Settings and click the button "Refresh FNDB", or run mktexlsr (or texhash in some distributions) at the command prompt.

share|improve this answer
    
I put it in the directory with the other classes. What u mean with a dedicated directory? I did refresh the database but didnt help. –  Toroo Feb 7 '11 at 18:57
    
@Toroo: I mean: don't mix your own files with distribution files. What if you update to MiKTeX 2.9 but your class remains in C:\Program Files\MiKTeX 2.8\tex\latex\base? –  Stefan Kottwitz Feb 7 '11 at 19:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.