Questions tagged [class-options]
Concerning options that can be passed to document classes.
196
questions
10
votes
3
answers
511
views
Avoid spurious warnings in a parasitic class with key-value options (LaTeX3 \DeclareKeys)
This is a modified version of "Unused global options(s)" when using arguments in options of class. The question is how to create a parasitic class (i.e. one which loads another) which ...
1
vote
0
answers
98
views
Unknown option leads to error with babel and geometry
Consider the following example:
\documentclass[logo height = 2\baselineskip]{article}
\usepackage[french]{babel}
\usepackage{geometry}
\begin{document}
Text in case of empty.
\end{document}
I am ...
0
votes
1
answer
50
views
How to define a beamer option with theme?
I am trying to create my own beamer theme that should be loaded with beamer's compress option by default. I tried using the following declaration, which I saw on a few different answers and themes:
\...
3
votes
1
answer
60
views
Options not passing through class file with \LoadClass command
The following code works fine and gives expected output.
\documentclass[fontsize=14pt,twoside,a4paper]{book}
\usepackage[T1]{fontenc}
\usepackage[none]{hyphenat}
\usepackage{scrextend}
\usepackage{...
4
votes
1
answer
69
views
"Unused global options(s)" when using arguments in options of class
I have been using a custom class file for some time now, which requires several options with arguments; e.g. my documents often begin with something like \documentclass[name=John\ Smith]{mathwork}. ...
0
votes
0
answers
24
views
Page orientation option doesn't work with new class
This is the new class I have created preloading article class
\LoadClassWithOptions{article}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{chain}[4/4/2022]
%Packages
\RequirePackage{tabularx}
\...
0
votes
0
answers
63
views
How can I to pass options (or Load) class to a new package? Is it possible?
I'm planning to build a new package, which I call abntstyle, that can implement Brazilian norms of writing academic works. There is already a class called abnTeX2 that does this. This class is ...
0
votes
1
answer
102
views
How to \ExecuteOptions that are handled by \DeclareOption*?
I'm writing a class file based on the report class, for which I want the default font size to be 12 pt rather than 10 pt. I tried specifying a default font size using the \ExecuteOptions{} command, ...
2
votes
1
answer
134
views
When to use \PassOptionsTo* and when \LoadClass/\RequirePackage?
I've created a few packages/classes for my own purposes and learned (from, e.g., there) that \PassOptionsTo*[opt] is similar/equivalent to \LoadClass[opt], \RequirePackage[opt], or \usepackage[opt], ...
0
votes
1
answer
64
views
Loop in a specific list to define class options
I have a class beamer-rl to create beamer presentation for RTL languages (like persian) and I need a way to include RTL language as a class option like this \documentclass[persian]{beamer-rl}
So class ...
1
vote
0
answers
63
views
Unused Global Option in custom class package
I've seen the pages Unused global option(s): [language=english] and Unused global options in custom class but I'm still getting an unused global options error and I'm not fully understanding why. (I ...
2
votes
0
answers
50
views
Options passed to babel with article class and not with beamer
In this example using article class options arabic-ma and provide=* are passed to babel, but when changing to beamer class options are not passed to babel. Is there an explanation?
\documentclass[...
0
votes
0
answers
57
views
How to process base document class options in the derived class?
I want to process options passed to the base class in my derived class. Specifically, I'd like to enforce margin sizes for the article class with geometry package.
Moreover, I would like to forbid ...
0
votes
2
answers
76
views
Pass LaTeX variable from DocumentClass file to class
DocumentClass MWE...
\documentclass{testclass}
\begin{document}
\outputdirpath{../auxil}
\begin{minted}{php}
<?php
$x = 1;
if($x=1){
echo "x=1";
...
0
votes
1
answer
34
views
Excluding one of the chapter from starting with an odd numbered page in thesis
My university provided me with a LaTeX template for my thesis. In the class file of it, there is a part of the code that makes all the chapters start from an odd-numbered page. However, I need to ...
1
vote
2
answers
68
views
Mixing traditional class options and pgfoptions?
I am trying to mix pgfopts with more classical options to make a custom class. The idea is that classical options would be here to provide predefined behavior, while pgfopts options would be here to ...
0
votes
1
answer
32
views
ProcessOptions within AtBeginDocument does not work but ExecuteOptions does
When I have the following class:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{CustomClass}
\LoadClass[11pt]{article}
\DeclareOption{option1}{
\texttt{Text 1}
\clearpage
\texttt{Text 2}
\...
0
votes
1
answer
18
views
Strange behavior of a macro in \LoadClass options
Consider the class file mwe.cls containing
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{mwe}[2022/09/26]
\def\myGreatMacro{twoside=false}
\LoadClass[a4paper,\myGreatMacro]{scrreprt}%% warning about ununsed ...
1
vote
1
answer
48
views
Preserve space in \@classoptionslist
I noticed that \@classoptionslist removes whitespace of the options. Is it possible to prreserve this whitespace?
%\documentclass[12pt]{scrartcl}
%\begin{filecontents*}{myclass.cls}
% \ProvidesClass{...
1
vote
0
answers
29
views
Metaclasses via global options
Vision
I am making a small, custom LaTeX class for my organization. I want this class to support a couple different kinds of documents: articles, and reports. I want to actually inherit from the ...
0
votes
0
answers
35
views
Interaction between global and local options
I'm trying to achieve a specific behavior between global and local options within my own class. The example below does not work as intended. Other attempts also failed.
\begin{filecontents*}[overwrite]...
0
votes
1
answer
88
views
Disable a package/classoption when the draft mode is on
I have a custom .cls file which passes the parameters of the \documentclass to a4paper.
In this .cls file, I have (from the top),
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesClass{Thesis}
...
1
vote
1
answer
165
views
Unused global option with multi-staged options in koma-script
We use koma-script for a wide range of different documents, e.g. reports and short legal documents. I would like to make our documents more consistent. My idea was to create a package (myBase.sty) ...
0
votes
1
answer
141
views
Best way to build a custom class
I am customizing a class based on beamer. In your opinion, what is the best way to define options?
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{myclass}[2019/03/25 myclass]
\DeclareOption*{\...
1
vote
1
answer
142
views
How to change default options of a document class?
I'm trying to define a custom class rs-book.cls based on a standard class book.cls and would like to change some of the default options.
For instance, by default (with no options given), the command \...
5
votes
1
answer
85
views
Define own class options relating to counter
I created a class file named class.cls as follows:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{class}
\LoadClass{report}
\RequirePackage{indentfirst}
\DeclareOption{withinchap}{%
\newcounter{...
0
votes
0
answers
24
views
Passing `table' option to bespoke class, not recognised by `xcolor`
I'm working on a document that uses a university-specific class file. For the purposes of this question, I've reduced the class file to one called test.cls, which contains the following:
\...
1
vote
1
answer
78
views
Class with keyval option consisting of lists of keyval pairs
I'm trying to figure out how to write a class that would allow for a key-value option where the key is called people, which would take a list of grouped key-value pairs (e.g., name, title, and role) ...
3
votes
2
answers
2k
views
How to set fontsize of 14pt in article class [duplicate]
I would like to set the fontsize of 14pt in the article class. But, using What point (pt) font size are \Large etc.?, I obtain:
Questions:
I am assuming that the output means that the closest font ...
0
votes
1
answer
72
views
Customized class options doesn't work
I'm trying to declare a new option poly in my .cls file.
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{classname}
\ClassInfo{JH}{Copyright (c), 2022.}
%
\DeclareOption{poly}{%
\PassOptionsToClass{french,...
2
votes
1
answer
286
views
Openbib Class Option
I have been reading and reviewing class files as well as starting to read the Leslie Lamport's book on LaTeX. One thing I have noticed in multiple places (including the book) is an openbib option ...
0
votes
2
answers
277
views
How change paper size in ElegantBook class?
I would like to get paper size A6 (105mm x 148mm). I have used paper=a6paper in document class option, but it is not working. Any suggest is appreciated in advance.
MWE:
\documentclass[10pt,fancy,...
0
votes
2
answers
391
views
How to Declare Font Size Class Option
I am creating a class with options, and desire to be able to \DeclareOption with the font size...
For example it would be nice to be able to write in the .tex file
documentclass[12pt]{myclass}
And in ...
1
vote
1
answer
125
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 ...
1
vote
1
answer
70
views
Twocolumn mod option in a class doesn't work any more
I'm using a class containing
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{class_test}
\LoadClassWithOptions{scrbook}
\ClassInfo{class_test}{Copyright (c), 2021.}
%--------------
\usepackage{lipsum}
In the ...
3
votes
0
answers
115
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 ...
0
votes
0
answers
19
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}{
\...
2
votes
1
answer
118
views
Trouble getting A4 output from custom class
I am trying to get an A4 output from a document with a custom class (https://www.latextemplates.com/template/stylish-article). I tried
\documentclass[a4paper,fleqn,11pt]{SelfArx}
in the document file ...
1
vote
0
answers
72
views
How many of \documentclass exist? [duplicate]
Sorry for my trivial question but I am curious to know how many \documentclass exist. I use generally, article, standalone, book, report, beamer, but I see in many question also other \documentclass ...
1
vote
0
answers
98
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 ...
3
votes
1
answer
3k
views
Undefined control sequence. \set@color ...\@pdfcolorstack push{\current@color}\aftergroup \reset@color
I know, there is this question but my knowledge regarding .cls files when it comes to latex, is too little. I tried to do as the solution there says there but I don't use begincmd so I don't know how ...
2
votes
1
answer
711
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. ...
3
votes
0
answers
328
views
Problem with \ProcessOptions? [closed]
I recently bought a new laptop and installed latest complete MiKTeX and Texmaker, which is the editor I use on my other laptop. Compiling the same document on my new laptop doesn't give the same ...
0
votes
0
answers
318
views
Options passed to \documentclass not recognised
I am using latex to write my thesis and I am using a template with a modified class.
Since last Wednesday, the options that I declare at the top of the document in the \documentclass command are not ...
0
votes
0
answers
124
views
How to reset line spacing when needed and set it again
I am using a journal's class file and it has more than 1 line spacing for paragraphs. However, I would like to disable it when I put some pseudocode with algorithm package and then enable it again.
If ...
1
vote
2
answers
219
views
Clash with `english` option in custom class and `babel`
I am writing a class file which takes an option english and then loads the article class. The english option defined in the new class is not passed to article.
However, if then I load babel with ...
0
votes
0
answers
53
views
On the usage of global option "style=..."
I created a document class and it has a key-val option style=... for setting the visual style of it. Now I load my class as follows:
\documentclass[style=STYLE1]{MyClass}
And since this option is ...
2
votes
1
answer
89
views
Can one suspend a document class option for even/uneven pages?
As the flashcards documentclass allows use the option grid to make the grid of flashcards visible globally, i.e. on the frontside as well as the backside, I was wondering whether it is possible to ...
2
votes
1
answer
121
views
Class options don't work if class and document files are in different directories
I have the following directory tree:
.
├── foo
│ └── foo.tex
└── testcls
└── testcls.cls
where foo.tex is
\makeatletter
\def\input@path{{../testcls/}}
\makeatother
\documentclass[hyperref=true]...
1
vote
1
answer
207
views
Images are loaded in draft mode
I'm trying to load draft mode as an option for my class. Overfull lines are highlighted, but unfortunately images are loaded normally (not just as frame). Can someone please tell me why?
Class file:
\...