{documentclass-writing} is about writing document classes. If your question is about choosing, installing, or using document classes, choose {documentclass} instead.

learn more… | top users | synonyms

79
votes
2answers
9k views

Where do I start LaTeX programming?

I'm interested in writing packages for TeX/LaTeX/XeLaTeX. I googled around, but all I found was guides or tutorials about how to prepare documents using LaTeX. I want to know how LaTeX works and how ...
68
votes
6answers
17k views

Style/class tutorials

What are some good tutorials on writing custom styles (classes) that clearly explain commands used and some of the features that TeX has to offer in the way of styles?
44
votes
4answers
5k views

Reference guide to begin writing a class and/or a package

Once a LaTeX user gets more and more skilled, and writes his/her own code, the question "Should I make a package (or a class) out of it?" will probably arise. My question is (you catch me: I'm one of ...
53
votes
4answers
1k views

What is good practice when preparing a package for CTAN?

I'm thinking of submitting a package to CTAN, and would like some hints which will help keep the path as smooth as possible for me, the CTAN administators, and the final users. Please tell me what I ...
42
votes
5answers
7k views

A cookbook in LaTeX?

I am interested in making a cookbook in LaTeX. Each page will contain a recipe, including ingredients, instructions, and a photo of the finished food. Has this been done previously? Where do I ...
25
votes
1answer
576 views

Macro naming best practice?

Is there a preferred or generally accepted idiom for naming user defined macros? I notice that in the change from Tufte 3.5.0 to 3.5.2, for example, the names of the debugging macros have change, for ...
12
votes
3answers
2k views

Possibility to pass options to packages

I am searching for a possibility to give additional options to another package. I have tried it with \PassOptionsToPackage. My idea was that I can use something like ...
5
votes
2answers
8k views

how to create a template or document class for latex?

I need to write a document class or template, as for an article, letter, etc. Is there software for this? How do I set it up so that anyone can use my class just like \documentclass{article}?
4
votes
1answer
308 views

Trying to create simple template for novice users

I am trying to create a simple template for students to create a one page abstract. The idea is that they just define their title, author, and abstract, and another file could actually have the main ...
13
votes
3answers
965 views

Macro for Declaring Variables in Class Files

I'm designing a new LaTeX class, and trying to write a convenient helper command for declaring new 'variables' for use in the class. Specifically, say I want to use a variable called \foo. I'd like ...
21
votes
1answer
465 views

When to use “.sty” extension and when to use “.def”

I'm new to this forum and a recent LaTeX user. I state that, before posting here, I searched all the web through, but I was not succeeded to solve a doubt. I'm writing my own class (myclass.cls), ...
19
votes
1answer
271 views

When should I upload my new style?

I've been working lately in a new style for my university, which is heavily influenced by a pre-existing style (feupteses). However, feupteses was never meant for PhD dissertations, so I decided to ...
14
votes
2answers
526 views

Defining a wrapper class for a set of document classes

Until now, I have been collecting my "frequently used packages", custom macros, and configurations in a personal style file. However, some of those configurations depend on the use of one of the ...
8
votes
1answer
839 views

New options and loaded class options bug?

I found some odd behavior that I can't seem to get around. I'm writing a new version of a class file I did a while ago that is based on the memoir class. Now, the memoir class has two mutually ...
18
votes
5answers
5k views

How to write a LaTeX class file for my thesis

I want to design a new LaTeX for my college thesis, so that all students could use it. I have decent understanding of how LaTeX works. I am looking for some nice article explaining how to write a ...
21
votes
1answer
722 views

How do I document my style files?

I have many style files (and one or two class files) that I've written in my local texmf tree. Most were simple things that got me out of some trouble and which I put in to a style file in case I ...
8
votes
3answers
612 views

How to write a class that accepts an optional key-value pair?

a user-defined class: \ProvidesClass{preview}[2012/12/15 v 0.01 class for creating a tight PSTricks diagram] \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} \ProcessOptions\relax ...
6
votes
1answer
439 views

Create environment within my own latex class?

How can I automate multiple choice question type in my own class in LaTeX?
3
votes
2answers
353 views

How to adjust the size and placement of chapter heading in report class

