I am trying to use the res class in a context where it may not be possible to direct LaTeX to the the res.cls file location in the usual way. (For more non-essential details, see my question on StackOverflow.)

The res class appears to be based on the article class:


So my question is, are there any obstacles to me simply using the article class in my .tex file, and copying the content of res.cls to the .tex file, so that only one file is required for pdflatex to generate a pdf?

I'm imagining something similar (in principle) to putting the CSS for a HTML page inside <style> ... </style> tags in the <head> rather than in a separate document. Of course, it wouldn't be a direct copy & paste (I've tried that); I presume there would be some modifications necessary. But is it theoretically possible?

Thanks in advance for you help.

  • 1
    all except the options can just be copied to the preamble, the option handling you would have to adjust, but that class doesn't have much, but why can't you arrange your service to cd to the document directory and then run pdflatex on the file as normal? – David Carlisle Mar 15 '17 at 23:14
  • 1
    I guess the first thing that causes trouble is the \ProvidesClass declaration, you should omit it too. – GuM Mar 15 '17 at 23:20
  • 1
    The option handling is easy too adjust, just set the relevant switches manually. Of course, you already know that you need to bracket the class code between \makeatletter and \makeatother, don’t you? :-) Please consider answering your own question, if you succeed, giving a concise description of what you did. You can accept your own answer, too (as you perhaps already know). – GuM Mar 15 '17 at 23:33
  • 1
    You can change e.g. TEXMFHOME at runtime e.g. TEXMFHOME=/d pdflatex <filename>.tex if you had /d/tex/latex/res/res.cls, for example. – cfr Mar 16 '17 at 2:40
  • 1
    You can add the code of the class within a filecontents environment before \documentclass to write the class file into the working directory. TeX should find it there. – Schweinebacke Mar 21 '17 at 8:22

Yes, it is possible. My final combined .tex file looked like:



\typeout{Document Style `res' <26 Sep 89>.}






\newtoks\tabular@text       % holds the current list being processed
\newtoks\tabular@head       % holds the head tabular list
\newtoks\tabular@tail       % holds the tail tabular list
\newtoks\@ta          % used by \@append




Thanks to all the help in the comments.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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