{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

94
votes
3answers
11k 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 ...
78
votes
6answers
20k 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?
47
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 ...
55
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 ...
43
votes
5answers
8k 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 ...
28
votes
1answer
641 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 ...
13
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
10k 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
359 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 ...
23
votes
5answers
6k 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 ...
13
votes
3answers
1k 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
496 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
277 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
571 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
877 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 ...
21
votes
1answer
799 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
731 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
464 views

Create environment within my own latex class?

How can I automate multiple choice question type in my own class in LaTeX?
14
votes
1answer
1k 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. ...
3
votes
2answers
681 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
1k 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
510 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} ...
15
votes
3answers
762 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 ...
7
votes
1answer
613 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 ...
13
votes
3answers
915 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
183 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 ...
8
votes
1answer
165 views

Beginner needing help to create simple documentclass for traditional printed Tibetan manuscripts (Pecha)

I am delighted to see how well XeLaTeX can handle Tibetan script and want to use it for the typesetting engine for my software. The first thing I want to do is to create a simple documentclass, ...
14
votes
3answers
379 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 ...
10
votes
2answers
154 views

article wrapper class that locks down some options, passes others through

I'm writing a wrapper document class that starts with article and adds a bunch of customizations (required for a particular journal style). One of the requirements is to lock down certain options: ...
7
votes
2answers
255 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
314 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
135 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
384 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 ...
6
votes
2answers
530 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 ...
5
votes
2answers
381 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 ...
4
votes
2answers
148 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
141 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
36 views

Is it possible to collect hyperref's \hypersetup argument?

Suppose you want to set, in a .sty or .cls file, some hyperref's options in case the end user loads this package. Because that's only at the begin of the document you know if hyperref has been loaded, ...
2
votes
0answers
25 views

Migrating from xkeyval to kvoptions: how to retrieve \define@choicekey?

I'm in the process of migrating a class I wrote from xkeyval to kvoptions, mainly because I'd like to provide class options whose values could be list of comma separated values: ...
2
votes
1answer
1k views

friggeri CV biblatex problem? [closed]

I am trying to compile the cv template given here I am using ubuntu 13.04, TeXStudio 2.5.2 and TeXLive 2012. I set up texstudio to use biber to compile the biblatex entries and also modified the code ...
2
votes
1answer
409 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 ...