Questions tagged [kvoptions]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
7 views

How to access class boolean macro from main .tex document

I'm trying to access the boolean macro I defined with my class. Whenever I access the boolean within the class, it works fine. However, if try to access it from the main document (using the same code),...
lwashington27's user avatar
0 votes
0 answers
37 views

questions about \xpatchcmd, \ProcessKeysOptions in l3keys2e package, \ProcessKeysOptions in kvoptions package and \widowpenalties

i use nowidow package and \setnowidow, but some case it work not fine: for example, i hope paragraph can do page break at red place, but it doesn't. Then I test, if I change nowidow.sty, make \...
redmoon's user avatar
  • 91
1 vote
1 answer
32 views

Figure positioning when using kvoptions

I am currently writing my thesis and have to use a template which uses the kvoptions package. My problem is, that I use a figure (consisting of two subfigures), which is automatically placed at the ...
longroad's user avatar
1 vote
1 answer
59 views

String option value is empty

I have the following class \NeedsTeXFormat{LaTeX2e} \ProvidesClass{democlass}[2022/11/15] \RequirePackage{kvoptions} \DeclareStringOption[\the\year{}]{year} \ProcessOptions\relax \LoadClass{article} \...
Philipp Imhof's user avatar
1 vote
1 answer
80 views

Using utf8 characters in kvoptions

The problem is actually quite simple yet I haven't found a working solution. In the kvoptions package, you can define option keys for custom packages which take strings as a value, e.g. % `mysty.sty`, ...
Gargantuar's user avatar
1 vote
0 answers
206 views

How to reverse Latex 2021-06-01 Update? => kvoptions error

I am working with my university's template and everything was just working fine, till I updated all Packages in MiKTeX automatically. Just after this update I get this warning (I have never had this ...
Holle H's user avatar
  • 11
2 votes
0 answers
61 views

Forwarding a kvoption DefaultOption to a StringOption

