Questions tagged [key-value]
{key-value} is about packages and macros using the key=value syntax for named parameters instead of numbered parameters.
272
questions
4
votes
1
answer
627
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
1
answer
108
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}
\usepackage{...
4
votes
1
answer
920
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 ...
4
votes
1
answer
589
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}{%
...
4
votes
1
answer
89
views
How to use similar package and command keys, should they be separate or the same variable?
I am writing a expl3 package for typesetting amino acid residues and I am still getting to grips with LaTeX3 and the interfaces documentation. I have looked at the nicematrix annotated code for ...
4
votes
1
answer
54
views
key property .notif is unknown
Following the example in The LaTeX Companion, 3rd edition, Part II, page 700, I'm trying the following .sty file and .tex file that loads it, but I get error:
./myfont.sty:8: LaTeX Error: The key ...
4
votes
3
answers
265
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
1
answer
552
views
How to pass comma in value of a (xkeyval) comma separated list of values at \documentclass level?
At \usepackage level, xkeyval allows us to insert commas in value of a comma separated list of values: it is enough to enclose in braces the values containing commas. For instance, the following MCE ...
4
votes
3
answers
311
views
Forward list of key-value-pairs to other command in expl3
I would like to pass a list of key-value pairs to another command/environment. In this MWE to tcolorbox, but it should work in general (e.g. pass parameters to \LoadClass[params]{article}).
\...
4
votes
1
answer
330
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
1
answer
262
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 \...
4
votes
1
answer
434
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 ...
4
votes
2
answers
219
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
1
answer
3k
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) ...
4
votes
1
answer
106
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}
\...
4
votes
1
answer
151
views
How to add more key to enumerate package
beamer class loads enumerate package that allow us to use key 1,a,A,i,I. In my purpose, I want to add two more keys called m and k for Khmer (Cambodian) numeral and alphabet respectively. My attempt ...
4
votes
1
answer
921
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 ...
4
votes
1
answer
1k
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:
\...
4
votes
1
answer
569
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}
\tcbuselibrary{listings,breakable,...
4
votes
1
answer
154
views
How to hijack a key assignment to raise an event that triggers its event handler?
Whenever I invoke \degrees the definition of operator au (angle unit) will be updated. It is easily done by redefining the \degrees with \let and \renewcommand. So far so good.
Now I want to create ...
4
votes
1
answer
115
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 ...
4
votes
1
answer
1k
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 ...
4
votes
0
answers
129
views
The 'inverted' attribute is not recognized if a \DefineName abbreviation is used in an AMSRefs \bib entry
In Section 8.1 of the AMSRefs package documentation, it is explained that to properly typeset author names that are to be written with the family name first, one should set the attribute inverted on ...
4
votes
0
answers
84
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: ...
4
votes
0
answers
222
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 ...
4
votes
0
answers
154
views
Difficulty getting pgfkeys to set my fontsizes as I want
I apologize that this isn't particularly short.
I'm going through old code and refactoring. In the process, I'm running into various bugs in how I've written things. In this particular example, the ...
3
votes
3
answers
194
views
Improve a keycommand macro
My question is about how to improve an already working macro via the keycommand package. The small inclusion shows my efforts so far:
\documentclass{article}
\usepackage[margin=0.95in]{geometry}
\...
3
votes
2
answers
132
views
Expand key-values with \def of \newcommand?
I have multiple repeated
\begin{enumerate}[label=A\alph*), ref=A\alph*]
and I want to reduce code duplication. I would also like to avoid creating new environments if possible. I just want a simple ...
3
votes
2
answers
9k
views
package keyval error: compat2 undefined
I am using MiKTeX 2.9, geometry v5.6. I am getting the following error
package keyval error: compat2 undefined.
The LaTeX code is attached here:
\documentclass[phD,synopsis,a4paper]{iitmdiss}
%\...
3
votes
2
answers
350
views
Conditional title in tcolorbox: not equivalent to an untitled box when empty
Consider the following code :
\documentclass[10pt]{article}
\usepackage{ifmtarg}
\usepackage{xcolor-material}
\usepackage[most]{tcolorbox}
\makeatletter
\newcommand{\makeboxtitle}[1]{\@ifmtarg{#1}{}{\...
3
votes
2
answers
183
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 ...
3
votes
1
answer
2k
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 ...
3
votes
1
answer
140
views
How can I parse a clist into a keyval prop?
I'm trying to store a comma-separated list into a key-value property to use it later, but I can't get it to work properly.
I don't really understand how latex parses a keyval parameter but my guess is ...
3
votes
1
answer
146
views
Getting the package options as a lua string, and allow arbitrary package options
I am making a lualatex-based class, which will be a thin wrapper around a lua library. I would like to use the luakeys package to process my options in lua, and would like to avoid declaring options. ...
3
votes
2
answers
530
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]{...
3
votes
1
answer
977
views
How to use keyval option processing
I'm trying to make a command/environments with a view key value options similar to many other popular packages.
I found description on how to use key value but the examples don't work. Anyway can ...
3
votes
2
answers
412
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, ...
3
votes
3
answers
447
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
\...
3
votes
3
answers
230
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}
\...
3
votes
1
answer
1k
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}%
\xdef\@gtempa{\expandafter\noexpand\...
3
votes
1
answer
417
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 ...
3
votes
1
answer
1k
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,...
3
votes
1
answer
118
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?
...
3
votes
1
answer
305
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; ...
3
votes
1
answer
159
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 ...
3
votes
1
answer
85
views
Using definitions for key-val arguments
I'm making a \logo command like the \title command used for the title page. By default, I would like to use the graphbox smash key-val arg to be tl. But later on (depending on a users choice, say by ...
3
votes
1
answer
765
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
...
3
votes
1
answer
1k
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 ...
3
votes
1
answer
213
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 ...
3
votes
1
answer
172
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.
<...