Tikzlibrary 书法错误

Tikzlibrary 书法错误

下面的代码使用 TiZ 库calligraphy,但抛出一个错误:

Package pgfkeys Error: I do not know the key '/pgf/decoration/\pgfkeyscurrentname ' and I am going to ignore it. Perhaps you misspelled it.

常规 TiZ 支架按预期工作。

可能缺少了一些基本的东西,但到目前为止我还没有找到解决方案。

更新:使用 MacTeX 2019,已更新。

\documentclass{article}

\usepackage{tikz}

\newsavebox{\barbox}

\usetikzlibrary{calligraphy,decorations.pathreplacing}

\begin{document}

\begin{lrbox}{\barbox}
    \begin{tabular}{lll}
        1&2&3\\
        A&B&C\\
        X&Y&Z
    \end{tabular}
\end{lrbox}

\tikz{%
    \node (z) {\usebox{\barbox}};
    %% This works:
    %\draw[decorate,decoration={brace,mirror}]
    %% This gives error:
    %% Package pgfkeys Error: I do not know the key '/pgf/decoration/\pgfkeyscurrentname ' and I am
    %% going to ignore it. Perhaps you misspelled it.
    \draw[decorate,decoration={calligraphic brace,amplitude=2mm,mirror}]
        (z.south east) -- (z.north east);
}

\end{document}

答案1

书法手册第 7 页上说:

如果在此库之前加载了 TikZ/PGF 装饰库,则书法库会定义一些使用书法路径的装饰,特别是使用铜版笔尖。当前的装饰是:• 书法括号换括号。[...]

因此:先加载decorations.pathreplacing,然后加载calligraphy

梅威瑟:

\documentclass{article}

\usepackage{tikz}

\newsavebox{\barbox}

\usetikzlibrary{decorations.pathreplacing,calligraphy}

\begin{document}

\begin{lrbox}{\barbox}
    \begin{tabular}{lll}
        1&2&3\\
        A&B&C\\
        X&Y&Z
    \end{tabular}
\end{lrbox}

\tikz{%
    \node (z) {\usebox{\barbox}};
    \draw[decorate,decoration={calligraphic brace,amplitude=2mm,mirror}]
        (z.south east) -- (z.north east);
}

\end{document}

结果:

在此处输入图片描述

相关内容