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
0
votes
1answer
25 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
24 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
51 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
49 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
34 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
107 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
24 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
29 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
25 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
42 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
35 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
26 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
94 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
56 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 ...
5
votes
1answer
76 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
61 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
71 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
68 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
51 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
27 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} ...
0
votes
0answers
13 views

Tocloft: unable to print tableofcontents

I gave some tries to write a personal class, however it does not indent the table of contents and therefore the numbers of Sections are written at the same place than the associated titles. Here is ...
1
vote
1answer
138 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
23 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 ...
0
votes
0answers
48 views

! LaTeX Error: Command \@ptsize already defined

I've written a LaTeX class file and created a dtx file by sty2dtx tool. The tex file that using the class file which I have written before is successfully built & compiled without error. However, ...
1
vote
1answer
76 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
31 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 ...
3
votes
1answer
25 views

Specifying font size with LoadClassWithOptions causes error

When I specify font size with LoadClassWithOptions, the main document gives error: File `.cls' not found. The custom class file is in the same folder as the main file. What I am doing wrong? ...
0
votes
1answer
38 views

Redefining 'section' environment to add margin to text

I'm writing a class and I would like to add a margin to the section, such that the text is aligned with the section title (and not with the section number as it is default). Basically using the ...
1
vote
1answer
16 views

Redefining style after the current command or page

I am trying to write for the first time my own class. I am redefining the \maketitle, and I would like two things: the font size to be changed after it (namely to around 14pt, the only way I found is ...
0
votes
0answers
43 views

How to create your own class for a very specific usage?

I have created my resume in Latex and honestly, I like it a lot. I was thinking of making a template and publish it somewhere so that people can use it. But it's rather complicated and it would be ...
0
votes
1answer
31 views

Random compile-time document style

I am trying to create a document class with random style attributes, determined at compilation time. Random attributes would ideally include: Margins Line spacing Font selection For my particular ...
0
votes
0answers
119 views

Choosing a base class

I started writing my own book class and I'm not sure wheter I should use book or scrbook as my base class. (I'm going to load one of these classes, I'm not going to start writing one from scratch or ...
0
votes
0answers
101 views

Using variables in custom class

I am working on a custom document class for my faculty. When creating the frontpage I want to have some custom variables. Such as title, author, supervisors etc. I was able to do it in a single ...
0
votes
0answers
24 views

How to document LaTeX custom packages and document classes? [duplicate]

While I can use something like Doxygen to document a C library (functions, constants and structures defined/written by me), I couldn't find something equivalent in LaTeX to document \newcommand(s) \...
0
votes
1answer
28 views

Change header from class file depending on whether or not a variable is declared in the document

I am trying to edit my class file to either have a header or not depending on whether or not a variable (\cv{}) is set in the document. I have scoured the internet for answers and based my initial ...
3
votes
2answers
373 views

Command for nulifying spaces (String.trim()) in latex

I want to declare a variable in class that takes in the font name from the preamble of the TeX file. Something like \docFont{<Variable>}. Is there a command that could nullify the space key in ...
0
votes
1answer
73 views

How to add new macros like \author{} without editing latex.ltx [duplicate]

I want to write a new class based on the article class for student home-works that needs a modified title page. Is it possible to create new macros like \title{} and \author{} that can be used in the ...
0
votes
0answers
53 views

Commands vs keys/values for setting up a document: what an own document class should provide?

This question somehow extends the question "Package option vs setup command". I'm currently writing a class dedicated to students reports for both academic projects and internships. This class ...
0
votes
1answer
33 views

Problem with passsing options through customized class interface \myclsset using pgfkeys

My intention is to create a class with a interface setup command \myclsset \documentclass{myclass} \myclsset{key1=val1, key2=val2, ..} % key-value list \begin{document} ... \end{document} where \...
2
votes
1answer
55 views

Exclamation mark around variable

What does the exclamation marks (!) around the \@subheader command do in the following? \renewcommand\maketitle{ ... \if!\@subheader!\else\noindent{\trfont{\@subheader}}\fi ... } Can someone please ...
1
vote
1answer
88 views

htlatex failing with custom documentclass: Error LaTeX Error: File `email' not found

I have created a custom class for a personal curriculum. It can be found at https://github.com/igormorgado/elegantcv It compiles nicely with pdlatex, XeTeX and LuaLaTeX, but trying to build with ...
2
votes
1answer
85 views

Incompatibility between kvoptions and babel

I'm using kvoptions in my document class and it's worked nicely so far, but after a major rewrite I started getting strange errors that I was able to trace back to the babel package. MWE: %% myclass....
0
votes
0answers
25 views

How to use authblk's \@author outside \maketitle (or other way to get easy-to-use author lists in document class)

The Problem: I am running into issues trying to use the author list created by authblk and stored in \@author outside of the \maketitle command, and cannot figure out what is happening -- detail below....
1
vote
1answer
165 views

Urdu Words can't be written in overleaf

I am writing Urdu words in the Overleaf but it does not appear in the text. May someone please help me? I have tried wits Arabic, but it does not work. For example, in Urdu, I am writing " the ...
1
vote
1answer
118 views

Top-right margin displaying “Contents” instead of section title

I have a class MyReportClass where I define what has to be displayed in the margins of all pages of my document. In particular I would like the current section to appear in the top-right margin of ...
2
votes
1answer
52 views

String parameter passed to a class vanish the spaces between words

I created a class in which I'd like to pass some parameters in \documentclass[parameters]{}. The parameters I need to pass are pdftitle and pdfsubject to the hyperref package. I succeeded in doing so, ...
2
votes
1answer
374 views

Error “\RequirePackage or \LoadClass in Options Section” in document class

I tried to make a document class out of a LaTeX document (that was generated from the default Pandoc LaTeX template, just FYI). The document compiled perfectly with XeLaTeX but I can't get the ...
0
votes
0answers
23 views

Specifying horizontal spacing for section title from the margin instead of after numbering

I am modifying the available class file for my requirement using renewcommand in the preamble. \renewcommand\section{\@startsection {section}{1}{0mm}%spacing before numbering ...
2
votes
1answer
26 views

Is it possible to write a class file that loops over the documentbody?

What I would like to achieve is a repeat.cls such that I could write a .tex file \documentclass{repeat} \begin{document} foobar \end{document} and then the document would contain 'foobar' a certain ...
1
vote
1answer
90 views

Writing custom.module file for LyX

MWE: This is for a custom.module file that should be accessed using the top-left drop down menu in LyX: #\DeclareLyXModule{custom} #DescriptionBegin #Legal Format #DescriptionEnd #Author: Jalep ...

1 2 3 4 5 8