Questions tagged [kvoptions]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
60 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`, ...
user avatar
1 vote
0 answers
114 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 ...
user avatar
  • 11
2 votes
0 answers
36 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 ...
user avatar
0 votes
1 answer
102 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 - ...
user avatar
  • 1,225
1 vote
2 answers
202 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 ...
user avatar
0 votes
2 answers
77 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. ...
user avatar
  • 155
0 votes
3 answers
150 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} ...
user avatar
0 votes
0 answers
67 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
91 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
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,...
user avatar
1 vote
0 answers
55 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
2 votes
2 answers
96 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 avatar
  • 4,375
2 votes
2 answers
61 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{...
user avatar
1 vote
1 answer
214 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 ...
user avatar
  • 6,661
0 votes
2 answers
303 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 \...
user avatar
  • 6,661
2 votes
1 answer
283 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{...
user avatar
  • 6,661
2 votes
1 answer
151 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....
user avatar
  • 227
1 vote
1 answer
166 views

Query beamer document class option aspectratio in a .sty file

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=...
user avatar
  • 257
2 votes
1 answer
1k 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 ...
user avatar
  • 227
1 vote
1 answer
119 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] \...
user avatar
  • 1,109
1 vote
1 answer
472 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} \...
user avatar
  • 199
2 votes
1 answer
400 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{...
user avatar
  • 9,278
3 votes
0 answers
374 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 ...
user avatar
  • 31
3 votes
3 answers
67 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 ...
user avatar
  • 988
3 votes
0 answers
112 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, ...
user avatar
  • 131
1 vote
0 answers
944 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. \...
user avatar
  • 97
1 vote
0 answers
155 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 ......
user avatar
  • 11.6k
0 votes
0 answers
72 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 ...
user avatar
  • 1,135
2 votes
1 answer
311 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
99 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 ...
user avatar
  • 49.2k
1 vote
1 answer
72 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 ...
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} ...
user avatar
2 votes
2 answers
579 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 ...
user avatar
4 votes
1 answer
175 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@} \...
user avatar
7 votes
2 answers
860 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 ...
user avatar
1 vote
1 answer
453 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{ ...
user avatar
  • 369
0 votes
1 answer
139 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} \...
user avatar
  • 238
2 votes
1 answer
965 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 ...
user avatar
3 votes
1 answer
265 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 ...
user avatar
5 votes
1 answer
443 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{%...
user avatar
5 votes
1 answer
165 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{...
user avatar
  • 1,349
1 vote
1 answer
1k 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=...
user avatar
2 votes
0 answers
495 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[...
user avatar
4 votes
1 answer
583 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 "...
user avatar
9 votes
1 answer
1k 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]...
user avatar
  • 21.7k
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 ...
user avatar
  • 21.7k
2 votes
1 answer
1k views

kvoptions and conditional environment

I'm trying to create a package with a single option, which provides an environment, which behaves differently if called by latex or pdflatex XeLaTeX. I tried to use kvoptions, but I'm a little lost. ...
user avatar
7 votes
2 answers
1k views

Using option for sty file

I would like to create and option (namely grid) to my sty file to produce a grid covering the whole page. I had success using \newif\if@sigur@grid \DeclareOption{grid}{\@sigur@gridtrue} and using ...
user avatar
  • 36k
3 votes
1 answer
295 views

How do I prevent the beamer class from removing my global options

I'm currently writing a latex package (or actually a beamer theme, but apparently that makes no difference) and I want to be able to specify a few things using key-value pairs in the global options. ...
user avatar
  • 324
7 votes
1 answer
761 views

Mark key-value class options as used

I have written a wrapper for the scrartcl class in the following way: \NeedsTeXFormat{LaTeX2e} \ProvidesClass{mycls}[2012/08/23] \RequirePackage{kvoptions} \DeclareStringOption{title} \...
user avatar
  • 6,078