Questions tagged [key-value]

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

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

arXiv upload issue: Emergency stop [duplicate]

I see that there are a ton of posts related to this topic but none seem to address the issue I'm having. Apologies if I overlooked the post I should be looking at. As the title says, I'm uploading a ...
1
vote
1answer
29 views

footnotedistance key undefined error in mdframed

My preamble is as follows: \documentclass{book} \usepackage{xcolor} \usepackage[framemethod=default]{mdframed} \usepackage{lipsum} \newmdenv[skipabove=7pt, skipbelow=7pt, rightline=false, leftline=...
4
votes
2answers
162 views

How to define key values for a newcommand function?

I have many functions like this MWE, and I want to define keys for the inputs of the functions; however I did not succeed to do so. \documentclass{standalone} \usepackage{tikz} \newcommand{\...
0
votes
1answer
42 views

Error loading an image named by a ltxkey

I am new to TeX and LaTeX and my first project is a very ambitious one. The plan is to use ltxkeys to define database entries for the D&D Role Playing game, and then have LaTeX templates to pretty-...
3
votes
2answers
236 views

Automatically shake questions and answers for a test created with LaTeX after the compilation

We suppose that we have 30 question to solve a text for students instead of 2 as this MWE: \documentclass[leqno,11pt,landscape,a3paper]{extarticle} \usepackage{multicol,mathtools} \usepackage[T1]{...
1
vote
0answers
106 views

Beamer frame option to change background and font that works with labels

I'd like to define a frame option in Beamer to "invert" the colors of background, foreground, and structure, and I can do so by defining \documentclass{beamer} \BeforeBeginEnvironment{frame}{% \...
1
vote
0answers
57 views

How to create a command that creates commands?

I recently learned how to make key=value commands with the pgfkeys package. I'm currently trying to define a command, let's call it \commander, with key=value options that can define new commands also ...
2
votes
1answer
50 views

Passing options from a newcommand to a another command (\includegraphics)

I'm making a command called \seal that uses the \includegraphics function. The command \seal has some key=value options of its own (color, beamer, trimz) and it must accept all options of \...
0
votes
2answers
294 views

Package keyval Error: letter undefined

I have no idea what's causing this, I have about 1800 lines of code, and no idea where the problem is. Could someone explain what the keyval package is, and what this error could possibly mean?
2
votes
1answer
62 views

Processing key/value options with many non-predefined keys

Say I want to define a command \defineaspect that takes a key/value option list to associate values with keys that are not known in advance. For example, to associate certain aspects with a list of ...
0
votes
0answers
39 views

How are pgf-keys stored and is it possible to print a list of them

I was wondering how pgf-keys are handled internally. For example: If I define: \pgfkeys{/A/.code={My Key}} and I call the key with Hello this is \pgfkeys{/A}. How does the \pgfkeys-command expand? ...
3
votes
2answers
110 views

keyval - function for keyB should act dependent on value of keyA - how to do this?

I'm new to LaTeX. I learn and I use article class. I struggle learning working with keyval package: I try to write macro \macro which only uses one mandatory argument where user can provide key value ...
0
votes
0answers
25 views

Setting defaults with keyval-interface - do it in the current scope or do it globally?

Assume a LaTeX 2e-macro, be it named \foo, which processes the content of one optional argument via keyval-syntax. E.g., \foo[key1=value1, key2=value2,...,\keyN=valueN] I would also like to have a ...
3
votes
2answers
108 views

Set command option with document wide newcommand

I work a lot with the siunitx package and I've got many numbers with a high decimal precision. Now I'd like to be able to just copy these numbers in full precision in the relevant positions in text, ...
5
votes
1answer
79 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
1answer
33 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
110 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
27 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
52 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
65 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
47 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 ...
4
votes
1answer
125 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
74 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
239 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 =...
1
vote
0answers
38 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
99 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 ...
5
votes
1answer
809 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
87 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
115 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
317 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
65 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
200 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 ...
2
votes
0answers
188 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
94 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
325 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
1k 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
502 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 ...
3
votes
2answers
152 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
361 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 \...
5
votes
1answer
132 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
287 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
103 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
653 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
67 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
90 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
256 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}...
5
votes
1answer
63 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
201 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
123 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; ...