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.
387
questions
1
vote
0answers
31 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
32 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
37 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 ...
0
votes
0answers
27 views
CV - swapping information from left to right
I would simply like to swap my degree name with the information about the time and place. I have no idea on how to do that
The code is the following. PLEASE HELP ME
\documentclass[%singlesided,
...
1
vote
1answer
35 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
35 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
36 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
37 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
49 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
23 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
63 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
31 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
72 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 ...
1
vote
0answers
37 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
82 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
23 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
28 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
40 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
31 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
71 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
42 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
52 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
43 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
50 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
21 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
101 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
178 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
230 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
63 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
249 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
41 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
40 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
7 views
Conditional definitions with BooleanOptions in kvoptions
Suppose I want to define a class (or equivalently a package) which allows to use some different styles for headings. I naïvely thought that is was enough an expression such as
\NeedsTeXFormat{LaTeX2e}...
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 ...
0
votes
1answer
57 views
Using package iflang with IfLanguageName doesn't work
I create a document class testclass.
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{testclass}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
\ProcessOptions\relax
\LoadClass[DIV=10,a4paper,...
0
votes
1answer
70 views
Footnote customization
I'd like to personalize my footnotes. So I wrote the following command:
\documentclass[12pt]{book}
\usepackage[oldstyle,proportional]{libertine}
\makeatletter
\def\thefootnote{\arabic{footnote}}...
1
vote
1answer
117 views
Get relative path to class file from inside the document class
Is it possible to get the relative path used in the call to \documentclass so that I can use \input inside a document class, to import files relative to the .cls file?
Example folder structure:
./...
1
vote
1answer
32 views
Outside column categorizing the paragraph
I'm looking to write a report where the outside column helps to categorize de paragraph on its side, as you can see in the attached image. The blue text acts like a "title" to some of the most ...
0
votes
1answer
54 views
pgfopts .unknown does not handle key-value pairs?
I would like my custom class to forward unknown keys to the base class, or in this case, a package.
The following works (to make the example smaller, this forwards only one key; expanding it to a ...
1
vote
0answers
31 views
Best practice of placing commonly used pgfplots settings in a separate file?
As years go by and make more and more figures I have started to accumulate code I reuse often, new commands, settings etc for pgfplots. After a while it start to get a bit cumbersome, so I'm looking ...
2
votes
1answer
198 views
How to set paper size in LaTeX outside of documentclass
I am looking at How to use A4 instead of letterpaper? and wondering how I can create a custom documentclass like \documentclass{foo}, and then have another function like \foosetsize{a4paper} right ...
1
vote
0answers
126 views
Converting a Pandoc LaTeX template to a Documentclass
This may be an inappropriate question to ask in a dedicated TeX/LaTeX forum, but I'm not sure where else to post it.
Are there any guidelines (or tools) for converting a Pandoc LaTeX template into a ...
1
vote
1answer
82 views
clv3 and hyperref conflict TeX capacity exceeded, sorry [input stack size=5000]
I have a problem when using the below code I got an error
TeX capacity exceeded, sorry [input stack size=5000]. \begin
I searched and I found another question here. It is a similar issue but did ...
1
vote
1answer
159 views
Subsection throws LaTeX Error: There's no line here to end
I have section and subsection commands in my LaTeX code described as follows. These are included in the style file, foo.cls:
\newenvironment{aside}{%
\let\oldsection\section
\renewcommand{\...
0
votes
1answer
73 views
Hyperref: `\hypersetup` ignored for `\AtBeginDocument`
I want to add an option to a class text.cls that automatically loads a default style for hyperref supplied via the hypersetup command. This works as expected.
However, if I want to account for the ...
1
vote
0answers
36 views
Class wrapper: Why “unused global option(s)” warning
I am trying to write a wrapper around some documentclasses as a small test. Everything works so far, but why do I get an
LaTeX Warning: Unused global option(s): [math=true,tikz=true,base=normal,type=...
0
votes
0answers
27 views
How to have my custom class throw a warning when displaymath wider than \displaywidth?
I am writing a custom class which provides a multicolumn environment (via the multicol package). The environment sets the value of \displaywidth to \columnwidth but doesn't actually do anything when a ...
0
votes
2answers
72 views
Definitions for sections, subsections and subsubsections (+chapter?)
I want to change the commands of the article/ book class and want to know how sections, especially in the article class but also in the book class, are defined.
I think it is something like this?:
\...
0
votes
0answers
459 views
Onecolumn command in twocolumn article
I'm making a class (.cls) for CVs, and I'm loading the [a4paper,10pt,twocolumn]{article} class. However, I would like a sort of "heading" section which should only have one column. It's going to look ...