I want to use kvoptions for a package, with a string option, and I want unknown options to be used as values for that string option. Like this: \ProvidesPackage{kvo}[2020/10/20 v 0.01 playing with ...
Vincent Beffara's user avatar
0 votes
1 answer
319 views

Usage of string value in kvoptions

I followed the sample of Heiko with very excellent explanation about his approach of my request. Since my main idea is to have as well a subtitle I'm little bit stuck why the ˋsubtitleˋ is not set - ...
LeO's user avatar
  • 1,363
1 vote
2 answers
376 views

Is this a correct way to handle Boolean options?

In trying to get a better understanding of kvoptions I have the following minimal example package and document. In the package, I construct a new macro command based on the logical states of three ...
LaTeXereXeTaL's user avatar
0 votes
2 answers
85 views

Weird 'ProvidesPackage' vs 'newenvironment' macro expansion

currently improving an existing package ('ditaa', based on ditaa0_9.jar) to add support for svg (implemented in ditaa-0.11.0-standalone.jar) yet I'm facing strange macro definition/expansion. ...
Kochise's user avatar
  • 155
0 votes
3 answers
225 views

kvoptions not working in a package setup command

I have a short demo using kvoptions to provide package options at load time. I wanted to experiment with a package setup command and found that removing the options from the \usepackage{kvtest} ...
LaTeXereXeTaL's user avatar
0 votes
0 answers
111 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 ...
Hyperplane's user avatar
1 vote
0 answers
119 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=...
avs's user avatar
  • 282
0 votes
0 answers
636 views

Package 'kvsetkeys' error Undefined key {family} [duplicate]

While compiling my document, I am getting the following error message. I updated my packages and especially, kvsetkeys and kvoptions packages. Kindly guide me how to fix this. \documentclass[12pt,...
Sachchidanand Prasad's user avatar
1 vote
0 answers
91 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=...
raedma's user avatar
  • 1,754
2 votes
2 answers
137 views

Package minted Warning: Unexpected value for option `chapter'(minted) is ignored on input line 77

I am importing minted like this: \documentclass[english,12pt,a4paper,twoside,chapter=TITLE,section=TITLE,]{abntex2} \usepackage[newfloat,chapter,outputdir=setup/cache]{minted} \begin{document} Hi. \...
user's user avatar
  • 4,675
2 votes
2 answers
73 views

Get an error, when passing bool variable in my own style file

I wrote a package to customize my footnotes. For now only one feature matters: I want to give a bool parameter to change the font of my footnotes. The style file looks like this: \NeedsTeXFormat{...
Pibe_chorro's user avatar
2 votes
1 answer
292 views

How negate value of Boolean option in package using kvoptions

In the package created by the following source, how can one change the value of \optB to true if \optA is true — so that the message written to the log would become >>> optB is true ...
murray's user avatar
  • 7,758
1 vote
2 answers
431 views

Passing boolean key value from one package to another with kvoptions

The source document below first writes two packages, each using keys and kvoptions; the first package passes a boolean option to the second and calls the second. Despite the preamble line \...
murray's user avatar
  • 7,758
2 votes
1 answer
453 views

Using key option to package that uses string cases

What's wrong with the following package and source file? I get an error at line 14, after [Other], of mypackage.sty, and a "Missing \begin{document}" error resulting. The source: \documentclass{...
murray's user avatar
  • 7,758
2 votes
1 answer
160 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....
vbwx's user avatar
  • 227
2 votes
1 answer
218 views

Query beamer document class option aspectratio in a .sty file [duplicate]

I am writing my own latex beamer style. I want to use different background graphics depending on the aspect ratio chosen in the documentclass in the main file, like \documentclass[12pt, aspectratio=...
Philippp's user avatar
  • 277
2 votes
1 answer
2k 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 ...
vbwx's user avatar
  • 227
1 vote
1 answer
179 views

How to test if a macro's value (set via kvoptions in a package) is empty or blank (e.g. using etoolbox)?

I have no idea, why this test fails and how to get it to work: \documentclass{article} \usepackage{filecontents} \begin{filecontents}{myTestSty.sty} \NeedsTeXFormat{LaTeX2e}[1994/06/01] \...
lAtExFaN's user avatar
  • 1,131
1 vote
1 answer
522 views

Conflicts with existing macro when using kvoptions: Undefined control sequence

I am trying to use kvoptions pacakage to allow passing key options to my style file. Here is a MWE of the style file: \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{test} \newcommand{\rtitle}{TITLE} \...
Norman's user avatar
  • 241
2 votes
1 answer
482 views

What’s the equivalence of \ExecuteOptions when kvoptions is used?

Consider the following short .sty package: %% This is file `mypackage.sty' \NeedsTeXFormat{LaTeX2e}[1997/06/01] \ProvidesPackage{mypackage} \DeclareOption{myoptionone}{Do something} \DeclareOption{...
Ruixi Zhang's user avatar
  • 9,483
3 votes
0 answers
430 views

Setting up kvoptions with a setup command [closed]

The hyperref package (for example) provides a \hypersetup command where key-value options can be provided as an alternative to \usepackage[key=value]{hyperref}. I'm trying to do the same, using ...
fionn's user avatar
  • 31
3 votes
3 answers
75 views

Passing macros as kvoptions to listing package commands does not work

I would like to save chosen listings style to a variable \mlstyle and use it later in some commands or definitions. However, while: \lstinputlisting[style=Matlab-editor]{a.mat} a version that I ...
Peter's user avatar
  • 998
3 votes
0 answers
142 views

Can pgfkeys be used to create nested key hierarchies

I currently have the following following setup (but with many more keys), which works, but isn't as clean as I'd like it. \pgfkeys { /title/.is family, /title, first/.estore in = \title@first, ...
quittle's user avatar
  • 131
1 vote
0 answers
1k views

Require Package Options

I would like to create a sty file that sources another custom sty file. I have all files in a directory /home/Desktop/Common/Latex/LatexSetup. I have tried the following code, which fails. \...
Jordan's user avatar
  • 87
1 vote
0 answers
180 views

How to choose the right options/key-value package? [closed]

I want to spruce up my department's thesis document class with better / less idiosyncratic class options support. So, I've noticed this community wiki question: A big list of every keyval package ......
einpoklum's user avatar
  • 12.2k
0 votes
0 answers
81 views

How can one use macros to define colors?

I want to write a package which may be loaded with key-value options that are meant to be used to define colors by means of the package xcolor. The package kvoptions is to be used to facilitate the ...
user24098's user avatar
  • 1,225
2 votes
1 answer
374 views

Verify that option was set

Based on this answer I'm able to verify that an option was set to specific values. But how do I verify that an option was set in case the actual value doesn't matter. I.e. how do I make sure an option ...
user avatar
2 votes
1 answer
114 views

Special characters in kvoptions (like \\)

I try to write a little package for my personal use. For this I use kvoptions. Now I have to give a string to one of the options which contains \\ but this fails with: undefined control sequence. \let ...
Skillmon's user avatar
  • 57.7k
1 vote
1 answer
74 views

Integrate package into main document

My document uses (via \usepackage) a non-standard local package, that I have written. The document has to be uploaded to a publisher, and apparently they do not offer a way to upload the package as ...
Lasse Kliemann's user avatar
3 votes
2 answers
1k views

Unused global options in custom class [duplicate]

Consider the following example class file \NeedsTeXFormat{LaTeX2e} \ProvidesClass{myclass} \RequirePackage{kvoptions} \DeclareBoolOption{foo} \ProcessKeyvalOptions* \ifmyclass@foo \def\@title{foo} ...
Philipp Imhof's user avatar
2 votes
2 answers
661 views

Can I use kvoptions - DeclareStringOption with Spanish characters?

I've just discovered kvoptions package to pass options to my sty file. I want to pass the title of the document but it contains Spanish characters (á,é,í,ó,ú) and it can't be rendered well. I use this ...
29antonioac's user avatar
4 votes
1 answer
211 views

Are dynamic defaults possible with kvoptions?

I'm writing a package with two options; one of the defaults should change, depending on the other option. Currently, the definitions are: \SetupKeyvalOptions{family=gitlog,prefix=gitLog@} \...
Brent.Longborough's user avatar
7 votes
2 answers
992 views

Evaluate strings of key-value option in custom package by using a switch-case environment

I'm trying to write a custom package MyUnicodefonts where I'd like to store all my font settings for various math fonts and roman fonts (later also mono and sans). In my document I intend to choose ...
Robert Seifert's user avatar
1 vote
1 answer
580 views

Spaces and commata in StringOptions (as possible in hyperref)

I want to write a little documentclass which can be used with options, e. g. \documentclass[title=a]{xyz} In order to do this, I wrote in the xyz.cls \RequirePackage{kvoptions} \SetupKeyvalOptions{ ...
FKranhold's user avatar
  • 381
0 votes
1 answer
209 views

Get the list of all options and parse them in a loop (kvoptions)

I'm writing a small package and am using kvoptions to parse key-val options passed to it as: \RequirePackage{kvoptions} \SetupKeyvalOptions{family=my,prefix=my@} \DeclareStringOption[bar]{foo} \...
Normadize's user avatar
  • 268
2 votes
1 answer
1k views

kvoptions is missing from texlive 2014

I upgraded from texlive 2007 to texlive 2014 on my Mac OS X. Now source files that previously compiled fine give the error messages below. I looked at the previous question suggesting to do "tlmgr ...
tmccormick4's user avatar
3 votes
1 answer
295 views

kvoptions declare local complementary options

Given the following declarations in a tst package using kvoptions \ProvidesPackage{tst} ... \DeclareBoolOption{abc} \DeclareComplementaryOption{cba}{abc} Which is the correct way of declaring both ...
Pieter Stroobants's user avatar
5 votes
1 answer
460 views

DeclareLocalOption of kvoptions does not work [closed]

Consider the following tst package: \NeedsTeXFormat{LaTeX2e}[2011/06/27] \ProvidesPackage{tst}[2014/12/01 v1.0 tst package] \RequirePackage{kvoptions} \RequirePackage{etoolbox} \SetupKeyvalOptions{%...
Pieter Stroobants's user avatar
5 votes
1 answer
187 views

Conflict between tkz-fct and thmtools?

I'm using TeXLive 2014. Here's a MWE: \documentclass{article} \usepackage{tkz-fct} % Must appear before {thmtools} \usepackage{thmtools} \declaretheorem{theorem} \begin{document} \begin{...
Dominique's user avatar
  • 1,369
2 votes
1 answer
2k views

Getting "Unknown option" error with \DeclareStringOption in custom package

I'm trying to write a package for personal use that takes custom arguments as follows: \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ZTPS}[2014/15/10 v1.0 Zach Taylor Problem Set] \RequirePackage[margin=...
Dumb Political Scientist's user avatar
2 votes
0 answers
560 views

Migrating from xkeyval to kvoptions: how to retrieve \define@choicekey? [closed]

I'm in the process of migrating a class I wrote from xkeyval to kvoptions, mainly because I'd like to provide class options whose values could be list of comma separated values: \documentclass[...
Denis Bitouzé's user avatar
4 votes
1 answer
621 views

Unrecognized key-values

I try to implement a personnal class using key-value options (I am a beginner in that field). For exemple, I would like to specify the language (for babel package) with an option "langue=xxx" with "...
Emmanuel G.'s user avatar
9 votes
1 answer
2k views

Appending options to hyperref

I am trying to append options to hyperref inside a package (say append.sty) I'm writing. More precisely, in the package I load the hyperref package and I tune it: \NeedsTeXFormat{LaTeX2e}[1994/06/01]...
Dror's user avatar
  • 22.4k
16 votes
1 answer
2k views

In \DeclareStringOption, what is the difference between <init> and <default>?

In the kvoptions package the following macro is defined: \DeclareStringOption [⟨init⟩] {⟨key⟩} [⟨default⟩] Following is the related documentation: A macro is created that remembers the value of ...
Dror's user avatar
  • 22.4k