Tell me more ×
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.

Recently, a journal I have some editorial involvement with has decided that for its 'rapid publication' outlet, it will no longer accept submissions where LaTeX has been used to format the document. They now demand everything be submitted as a (sigh) Word document.

After much whining, bitching and moaning from me (and some others), they've relented -- partially. They'll take LaTeX submissions if we can build a strong stylesheet - one wherein the generated PDF looks "pretty damned close to exactly like the published form" (their words).

The actual (published) format they want isn't particular complex. Fore example, see

http://www.esajournals.org/doi/pdf/10.1890/ES12-00286.1

Now, I'm 'good enough' with laTeX to be able to use this package, and that, a few tweaks here and there, to cobble together something pretty damned close. But, that approach isn't particularly portable. What they want (and I would agree) is a .cls file (and a .bst for the bib) which a user could apply to their document, and presto chango, out comes the paper.

I've never tried writing a .cls file. Those that I've accumulated over the years (e.g., Springer etc), I can follow pretty well, but I'm not quite sure where to start.

Suggestions? Of course, if any of your smart folks who can do this in your sleep wanna take 15 minutes and put it together, ( (and oh, say, 500 or so folks who use LaTeX for this journal) would be forever indebted - virtual beers on us for life. Real ones if we ever crossed corporeal paths.

share|improve this question
8  
A suggestion: Change your username to something more telling than "user123456789". –  Speravir Mar 7 at 2:20
2  
For anyone that wants to give a try the TUGboat class comes very close to the sample. –  Yiannis Lazarides Mar 7 at 3:15
3  
The fonts and the bibliography style (or closest approximation) might be useful to mention. Perhaps also a formal description of the article elements (astract, keywords, etc.), the highest possible number of sectional divisions, and so forth might be useful. It is hard to develop a prescriptive class style based on inductive reasoning from one journal article. Is there no formal style sheet? –  jon Mar 7 at 3:28
1  
@user67322 : Please see my prior comment. I intended it for you, but sent it to Speravir. In essence, I recommend starting with a class closest to your final goal, and modifying it from there. –  Steven B. Segletes Mar 7 at 20:34
2  
@DominikusK. yes it is true: \def let's you overwrite anything at least as long as we're talking about TeX macros. You of course may to have a look at the package/class source in order not to break anything... the best a package/class author can do is encourage a certain use. –  cgnieder Mar 8 at 14:30
show 13 more comments

1 Answer

I recently had to write a new class without very much LaTeX experience at all. I found LaTeX2e for class and package writers (http://www.ctan.org/pkg/clsguide) a great way to get started. It includes several examples.

It sounds like you already know what you're doing, so apologies if this is obvious, but a good way to start is to load a standard LaTeX class like article and then some extra packages on top of it, with something like:

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{yourclass}[yyyy/mm/dd Your class description]

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions \relax

\LoadClass[a4paper,twoside]{article}

\RequirePackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}

This is just an example, but that worked for me, and I found that I could get fairly far by just adding packages. The class guide has better examples.

share|improve this answer
 
Welcome to TeX.sx! –  texenthusiast Apr 25 at 15:33
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.
http://tex.stackexchange.com/questions/101250/creating-new-class-file-where-to-start/110705
tex.stackexchange.com
crawl=CC-MAIN-2013-48
56609
application/http; msgtype=response
sha1:XLHPHOUJ4YZVQHWQNNEHL635OMJAYJMG
<urn:uuid:a0184f5a-a799-4e5f-88f8-14d09f541fa1>
2013-12-08T18:21:59Z
198.252.206.16
sha1:4EKPDB3UQ2XLRE5JCB6U6RMXPYLJEXQK
<urn:uuid:b6ef4e4d-83a8-4fb8-a65b-04ba53e6e5e9>
http://tex.stackexchange.com/questions/101250/creating-new-class-file-where-to-start/110705
response
<urn:uuid:c6a44acc-cb7d-40c2-a637-79e0f3375e60>
robots: classic
hostname: ip-10-33-133-15.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2013-48
operator: CommonCrawl Admin
description: Wide crawl of the web with URLs provided by Blekko for Winter 2013
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf