Tikz 中 Lilyglyphs 的音乐符号

Tikz 中 Lilyglyphs 的音乐符号

我需要什么才能使用 tikz 和 lilyglyphs(以及西班牙 babel)?在这个例子中,Lilyglyphs 对我来说不起作用。我使用 LuaTeX,版本 1.0.4(TeX Live 2017/Debian)

\pgfmathprintnumber此代码中的另一个问题是,当删除时,升号和降号会丢失。

\documentclass{article}
\usepackage{fontspec} 
\usepackage[spanish]{babel}

\usepackage{tikz}
\usetikzlibrary{babel}
\usetikzlibrary{decorations.text}

%\usepackage{lilyglyphs}%<-- Want to use this

\begin{document}
\noindent
\begin{center}
{\huge Círculo de Quintas}
\break

\begin{tikzpicture}
  \draw node {\pgfmathprintnumber{0}}; % <-- Want to remove this
    \foreach \x/\xmaj/\xmin in {1/C/A,2/G/E,3/D/B,
            4/A/F\sharp,5/E/C\sharp,6/B/G\sharp,
            7/{G\flat/F\sharp}/{E\flat/D\sharp},8/D\flat/B\flat,9/A\flat/F,
            10/E\flat/C,11/B\flat/G,12/F/D}
        {
        \draw (-30*\x+120:3.8)  node {\textbf{\xmaj M}};
        \draw (-30*\x+120:2.8)  node {\textbf{\xmin m}};
        }
  \draw [decorate,
         decoration={text along path,
         text={Tonalidades con sostenidos ->},
         text align=left}]
         (60:5)  arc [start angle =60, end angle=-10,radius=5];
  \draw [decorate,
         decoration={text along path,
         text={<- Tonalidades con bemoles},
         text align=right}]
         (180:5)  arc [start angle =180, end angle=120,radius=5];
\end{tikzpicture}

\end{center}
\end{document}

五行循环

答案1

这充其量只是一种解决方法,我很乐意将其删除,但也许这有点用处。它将符号存储在 中\saveboxes,然后重复使用。

\documentclass{article}
\usepackage{fontspec} 
\usepackage[spanish]{babel}
\usepackage{lilyglyphs}%<-- Want to use this
\newsavebox\SharpBox
\sbox\SharpBox{\sharp[scale=1]}
\newcommand\Sharp{\usebox\SharpBox}
\newsavebox\FlatBox
\sbox\FlatBox{\flat[scale=1]}
\newcommand\Flat{\usebox\FlatBox}

\usepackage{tikz}
\usetikzlibrary{babel}
\usetikzlibrary{decorations.text}


\begin{document}
\noindent
\begin{center}
{\huge C\'irculo de Quintas}
\break

\begin{tikzpicture}
  %\draw node {\pgfmathprintnumber{0}}; % <-- Want to remove this
    \foreach \x/\xmaj/\xmin in {1/C/A,2/G/E,3/D/B,
            4/A/F\Sharp,5/E/C\Sharp,6/B/G\Sharp,
            7/{G\Flat/F\Sharp}/{E\Flat/D\Sharp},8/D\Flat/B\Flat,9/A\Flat/F,
            10/E\Flat/C,11/B\Flat/G,12/F/D}
        {
        \draw (-30*\x+120:3.8)  node[font=\bfseries] {\xmaj M};
        \draw (-30*\x+120:2.8)  node[font=\bfseries] {\xmin m};
        }
  \draw [decorate,
         decoration={text along path,
         text={Tonalidades con sostenidos ->},
         text align=left}]
         (60:5)  arc [start angle =60, end angle=-10,radius=5];
  \draw [decorate,
         decoration={text along path,
         text={<- Tonalidades con bemoles},
         text align=right}]
         (180:5)  arc [start angle =180, end angle=120,radius=5];
\end{tikzpicture}

\end{center}
\end{document}

相关内容