Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [key-value]

{key-value} is about packages and macros using the key=value syntax for named parameters instead of numbered parameters.

5
votes
1answer
59 views

xkeyval — read keys from file

I want to read xkeyval options from an external file, like: \setkeys{my@keys}{\input{conf}} I tried several combinations of \edef and \expandafter, but to no avail. Any ideas? Best regards, ...
0
votes
0answers
8 views

Problem with passsing options through customized class interface \myclsset using pgfkeys

My intention is to create a class with a interface setup command \myclsset \documentclass{myclass} \myclsset{key1=val1, key2=val2, ..} % key-value list \begin{document} ... \end{document} where \...
1
vote
1answer
88 views

Keep a key locally passed from multicols to enumitem using xparse

I have a small problem when trying to keep a key=val locally defining using xparse to pass multicols to enumerate (enumitem package). I have redefined the environment enumerate to accept the columns=...
2
votes
0answers
23 views

Input Values To Produce changing Tikzpicture

I have a general question with a minimal example. Is it at all possible in Latex or Tikz to produce a field where an input value can be placed and once the enter key is pressed then a new output is ...
0
votes
0answers
22 views

keyval: pass unknown options to a command

Consider the following MWE: \documentclass[a4paper]{article} \usepackage{keyval} \makeatletter \define@key{my}{foo}[]{foo is enabled\par} \define@key{my}{bar}[0]{bar is set to #1\par} \makeatother \...
1
vote
1answer
46 views

Check if the macro expands to undefined

MWE: \documentclass{article} \usepackage{clefval} \begin{document} \TheKey{test}{zez} \def\mymacro{\TheValue{test}} \makeatletter \ifdefined\V@test \mymacro \else empty \fi \ifdefined\mymacro \...
2
votes
1answer
37 views

Create checklist with pgfkeys -> multiple /.is if needed

I want to create a checklist with "static" content, but with every instance of this list I want to be able to check or uncheck some items of the list. As I want to learn PGFKeys, I tried to do it ...
0
votes
0answers
28 views

Expandable Keyval package

This is a follow up on this question. Like the other user, I am trying to execute a \multicolumn on some conditions and I would like to implement a keyval interface for this. However, it doesn't work ...
4
votes
1answer
104 views

xkeyval `boolkey` setting is persistent across macro calls: scope leak?

I thought that keyval arguments to macros were supposed to be confined in their macro scope, but the following code: \documentclass{report} \usepackage{xkeyval} % Define a custom command option ...
2
votes
3answers
58 views

Custom command with addressable arguments

I know about \newcommand[<arg_num>]{#1 ... #n} to define a simple macro with up to nine arguments. (More if you link multiple newcommands together) I recently started to look at xparse for ...
3
votes
0answers
172 views

Using the bibtex format (with JabRef) as a non-bib key-value database in LaTeX

This might sound a bit odd: I am using JabRef for maintaining a database which does not content bibliographical data in the first place: @Person{caesar, date = {100-44BC}, comment =...
0
votes
0answers
31 views

Accessing list of key-value lists as macro argument

I'm looking to create a macro that takes a list of key-value lists as an argument. I don't know the right data structure that can be used for this kind of situation in LaTeX and also didn't find it ...
1
vote
0answers
34 views

Right expl3 data type and method to store and pass key-value style options to a LaTeX2e macro? [duplicate]

How can I store comma separated options in an expl3 data type and then pass those options to a LaTeX2e macro? Something like this (doesn't have to be a clist—I'm not sure what is the best data type ...
0
votes
1answer
69 views

Error with seting keyval default values with def

First of all, sorry for my english level. I'm trying to do a personalized command with key value parameters through keyval package. It's my first attempt and probably can be better forms to do it. I ...
4
votes
1answer
523 views

key-value syntax in package options

I want to create a style file capturing my layout for theorem environments. In particular, I would like to pass an option to the package specifying the level of the theorem counter. So here is a ...
2
votes
1answer
69 views

Help needed for setting key-val options for my package

I want to use key-svalue options for my package and I tried a solution with pgfopts. It must be possible 1) to load the package with e.g. \usepackage[colors=1]{mypack} 2) to change the color ...
0
votes
2answers
95 views

How correctly pass to a command a tuple of parameters parsed from an arbitrarily long list?

Following my previous question, I am continuing the design of a complex image embedding command and I have still problems in managing joint groups of parameters I need to pass to other commands in ...
1
vote
1answer
226 views

Set a value for \letterspace feature of fontspec package

I have found that with XeTeX and fontspec package using the following value {\addfontfeature{LetterSpace=15em plus.1em minus.1em} instead of e.g. {\addfontfeature{LetterSpace=15} it gives good ...
0
votes
1answer
61 views

Optional key values in environments

The MWE below produces the following picture: I would like to have the tabs and spacing parameters to be declared as optional key values so that the syntax looks like: \begin{tabbedenum}[tabs=2, ...
1
vote
2answers
108 views

Fixing a keyval problem

This is my first attempt at a keyval macro. I have a more complicated macro that boils down to the MWE given below. The idea is to typeset a paragraph in multiple columns where the number of columns ...
1
vote
0answers
119 views

arXiv, keyval and family_i [duplicate]

I'm trying to upload a long article with many macro files to arXiv, and I'm ending up with the following error: ! Package keyval Error: family_i undefined. It seems that something is wrong with my *....
1
vote
0answers
82 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 ......
2
votes
1answer
218 views

when loading a new database in datatool only the first key works

I try to load a .csv into my .tex using datatool, but it uses only the first given key and I just don't get why. first lines of my example foobar.csv: 1;a;ax 2;b;be 2;c;ck 3;d;do (at the end the ...
15
votes
1answer
752 views

What's the correct way to define package options in expl3?

For writing a package it's usually important to be able to define package options. Since the package I'm writing is in expl3 I wondered whether there's a l3ish way of defining key-value-package-...
16
votes
6answers
415 views

How to create and manage hierarchically dependent PGF keys?

Disclaimer: I have decided to award a bounty on this question, because the solution suggested by Christian Hupfer works but is not fully satisfactory. In doing so, I rephrased this question so that ...
4
votes
2answers
107 views

how to expand a keyval argument

I'm trying to expand a value for an argument which will be the range of pages included in the document, but I can't figure out how to do that. At first, I was getting ERROR: Missing = inserted ...
4
votes
2answers
232 views

Numerical variables to use as a scale parameter in figures

I have a text with several figures, and I want to change their size in order to see the effect (position, for example) in the text. To define its size, I am using the scale parameter in the \...
6
votes
1answer
115 views

How can I save key-value options which include key-value options in expl3?

I have a command which uses a key-value syntax. For example, it includes an image with various options, if desired. I am using expl3 key-value processing. I would like to save the key-value ...
4
votes
3answers
180 views

How do I extraxt a value from a “key1=value1,key2=value2” list?

I have a comma-separated list of key=value strings. I want to extract the value based on the key. Something a bit like \LookUpValue{c}{a=foo,b=bar,c=baz,d=zyyzx}{error:notfound} The intention is ...
4
votes
1answer
83 views

Pass variable as a parameter in \newgeometry

I have defined the following variable storing my margin settings: \def \geometryTitlepage { left=25mm, right=25mm, top=25mm, bottom=25mm } Then in the titlepage I want to set \...
3
votes
1answer
486 views

Passing arguments to includegraphics

I have a multi-page PDF document, which must be 'cut up' and spread across pages. To this end, I would like to have a command defined, something like \newcommand{\flub}[2]{\includegraphics[page=#1,...
1
vote
0answers
58 views

Modify `\funcdef` macro to use `pgfkeys` instead of `keyval`

I attempted to modify the \funcdef macro from egreg's solution from A macro adding or removing parenthesis automatically to use pgfkeys, but am running into some difficulty (probably related to some ...
6
votes
0answers
6k views

Package keyval error when compiling bibliography (Package keyval Error: given_i undefined. \printbibliography[heading=bibintoc]) [closed]

I'm quite new to LaTeX. I had MiKTeX 2.9.5987 and I use TeXstudio as editor to write a thesis. I had no errors in my .tex file for long, but due to missing/messing graphicx package (I wanted figures ...
3
votes
1answer
83 views

Using siunitx S columns with keyval macro-expanded entries

I have the following table that compiles with regular 'c' columns, but doesn't work with an S-column. Is there a way to format the following table using alignment features in the siunitx package? ...
7
votes
3answers
231 views

pgfkeys “.estore in” handler does not work as expected

In the process to migrate from (x)keyval to pgfkeys, I realized that .estore in was not expanding my command properly. Here is my minimal working example: \documentclass{report} \usepackage{pgfkeys}...
6
votes
1answer
60 views

How can I pass a list of values generated in expl3 as a single value for a key to a macro such as \includepdf?

This should probably be obvious but it is not. Or not to me right now, anyway. I want to generate a list of values (e.g. page numbers and empty values) and then pass that list as a value of a key (e....
5
votes
1answer
146 views

\begingroup\def trick vs. macro delimiters vs. conditionals

In this MWE, combining newtxtext and microtype leads to a compilation error (Extra \else). This particular example is inspired by the svjour3 document class, but I reduced it to the article class and ...
3
votes
1answer
94 views

Ignore undefined key in argument (it's defined in the macro before it's used)

How can I make this macro initially ignore the undefined key fn-special-text in the second argument? It is defined within the macro (because the name is generated from the text of the first argument; ...
0
votes
2answers
152 views

Automatically generate new commands and keyval definitions

I would like to automatically define new commands and keyval definitions anytime that a command beginning with the prefix \fn is used within a string. Part I below is the stub that needs to be ...
1
vote
2answers
90 views

Pass a list to a keycommand or keyenvironment

I want to define command or environment using the keycommand package and pass a list to one key. In my case this would be a list of images. To be more explicit: How can I make the following ...
8
votes
2answers
295 views

How can I define a key-value command like \hypersetup?

I am quite familiar with switch (\if...\else...\fi) now and read many questions on key-value topic, but I cannot find an example to create the options listing command like \hypersetup, to make \...
3
votes
1answer
361 views

Best Key-Value System For LaTeX

I want to make new macros that support key=value style. But, there are many such packages for doing this. What is the best choice, given these priorities: Highly developed, complete, or actively ...
4
votes
1answer
99 views

Filling matrix rows with a user defined key-value macro

I'm trying to create tables with many columns and many empty fields. I'd like to reference the fields later as TikZ nodes to add more TikZ stuff around them, so \matrix{} looked like a good idea. I ...
2
votes
1answer
211 views

Get key value of command

i'm beginner in Tex and i have tex file \documentclass{article} \addtolength{\jot}{1em} \begin{document} \begin{verbatim} \end{verbatim} \begin{chestnutStem} In the following figure, if the ...
2
votes
0answers
306 views

Reason not to use a specific key val package [closed]

According to the very nice list of packages concerning this topic (A big list of every keyval package) I am confused which package I should use now to be prepared for the future. Any ideas which ...
10
votes
1answer
147 views

Does expl3 key-setting syntax have an equivalent of TikZ/PGF's .cd?

This question has the following form: 'I know how to do X using Y. I can also do X using Z but not so elegantly as using Y. Can I do X using Z in the same way that I can do X using Y, for a more ...
7
votes
1answer
64 views

How to convert the method to a key-value version?

I have been told a number of times now, that I should consider implementing a key-value version of my method \createPerson. I wan't to do this, but my problem is that I don't know how to go on with it....
4
votes
0answers
64 views

Is it possible to label (tag) a value of a (l3keys) key-value in order to reuse it elsewhere easily?

I have a command (\people[⟨options⟩]{⟨name⟩}) for entering people. Its optional argument lets the user specify possible people's (possibly multiple) attribute(s) with a (l3keys) key–value system: ...
10
votes
2answers
374 views

Misunderstanding from l3keys documentation

Based on the interface3 documentation and a nice article in TUGboat, Volume 31 (2010), No. 1 called Programming key–value in expl3 by Joseph Wright, I have been trying to put together a MWE that will ...
4
votes
0answers
146 views

How can I reliably and consistently save PGF keys filtered by path to a macro for later use?

I am trying to use PGF keys in TikZ with a relatively complex key tree. (Complex by my standards, that is - I'm sure it isn't that complicated in the scheme of things.) What I hoped to do is to ...