Skip to content

Commit

Permalink
fix(decorations): wrong key name in unknown decoration option error
Browse files Browse the repository at this point in the history
Introduced by previous fix #1083.

Signed-off-by: Yukai Chou <muzimuzhi@gmail.com>
  • Loading branch information
muzimuzhi committed Dec 5, 2024
1 parent 10f6096 commit ab79a72
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 7 deletions.
1 change: 1 addition & 0 deletions doc/generic/pgf/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Resolve missing `gnuplot` plots in manual #1238
- Treat varargs for `min()` and `max()` in `luamath` pgf library pgf-tikz/pgfplots#492 #1359
- Fixed support for the `\tikz` command in the `dvisvgm4ht` driver for TeX4ht
- Wrong key name in unknown decoration option error #1082

### Changed

Expand Down
15 changes: 15 additions & 0 deletions testfiles/gh-1082.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
\documentclass{minimal}
\input{pgf-regression-test}

\usepackage{tikz}
\usetikzlibrary{decorations}

\START

\BEGINTEST{Unknown decoration option}
\tikzset{
decoration={segment length=5pt, red}
}
\ENDTEST

\END
15 changes: 15 additions & 0 deletions testfiles/gh-1082.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
============================================================
TEST 1: Unknown decoration option
============================================================
! Package pgfkeys Error: I do not know the key '/pgf/decoration/red' and I am going to ignore it. Perhaps you misspelled it.
See the pgfkeys package documentation for explanation.
Type H <return> for immediate help.
...
l. ...}
This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.
============================================================
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@

\tikzset{decorate/.is if=tikz@decoratepath,
/pgf/decoration/name/.store in=\tikz@decoration@name,
/pgf/decoration/.unknown/.code=%
\pgfifdecoration{\pgfkeyscurrentname}{\edef\tikz@decoration@name{\pgfkeyscurrentname}}
{\pgfifmetadecoration{\pgfkeyscurrentname}{\edef\tikz@decoration@name{\pgfkeyscurrentname}}
% Fully expand `\pgfkeyscurrentname' before being used in first-arg of
% `/errors/unknown key'.
{\pgfkeys{/errors/unknown
key/.expanded={/pgf/decoration/\pgfkeyscurrentname}{\pgfutil@unexpanded{#1}}}}},%
/pgf/decoration/.unknown/.code={%
\pgfifdecoration{\pgfkeyscurrentname}
{\edef\tikz@decoration@name{\pgfkeyscurrentname}}
{\pgfifmetadecoration{\pgfkeyscurrentname}
{\edef\tikz@decoration@name{\pgfkeyscurrentname}}
% expand \pgfkeyscurrentname _before_ it's updated by nested \pgfkeys
{\pgfutil@expanded{\noexpand\pgfkeys{/errors/unknown key=
{/pgf/decoration/\pgfkeyscurrentname}{\pgfutil@unexpanded{#1}}}}}}%
},
/pgf/decoration/raise/.code={\def\tikz@dec@shift{\pgftransformyshift{#1}}\tikz@dec@trans},
/pgf/decoration/mirror/.code={%
\csname if#1\endcsname
Expand Down

0 comments on commit ab79a72

Please sign in to comment.