Questions tagged [documentclass-writing]

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

{documentclass-writing} is about writing document classes. If your question is about choosing, installing, or using document classes, choose {documentclass} instead. (copied over from exercept)

A class needs at least the statement

\ProvidesClass{class name} to make it known as a class.

473 questions
11
votes
1 answer

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 minimal code to create this document class?
Display Name
  • 46,933
10
votes
2 answers

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 exclusive options: oneside and twoside (twoside is the…
bev
  • 1,669
8
votes
2 answers

Base a class on another class

Possible Duplicate: Defining a wrapper class for a set of document classes When writing a new class (say, journal), how can I base it on an existing class (say, scrbook)?
raphink
  • 31,894
8
votes
1 answer

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 result of that command, modify it a tiny bit, and…
FelixCQ
  • 1,443
  • 1
  • 13
  • 11
7
votes
2 answers

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 to it neither on the internet nor in a book. The…
Display Name
  • 46,933
7
votes
1 answer

Class file for "Feynman Lectures on Physics"

I have a pile of handouts and lecture notes from a course that I've been teaching every fall for a number of years, and I'm thinking of putting them together in a textbook format (I know that some people advise against writing textbooks; let's just…
Koldito
  • 913
7
votes
1 answer

Define variable in a class

I am trying to figure out how to use a variable in a class. From another question (Macro for Declaring Variables in Class Files) I got started. However, I find myself in need of using four lines or rather unclear code. This is what I…
6
votes
1 answer

Does multiple \AtBeginDocument calls execute code in the appearing order

Let's say I have these two simple files myclass.cls : \LoadClass{article} \AtBeginDocument{\typeout{IN CLASS}} myfile.tex \AtBeginDocument{\typeout{BEFORE CLASS}} \documentclass{myclass} \AtBeginDocument{\typeout{AFTER…
6
votes
1 answer

Writing a book class for LaTeX2e, \NeedsTexFormat{LaTeX2e} "not defined" error?

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{titlesec}% [redefinition of \section,…
6
votes
1 answer

First two pages are empty. There is a bug in cls

there are two empty page before title.I think there is a bug in cls file. thanks online : https://cloud.sagemath.com/projects/28237dba-3851-4c63-8de3-fb49e5ecd8c0/files/template/
6
votes
2 answers

LaTeX Document class for department technical reports

Can anyone recommend a LaTeX document class that I could modify for use as our department technical report series? Something in the vein of document classes from publishers (Springer, Elsevier etc) where there are commands for inserting author…
edantes
  • 61
5
votes
1 answer

Class name that is also a trademark

I am sorry if this question is off-topic or there is a better place--feel free to move it or close with an explanation. I have no affiliation with Vistaprint. I would like to publish a class with the name vistaprint.cls. The class is already written…
5
votes
0 answers

Beginner issues about custom class files

I am trying to write my first ugly .cls for LaTeX related to the following problem which Mike and me are trying to solve (we will post soon the link to Github for people who are interested to work with us). I have two baby questions which probably…
5
votes
2 answers

Prevent passing of options when defining a new class

I'm defining a new class. In this class I created an option total. This however breaks the document since apparently this option is passed to the geometry package, even though I'm not specifying this should happen. I thought that options were only…
nvcleemp
  • 1,546
4
votes
1 answer

Is there a way make a custom default document style in LaTeX?

Possible Duplicate: how to create a template or document class for latex? Currently, whenever I create a new document, I add a reference in the header to \input{header.tex} where header.tex contains a whole bunch of package imports and…
1
2 3