Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Installing .cls file in MikTex

  1. Jun 30, 2012 #1
    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.
     
  2. jcsd
  3. Jul 1, 2012 #2

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    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 untill you have finished writing the content, or you will only have to tweak it again, and again, and again!

    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.
     
  4. Jul 1, 2012 #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?
     
  5. Jul 1, 2012 #4
    And thank you very much for your ideas and help by the way, alephzero.
     
  6. Jul 1, 2012 #5

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    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.
     
  7. Jul 1, 2012 #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 begining 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.
     
  8. Jul 2, 2012 #7

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    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 (Text):

    ...
    ("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 (Text):

    ("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 (Text):

    \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: Jul 2, 2012
  9. Jul 3, 2012 #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?
     
  10. Jul 3, 2012 #9

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    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...
     
  11. Jul 3, 2012 #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.....
     
  12. Jul 3, 2012 #11

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    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.

    Fair enough - I assumed by "thesis" you meant "PhD Thesis!"
     
  13. Jul 3, 2012 #12
    some day.....

    Thanks again for your help!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Installing .cls file in MikTex
  1. MiKTeX Help Please. (Replies: 4)

  2. Install Ubuntu (Replies: 2)

  3. Python installation (Replies: 10)

Loading...