包 pgfkeys 错误:我不知道密钥‘/tikz/10mm)’

包 pgfkeys 错误:我不知道密钥‘/tikz/10mm)’

当尝试垂直移动使用 pgfkeys 坐标的 Tikz 节点时,它会显示一条错误消息:包 pgfkeys 错误:我不知道键“/tikz/10mm)”基本代码如下:

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\setmainlanguage{spanish}
\usepackage{etoolbox}
\usepackage{float} %Paquete para posicionar Tablas
\usepackage{tikz}
\usetikzlibrary{arrows.meta, math}
\usetikzlibrary{tikzmark}
\usetikzlibrary{positioning}
\NewDocumentCommand{\addU}{mm}{\tikz[remember picture]{\node[overlay,above=(of pic cs:#1) ++ (0,10mm)]{#2};}}
\NewDocumentCommand{\addB}{mm}{\tikz[remember picture]{\node[overlay,below=of pic cs:#1]{#2};}}
\usepackage{amsmath}%Para signo igual
\usepackage{musixtex} 
\input {musixfll}
\input {musixper}%percusión

\begin{document}

\begin{music}
    \font\A=phvb8t at 10pt% added for letter type.
      \largemusicsize
      \setlines{1}{5}
      \setclefsymbol{1}{\drumclef}%
      \nobarnumbers
      \nostartrule
      \startextract
      \NOTes\tikzmark{BD}\zql f\tikzmark{R}\doqu m\en
      \znotes\hsk\tikzmark{HH}\doql d\en
      \NOTes\tikzmark{HHH}\zcharnote{16}{\textbf\small \hspace*{-0.08cm} $\circ$}\ibu0m0\doqb0{m}\zcharnote{16}{\textbf\small \hspace*{-0.08cm} $+$}\en
      \NOTes\tbu0\doqb0m\en
      \NOTes\tikzmark{S}\qu j\en
      \NOTes\tikzmark{SR}\dcqu j\en
      \NOTes\tikzmark{C}\roql j\en
      \NOTes\tikzmark{CB}\tgql l\en
      \endextract
\end{music} 
\addU{R}{Ride}
\addU{S}{Snare}
\addU{HHH}{Hi-Hat}
\addB{BD}{Bass Drum}
\addB{HH}{Hi-Hat (foot)}
%\addU{SR}{Snare\\rimshot}
\addU{C}{Clave}
\addU{CB}{Cow Bell}

\end{document}

答案1

定位库允许你使用语法指定将某个对象定位到多高的位置above=10mm of nodename

% !TeX TS-program = lualatex

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\setmainlanguage{spanish}
\usepackage{etoolbox}
\usepackage{float} %Paquete para posicionar Tablas
\usepackage{tikz}
\usetikzlibrary{arrows.meta, math}
\usetikzlibrary{tikzmark}
\usetikzlibrary{positioning}
\NewDocumentCommand{\addU}{mm}{\tikz[remember picture]{\node[overlay,above=10mm of pic cs:#1]{#2};}}
\NewDocumentCommand{\addB}{mm}{\tikz[remember picture]{\node[overlay,below=of pic cs:#1]{#2};}}
\usepackage{amsmath}%Para signo igual
\usepackage{musixtex} 
\input {musixfll}
\input {musixper}%percusión

\begin{document}

\begin{music}
    \font\A=phvb8t at 10pt% added for letter type.
      \largemusicsize
      \setlines{1}{5}
      \setclefsymbol{1}{\drumclef}%
      \nobarnumbers
      \nostartrule
      \startextract
      \NOTes\tikzmark{BD}\zql f\tikzmark{R}\doqu m\en
      \znotes\hsk\tikzmark{HH}\doql d\en
      \NOTes\tikzmark{HHH}\zcharnote{16}{\textbf\small \hspace*{-0.08cm} $\circ$}\ibu0m0\doqb0{m}\zcharnote{16}{\textbf\small \hspace*{-0.08cm} $+$}\en
      \NOTes\tbu0\doqb0m\en
      \NOTes\tikzmark{S}\qu j\en
      \NOTes\tikzmark{SR}\dcqu j\en
      \NOTes\tikzmark{C}\roql j\en
      \NOTes\tikzmark{CB}\tgql l\en
      \endextract
\end{music} 
\addU{R}{Ride}
\addU{S}{Snare}
\addU{HHH}{Hi-Hat}
\addB{BD}{Bass Drum}
\addB{HH}{Hi-Hat (foot)}
%\addU{SR}{Snare\\rimshot}
\addU{C}{Clave}
\addU{CB}{Cow Bell}

\end{document}

相关内容