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
1
vote
0answers
30 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
71 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
22 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
15 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
34 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
21 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
35 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
47 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
38 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
49 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
38 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
47 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
19 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
94 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
93 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
210 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
59 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
178 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
38 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
33 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
5 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
28 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
33 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
58 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
80 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
38 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
30 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
132 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
83 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
57 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
134 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
49 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
34 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
54 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
60 views

Allow kvoptions with spaces in String

I try to write my own package + class. The package is supposed to offer some option like so: options -> class -> package -> custom command For this I use the kvoptions-package, and my files ...
0
votes
0answers
252 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 ...
2
votes
2answers
134 views

How to check for errors when creating package/class

Short: How can you find errors in a package/class without importing the .cls/.sty file to your project/without using the package? Note: I'm looking for a general way of checking package/class errors, ...
3
votes
2answers
99 views

Wishlist (itemize) environment in .cls not working

I made this wishlist environment in a .cls file. However, it is not working. Instead of a star, I get a dot. On the other levels as well, it is a totally normal list without any of the labels I ...
6
votes
1answer
84 views

New package or class: way tho share it

My prime question is: is there a proper way/website to share a package or a class of our own? If the question is too generic, I can try to refine it a little bit: what is the best way to get some ...
1
vote
1answer
76 views

How do I use `ifpackageloaded` inside a `cls` file?

I am writing a class that makes some changes in its commands according to the packages that are loaded in the main tex file. However, when is use \@ifpackageloaded for that purpose, it only performs ...
6
votes
1answer
75 views

How can I set \l_file_search_path_seq so \file_input:n finds files in Texlive 2019 as it did in Texlive 2018?

I have code which used to use \file_path_include:n, but now tries to adjust \l_file_search_path_seq as follows. With Texlive 2018, this works, but with Texlive 2019, it doesn't. What am I missing? ...
1
vote
1answer
74 views

Is it common to save each chapter of a document as a separate file?

I’m due to start my dissertation and saw a few people recommend the technique of having one master file which links to each chapter which in itself is saved as a separate file. If this is optimal, how ...
0
votes
1answer
59 views

New \@startsection doubles text and adds too much space

I'm making my own documentclass based on article. I need a new section type so I copied and adapted the following code from what I believe is the relevant code to add \subsection (at least in a simple ...
2
votes
1answer
29 views

how to merge table cells from redefined environments

I am writing my CV and i have a problem for merging table cells. The table is defined in the new latex environment "experience", written on the modelcv_dbg.cls file as shown below \LoadClass{article} ...
1
vote
1answer
186 views

Can't include file with \includegraphics using ifthen

I am using TexLive and TexStudio as a compiler. I created a custom class in order to produce tests. In that class file there is an option for the color output so I can choose for example to use blue ...
0
votes
0answers
26 views

removing footer of the first page of preface in using gsm-l.cls

I am using gsm-l.cls, which is downloadable from here. It defines a special style for chapters. In particular, the first page of each chapter has a footer consisting of short thick rule at the bottom ...
1
vote
1answer
101 views

In what ways can one write a parser in plain TeX or packageless LaTeX?

I want to write my own document class as a literate program with as minimal of a dependency tree as possible as an exercise to test my ability. I've implemented a stable foreach loop by shredding an ...
0
votes
1answer
45 views

Controlling distance between page number and text in terms of lines

According to the below requirement for my thesis, I would like to set the distance between page number and text in terms of number of lines. Page numbers must be at least two single spaces above or ...

1
2 3 4 5
8