2

/alaligne (new line space for system score) not working on tikzpicture environment. The basic code is as follow:

\documentclass[%
border={35pt 100pt 150pt 5pt},% left bottom right top
varwidth]{standalone}

% ========== PAQUETES ==========
\usepackage{tikz}
\usetikzlibrary{arrows.meta,calc} %LIBRERIA PARA LAS FORMAS
\usetikzlibrary{quotes}
\usetikzlibrary{shapes}
\usetikzlibrary{fit,positioning}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{decorations}
\usepackage{amsmath}%
\usepackage{musicography}%
\usepackage{musixtex}%
\input musixlyr%
\usepackage{xcolor}%
\xdefinecolor{red-undar}{RGB}{179,35,79}

\begin{document}%
\begin{tikzpicture}
\node[anchor=north west, inner sep=0pt] (score) at (0,0) {%
\begin{music}%
\resetlyrics%
\font\A=phvb8t at 10pt%
\font\B=phvb8t at 8pt%
\setsongraise1{-1.5mm}%
\staffbotmarg3\Interligne%
\setclef1\treble%
\nobarnumbers%
\nostartrule%   
%\startextract%
\startpiece%\addspace\afterruleskip%
% AQUI EMPIEZOOO
\Notes\zw{h}\hu{j}\qsk\hu{l}\en\bar%
\Notes\zw{f}\hu{k}\qsk\hu{j}\en\bar%
\Notes\zw{g}\hu{i}\sk\en\setdoublebar\bar%
\Notes\zw{h}\hu{m}\qsk\hu{l}\en\bar%
\Notes\zw{f}\hu{k}\qsk\hu{j}\en\bar\setdoublebar%
\Notes\zw{g}\hu{i}\sk\en\alaligne%%\setdoublebar\bar%
\Notes\zw{b}\hu{g}\qsk\hu{f}\en\bar%
\Notes\zw{c}\hu{e}\qsk\hu{g}\en\setdoublebar\bar%
\Notes\zw{g}\hu{i}\qsk\hu{k}\en\bar%
\Notes\zw{c}\hu{l}\qsk\hu{n}\en\setdoublebar%
\endpiece%
%\endextract%
\end{music}%
};
% CURVA 1
%   \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(-1.1cm,-0.7cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(-1.7cm,-1.2cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(-1.9cm,-1.0cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(-2.0cm,-1.1cm)$);   % punto FIN (nota abajo)
%       
%       % CURVA 2
%       \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(0.6cm,-0.9cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(0.5cm,-1.1cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(0.2cm,-1.2cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(-0.1cm,-1.2cm)$);   % punto FIN (nota abajo)
%       
%       % CURVA 3
%       \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(4.1cm,-0.7cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(3.8cm,-1.0cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(3.6cm,-1.0cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(3.2cm,-1.1cm)$);   % punto FIN (nota abajo)
%       
%       % CURVA 4
%       \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(5.8cm,-0.9cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(5.6cm,-1.1cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(5.4cm,-1.2cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(5.1cm,-1.2cm)$);   % punto FIN (nota abajo)
%       
%       % CURVA 5
%       \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(9.2cm,-1.3cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(9.1cm,-1.5cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(8.7cm,-1.6cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(8.4cm,-1.6cm)$);   % punto FIN (nota abajo)
%       
%       % CURVA 6
%       \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(11.0cm,-1.2cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(10.8cm,-1.4cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(10.5cm,-1.5cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(10.2cm,-1.5cm)$);   % punto FIN (nota abajo)
%       
%       % CURVA 7
%       \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(12.9cm,-0.8cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(12.8cm,-1.0cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(12.4cm,-1.2cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(12.0cm,-1.2cm)$);   % punto FIN (nota abajo)
%       
%       % CURVA 8
%       \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(14.6cm,-0.6cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(14.5cm,-1.1cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(14.2cm,-1.4cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(13.9cm,-1.5cm)$);   % punto FIN (nota abajo)
%       
%       \node[anchor=south west] at ($(score.north west)+(1.6cm, -0.6cm)$)
%       {\small\textbf{Etc.}};
%       
%       \node[anchor=south west] at ($(score.north west)+(6.9cm, -0.6cm)$)
%       {\small\textbf{Etc.}};
%       
%       \node[anchor=south west] at ($(score.north west)+(0.0cm, -0.2cm)$)
%       {\small\textbf{a)}};
%       
%       \node[anchor=south west] at ($(score.north west)+(5.1cm, -0.2cm)$)
%       {\small\textbf{b)}};
%       \\
%       \node[anchor=south west] at ($(score.north west)+(9.5cm, -0.2cm)$)
%       {\small\textbf{c)}};
%       \node[anchor=south west] at ($(score.north west)+(13.1cm, -0.2cm)$)
%       {\small\textbf{d)}};
% PUNTOS DE REFERENCIA
%\fill[red]   ($(score.north west)+(4.4cm,-0.9cm)$) circle (1pt); % INICIO
%\fill[blue]  ($(score.north west)+(0.5cm,-1.2cm)$) circle (1pt); % FIN
%\fill[green] ($(score.north west)+(14.5cm,-0.9cm)$) circle (1pt); % CONTROL 1
%\fill[green] ($(score.north west)+(14.2cm,-1.1cm)$) circle (1pt); % CONTROL 2
\end{tikzpicture}
\end{document}%

The current output is as follow: error

2
  • please don't include a screen full of commented lines when posting here. that's just clutter. Commented Apr 15 at 4:05
  • you cannot typeset the score over multiple lines inside a node. what are you actually trying to do? that is, why do you want this in a tikz node? Commented Apr 15 at 4:11

2 Answers 2

4

This is not the kind of environment which you can happily put into a TikZ node. Nor does it lend itself to standalone.

You can make it sort of work if you box the content e.g. using a minipage, though my experiments suggest it is quite easy for this to go wrong.

On the whole, I would most recommend taking this out of any kind of strange environment i.e. standalone, tikzpicture etc. However, if for some reason that's not an option, you can play with something like this to see if it can give you what you want:

% Source - https://tex.stackexchange.com/q/761901
% Posted by ABV
% Retrieved 2026-04-15, License - CC BY-SA 4.0

\documentclass[%
border={35pt 100pt 150pt 5pt},
varwidth]{standalone}
\usepackage{tikz}
\usepackage{musixtex}%
% \input musixlyr% << never do this!!
\input {musixlyr}% or \input musixlyr\relax or \input musixlyr %
\xdefinecolor{red-undar}{RGB}{179,35,79}

\begin{document}
\begin{tikzpicture}
  \node[anchor=north west, align=left, inner sep=0pt] (score) at (0,0) {%
    \begin{minipage}{80mm}
      \begin{music}%
        \resetlyrics
        \font\A=phvb8t at 10pt
        \font\B=phvb8t at 8pt
        \setsongraise1{-1.5mm}%
        \staffbotmarg3\Interligne
        \setclef1\treble
        \nobarnumbers
        \nostartrule   
        \startpiece
          \Notes\zw{h}\hu{j}\qsk\hu{l}\en\bar
          \Notes\zw{f}\hu{k}\qsk\hu{j}\en\bar
          \Notes\zw{g}\hu{i}\sk\en\setdoublebar\bar
          \Notes\zw{h}\hu{m}\qsk\hu{l}\en\bar
          \Notes\zw{f}\hu{k}\qsk\hu{j}\en\bar\setdoublebar
          \Notes\zw{g}\hu{i}\sk\en\alaligne
          \Notes\zw{b}\hu{g}\qsk\hu{f}\en\bar
          \Notes\zw{c}\hu{e}\qsk\hu{g}\en\setdoublebar\bar
          \Notes\zw{g}\hu{i}\qsk\hu{k}\en\bar
          \Notes\zw{c}\hu{l}\qsk\hu{n}\en\setdoublebar
        \endpiece
      \end{music}%
    \end{minipage}%
  };
\end{tikzpicture}
\end{document}

The results are (predictably?) weird, though it is not so obvious in the image as it is white-on-white:

somewhat weird music in node

3

Maybe with splitting your music environment in two (start)pieces you can add the comments you want, taking into account that you know where you want to insert the line breaks:

\documentclass[%
border={35pt 100pt 150pt 5pt},% left bottom right top
varwidth]{standalone}

% ========== PAQUETES ==========
\usepackage{tikz}
\usetikzlibrary{arrows.meta,calc} %LIBRERIA PARA LAS FORMAS
\usetikzlibrary{quotes}
\usetikzlibrary{shapes}
\usetikzlibrary{fit,positioning}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{decorations}
\usepackage{amsmath}%
\usepackage{musicography}%
\usepackage{musixtex}%
\input musixlyr%
\usepackage{xcolor}%
\xdefinecolor{red-undar}{RGB}{179,35,79}

\begin{document}%
%\begin{tikzpicture}
%\node[anchor=north west, inner sep=0pt] (score) at (0,0) {%
\begin{music}%
\resetlyrics%
\font\A=phvb8t at 10pt%
\font\B=phvb8t at 8pt%
\setsongraise1{-1.5mm}%
\staffbotmarg3\Interligne%
\setclef1\treble%
\nobarnumbers%
\nostartrule%   
%\startextract%
\begin{tikzpicture}%
\node[anchor=north west, inner sep=0pt] (score) at (0,0) {%
\startpiece%\addspace\afterruleskip%
% AQUI EMPIEZOOO
\Notes\zw{h}\hu{j}\qsk\hu{l}\en\bar%
\Notes\zw{f}\hu{k}\qsk\hu{j}\en\bar%
\Notes\zw{g}\hu{i}\sk\en\setdoublebar\bar%
\Notes\zw{h}\hu{m}\qsk\hu{l}\en\bar%
\Notes\zw{f}\hu{k}\qsk\hu{j}\en\bar\setdoublebar%
\Notes\zw{g}\hu{i}\sk\en%\alaligne%%
\setdoublebar\endpiece%
};\end{tikzpicture}%

\bigskip%
\begin{tikzpicture}%
\node[anchor=north west, inner sep=0pt] (score) at (0,0) {%
\startpiece%
\Notes\zw{b}\hu{g}\qsk\hu{f}\en\bar%
\Notes\zw{c}\hu{e}\qsk\hu{g}\en\setdoublebar\bar%
\Notes\zw{g}\hu{i}\qsk\hu{k}\en\bar%
\Notes\zw{c}\hu{l}\qsk\hu{n}\en\setdoublebar%
\endpiece%
};\end{tikzpicture}%
%\endextract%
\end{music}%
%};
% CURVA 1
%   \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(-1.1cm,-0.7cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(-1.7cm,-1.2cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(-1.9cm,-1.0cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(-2.0cm,-1.1cm)$);   % punto FIN (nota abajo)
%       
%       % CURVA 2
%       \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(0.6cm,-0.9cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(0.5cm,-1.1cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(0.2cm,-1.2cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(-0.1cm,-1.2cm)$);   % punto FIN (nota abajo)
%       
%       % CURVA 3
%       \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(4.1cm,-0.7cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(3.8cm,-1.0cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(3.6cm,-1.0cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(3.2cm,-1.1cm)$);   % punto FIN (nota abajo)
%       
%       % CURVA 4
%       \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(5.8cm,-0.9cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(5.6cm,-1.1cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(5.4cm,-1.2cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(5.1cm,-1.2cm)$);   % punto FIN (nota abajo)
%       
%       % CURVA 5
%       \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(9.2cm,-1.3cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(9.1cm,-1.5cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(8.7cm,-1.6cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(8.4cm,-1.6cm)$);   % punto FIN (nota abajo)
%       
%       % CURVA 6
%       \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(11.0cm,-1.2cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(10.8cm,-1.4cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(10.5cm,-1.5cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(10.2cm,-1.5cm)$);   % punto FIN (nota abajo)
%       
%       % CURVA 7
%       \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(12.9cm,-0.8cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(12.8cm,-1.0cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(12.4cm,-1.2cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(12.0cm,-1.2cm)$);   % punto FIN (nota abajo)
%       
%       % CURVA 8
%       \draw[line width=0.9pt, color=red-undar]
%       ($(score.north west)+(14.6cm,-0.6cm)$)    % punto INICIO (nota arriba)
%       .. controls
%       ($(score.north west)+(14.5cm,-1.1cm)$)    % punto control 1 (curva izquierda)
%       and
%       ($(score.north west)+(14.2cm,-1.4cm)$)    % punto control 2 (curva izquierda)
%       ..
%       ($(score.north west)+(13.9cm,-1.5cm)$);   % punto FIN (nota abajo)
%       
%       \node[anchor=south west] at ($(score.north west)+(1.6cm, -0.6cm)$)
%       {\small\textbf{Etc.}};
%       
%       \node[anchor=south west] at ($(score.north west)+(6.9cm, -0.6cm)$)
%       {\small\textbf{Etc.}};
%       
%       \node[anchor=south west] at ($(score.north west)+(0.0cm, -0.2cm)$)
%       {\small\textbf{a)}};
%       
%       \node[anchor=south west] at ($(score.north west)+(5.1cm, -0.2cm)$)
%       {\small\textbf{b)}};
%       \\
%       \node[anchor=south west] at ($(score.north west)+(9.5cm, -0.2cm)$)
%       {\small\textbf{c)}};
%       \node[anchor=south west] at ($(score.north west)+(13.1cm, -0.2cm)$)
%       {\small\textbf{d)}};
% PUNTOS DE REFERENCIA
%\fill[red]   ($(score.north west)+(4.4cm,-0.9cm)$) circle (1pt); % INICIO
%\fill[blue]  ($(score.north west)+(0.5cm,-1.2cm)$) circle (1pt); % FIN
%\fill[green] ($(score.north west)+(14.5cm,-0.9cm)$) circle (1pt); % CONTROL 1
%\fill[green] ($(score.north west)+(14.2cm,-1.1cm)$) circle (1pt); % CONTROL 2
%\end{tikzpicture}
\end{document}%

\bigskip is my old fashioned way to have a larger line break within music. You can see where I disactivated the \begin{tikzpicture} etc. and where I inserted it.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.