Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
\usepackage{pgfkeys}
\pgfkeys{/a/.code={a#1},
    /b/.code={b#1},
    /c/.code={c#1}}
\pgfkeys{/my style/.style = {/a=1, /b=2, /c=3}}
\begin{document}
\pgfkeys{/my style}\par
%\pgfkeys{/my style/.remove from style = {b}}
\pgfkeys{/my style}
\end{document}

The output is

a1b2c3a1b2c3

The desired output, if the commented line were to be uncommented, would be

a1b2c3
a1c3

Here are a couple of closely related questions. They are not duplicates of this one, but the answers to the second one might be useful in devising an answer to this question.

Unsetting a PGF/TikZ key

How to extract the value from a pgfkeys style element

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.