Questions tagged [kvoptions]

The tag has no usage guidance.

2
votes
1answer
37 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{...
2
votes
1answer
59 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....
1
vote
1answer
26 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=...
1
vote
1answer
181 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 ...
1
vote
1answer
38 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] \...
0
votes
1answer
182 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} \...
2
votes
1answer
114 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{...
2
votes
0answers
120 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 ...
3
votes
3answers
43 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 ...
2
votes
0answers
55 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,...
0
votes
0answers
267 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. \...
1
vote
0answers
84 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 ......
0
votes
0answers
59 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 ...
1
vote
1answer
119 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 ...
2
votes
1answer
64 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 ...
1
vote
1answer
60 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 ...
2
votes
2answers
609 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} ...
2
votes
2answers
337 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 ...
4
votes
1answer
127 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@} \...
5
votes
2answers
520 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 ...
0
votes
0answers
138 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{ ...
0
votes
1answer
100 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} \...
2
votes
1answer
316 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 ...
3
votes
1answer
208 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 ...
5
votes
1answer
275 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{%...
4
votes
1answer
113 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{...
1
vote
1answer
744 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=...
1
vote
0answers
295 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[...
4
votes
1answer
385 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 "...
7
votes
1answer
728 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]...
11
votes
1answer
1k 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 ...
2
votes
1answer
546 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. ...
7
votes
2answers
700 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 ...
3
votes
1answer
250 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. ...
6
votes
1answer
622 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} \...
3
votes
1answer
2k views

beamerposter passing portrait options to custom theme

Hi I'm preparing a custom theme for beamerposter to align with the theme of my institution. I have to include a figure banner on the headline plus the possibility to include 2 different logos. So far ...
10
votes
2answers
5k views

ProcessOptions and ProcessKeyvalOptions

\ProcessOptions and \ProcessKeyvalOptions Which comes first? Does it matter? \ProcessOptions\relax or \ProcessOptions* What's the difference? Apparently for keyval there is only the starred version....
7
votes
1answer
1k views

Argument of setkeys

My motivation bases on the package listings (also my package mdframed). The package allows to define a style via \lstset{foo}{options}. Now I want to create a macro to expand the style foo. For ...
10
votes
2answers
2k views

Pass keyval string option to babel

How to pass a keyval string option given to my package to babel? I load my package with \usepackage[languages={ngerman,english}]{mylang} In package mylang I want to handle this optional languages ...
6
votes
1answer
502 views

Why am I processing a comma-separated list incorrectly when using etoolbox and kvoptions?

I'm trying to pick something out of a list that has been passed from some package options by kvoptions, but docsvlist doesn't appear to be recognising the commas. I suspect this may be something to ...