{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

4
votes
1answer
3k views

How to customize a document class?

In LaTeX, we modify a predefined documentclass to fit our need. I wonder how we can edit the original documentclass (e.g. article) to have our customized properties? I mean which file is responsible ...
21
votes
1answer
467 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), ...
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 ...
0
votes
1answer
494 views

DocumentClass Writing [duplicate]

Possible Duplicate: Style/class tutorials I am a newbie at LaTeX. But I need start from my own text style in LaTeX. I want to setup page format, margins, paragraphs style, fonts, etc. Can ...
1
vote
2answers
699 views

custom header text and headrule

Using mweclass LaTeX class (report based) is writing a document as follows: \documentclass{mweclass} \title{MWE} \author{J. Doe} \begin{document} \thispagestyle{mwetest} \maketitle ...
25
votes
1answer
578 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 ...
5
votes
1answer
352 views

Minimal code to support table of contents in custom class

I'm trying to create a custom class to replace the class book and need to include ToC functionality. Placing the command \tableofcontents leads to error "Undefined control sequence". Using packages ...
2
votes
1answer
325 views

How to pass a string to a class

I have a class file where I load hyperref. Now I'd like to change the content of hyperref's \pdftitle from the main .tex file on: \RequirePackage{filecontents} \begin{filecontents}{myclass.cls} ...
3
votes
1answer
830 views

How do I load a custom class in LyX?

I'm interested in making some modifications to a standard class to use as the class for many documents I'm creating, and see that one way to do this is to simply create a "wrapper class". This ...
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 ...
4
votes
2answers
932 views

How to set default line spacing in a .cls file?

I am writing a document class where I want to set the default line spacing to be 1.5. How can I use the setspace package to achieve this? More particularly, where in my .cls file should I mention ...
9
votes
2answers
3k views

How to set default font size in latex cls file?

I am using a custom LaTeX document class for my thesis which is derived from the report class. I'd like to set the default size of the font to 12pt, and still have the option to change it (to 10pt) ...
1
vote
1answer
399 views

own class with twocolumns activated in \ifdefined for KOMA and xelatex

I want to do something like in http://stackoverflow.com/questions/1465665/passing-command-line-arguments-to-latex-document. For better explanation I'll show a minimal running example: My test.cls: ...
35
votes
2answers
642 views

When or why should I use %% as opposed to %?

I've noticed that many (all?) style and class files have "documentation blocks" with a double comment character at the beginning of the line, %% like so instead of the usual style of comments, % ...
4
votes
1answer
3k views

\titleformat{name=\section} in documentclass

I defined a documentclass in which I redefine a heading format with (using the package titlesec): \titleformat{name=\section} This works. But if I move this \titleformat{name=\section} to a ...
8
votes
3answers
614 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 ...
1
vote
1answer
61 views

Finding Information about Class Level Commands [duplicate]

Possible Duplicate: Documentation reference for LaTeX internal commands? I'm working on writing a company-specific class file for reports in LaTeX and I thought I would start by reading ...
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 ...
17
votes
2answers
500 views

Write new package with LaTeX2e or LaTeX3

I’m planning to create a package and I wonder if it’s better do do this with LaTeX3 syntax or the „old“ LaTeX2e, which is the one I know. Will LaTeX2e packages be supported by LaTeX3? I can give ...
3
votes
1answer
334 views

How can I check/debug a .cls file?

I am editing a .cls file in order to customize the output of a particular document. However, I am occasionally coming up against errors. Is it possible to check that my .cls file is valid (i.e. no ...
3
votes
1answer
511 views

Best practice for setting package options through class options?

I want to process my class options so as to create a (potentially long) options list for package(s) I'm loading, e.g. % set default package options here somehow \DeclareOption{myvariant}{ % set a ...
6
votes
1answer
664 views

Redefine \title command in custom class

I am currently writing a custom class that inherits from a standard class (article), and I would like to redefine the \title command, so that the end user can call it, and I would be able to get the ...
3
votes
1answer
82 views

doc.sty: Print codelinenumbers in index in tt font?

Is it possible to print the index numbers which are referring to a code line number instead of a page in typewirter font. I know that I can change \main, but on this way I can’t change the format of ...
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 ...
3
votes
1answer
565 views

Commercial use of LaTeX templates

I was wondering what are the licensing issues or the best way to know if certain templates allow for commercial use. I know the best way is to contact the original author but sometimes the sites don't ...
5
votes
2answers
484 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 ...
7
votes
2answers
129 views

Controlling placement of package warnings in the log

Is there any way to control where in the log file or console output \PackageWarning or \ClassWarning messages get placed? I have a class warning (generated by my own document class) that gets buried ...
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 ...
4
votes
1answer
4k views

How to pass parameters in a class file to different packages?

I'm writing a new class file that is based on book, and thought of making it available both in an English and in a Dutch version. Easiest to do seemed passing the arguments, so I constructed following ...
7
votes
2answers
182 views

How to make certain macros defined in document class inaccessible from within an input file using it?

In C#, we can specify certain properties of a class to be private, read only, etc. I want to apply this methodology in writing LaTeX document class if it is possible. I can find articles pertaining ...
5
votes
1answer
3k views

Removing extra vertical space in \maketitle with titling package

Consider the following two LaTeX source files: First, manually producing a title using a new environment (eww): \documentclass[a4paper,10pt]{article} \parindent0cm% ...
10
votes
1answer
982 views

Changing the default options of a document class?

I would like to define some base-class.cls, with some options and their defaults, and then provide some mechanism so that other derived classes can reuse the existing options and change the defaults. ...
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 ...
5
votes
1answer
270 views

Making a daily devotional

This question led to a new package: scrjrnl I'm searching for packages to write a daily devotional such as this one (Click "Search inside this book" and see in the end of the preview for ...
9
votes
3answers
196 views

Backward compatibility for command names

I have made a class file. It defines commands for use in document files. I want to change some of the command names, but I also want old document files to work without changing them. Here's an ...
14
votes
3answers
642 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 ...
4
votes
2answers
377 views

Defining (optional) data in a class

I'm trying to learn how to write latex classes and am using my resume as a toy example. I am trying to separate style from content as much as possible so I am trying to define data fields such as ...
21
votes
1answer
723 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
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 ...
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 ...
0
votes
2answers
2k views

Problem with defining a titlepage

I am writing a LaTeX 2e class with two options msc and phd for my department theses/dissertations. In this class, I need to define a titlepage for the first page of the theses/dissertations which ...
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 ...
15
votes
1answer
182 views

What are the established methods for filing and tracking bugs in packages?

My particular concern is in finding Polyglossia's author, Francois Charette, whose email address I could not find in Google. However, I think the issue is much more general. If you encounter a bug in ...
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 ...
13
votes
3answers
887 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 ...
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 ...
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?