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.

Filter by
Sorted by
Tagged with
6
votes
1answer
89 views

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} \...
0
votes
1answer
32 views

Is it possible to prevent class options from being passed to some packages?

I have an option named indent in my document class. However, some of the packages loaded also have this option, and since the option is written in \documentclass[...]{myclass} as a global option, it ...
2
votes
1answer
42 views

\PassOptionsToClass{\CurrentOption} not working

I get an error which I don't understand. I have the following cls-file called error.cls \NeedsTeXFormat{LaTeX2e} \ProvidesClass{error} \DeclareOption*{\...
1
vote
0answers
45 views

Best practice for dealing with bidi's redefinitions for class authors

As is well-documented elsewhere, bidi.sty does a lot of redeclarations and assumes that the author is using one of a small set of document classes. For use of packages, one can fiddle with the order ...
3
votes
0answers
51 views

Class/package: design vs code

LaTeX3 team often reminds us: "Classes really should be about formatting/style/etc., not functionality. The latter should be added by packages, which ideally would be independent of the classes ...
0
votes
0answers
17 views

Suppressing underlined section titles in custom documentclass

Hi I need to suppress the underlining in a custom document class. I am trying to submit my thesis and my school gave me a handy document class option that ideally should take care of all the ...
1
vote
1answer
10 views

Using amsart indirectly as a base class of another class changes the way the date is printed

I created a custom document class based on amsart. When I used it instead of amsart, to my great surprise this changed the way the date is printed in the footnote of the first page: instead of Date: ...
0
votes
0answers
16 views

Writing custom article class with fancyhdr - title issues

I'm trying to write my own article class that inherits from the standard article class, and adds some stuff to it. I'm using the fancyhdr package, which works well but what I want is to get rid of ...
1
vote
1answer
40 views

Document class that places a figure on a specific page

I'm trying to write a document class with a twocolumn layout such that when a document is written using that class, a certain figure, e.g. a logo, is always inserted on a specific page - say, page 10. ...
1
vote
1answer
28 views

How can I specify page numbering for \chapter headers to be in the top right corner?

I wrote my own Dissertation .cls file and I'm not sure how to make my chapter page numbers located in the top right-hand corner. I believe the base class is report and not article. I was using an ...
2
votes
0answers
24 views

How to override a base class's default options in a derived class

Apologies if this is answered somewhere else; I've seen several questions with similar titles but I can't seem to determine how the answers would apply to my case. What I would like to do is define a ...
2
votes
0answers
21 views

How can I change margin and block size in a class definition based on Memoir? [closed]