How could I adjust the size and placement of chapter heading in my custom class? I am using report class as my base. When I used titlesec package inside my custom class, it threw error ! Package ...
18
votes
3answers
985 views

Customizing LaTeX - create a document class or a package?

Are there general rules for when to create a document class vs. creating a package to customize LaTeX? Does one have benefits over the other? My specific need is to create a customized page layout, ...
8
votes
2answers
439 views

Loading package twice with \RequirePackage causes “option clash”

I thought that loading a package twice with the same options cannot lead to option clash, still I get a clash in the following simple example: \documentclass{article} ...
7
votes
1answer
595 views

What is the minimal codes to create my own `\documentclass` derived from LaTeX's `book`?

I want to invoke my document class as follows: \documentclass[cymk,dvips,dvipsnames]{mybook} Internally mybook.cls includes my own packages such as mytables.sty, mypstricks.sty, etc. What is the ...
14
votes
3answers
641 views

what TeX package(s) should I use for a Church Bulletin

I create Sunday Bulletins (aka service leaflets) for an Episcopal Church each week. Currently, I use the MS Publisher (PITA) I also do some web design using Ruby. While a physics undergrad, I ...
14
votes
1answer
683 views

Creating new class file: Where to start?

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. ...
13
votes
3answers
886 views

How can I word-wrap LaTeX warning/error output?

This question led to a new package: hardwrap In writing error messages and warnings for a package/class, I find it a pain to manually insert \MessageBreaks so that words don't get cruelly ...
11
votes
2answers
156 views

What is the best practice for arithmetic operations specially for package/class writing?

There are some possibilities to execute arithmetic operations inside a package or class. TeX TeX supports \advance, \multiply or \divide to execute arithmetic operations. However the syntax is more ...
14
votes
3answers
373 views

Advantages of a custom class over a package and environment

What are the advantages/disadvantages of defining a class over a package and environment? I have recently started to clean up some of the cruft in the preamble of my letters. The simplest solution ...
7
votes
2answers
184 views

New class base on book class with options

I created a class of my own that uses book as base class. \NeedsTeXFormat{LaTeX2e} \ProvidesClass{manuscript}[2013/03/23 Creative writing manuscripts class] \LoadClass[a4paper,12pt,oneside]{book} ...
6
votes
1answer
276 views

Mark key-value class options as used

I have written a wrapper for the scrartcl class in the following way: \NeedsTeXFormat{LaTeX2e} \ProvidesClass{mycls}[2012/08/23] \RequirePackage{kvoptions} \DeclareStringOption{title} ...
6
votes
3answers
130 views

Class/package for German documentation

I’m writing the musuos class and I’m writing the documentation with ltxdoc.cls and doc.sty which seems to work. But the documentation is in German so it’s not very nice to get (environment) in the ...
6
votes
3answers
355 views

What is the difference between \myname and \my@name while writing a .cls file?

What is the difference between \myname and \my@name while writing a .cls file? Are they equivalent? Please let me know if it is necessary to post a minimal example. Edit: Let me ask my question more ...
5
votes
2answers
325 views

Indent all the normal text

I decided to write my first own latex class that has to reproduce template used for some intenal type of documents made in word. I cannot find how to do one thing. In the template, all standard text ...
5
votes
2answers
483 views

KOMA classes and \LoadClass

I want to create a document class based on a KOMA-Script class. If myclass.cls contains the following \ProvidesClass{myclass}[2011/08/31] \LoadClass[paper=a5]{scrartcl} then compiling a document ...
4
votes
2answers
114 views

What type of .sty or document class will be good for thesis? [closed]

I am writing my thesis but i want to write it with Latex as my University do not have a document class or .sty as i used to see other university. Could any one know the the .sty that has the under ...
4
votes
1answer
135 views

Class Design: Environment vs. Macro

I have seen What are the consideration when choosing either newcommand or newenvironment? but I think this is a little more specific. If it's a duplicate, then so be it. If the second part of the ...
2
votes
1answer
355 views

Modify footer of first page in custom class

I know I can do \maketitle \thispagestyle{fancy} But I want my custom class that I am making (based on article) to do this for me. It already does pagestyle{fancy}, but I can't get it to change the ...