Installing .cls file in MikTex

  • Thread starter ArcanaNoir
  • Start date
  • Tags
    File
In summary: The first time I clicked on "add" it said it couldn't find the file. I clicked on "update formats" and it did the same thing. So I clicked on "install from local" and it downloaded and installed the {IEEEtrantools} package. Then when I tried to use it in my document it said it couldn't find the class.In summary, the person is trying to use a document class that they were provided with by their university, but is having trouble finding it. They then go onto the MikTex package manager and add a new class. When they try to use the class in a document, it says that it can't find the file. They then go onto the Package Manager and add
  • #1
ArcanaNoir
779
4
Okay I am at my wit's end here. I need some personal guidance, reading internet information has gotten me nowhere. Sorry if this is the wrong sub forum first of all.

*stay calm stay calm*

I am trying to work on my undergraduate thesis as a latex document. I am using MikTex because that is what my university provides. My university does not seem to provide a document class but other schools do, so I want to pick a random school to use, just to jump start the formatting. So I downloaded a thesis.cls file. First of all, I don't know where to put it. I currently have it in tex/latex/thesis. (If it matters I'm using MikTex portable). I pressed the refresh FNDB button. I also pressed the "update formats" button. But when I try to use the document class, it says it can't find thesis.cls.

I have tried reading every direction on the planet but I am not getting anywhere. I am not experienced with latex, or programming or much advance computer function at all. I really need some patient advice.
 
Technology news on Phys.org
  • #2
This isn't a good long term solution, but try putting the .cls file in the same directory as your other .tex files. If it still doesn't work, the problem isn't that MikTeX can't find it, it's something else.

I don't use MikTeX portable, so I don't know if there are any special issues installing packages with it. The "non-portable" version of MikTeX has a "package manager" that will automatically download and install any missing packages that it knows about, the first time you try to use them. Look to see if you have a Package Manager utility in the portable version. If you have it, the database of packages will probably contain 10 or 20 "thesis" formats already, so pick one of those rather than something you found "at random" on the web.

Otherwise, just forget about all this for now. and use with the standard package
\documentclass{book}
which "understands" all the basic document formatting structures like chapters, sections, figures, footnotes, tables of contents, etc. Don't spend a lot of time tweaking the detailed layout of your document until you have finished writing the content, or you will only have to tweak it again, and again, and again!

My university does not seem to provide a document class
This seems strange. Most universities have fairly strict rules about how theses should be formatted, and it doesn't make much sense for every PhD candidate to have to reinvent the formatting wheels for themselves. If the uni supplied you with MikTeX portable already installed on a USB drive or whatever, I would ask the people who supplied it what document format you are supposed to use.
 
  • #3
omg I just wrote long reply and accidentally closed it. >_<

So basically putting thesis.cls in the same place as my document did not help. I agreed to let miktex search for the document class online and download it. It did this and then was able to run my document but I do not know/think that this is the same document class that I was trying to install myself.
I went to the package manager and added the {psu-thesis} class. When I tried to use this in my document it could not find it. I had refreshed the FNDB too, that didn't help.

Weird thing is I did install a package before, {IEEEtrantools} and am successfully using that. At this point I think your suggestion that I don't bother with random document classes from the web and I stick to one of the included packages is a good idea. So how do I get the package added from the package manager?
 
  • #4
And thank you very much for your ideas and help by the way, alephzero.
 
  • #5
ArcanaNoir said:
I went to the package manager and added the {psu-thesis} class. When I tried to use this in my document it could not find it. I had refreshed the FNDB too, that didn't help.

Hm... I don't understand what you mean by "added the class" in the package manager. The package manager has a database of all the packages that it knows about (more than 2000 in the "non-portable" version). That is pretty much everything that has been put onto the "official" CTAN TeX archive, is compatible with MikTeX, and doesn't violate the software license restrictions.

If you got the auto-install to work for IEEEtrantools, it should work for other packages!

AFAIK if you want to install something that is not in the package database, you have to do it manually, i.e. by copying the various files to the correct places in the TeX directory structure - but that's going back to your original problem.
 
  • #6
Sorry for my vocabulary. I don't have a good handle on this.
I went to the miktex package manager and yes there were like 2167 thingys. I'll call them thingys. I chose the psuthesis thingy. I clicked on add this thingy.
So I went and found the manual that came with psuthesis and read the beginning commands, and did them like they said. So the beginning of my document looks like this:
Then miktex complained about a doublespace package so I read online that that was obsolete and I should use setspace. So I went back to the package manager and added setspace. Problem is I'm not sure how to give the command for "doublespacing" and the readme file didn't say. regardless, i put this in for my document beginning

\documentclass{report}
\usepackage{setspace}
\usepackage{psu-thesis}
\usepackage{amsmath}
\begin{document}

and miktex gave me back this error : ! LaTeX Error: Option clash for package setspace.

Don't really know where to go from here.
 
  • #7
OK, here's a TeX debugging demo (I've never used these packages before).

If you look in the .log file you will see some messages like
Code:
...
("C:\Program Files\MiKTeX 2.9\tex\latex\setspace\setspace.sty"
Package: setspace 2011/12/19 v6.7a set line spacing
)
("C:\Program Files\MiKTeX 2.9\tex\latex\psu-thesis\psu-thesis.sty"
Package: psu-thesis 2008/9/17 1.1 Contributed and Supported LaTeX2e package

Package: `psu-thesis' 1.1 <2008/9/17>

! LaTeX Error: Option clash for package setspace.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.146 
      
The package setspace has already been loaded with options:
  []
There has now been an attempt to load it with options
  [doublespacing]
...
When TeX starts to read a ile, the log file says "(filename", and when it stops reading the file it prints the matching ")" . So,
Code:
("C:\Program Files\MiKTeX 2.9\tex\latex\setspace\setspace.sty"
Package: setspace 2011/12/19 v6.7a set line spacing
)
says TeX processed setspace.sty without complaining about anything. But then psu-thesis.sty tried to read setspace.sty again, with a different incompatible option (and it's a reasonable guess that the "doublespace" option is something to do with double spacing).

So the fix is probably to delete the line "\usepackage{setspace}" and just let psu-thesis do whatever it wants to do.

Another take-home message: the documentation for packages is often out of date - e.g. the stuff about using "doublespace".

This works for me, and the output is double spaced.
Code:
\documentclass{report}
\usepackage{psu-thesis}
\usepackage{amsmath}
\begin{document}
This is a long paragraph.
This is a long paragraph.
This is a long paragraph.
This is a long paragraph.
This is a long paragraph.
This is a long paragraph.
This is a long paragraph.
This is a long paragraph.
This is a long paragraph.
This is a long paragraph.
\end{document}
 
Last edited:
  • #8
That's pretty awesome, I was able to run the stuff the way you presented and got the results you did. Then I put the commands into my thesis document and unfortunately the psu-thesis package did something to the margins so I was unable to set my margins properly. Before I put the psu-thesis command in my document set up looked like this:

\documentclass[12pt]{report}
\usepackage{amssymb,amsmath}
\usepackage[retainorgcmds]{IEEEtrantools}
\usepackage{setspace}
\doublespacing
\usepackage[margin=1in]{geometry}
\begin{document}

And I had 1-inch margins all around.

After I put the psu-thesis command in I have this:

\documentclass[12pt]{report}
\usepackage[margin=1in]{geometry}
\usepackage{psu-thesis}
\usepackage{amssymb,amsmath}
\usepackage[retainorgcmds]{IEEEtrantools}
\begin{document}

but the left margin is larger than 1 inch. Maybe that's okay, but that's not really the point. The point is if I DID want to change that margin, is it now more difficult? So if the psu-package is going to screw up the more well-known commands, should I really just give up on using a thesis package and just do the formatting myself with standard latex? I thought a thesis package would be a good quick start for formatting but if re-adjusting the formatting is going to be even harder than setting it all up in the first place I guess I should forget about it. Am I seeing the situation correctly?
 
  • #9
The basic point of something like the "thesis" package is that it gives you the format that is mandatory for submitting a thesis at the organization which wrote the package. In other words, you aren't meant to tweak it.

Don't ask WHY people make apparently pointless rules like specifying the width of the page margins, but they do. (There is probably somebody in the university adnin office whose offical job title is "thesis page margin measurement executive"...)

IMO the best time to worry about details of formatting is AFTER you have a few hundred pages of nearly-complete document to format. Then you know what the real constraints are (e.g. the "best" choice for page margins might depend on the size of some graphics you want to include, or whatever).

If you want to have control of every last formatting detail, I suggest you use the "memoir" document class. That has its own built-in versions of a lot of other packages (including "geometry") which tends to minimize compatibilty problems. Even better, it has a very good user guide, which includes a section specifically on formatting theses. The bad news is, the user guide is about 550 pages long, so you might end up learning a lot more than you ever wanted to know about document formatting...
 
  • #10
Thanks for the info! Memoir sounds like a good plan. I don't mind a super long user guide, in fact it is almost necessary as I have (zero+what pf does for math equations+what I learned this week=knowledge about latex documents). As for poking through documents for relevant information, that I am quite good at.

Some rules like page margins have to do with the way the thesis is bound. That's why there are odd page and even page margin parameters sometimes. But other rules do seem arbitrary...

I hear you on formatting after I finish writing, this is exactly why I chose latex, but I did want to get some basic elements in place like margins and font size and double space so I could have an idea of length, it would be big enough for my professor to read the script, and the double spacing is nice for writing in notes and corrections. So when I first started this journey, I thought a thesis package would save me from having to learn how to change these parameters. I did not know it would be easier to learn how to change these parameters than to figure out the thesis package situation >_<

Another reason why I started thinking about formatting already is that my thesis is due in about a month. (it's only undergrad, hence the lack of support from the school... It only has to be as nice as I want it to be, and I want it to be as close to a real grad thesis as possible, but I have to do everything without the benefit of thesis workshops and detailed instructions. Yeah it's over acheiving, but so is writing a thesis as an undergrad...)

You have been so helpful. I am so extremely grateful! Thank you so much! One last question though, practically everything I read about installing packages manually and such kept referring to the directory texmf. I do not have this directory, but I did have the subfolder that would be listed after texmf, like texmf/tex/latex, for example (just recalling from memory, that may not be exact). So is texmf just whatever file you installed your tex program into? Like...maybe it stands for something like "tex main file"? Don't laugh if that's silly...
 
  • #11
The "mf" probably stands for "MetaFont", which was the program that Knuth wrote to create the original fonts used be TeX. MetaFont is rarely used now, because it creates fonts in a format that doesn't work well with PDF output files. TeX and MetaFont were written before PDFs had been invented.

In the same place (e.g. the Windows start menu) that gets you to the Package Manager, do you have something like Help - Manual? That contains a description of the MikTeX directory structure, which might not be exactly the same as the TeX version used by the person who wrote the package documentation.

Another reason why I started thinking about formatting already is that my thesis is due in about a month. (it's only undergrad,
Fair enough - I assumed by "thesis" you meant "PhD Thesis!"
 
  • #12
AlephZero said:
Fair enough - I assumed by "thesis" you meant "PhD Thesis!"

some day...

Thanks again for your help!
 

1. How do I install a .cls file in MikTex?

To install a .cls file in MikTex, you can follow these steps:

  1. Open MikTex and go to the "Options" menu.
  2. Select "Install Packages" from the menu.
  3. In the search bar, type the name of the .cls file you want to install.
  4. Click on the package name and then click "Install".
  5. Wait for the installation to complete, and then click "Close".

2. Where can I find .cls files to install in MikTex?

.cls files can be found on various websites, such as CTAN (Comprehensive TeX Archive Network) or on the website of the package author. You can also search for .cls files directly through MikTex's "Package Manager".

3. How do I update an installed .cls file in MikTex?

To update an installed .cls file in MikTex, you can follow these steps:

  1. Open MikTex and go to the "Options" menu.
  2. Select "Package Manager" from the menu.
  3. In the list of installed packages, find the .cls file you want to update.
  4. Select the package and click "Update".
  5. Wait for the update to complete, and then click "Close".

4. Can I install multiple .cls files at once in MikTex?

Yes, you can install multiple .cls files at once in MikTex. To do so, follow these steps:

  1. Open MikTex and go to the "Options" menu.
  2. Select "Install Packages" from the menu.
  3. In the search bar, type the names of the .cls files you want to install, separated by a comma.
  4. Click on the packages you want to install, and then click "Install".
  5. Wait for the installation to complete, and then click "Close".

5. What do I do if I encounter an error while installing a .cls file in MikTex?

If you encounter an error while installing a .cls file in MikTex, you can try the following solutions:

  1. Make sure you have a stable internet connection.
  2. Close and reopen MikTex and try installing the .cls file again.
  3. If the error persists, try updating MikTex to the latest version and then try installing the .cls file again.
  4. If none of these solutions work, you can search for the error message online or seek help from the MikTex community forums.

Similar threads

  • Programming and Computer Science
Replies
2
Views
387
  • Programming and Computer Science
Replies
21
Views
559
  • Programming and Computer Science
Replies
6
Views
982
  • Programming and Computer Science
3
Replies
81
Views
5K
  • Programming and Computer Science
Replies
4
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
4K
  • Programming and Computer Science
Replies
3
Views
4K
  • Programming and Computer Science
Replies
6
Views
8K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
Back
Top