{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

2
votes
1answer
28 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
500 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
23 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
22 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
46 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
95 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
43 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
866 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
77 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
24 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
51 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
161 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 ...
3
votes
1answer
76 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
256 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
60 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
46 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
77 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
79 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} ...
4
votes
2answers
921 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
108 views

Need a little guidance for latex document design

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
48 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
89 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
54 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
90 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
214 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
48 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
41 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
106 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
296 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 ...
5
votes
1answer
91 views

Defined a new class verbatim from my preamble, but resulting document does not have identical layout

I've designed a poster layout that will most likely be used again, so I decided to define a new document class using all the settings from my preamble. However, when I compile a document using my ...
2
votes
1answer
183 views

Calling macro fails with error \inaccessible

I am trying to define a macro which I will include in a class definition. For the time being I put the macro definition in the normal document. Compiling the following document fails. ...
3
votes
1answer
104 views

Automatic report generation from bibtex with Perl

I like to benefit from my existing myarticles.bib file to create a different report automatically something like in following picture (I prepared this template with tikz). What is it best way to do ...
0
votes
0answers
82 views

Overlay specifications in beamer

I'm trying to create a beamer document class (.cls) with some configurations that please me. But, I ended in this point where a cannot overlay my \newcommand. This code has to collect a few ...
0
votes
0answers
81 views

How to instal document class type for use in R studio.

I found a template on writeLaTex.com for optica style articles. I downloaded the optica.cls from the optical website so i could follow that format. Just fooling around to learn more and unfortunately ...
8
votes
2answers
126 views

How can I prevent LGR encoding from switching font size?

I am using 12pt fonts with what is essentially the article class. (That is, I'm using a custom class which is parasitic on article.cls.) In order to set an appropriate headheight for fancyhdr using ...
0
votes
3answers
282 views

Redefine \chapter and \chapter* with \cleardoublepage inside .cls-file

\newcommand{\Chapter}[1]{{\let\cleardoublepage\relax\chapter{#1}}} works fine. How can I do the same for the stared (*) version inside a .cls-file? (Could be interesting for others: Is there any ...
5
votes
1answer
75 views

In a package or parasitic class, when is it better to redefine a command and when is it better to define a new one?

When I'm working on a document for which I need special layout, I tend initially to accumulate a very long preamble. At some point, if I need to reuse similar layout regularly, I decide that I really ...
1
vote
1answer
67 views

New list environment not working in class file

Sorry in advance for the length of this one.... The following MWE contains an enumerate environment I defined: \documentclass{memoir} \usepackage{multicol} \usepackage{enumitem} ...
3
votes
1answer
33 views

How to parse a macro using babel replacements in a class file?

I was trying to write a simple class and have the following issue: I need to write some text containg German quotation marks that is staic and thus should be typeset by the class by default. You can ...
2
votes
0answers
42 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 ...
2
votes
1answer
105 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, ...
0
votes
0answers
98 views

What is the kvoptions-patch's equivalent of \@classoptionslist?

For a class I'm working on, I'd like some (babel's) languages to be automatically loaded. This can be achieved thanks to \@classoptionslist: \begin{filecontents*}{myclass.cls} ...
2
votes
0answers
88 views

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

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: ...
8
votes
1answer
146 views

Why are these options passed to \LoadClass ignored?

Consider the following simple example: % === this is simple.tex === \documentclass[paper=a5,pagesize]{scrbook} \usepackage{lipsum} \begin{document} \lipsum{1-10} \end{document} When processing this ...
9
votes
1answer
291 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, ...
7
votes
2answers
229 views

Where can I find definition of starred version of \chapter command to redefine it

General question I need to redefine how starred version of \chapter command (that is \chapter*) works in book class. I found definition of not-starred version of \chapter command in book class: ...
3
votes
1answer
99 views

Issue with custom styles

I am in the middle of writing a much needed report template and have hit more than a wall and cannot seem to figure out why some of the macros aren't loading. The two main files are massive and I ...
1
vote
1answer
2k views

how to add a document class to texstudio

I want to add a new document class to TexStudio. the document class is named "AEA" and is available in this link(the first .zip file below "Please note:") The code will look like this ...