Questions tagged [class-options]

Concerning options that can be passed to document classes.

Filter by
Sorted by
Tagged with
1 vote
1 answer
29 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) ...
user avatar
0 votes
1 answer
72 views
+50

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*{\...
user avatar
1 vote
1 answer
41 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 \...
user avatar
5 votes
1 answer
61 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{...
user avatar
  • 343
0 votes
0 answers
17 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: \...
user avatar
  • 1,373
1 vote
1 answer
39 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) ...
user avatar
1 vote
2 answers
153 views

How to set fontsize of 14pt in article class

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 ...
user avatar
0 votes
1 answer
43 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,...
user avatar
  • 693
1 vote
0 answers
50 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 ...
user avatar
  • 411
0 votes
2 answers
92 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,...
user avatar
  • 87
0 votes
0 answers
20 views

Custom class makes hyperlink boxes re-appear

When creating a custom class, hyperlink boxes appear. main.tex %\documentclass[hidelinks]{scrartcl} %%% link box hidden, good \documentclass{myclass} %%% link box appears, bad!!! \...
user avatar
0 votes
2 answers
108 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 ...
user avatar
  • 11
0 votes
1 answer
43 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 ...
user avatar
  • 4,515
0 votes
1 answer
54 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 ...
user avatar
  • 693
3 votes
0 answers
52 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 ...
user avatar
  • 615
0 votes
0 answers
17 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}{ \...
user avatar
  • 11k
2 votes
1 answer
50 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 ...
user avatar
1 vote
0 answers
58 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 ...
user avatar
  • 46.1k
1 vote
0 answers
47 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 ...
user avatar
  • 2,668
1 vote
1 answer
1k 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 ...
user avatar
  • 29
1 vote
1 answer
180 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. ...
user avatar
  • 2,668
3 votes
0 answers
171 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 ...
user avatar
  • 31
0 votes
0 answers
140 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 ...
user avatar
0 votes
0 answers
38 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 ...
user avatar
  • 301
1 vote
2 answers
75 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 ...
user avatar
  • 687
0 votes
0 answers
36 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 ...
user avatar
  • 4,515
2 votes
1 answer
82 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 ...
user avatar
2 votes
1 answer
99 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]...
user avatar
  • 1,994
1 vote
1 answer
59 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: \...
user avatar
  • 57
0 votes
0 answers
60 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 ...
user avatar
1 vote
0 answers
49 views

Add geometry options in class result an "Unused global option(s)" warning

This small example cause a warning Unused global option(s):[showframe] although the option is passed to geometry package \documentclass[showframe]{article} \usepackage{geometry} \begin{document} ...
user avatar
  • 16k
1 vote
1 answer
56 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, ...
user avatar
  • 16k
1 vote
0 answers
84 views

Font selection using key=val in custom article class

I am writing a simple class based on article that loads some commonly used packages and sets some defaults. The document font should be a key=value option \documentclass{myarticle}. For example, font=...
user avatar
  • 252
1 vote
3 answers
124 views

Command to return both font size class and font size in pt

I am looking for a command to return both the font size class and the font size in pt. The following approach from @Alan Munn as per this SE post prints font-size values for all standard classes: \...
user avatar
  • 113
1 vote
0 answers
39 views

When is the onecolumn document class option explicitly required?

Is there any situation while writing LaTeX documents where we need to explicitly specify the oneside document class option? For example, the oneside option in the following code is redundant because ...
user avatar
  • 2,887
0 votes
1 answer
53 views

Minimal example document to demonstrate the usefulness of notitlepage option

I am trying to make an example document that would demonstrate the usefulness of notitlepage option to beginners of LaTeX. Here is an example document: \documentclass[notitlepage]{report} \author{Lone ...
user avatar
  • 2,887
0 votes
2 answers
41 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} \...
user avatar
1 vote
0 answers
75 views

How to escape underscore in class options?

I have written a class for formatting reports. The class, Demo.cls, processes some options. Among them is a short title that is displayed at the top of every page using \fancyhdr. Short titles ...
user avatar
  • 111
1 vote
1 answer
254 views

general options for graphix overriding every includegraphics settings

I have multimarkdown text compiled from an external source and which is including its own settings for each figure compiled. I would like to have a general settings at the beginning of the document ...
user avatar
  • 113
1 vote
1 answer
265 views

Passing options to a class and evaluate using latex3 interfaces

I am trying to rewrite my custom class using a cleaner interface. In other posts it was suggested to use the functionality provided around the latex3 project. Comprehensive overview in The LATEX3 ...
user avatar
0 votes
0 answers
60 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 ...
user avatar
0 votes
1 answer
563 views

Pass beamer class options to beamer theme

How do I pass the document class options to a beamer theme? I am writing a beamer theme. I would like to use the beamer class option aspectratio to have individual layout settings for the 43 and 169 ...
user avatar
  • 1,742
0 votes
1 answer
75 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 ...
user avatar
0 votes
0 answers
27 views

Can a document class be installed locally inside a file?

I have 2 documents each in a different document class. Can I somehow add one file to the other preserving the formatting? Is there a way to locally install inside one of the documents the .cls and ...
user avatar
1 vote
0 answers
52 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=...
user avatar
  • 1,714
0 votes
1 answer
143 views

How to generate an outline for a document?

I am writing a debate case class in latex and I have environments set up so the user can easily declare a contention and subpoint. For example, if the user had: Contention 1: My solution is better ...
user avatar
2 votes
1 answer
48 views

Default font sizes do not work with new paper size option

I wonder why the default font sizes won't work in the following modified class file. \RequirePackage{filecontents} \begin{filecontents}{example.cls} \ProvidesClass{example} \NeedsTeXFormat{LaTeX2e}[...
user avatar
  • 16.6k
1 vote
0 answers
90 views

How to pass options from beamertheme to beamer class?

How to pass options from custom beamertheme to beamer class (and already loaded packages)? slides.tex: \documentclass[ %xcolor=table, % this option should be set in the theme! 17pt, % you can ...
user avatar
  • 1,415
0 votes
2 answers
173 views

How scale a mathrel to match current context's font size?

Revised question: I'm using TikZ to re-design \rightarrow for the Lucida Bright fonts, to better match tikzcd arrows. How do I scale that mathrel for script- and scriptscript-styles (as well as have ...
user avatar
  • 6,372
1 vote
1 answer
80 views

Conditionally set bibliography title

I am writing a class and would like to offer the option of changing the bibliography title as a class option. If no title was given I would like to just use the default one. Unfortunately I can't seem ...
user avatar