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

learn more… | top users | synonyms

2
votes
1answer
62 views

Can a command be defined to have key=value in it?

I am learning about making LaTeX commands. I thought that they were just macro, and the command is replaced literally by its definition. But the following example does not work and I wanted to ask if ...
5
votes
2answers
45 views

How can you force keys to display in a certain order?

I am building a catalog of items and would like to ensure that my fields always display in a certain order (for the sakes of argument lets us say in the order "Intentory Number, Weight, Diameter" even ...
3
votes
1answer
60 views

How do I remove keyval options from a template class?

I want to create a template class based on scrreprt.cls but with fewer options. Specifically, I need to restrict the font size to 11pt or 12pt (while still passing other options on to scrreprt.cls in ...
3
votes
2answers
67 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
20 views

Add key of enumerate (already defined by enumerate) in a new list

This is a follow-up question to Enumitem \SetEnumitemKey and conflict between multiple key before and after. Here is the code to set two keys, for a list named answers, without conflict (as it was ...
1
vote
0answers
23 views

Using key value in enumerate to another key value

This is a follow-up question to Enumitem \SetEnumitemKey and conflict between multiple key before and after. I want to use a key value in a list in the definition of another. Here I use a better ...
2
votes
1answer
41 views

Enumitem \SetEnumitemKey and conflict between multiple key before and after

I try to make life easier by setting key to list with the package enumitem. But, the options before and after seem to be in conflict when used more than once. Here is some code that show four ...
0
votes
0answers
35 views

Number format as optional key value argument for LaTeX function

I followed the answer as given in http://tex.stackexchange.com/a/34318/28093 in constructing a function which uses key values. It works fine, but I also want to be able to give the number format as ...
3
votes
1answer
41 views

How to configure complex options for graphics groups in LyX

I have a document with several images from a few different sources. I'd like to indicate different formatting options for each source. I understand I can use graphics groups for this, but I don't know ...
5
votes
1answer
63 views

Key names of the axis limits when not set explicitly

In the minimum working example below I use the keys xmin, xmax, ymin and ymax for calculations of coordinates for annotations. However, this only works when the axis limits are set explicitly in the ...
3
votes
1answer
35 views

Adding extra conditional to a sidenote command

Below is an adapted part of the code from the sidenotes package, which I intend to include in my class file. I'm trying to extend it with an optional argument [flip], with usage \sidenote[flip]{Text} ...
2
votes
1answer
81 views

How to get line width and inner sep values?

I try to get the values of line widths and node inner sep. How to read such a value form own style (if it will be specified during modifications of the picture) or if it is not specified in this ...
2
votes
1answer
20 views

Documentation for \newadjustboxkey

The documentation for package adjustbox has a brief section describing \newadjustboxkey, but it provides no examples. I tried searching the internet, but Google provided only three results for the ...
6
votes
1answer
78 views

Define \keys_filter:nnnN without modifying core functions

I would like to define a function \keys_filter:nnnN which would do the very same thing as \keys_set_filter:nnnN but without the setting. I realized that the setting is realized by a core function ...
1
vote
1answer
49 views

Short running title using xkeyval option

I will try to set the short running title using xkeyval package. But I don't how to execute this coding using the xkeyval option \title[shorttitle={Cross-linked aromatic polymers}]{Stabilized ...
6
votes
2answers
203 views

How to define macros in order to reuse key-value parameters?

I use the listings package to typeset code in my document. I have defined a new environment via \lstnewenvironment in which I use \lstset to set a large number of options through a list of key-values. ...
5
votes
2answers
92 views

A key-value side effect

In one of my macros, I wanted to set some width to either two-column or single column width. In other macros I do use key width, so I wanted to store the requested width in that key. So my first ...
4
votes
1answer
32 views

When are {} needed to surround a string in a keyval pair

I am using the package kvoptions and declaring various stringoption's. When do you need to embrace a string value when calling your package/class? E.g. In mypackage: ...
3
votes
3answers
69 views

Integer padding with something other than a zero

Consider the following example: \documentclass{article} \usepackage{siunitx,collcell} \sisetup{minimum-integer-digits=4} \begin{document} \begin{tabular}{S} {Header} \\ 1234 \\ 234 \\ 34 \\ 4 ...
7
votes
3answers
103 views

Defining default arguments for a macro?

Quick question, is there a way to define default arguments for a macro? For example, I have a page filled with these: \TextField[width=2cm,height=10pt,bordercolor=stuff]{Question 1} ...
3
votes
0answers
108 views

Beamer frame: add user options

I would like to add 2 more user options to \frame command. However, when calling \frame with both parameters at the same time in a specific order (the one with implicit value first), it generates an ...
1
vote
1answer
415 views

Unable to install keyval.sty

I have a minimal TeX Live installation in ~/texlive/2014. I was trying to install keyval.sty using tlmgr. So, I tried, tlmgr install keyval But it gives an error: tlmgr: package repository ...
1
vote
2answers
162 views

refstepcounter in tcolorbox option

I want to increment a counter and update the current label in the phantom key of the tcolorbox environment, but it is not working, as can be seen in the example below: \documentclass{article} ...
6
votes
1answer
78 views

How to pass figure position to keyval macro?

I want to wrap a macro around figure-env to make my document more readable. Here is minimal example of how it is now: \documentclass[10pt,a4paper]{article} \usepackage{keyval} \makeatletter ...
4
votes
1answer
62 views

pgfkeys computed (i.e., dynamically defined) key

I would like to perform some simple simulation in latex/tikz (in order to produce dynamical graphs). Say something like cellular automata, Ising model, etc. I need to store somewhere the value of ...
0
votes
0answers
57 views

Prepend and append options to options list in environment

I need to define a macro superenv that expands to the usage of an environment which accepts key-value options. superenv should have three arguments: the environment name, the list of options, and the ...
2
votes
0answers
45 views

Filtering key-value options

I want to define a new environment whose implementation depends on another environment. The first environment should accept a list of key-value options. Some of these options are for use only on this ...
3
votes
1answer
66 views

Accessing sub/keys with l3keys

I'm not sure if I'm taking it too far, but I think I've seen something like this around. This gives an error: \documentclass{scrartcl} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand \RULE {} ...
3
votes
1answer
73 views

How to add another optional option to the “printglossary” command?

I'm using the glossaries package to introduce my terms in my book. Now I want to add another option to the printglossary command named "column" as below: ‎‎‎\printglossary[‎‎column=X]‎% which X is ...
7
votes
1answer
294 views

Reading - and effect - of (default) tikz/pgf keys?

Consider the following MWE: \documentclass[varwidth,tightpage,border=1bp]{standalone} \usepackage{tikz} \pagecolor{yellow!15} % ignored with preview, but not w/ varwidth \begin{document} ...
2
votes
1answer
640 views

Backward compatibility of Beamer problem - Keyval error

I'm stuck with a problem for compiling a "not so old" beamer document I've made last year, and it seems that there is a big problem of backward compatibility between my new version of beamer (3.33) ...
5
votes
2answers
186 views

How can I force lstlisting to expand an argument?

I'm trying to use the listings package with a variable language (it's actually for a package). However, I can't seem to pass a macro as the value half of a key-value pair. Here's a simple example: ...
1
vote
2answers
1k views

Package keyval Error: sorting undefined

Even at the risk of being this question closed as too localized or a duplicate of this, I feel that it is relevant for people like me, using XeLatex and Biber for the first time... I am using Adrien ...
5
votes
3answers
305 views

\newcommand for tabular entries using keyval

I am trying to define a command for tabular entries using keyval. \documentclass{article} \usepackage{keyval} \makeatletter \define@key{tabularEntryKeys}{a}[\dots]{#1 & } ...
6
votes
1answer
126 views

Use choice key with choices setting booleans

When defining choice keys with l3keys2e there are two possible ways and I use the one with sub-keys in a new package. When defining watch each value should do interface3.pdf says that I can use .code ...
9
votes
1answer
288 views

xkvltxp gives keyval error in case of biblatex's options on multiple lines

A keyval error arises if both: xkvltxp is loaded biblatex is loaded with options on multiple lines. The following MWE shows this strange behavior: \documentclass{article} % \usepackage{xkvltxp} ...
3
votes
1answer
166 views

Error while using 'author' option in 'todonotes' package

I am trying to use the author option in the \todo command provided by todonotes package. This is clearly mentioned in its manual. Following is the code snippet and the error it produces: Snippet: ...
2
votes
1answer
127 views

How can I change the syntax of showexpl's graphic key?

I'm trying to rewrite the option graphic from showexpl package, I have reviewed the source code showexpl.sty but, fail to find the modification, the package use keyval (or xkeyval) and listings for ...
4
votes
0answers
2k views

basic beamerposter example, keyval error

I found a beamerposter example at this url: http://www-i6.informatik.rwth-aachen.de/~dreuw/latexbeamerposter.php The content suggests that a number of packages may be required, therefore, I use the ...
17
votes
2answers
264 views

Can I turn a collection of optional parameters into a macro?

I currently have several environments from mdframed that have a large number of options that are shared between them. The situation looks like \newmdtheoremenv[options0,options1]{env1}{Environment 1} ...
4
votes
1answer
143 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 ...
4
votes
0answers
52 views

Remove key from style

Is it possible to create a key handler with the pgfkeys package that removes a key from a style? Here's a minimal working example: \documentclass[preview,margin=10pt,convert]{standalone} ...
3
votes
1answer
107 views

How to define a function with optional key-value arguments [duplicate]

I have setup a function called quickfigure which has the purpose of inserting a centered image with a one-line command: \newcommand{\quickfigure}[2] { \begin{figure}[H] \centering ...
6
votes
1answer
219 views

Key value options in combination with TikZ

I'm trying to create some TikZ commands that use key value options. Using the following link: How to create a command with key values? I was able to declare some commands, but now I'm stuck. As a MWE ...
9
votes
1answer
149 views

Working with keys instead of \def

I have looked around on TeX.SX and I have learnt a lot of things. One of the things I have not yet mastered is how to use the key=value function that packages like keyval or xkeyval offer or even ...
6
votes
0answers
180 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: ...
2
votes
1answer
60 views

Mix value and key/value with xparse

Following an earlier question I switched to xparse. Now I am sitting in a compatibility trap and try to allow old and new stuff at the same time. The point of origin is the infamous macro with two ...
5
votes
1answer
113 views

pass to \geometry{} options using a macro - keyval error

MWE: \documentclass{article} \usepackage{geometry} \newcommand{\GeomOpts}{a4paper,vmargin={3cm,3cm}} \geometry{\GeomOpts} \begin{document} \end{document} Because of the braces in \GeomOpts its ...
8
votes
1answer
112 views

How to mimic LINQ's query method for macro's key-value?

Inspired by LINQ's query method, such as deck.Take(randomCount) .Where (card => card.Suit == "Hearts") .Skip(2) .Take(5) .OrderBy (card => card.FaceValue); The deck which is ...
5
votes
1answer
223 views

Forcing the first choice of an newtcblisting environment

I have created a new environment based on "tcblisting" from package "tcolorbox" is code (MWE) is as follows: \documentclass[10pt]{article} \usepackage{tcolorbox} ...