10

I want to install the class found at this git repository: LaTeX homework

I see some questions asked in the past on installing packages in LaTeX but this sounds like a different kind of file than a .cls file. My impression is that packages come in either a .ins or a .dtx file which I would assume you don't use the same way as a .cls file.

I believe I'm using TeXlive, and although I often compile through Sublime Text 2 I also have TeXWorks which can often be simpler to install packages I don't already have. A couple months ago I installed the latest version of TeXlive, though in my local directories (C:/users/Me/...) I have no folder for texlive2015. I have a folder, /.texlive2013 and another one, /TeXWorks. In my shared directories (C:/texlive/...) I do have a folder, 2015. My operating system is Windows 10.

In trying to figure this out on my own I've seen reference to a "texmf" structure, and I've tried googling and learning about it but I'm still not getting a very clear picture of it since my directories don't seem to make a lot of what I see in those pages. What I do have are things like C:/texlive/2015/texmf-dist/ and C:/users/Me/.texlive2013/texmf-config.

So anyway, back to my question, can anyone tell me how I go about installing the class file?

[Update: Due to a recommendation in the comments I followed another question and made the directory C:/Users/Me/texlive/texmf/tex/latex/commonstuff/ and put the .cls file in there. Then I made the minimal example .tex file as follows

\documentclass{homework}
\begin{document}
Text
\end{document}

and in Sublime Text 2 it gave me the error 4: LaTeX Error: Missing \begin{document}. [<]. In TeXWorks it gave basically the same error.]

4
  • 8
    You should follow the instructions listed in Where do I place my own .sty or .cls files, to make them available to all my .tex files?
    – Werner
    Commented Sep 9, 2015 at 19:22
  • @Werner That was helpful to some extent, I think, since I created the director C:/users/Me/texmf/tex/latex/commonstuff and put the file in there. I tried compiling and it nearly worked except that I got the error 4: LaTeX Error: Missing \begin{document}. [<] even though I have the begin and end document lines. When I try to run the same thing in TeXWorks it says basically the same thing.
    – Addem
    Commented Sep 9, 2015 at 19:56
  • I don't get any error changing it to article so maybe it's the latter.
    – Addem
    Commented Sep 9, 2015 at 20:10
  • The path should be <Your home folder>/texmf/tex/latex/local/. This is known as your local texmf tree, which is distinct from any other folders with texmf in their names. LaTeX should find any file you put in your local tree. You can debug this most easily if you run pdflatex in the terminal (not in an editor) and then read the .log file. Commented Sep 9, 2015 at 20:24

1 Answer 1

9

(This should be a comment, but I don't have enough reputation to leave one.)

I am the author of that class, and your minimal example doesn't work because you haven't used the necessary \name, \course, \term, and \hwnum commands in the preamble of your document, as described in the documentation. The homework class depends on those to automatically typeset the title and headers.

Have you checked if example.tex works on your machine?

Edit. Here is a truly minimal document using homework.cls:

\documentclass{homework}

\name{Artem Mavrin}
\term{Fall 2015}
\course{\TeX\ 101}
\hwnum{1}

\begin{document}

\end{document}
7
  • So I just checked if the example.tex file would compile and I still get the same error.
    – Addem
    Commented Sep 10, 2015 at 16:00
  • @Addem What does your error say? Do you have the latest version of the class? I updated the homework class to give more specific errors if the four necessary commands aren't used. Maybe you can try again and see if you still get those errors. Also, I added a template file template.tex that you can try to use to get started. Everything works for me on my machine, so I'm curious to know why it doesn't work for you. Commented Sep 11, 2015 at 12:06
  • I downloaded the class just now to make sure it's the latest version, and I get the same error. It's Errors: c:/Users/Adam/texmf/tex/homework/local/homework.cls:4: LaTeX Error: Missing \begin{document}. [<]
    – Addem
    Commented Sep 11, 2015 at 22:25
  • That's using Sublime Text 2; if I use TeXWorks I get basically the same thing. ! LaTeX Error: Missing \begin{document}.
    – Addem
    Commented Sep 11, 2015 at 22:27
  • The directories in which I've saved the class file, trying to put it everywhere anyone has told me to make a texmf structure, are: C:\texmf\tex\latex\local and C:\Users\Adam\texmf\tex\latex\homework\local and probably somewhere else too. But I just tried moving it to just C:\Users\Adam\texmf\tex\latex\homework and now I get no errors when I compile. However, the resulting PDF is just random symbols and text.
    – Addem
    Commented Sep 11, 2015 at 22:32

Not the answer you're looking for? Browse other questions tagged .