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

learn more… | top users | synonyms

8
votes
2answers
224 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} ...
12
votes
1answer
318 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
188 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
581 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
69 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
68 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
633 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
129 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
242 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
39 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
142 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
156 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
351 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
233 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
162 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} ...
4
votes
2answers
635 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
206 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 ...
8
votes
3answers
613 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
168 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 ...
39
votes
4answers
2k 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
216 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 ...
10
votes
1answer
1k 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
325 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
392 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 ...
41
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 ...
7
votes
2answers
2k 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
132 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 ...
3
votes
1answer
135 views

LaTeX3: problem with .generate_coices:n after l3kernel update

I'd like to report an issue I encountered with the l3keys sub-package of l3kernel (Hope it is ok to be done here). The test code at the end produces the error ! Undefined control sequence. ...
0
votes
1answer
1k views

Help! How to get the PDF-File? Error & Warnings lead to no pdf-file

I have a big problem. I am writing my phd thesis and started to use latex recently. I developed some basic skills that helped out me most time. But at the moment I dont know how to solve the problem. ...
4
votes
2answers
917 views

TikZ: Track the bounding rectangle of created nodes (Storing values?)

In the main part of the tikzpicture I'd like to simply create blocks. So I need somewhere in theirs' style definition to perform tracking of their common bounding rectangle. I've tried to access ...
7
votes
1answer
695 views

Building keyval arguments using a macro.

I try to create the arguments for a package which uses keyval, with macro, but this does not work: Here is the demo code: \documentclass{minimal} \usepackage{listings} \lstset{language=Pascal} ...
13
votes
3answers
2k views

A package template using xkeyval?

I would like to write a package offering a number of commands. The package should accept options, and some of these options should be available as command options. Usage should be as follows: ... ...
26
votes
1answer
2k views

How can I make a package that accepts an optional argument?

I am writing a package that has a bunch of values that are going to be the same most of the time, but that I might want to change in select cases. I want to do this by giving this package an optional ...
2
votes
2answers
123 views

How to assign a key of a package a key value of another package?

Scenario 1 Actually I can do like this: In mylistings.sty, I define \def\tabsize{3} \RequirePackage{listings} \lstset{tabsize=\tabsize} and in mytable.sty, I define \RequirePackage{mylistings} ...