{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

0
votes
0answers
47 views

Problems with own class [on hold]

I wanted to try to write my own class for a project in TeX, and therefore started to write a test class, where I can try out if my ideas are working or not. Thus I wrote a first draft: ...
1
vote
0answers
37 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 ...
10
votes
3answers
170 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 % ...
2
votes
0answers
44 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 ...
0
votes
0answers
30 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 ...
0
votes
0answers
29 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 ...
2
votes
1answer
45 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
43 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
50 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 ...
5
votes
1answer
160 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}% ...
5
votes
1answer
159 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 ...
1
vote
1answer
22 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 ...
4
votes
1answer
47 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 ...
1
vote
1answer
33 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
135 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
55 views

jou class apa6, problem with one column

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
48 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: ...
13
votes
2answers
171 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
82 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
29 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 ...
20
votes
4answers
568 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
32 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}} ...
0
votes
0answers
32 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
68 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
1answer
160 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 ...
4
votes
1answer
53 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 ...
12
votes
7answers
930 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 ...
1
vote
0answers
86 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 ...
0
votes
2answers
37 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
120 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
244 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 ...
4
votes
1answer
113 views

Unused global option in KOMAscript wrapper class

I want to write several classes, most of them will use KOMA classes as base class. However I stumbled upon the problem that some options (mainly concerned with layout) are not processed if given in ...
6
votes
1answer
292 views

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/
2
votes
0answers
99 views

How to adapt a class to use with xelatex/lualatex? [closed]

I have a custom .cls written (by somebody else) for use specifically with pdfLaTex engine. However, I want to compile my document with xe or lua for the sake of font support (and I don't want to use ...
4
votes
2answers
66 views

How can I set contents in a box of zero width and specified height, optionally rotating, using expl3 syntax?

Using Steven B. Segletes's answer, I can centre something horizontally, optionally rotating it, using \centering \makebox[0pt]{\rotatebox{<angle>}{<contents>}} \par However, I would ...
5
votes
1answer
146 views

How can I override geometry's scale in the preamble? (E.g. if a class or package has set a default using geometry.)

With some geometry options, it is possible to override a previous setting in the preamble. For example: \documentclass{article} \usepackage{geometry} \geometry{hmarginratio=1:1} ...
1
vote
0answers
147 views

Set global option (and pass it to all packages) in a custom class file

I had a tex-file that basically started as follows \documentclass[ a4paper, hyperref, amsmath, headinclude=true, ngerman, final ]{scrbook} \usepackage{babel} \usepackage{ntheorem} ...
5
votes
2answers
3k views

LaTeX “Variables” - \@varname

I'm currently in the process of writing my first document class file (a personalized resume class), and I want to get a better understanding of what exactly I'm doing. So, right now I'm setting up ...
2
votes
0answers
131 views

Need a little guidance for latex document design [closed]

I want to use LaTEX to write a fascicle (a small book part of a bigger set of books). So I need some specialized design. For example a specialized design for headers, specialized edging, rearranged ...
3
votes
1answer
72 views

How to pass a string to a custom documentclass for use in pre-compiled preambles in lualatex?

I've got a heavy class definition and want to modify it for the use with precompiled preambles. Minimal example preamble.tex \documentclass{myClass} \def\preambleloaded{Precompiled preamble ...
2
votes
1answer
104 views

LaTeX command or environment to selectively print one out of several given options

I'm currently wasting my time by trying to create a proof-of-concept class to show that writing our university's curricula with LaTeX instead of MS Word would have some benefits. Since these curricula ...
0
votes
0answers
37 views

Create an template [duplicate]

I've been using the same format and setup of a front page in my homework's e.t.c and I've always wanted to just create an template file. (*.cls) I think? I.e. I don't want to see all my packages in ...
0
votes
0answers
18 views

Where are the common document classes (article, letter, etc.) stored on Ubuntu? [duplicate]

I use TeXworks on Ubuntu 14.04. I've been trying to locate where the default templates (article.tex, letter.tex) are stored, to no avail. I'm looking for their location because, I have a document ...
4
votes
1answer
61 views

Confusion when trying to write a class

I'm writing my own class for a thesis... yes, yet another thesis class! XD This class is based on the standard book class, but I don't want all options of the book class to be available when writing ...
2
votes
2answers
106 views

How can I have bigger fontsize than \fontsize{60}{70}? [duplicate]

I am writing my thesis and the font size of the chapter title is defined in the class of the document. Somehow I cannot make bigger than \fontsize{60}{70}. Even if I write \fontsize{3000}{70} I cannot ...
4
votes
2answers
491 views

Please explain how moderncv.cls defines \maketitle

This is the package https://github.com/mliu7/latex-moderncv I'm trying to learn how to make packages and classes something about this package makes me confused. On line 380 ...
1
vote
0answers
56 views

Write a class with different code for different version

I want to write a report-like class (maybe based on KOMA-Script). My problem is that the layout will be evolving and maybe the features of the package to. I would like to know if there is an easy way ...
4
votes
2answers
43 views

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 ...
4
votes
3answers
113 views

How to define such a command with an optional argument in my class?

I'm preparing a document class: \NeedsTeXFormat{LaTeX2e} \ProvidesClass{myclass} \LoadClass{book} \RequirePackage[demo]{graphicx} \newcommand{\@mypic}[1]{% ...
4
votes
1answer
414 views

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 ...