TransWikia.com

Unused global options with custom class and kvoptions

TeX - LaTeX Asked by sqrtroot on June 29, 2021

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=report]. The code I’m using for my custom class in test.cls:

ProvidesClass{test}[test]
NeedsTeXFormat{LaTeX2e}
RequirePackage{kvoptions}
RequirePackage{iftex}

SetupKeyvalOptions{
family=bscls,
prefix=bscls@
}
DeclareStringOption[article]{baseclass}
ProcessKeyvalOptions{bscls}
newcommand{baseclass}{bscls@baseclass}

SetupKeyvalOptions{
family=test,
prefix=test@
}

DeclareDefaultOption{PassOptionsToClass{CurrentOption}{baseclass}}
ProcessKeyvalOptions{test}


wlog{baseclass}
LoadClass{baseclass}

endinput

If I add the stringoption just above the defaultoption like this:

DeclareStringOption[article]{baseclass}
DeclareDefaultOption{PassOptionsToClass{CurrentOption}{baseclass}}

The error goes away, but it doesn’t feel like the right solution.
Does anyone know how to get this working correctly without these kind of hacks?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP