{key-value} is about packages and macros using the `key=value` syntax for named parameters instead of numbered parameters.
4
votes
1answer
34 views
Bad interaction between keycommand and environ?
I suspect the keycommand and environ packages are not playing nicely together, because the following code gives an error. Can anybody explain what's going on?
\documentclass{article}
...
5
votes
2answers
131 views
Simple example of pgfkeys
I'm struggling to get my head around the pgfkeys package. I currently use the keycommand package, which I find very easy to understand: it's just ordinary LaTeX commands with named rather than ...
3
votes
1answer
44 views
Passing arguments to a .sty-file - a specific case
After having plowed through (i.e. read and trimmed down the given examples in an attempt to apply them to my case) these documentations and guides:
Implementing key-value input: An introduction
The ...
9
votes
2answers
100 views
How can I define a new minted environment with optional arguments?
I have the following mwe:
% arara: pdflatex: { shell: true }
% arara: pdflatex: { shell: true }
\documentclass{article}
\usepackage{minted}
\usepackage{listings}
\usepackage{caption}
...
9
votes
1answer
63 views
Expandable, very specific keyval processing
I am having a hard time trying to come up with an fully expandable keyval parsing macro which deals only with specific keys/values. I wouldn't even attempt this in full generality, that's way beyond ...
3
votes
1answer
34 views
Add key for new Listings environment
I'm trying to add a new key to a custom listings environment. I have tried to modify this example.
My problem is that the value I am attempting to pass through in the document for the key does not ...
1
vote
1answer
47 views
How to expand keyval options immediately
I am trying to build up a macro that creates other macros depending on kvoptions' options. But then, the outcoming macros are dependent on the actual state of the options instead of their state at the ...
7
votes
2answers
82 views
Pass named arguments to macro
I notice that includegraphics takes what seems to be named arguments:
\includegraphics[width=50,height=25,trim=1 2 3 4,clip]{an_img.png}
I'd like to wrap a number of my includegraphics calls in a ...
6
votes
1answer
63 views
Forcing macro expansion with keyval
While trying to provide an answer to this question, I've run into a stumbling block that I can't seem to get over. The listings package (like many others) uses keyval to handle configuration. What ...
5
votes
1answer
56 views
Keycommand package - \commandkey{mykey} doesn't expand
UPDATED, see edit history for completeness
I'm trying out the keycommand package but it's not working as expected. There seems to be some incompatibility with tables, but I've read and re-read the ...
2
votes
1answer
63 views
xkeyval's \presetkeys
Please is there a way to avoid xkeyval package bombing out in endless loop, as implied by the following simplified case?
\documentclass{article}
\usepackage{xkeyval}
\makeatletter
...
3
votes
1answer
97 views
Filter exercises according to their difficulty
This is somehow a follow-up question after this question. I came across this problem when writing the answer, but I was wrong when I thought I would easily be able to get this to work later. Shame.
...
3
votes
1answer
148 views
How to define package options in a command (for reuse)?
I need some options of the listings package several times in my document. I am thus wondering if one can define (and later change) these options once somewhere in the preamble via a command/macro, for ...
1
vote
0answers
43 views
How can I pass class/package options with spaces in values? [duplicate]
Possible Duplicate:
Spaces in pfgopts options
I have read Joseph Wright's excellent article on key-value systems, as well as questions on this site about how to pass arguments to class ...
6
votes
2answers
155 views
Filtering options with pgfkeys
I am looking for an example of how to get pgfkeys to split a list of options so that: (1) some of the options are processed now, and (2) the rest of the options are passed to a second macro for ...
7
votes
1answer
119 views
Choice keys and exception handling
Recently, I switched a self-written "bundle package" from using xkeyval to keyreader. One reason for this, beside the backward compatibility, was that the definition of keys is more convenient in ...
3
votes
1answer
202 views
beamerposter custom style with keyval definition
I'm creating a beamerposter style accordingly to my department specification. I would like to create a theme where the definitions of the blocks can vary accordingly to a keyword in the calling of the ...
8
votes
3answers
163 views
More complicated key definitions in loops/for each statements
While writing a package with a key-value interface,
I had a lot of repetitive key definitions.
Naturally, one would like to express these definitions with a loop.
When the definition contains ...
8
votes
2answers
154 views
How to pass a macro as a value for a key?
I want to pass a macro to a showgrid key. The macro can be redefined later. Its possible values are top, bottom, false, true.
The following MWE produces a blank page. How to fix it?
...
20
votes
4answers
319 views
Does the order of specified key-values matter?
The following screen shot shows how the order of specified key-values affects the output.
When using dx=\psPiH,xunit=\psPi.
When using xunit=\psPi,dx=\psPiH.
Minimal Working Example
...
3
votes
1answer
203 views
Extract key-value pairs from a string
I want to extract key value pairs from a string. I need this to define a new glossary style and want to pass some additional information through a existing parameter.
\newglossarystyle{meinglossar}{%
...
2
votes
1answer
194 views
newcommand key value
This is a completely noob question for LaTeX package writers. Could somebody share a piece of code or a MWE for the following situation. I would like to define a newcommand which will depend on the ...
7
votes
3answers
257 views
How to define a key=value that has an equivalent boolean value key
Assume you're defining a key=value align for some environment realign that you'll use in the following way:
\usepackage{xkeyval}% http://ctan.org/pkg/xkeyval
\newenvironment{realign}[1][]
...
8
votes
2answers
175 views
Key Value option in package
I trying to write a package, and I'd like to specify whether there should be colour or not.
I'd like to do:
\usepackage[color=false]{foo}
and have this set
\RequirePackage[color=false]{hyperref}
...
11
votes
1answer
204 views
PGF Keys differences between .initial and .default
I am not too sure just by reading the manual as to the subtle differences between the .initial and .default PGF key types. Can someone explain and demonstrate the differences with a minimal example?
3
votes
1answer
162 views
Iterate over all defined PGF keys
Is there a way to iterate over all PGF keys that have been defined previously? My idea is to capture the value of all keys in order to do Proper nesting of tikzpicture environments: Reset all PGF ...
6
votes
1answer
361 views
Using a macro as value of addtotoc in \includepdf
I would like to include pages from an external PDF file into my document, using the pdfpages package. The following works for me:
\documentclass{article}
\usepackage{pdfpages}
\begin{document}
...
4
votes
1answer
56 views
How to make xkvview record keyreader defined keys?
Since keyreader is based on xkeyval i wonder if it’s possible to make it wokr with xkvview which comes with xkeyval.
\documentclass{scrartcl}
\usepackage{xkvview}
\usepackage{keyreader}
...
2
votes
1answer
63 views
How to encapsulate a package to rename keys defined in it?
I use pst-eucl package and I am not so happy with the names defined for its keys (because the names are difficult to remember).
I want to rename some of the keys for my own purpose by creating a new ...
4
votes
2answers
340 views
Environment in \NewEnviron style, with key-value parameters
I want to define an environment that read its content before processing (like \newEnviron from the package environ) but also that allows key-value parameters (like \newkeyenvironment from the package ...
3
votes
3answers
115 views
Set font with keyreader as package option
Im developing a package an use keyreader to define it’s options, but I fail to set a font as an option.
\begin{filecontents}{myfonts.sty}
\ProvidesPackage{myfonts}
\usepackage{keyreader}
...
1
vote
1answer
177 views
keyreader: How to save choice key value to a macro
Why does a choice key not save it’s value to a macro as a cmd key and as the corresponding xkeyval \define@choicekey do?
In the following example I have to define my@key manually by using the ...
1
vote
1answer
37 views
kprefix in \krddefinekeys seems to be not optional
Maybe I misunderstood something but the following example doesn’t compile with out a optional argument defining the kprefix
\documentclass{article}
\usepackage{keyreader}
% [KV]------\/
...
6
votes
2answers
122 views
Writing a macro with parameters
I'm trying to write a macro which should be able to do several different yet somewhat similar things. I thought that instead of writing different macros for every thing, I should be able to write just ...
2
votes
1answer
135 views
pgfkeys-values only in list of possible values
In the following example, the key formatting has the initial default value apmep.
\pgfkeys{
/test/.is family, /test,
formatting/.initial = apmep
}
I would also like that the value of the ...
2
votes
1answer
252 views
The definition of key default value by keyval package
For a key keya defined by
\define@key{fam}{keya}[\def\y#1{#1}]{\def\x##1{##1x#1}}
the keyval package uses
\def\KV@def#1#2[#3]#4{%
\begingroup\toks@{#3}%
...
1
vote
1answer
156 views
keyvalue with kvoptions and switch structure
I am using kvoptions for a key-value syntax. However I need a switch syntax for the evaluation. Since boolexpr is problamatic (see here) I use now the other solution of this question.
However the ...
3
votes
1answer
139 views
difficulty with datatool + keyval
I want to define a command with key arguments, which stores something in a table with help of the package datatool. My attempt is :
\documentclass[12pt]{scrartcl}
\usepackage{keycommand}
...
3
votes
2answers
350 views
fontsize setting with newcommand and newlength
How do I set a \newcommand so that the field #1, which is calculated to be 1.2*#2 Optional? Something similar to the following commands, but that did not work.
\documentclass{article}
...
3
votes
1answer
171 views
Font size as a key-value pair using pgfkeys does not work
I want to define a new environment whose contents can be typeset using a specific font family and size optionally specified as key-value pairs. For handling the key-value pairs I am using pgfkeys. Why ...
7
votes
3answers
458 views
How to write a class that accepts an optional key-value pair?
a user-defined class:
\ProvidesClass{preview}[2012/12/15 v 0.01 class for creating a tight PSTricks diagram]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
...
4
votes
1answer
148 views
How do I use \ifcommandkey , or how do I check if a key was given?
I'm trying to create a keycommand with optional arguments, but I can't get it to work. I looked at Comparing an argument to a string when argument is a result of a command with etoolbox and although ...
25
votes
3answers
1k views
How to create a command with key values?
I am trying to create a command that the user can enter keys for values. How can I create one, for example:
\myparbox[width=50,height=10,color=blue, align=left -10px]{}
8
votes
3answers
204 views
How to use named variables with one environment
Just after there is one code which has been proposed to me in this site.
Instead of using \begin{MyFrame}[1.5cm][2pt][1.3cm][blue][2][8ex], I would like to use something more friendly like ...
9
votes
1answer
845 views
Use \setkeys{Gin} to set default scale value doesn’t work
I’d like to make all my graphic a little smaller and tried to set the scale-value of \includegraphics globally with \setkeys{Gin} but while changing width works fine scale has no effect.
...
3
votes
2answers
241 views
Pass several comma separated TikZ options to a single keyval key
I'm still improving my answer to Need help creating a 3D cube from a 2D set of nodes in TikZ. One of the options should be to emphasize the edges of the cuboid. This would mean e.g.
\draw[red, very ...
7
votes
1answer
309 views
How to access the value of a biblatex package option/key
Is it possible to access a value which is given as a bibliography option. For example if I have
\usepackage[somekey=foobar]{biblatex}
can I get the value (foobar) of somekey as a macro like ...
33
votes
17answers
2k views
A big list of every keyval package
I lose track of all the different keyval packages. Can we maintain a list here? (Community wiki, one package per answer with a brief description of scope. I've started things off but need help ...
5
votes
2answers
1k views
How to control enumitem's description list via leftmargin and labelwidth keys
I am trying to learn how to use enumitem's keys to adjust a description list. In this case, I would like to have my list items and description text both left aligned, but the description text should ...
1
vote
2answers
127 views
What are the advantages and disadvantages between these coding styles?
Some people use the following style
setting
{
a=1
,b=2
,c=3
}
and the other ones use the style below
setting
{
a=1,
b=2,
c=3
}
I use the latter style but I wonder ...