Given the following example: test.cls: \NeedsTeXFormat{LaTeX2e} \ProvidesClass{test} \LoadClass[article,oneside]{memoir} \setstocksize{3in}{3in} \settrimmedsize{3in}{3in} %\setlrmarginsandblock{5pt}{...
1
vote
0answers
38 views

How does the user set geometry in a class that loads fancyhdr?

In my class, I defined the header style with fancyhdr. This causes trouble when the user wishes to modify the geometry settings, since geometry configuration should happen before fancyhdr. Below is an ...
0
votes
0answers
13 views

How to change to helvetice font in class based on class option? [duplicate]

I want to based on a class option change to using Helvetica as font, the simplest way I found to do this would be to load the helvet package. But if I do that like: \DeclareOption{foo}{ \...
1
vote
1answer
77 views

Any reference and tutorial on writing .cls file class?

I was trying to re-edit the report.cls file to adapt to our institution thesis presentation format. I was stuck at declaring and executing options,also with error flag on xcolor file execution. Having ...
0
votes
0answers
19 views

Require package as an option in a class

I am trying to make a personnal class and I want to declare some options to chose the language, but it does not work. For exemple, if I put \NeedsTeXFormat{LaTeX2e} \ProvidesClass{mytest} \LoadClass[...
0
votes
0answers
66 views

Switching my existing class from LaTeX2e to expl3 syntax

It has been my dream to rewrite my existing class with the expl3 syntax, as (I believe that) the code would be much clearer and would be easier to maintain by then. One year ago, while searching on ...
1
vote
0answers
36 views

Writing a class + template with default sections

I'm right now writing a class for technical manuals to be used inside my company. This class holds e.g. the company logo and defines some macros for e.g. specific Corporate Identity styling of code ...
1
vote
1answer
40 views

Increasing the font size makes the font smaller instead

I screen capped my workspace in overleaf below: The font size was initially at 12 pts as is in the command \documentclass[titlepage,12 pt]{article}. When I tried increasing the font size to 14 by ...
0
votes
1answer
69 views

Change font in my document-class [closed]

I created a new documentclass that is based on the \documentclass{article} . I would like to use the font Barlow that I just downloaded. I use the package fontspec and the compiler XeLaTeX. When I ...
1
vote
1answer
38 views

Spacing in a lined document

I have the following document: \documentclass[12pt,a4paper,fleqn]{article} \usepackage[utf8]{inputenc} \usepackage{tikz,amsmath} \usepackage{amsfonts} \usepackage[left=2cm,right=1.7cm,top=2cm,bottom=...
0
votes
0answers
51 views

Undefined control seqeunece.\ documentclass

may u help me with this error When I write this simple command in texstudio?when I type \ documnet class the error will apppear but when I typ doc.. and then the software propose default the phrase \...
1
vote
0answers
38 views

Use babel's `main` key in global options

In one of my templates, I need to load babel in the .cls file, as some functionalities in the .cls file depend on babel. I would, however, like to keep the flexibility for the user to set whatever ...
1
vote
1answer
74 views

Options not working if custom class is in subfolder

I have created my own LaTeX template and use a custom class for this purpose. I developed the template on a Windows machine using TeX Live 2020 and recently compiled a copy of the project on my Mac. ...
1
vote
2answers
50 views

How to set footnotes in ‘small’ size

Footnotes are set is \footnotesize. For some conference paper style, essentially \footnotesize is redefined to be \small. The choice to set footnotes in ‘small’ size is fine. The fact that in the way ...
0
votes
1answer
24 views

define different font depending on the compiler [duplicate]

I am writing a class file and want to use fontspec and unicode-math if the compiler is luatex or xetex. If the compiler is pdftex I would like to define default fonts like cmr and phv instead. I am ...
1
vote
4answers
81 views

Writing own LaTeX templates with relative paths, difference between include, input, class

I'm working on a Windows environment with Miktex. Most my documents are created with XeLaTeX but I think my problem is not compiler-specific. I would like to create a template with all my package ...
1
vote
0answers
45 views

Is it possible to modify the article class file?

I would like to write a new class file, preferably from scratch (if that is not way too time consuming). I do not want it to take too long to compile an empty document. The one I have written now uses ...
4
votes
2answers
97 views

Robust command not expanding as \input argument

I could really use some help - I've been using LaTeX casually for several years, but have rarely had to dive into the details or problems, and I can't figure this out. Problem I am working with a .cls ...
0
votes
0answers
43 views

How to achieve local class options?

I am writing a custom class and want to use some option keywords (such as draft) that are also shared by some packages that I need to import, which leads to unintended results. This is because, by ...
4
votes
1answer
108 views

When and how are commands in the argument of \AtBeginDocument evaluated?

This question is motivated as a followup to this one, where I ran into an issue with subtle differences in execution order between a usepackage command and AtBeginDocument. To simplify the discussion, ...
0
votes
0answers
25 views

How can I include content from a class file?

I have a header (with a logo image) that should be included in every document that uses my document class. The nature of the header is visually complicated, but pretty simple from a code perspective ...
0
votes
0answers
35 views

Unused global options with custom class and kvoptions

I'm trying to make a custom latex class that dynamically can load a different base class. I've got that working so far but I'm getting the warning LaTeX Warning: Unused global option(s): [baseclass=...
0
votes
0answers
42 views

Writing on Images

I hope you are having a nice day. There are a lot of Instagram pages that use LaTeX to write on images. Is it possible to write on images? If yes, how can I do that?
1
vote
0answers
35 views

using xstring to obtain lead author's last name from authblk in a class file

I would like to query the last name of the first author of an article and then put it into the header. I use \StrBetween on the \AB@authlist macro to get the part of the string between the first space ...
1
vote
1answer
164 views

Table captions expanding over both columns in a single-column table

I'm using the 2-column IET template and am running into a problem with tables. Namely, the captions of the tables extend over both columns even when the table itself is single-column. I've set up a ...
1
vote
1answer
48 views

Block additional document contents after appendices

I'm using the appendix package's appendices environment, and due to style changes for the appendices, placing anything after the appendices doesn't make sense. I'd like to raise an error if anything ...
1
vote
1answer
45 views

Pass “arabic” option to translator and not to babel

This question is a complement of How to add and use Arabic dictionary translation for theorem, example, I have a class beamer-rl based on beamer to create presentation for right to left languages, ...
0
votes
1answer
59 views

Possible to import prewritten code?

I am not sure if what I'm envisioning is possible, but I am not referring to the listings package (which is what all of my searches are yielding). I reuse a lot of my LaTeX code. I recently figured ...
0
votes
1answer
53 views

MinionPro package works fine included in a document, throws dozens of errors when required by a class file

I have the following M(N)WE—minimum (not) working example: \begin{filecontents}{class.cls} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{class}[20/07/14 A class] \RequirePackage[utf8]{inputenc} ...
0
votes
1answer
65 views

Check if biblatex key exists

How do I test if an entry bibliography key exists? I have a command that takes a key, but should fall back to handling the argument as just a label if the key doesn't exist. MWE: \documentclass{...
0
votes
2answers
25 views

Cannot set draftmode via LoadClass in custom class

I have a custom class that loads article. I can set certain default parameters, but the draft option seems to be ignored. I have the following in my custom class: \NeedsTeXFormat{LaTeX2e} \...
0
votes
0answers
105 views

Writing class file

I am trying to learn how to write a class file. I know it is not going to be easy, but I am determined to learn that skill. What I did was to choose a simple document to create, namely, a personal ...
1
vote
1answer
251 views

Custom document class, math mode in thesis title

I'm writing my thesis using a custom document class provided by our university vutinfth ( template in overleaf ), the title of the thesis has a few math symbols, which I need them to be bold to match ...
4
votes
1answer
236 views

Automatically turning tables into color boxes

I am writing a document class. I'd like that table environments are automatically transformed with tcolorboxes. Specifically, I'd like that the code \begin{table} ... \end{table} produces a table ...
0
votes
0answers
65 views

How can lua help class or package authors?

I am maintaining a rather simple class for internal company use for myself and some collegues. Mostly simple stuff like including the logo, setting the paper formats, adjust the colors, set headers ...
4
votes
1answer
386 views

\def\Command#1{\def\command{#1}} - Why?

I am dealing with a proprietary .cls file, which has a lot of constructions that work like this: a capitalized Macro (made-up, not existing in the packages loaded) is def'ed to be the lower-case ...
0
votes
0answers
43 views

Calling language in babel through class options

I'm writing a thesis class that should be bilingual, and the languages should be user inputted - one as primary and the other as secondary. Because of the document structure, parts of the document ...
1
vote
1answer
53 views

extra space in acronyms on document

I'm working with some acronyms and when I compile every acronym has extra space, for example with this abbreviation, Higher Education ( HE) and not Higher Education (HE). Even after the first time is ...
0
votes
0answers
29 views

Modifying commands defined by the article class document

So I am trying to add or take out a few lines to the already existing article class file to make a something like a NEWarticle.cls. The original class I used the following command lines, which gives ...

1
2 3 4 5
9