{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

3
votes
1answer
42 views

Counting the number of strings stored in array

I stored a list of strings (command strings) in an array following the answer here: http://tex.stackexchange.com/a/215571/61517 . Now I wanted to access them randomly, and therefore I added a random ...
5
votes
0answers
79 views

Looking for someone to help me finalize and distribute a class file

I'm not sure this is the right place to ask but I don't know where else to go ! I've been working on the design of my lecture notes for a little while and now that I'm happy with the result, I would ...
1
vote
0answers
24 views

Getting LyX to honor paper size of LaTeX class? [duplicate]

I'm not sure, if I'm just overlooking a simple preference setting or if what I would like to achieve is possible at all... Anyway, I recently created a LaTeX class file (it's based on scrbook from ...
0
votes
1answer
59 views

Use variables/properties in class file

I have a class resume which I use in a .tex file as \documentclass{resume} \begin{document} \end{document} but I also want to define some variables in my .tex document to be used in my class. How ...
7
votes
1answer
51 views

How can I generate precisely one warning within a tabularx environment?

I realise this is an unholy mix of expl3 and LaTeX-2e, but most of my code is like this at the moment, unfortunately. I want to be warned when I fail to set a particular variable. More specifically, ...
1
vote
1answer
77 views

The package `' is defective

I am trying to extend my class by supporting multiple paper sizes, and therefore adding some options by \DeclareOption{a5paper}{% Paper size: 148mm x 210mm % \SBpaperAfivetrue % \...
10
votes
2answers
304 views

How to detect whether “I'm on arXiv.org”?

I write a class. I'm interested in having a different page headers (and eventually make some other small differences) based on whether the class is used on the site arXiv.org or not. Minimal example ...
116
votes
7answers
42k 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?
2
votes
1answer
48 views

\renewenvironment{document}

I would like to use \usepackage{filecontents} to write another version of my document to a file later with \write18 and compile it. My question is: How do I create a custom \begin{document} to ...
10
votes
3answers
221 views

When/How should a class load biblatex

I would like to write a custom class that loads the biblatex package, but I am having trouble with option clashes. For example, the following MWE gives me an error % arara: pdflatex % arara: biber % ...
3
votes
1answer
81 views

Modify page behaviour in a cookbook .sty file to manage complex recipes

I'm trying to edit a .sty file for the typesetting of recipe books. It's a modification by Alexis Flesch of cookybooky: link to the full package (with output) The problem is that the code is ...
2
votes
2answers
1k views

Document Class for Briefing Notes

I was wondering whether there was a document class for briefing notes/memos in LaTeX. If there is not any what is the easiest way of making my own? PS: Sorry, I should have given an example. Here are ...
0
votes
0answers
26 views

Lettrine in a custom environment

I want to use the lettrine-package in my custom class in order to modify the first letter in a section. The usual way of doing it is \lettrine{T}{est} of my text The problem for me is that I do not ...
4
votes
1answer
91 views

How to load class with options, e.g. headsepline

I'm trying to write my own class file for subsequent documents based on my template. What I did is simply copy everthing from \documentclass to (but not including) \begin{document} and paste it into ...
1
vote
1answer
50 views

Fancypagestyle in \DeclareOption

In my class I want to define the page layout first during\DeclareOption and then modify it during a \newenvironment declaration. For that I wanted to use the fancyhdr package. Now my problem is that a)...
2
votes
0answers
77 views

How to make Bibtex works with a particular cls file?

I am using a template that uses a particular class (proposal.cls). This class doesn´t support bibtex yet. I have noticed that in this class it wasn´t created thebibliography environment. I think this ...
15
votes
2answers
26k 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}?
2
votes
0answers
63 views

Reset/clear Part with \backmatter in a customized book.cls? [closed]

I'm producing a fairly large volume using a customized version of book.cls with four Parts containing several chapters in \mainmatter, followed by a \backmatter that contains only the Bibliography for ...
3
votes
1answer
61 views

Commands for getting and setting additional elements in a class and document

As I'm writing my first class, I'm wondering the best way to create additional elements that can be used both in the class file and the LaTeX document. For instance, I want the user to set the ...
4
votes
1answer
58 views

How to display the dates in the \PrintChanges' changes?

An information I'm often missing when I have a look at the "Change History" of a package/classe is the dates of the changes because, IMHO, just the version number is not informative enough: if I could ...
0
votes
0answers
49 views

In a custom documentclass, maintain chapter title headings but move page numbers to bottom

I am using a custom documentclass provided by my school for writing my thesis, which is a modification of the documentclass book. They also give a template, which includes the line \pagestyle{...
2
votes
1answer
48 views

How to determine if documents has parts

I'm writing a custom class based on book.cls for our office's publication series, but I've hit a problem in how to set up a conditional. Some of the publications are part->chapter->section while ...
0
votes
1answer
56 views

.cls edit makes at-sign (@) appear in 'list of tables' and 'list of figures' between chapters

I am formatting my thesis and have been using a template for which a custom style file was created. The template had the front matter, such as "list of tables", acknowledgements, etc., listed in the ...
4
votes
1answer
83 views

Loading packages in custom class based on option

I'd like to define a custom documentclass for assignments which can be optionally passed the minionpro argument to use the Adobe Minion Pro font; if it's not set, the Adobe Utopia font (fourier) shall ...
6
votes
1answer
485 views

Writing a book class for LaTeX2e, \NeedsTexFormat{LaTeX2e} “not defined” error? [closed]

I have a book class titled epbook.cls with the following opening lines \NeedsTexFormat{LaTeX2e}% \ProvidesClass{epbook}[2015/11/21 The EmptyPotato Press Book Class]% \LoadClass{book}% \RequirePackage{...
5
votes
1answer
178 views

I would like to create a custom-made “class” for my lab reports

I regularly write chemistry lab reports. Over time, I figured which packages to use. However, I would like to write some sort of superclass (like in C++) so the following code is read in the directory,...
1
vote
1answer
26 views

Provided a command in writing a class which can be used by the user

Suppose that I try to write a test_cls class, in which I want to provided a command \inst, that can be used by the user and also in the class doc itself. The class file named test_cls.cls looks like:...
4
votes
1answer
49 views

Using conditionals in a document that changes something in a class

A bit new to making document classes .. so please forgive the newbie sins I have surely committed. I am trying to make a documentclass that represents a Report that my organization uses. I am ...
19
votes
2answers
704 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 ...
132
votes
4answers
20k 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 ...
7
votes
1answer
390 views

Class available for law Reports?

Has anyone used LaTeX for writing Expert Witness reports or similar for UK Courts? These have to follow a particular format which would be ideal in Latex but I am a relative newcomer to Latex and ...
1
vote
1answer
39 views

Modifying \@dottedtocline to include a hyperlink

I am trying to edit the \@dottedtocline command to give a hyperlink on the dots as well as the chapter title and the page number. I searched for this and found exactly what I want here, unfortunately ...
9
votes
2answers
141 views

Enforcing or encouraging use of the most up-to-date version of a class

Background I maintain a thesis class for my university. The class changes more frequently that I would like based on the whims of the university thesis office who clearly have little else to occupy ...
1
vote
0answers
94 views

jou class apa6, problem with one column [on hold]

I have a problem trying to insert an equation cause is too large, so, I use the enviroment multicols, and @twocolumnfalse, but when I run the document, the precendent text its displayed in one column ...
2
votes
1answer
76 views

It is possible to load babel with a default language if none is specified in the class?

I would like to write a class that loads the package babel with a default language but that this language could be overridden by a language specified in the class options. MWE: \RequirePackage{...
13
votes
2answers
180 views

The following code compiles without error. How can I change that?

Unlike most questions on this site, my problem is that my code compiles without error and I do not want it to. I want to be able the check whether \command is defined and to do something if it is ...
3
votes
1answer
166 views

AIP conference proceedings template - placing subfigures vertically

I am using the AIP conference proceedings class file (aip-cp.cls) for writing a paper. I want to place two subfigures vertically, one below the other, using the subcaption package. The following is a ...
2
votes
1answer
32 views

Why is the “geometry” package passed an unwanted argument?

I am working on a class and cannot figure out why geometry is passed my argument "twocolumn", even though I did not use \RequirePackageWithOptions but only \RequirePackage. Can someone explain to me ...
1
vote
1answer
216 views

How can I make a professional looking article layout?

Elsevier and Springer and other publishers provide latex classes for authors, similar to the standard article class. But those classes don't have the full published formatting, it's just for ...
20
votes
4answers
609 views

Creating a class file vs using packages

In my limited LaTeX experience, I've always found that I can accomplish what I want by just using the relevant set of packages, even for more complex formatting. If I were to try and create a ...
1
vote
1answer
38 views

Variables defined but used in a class file & want to specify value in tex file

I'm new to TeX & I "inherited" a tex document & class file. The class file has: \newtoks\copyrtyr \newtoks\acmcopyr \newtoks\boilerplate \def\CopyrightYear#1{\global\copyrtyr{#1}} \def\...
0
votes
0answers
38 views

Package writing: unset global option?

I'm writing a class file which is supposed to have a global "draft" option. However, this option is inherited by all imported packages and causes e.g. graphicx to replace all images with boxes. Is ...
3
votes
1answer
92 views

Converting preamble into a new class changes margins

I'm trying to convert a preamble into a new class file. This is a simplfied version of the original file: testdoc.tex \documentclass[% 11pt, a4paper, twoside, openright, titlepage, fleqn,% ...
1
vote
0answers
87 views

Writing modular classes

As an OOP programmer, I am very attracted to the idea of making separate files for independent features within a class definition, where each feature I feel is too long to be included inline in the ...
11
votes
1answer
789 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 ...
12
votes
7answers
987 views

Remove leading zeroes from an integer

In the documentclass I am writing, the user will input an integer such as \lessonnumber as an integer with possibly a number of leading zeroes, e.g. 4 as 04. At some places in the document I will need ...
4
votes
1answer
68 views

class file option: switch endnote to footnote

I'm working on a class file where notes are endnotes by default but can be converted to footnotes through a class option (this is because some prominent journals in my field require that submissions ...
0
votes
2answers
41 views

Terminate environments within environment in class function

I'm writing a class for a document, that inherits from article, and I encountered a problem with this: the document should be all in two columns, except the abstract. For the two columns, I use the ...
1
vote
1answer
241 views

How to pass title (or other parameter) to class file

I know LaTeX just to the point of making simple documents and modifying simple characteristics of a document's layout. Now I'm creating a class for a kind of document in order not to have to copy a ...
6
votes
2answers
279 views

What is the difference between \@@par and \par?

In LaTeX internal code I came accross \@@par. How is this different from \par or \newline. When should I use \@@par if I am writing a package or class file? In general, there are so many other ...