Musixtex 中的五线谱和空格编号

Musixtex 中的五线谱和空格编号

需要对五线谱的线和空格进行编号,基本代码如下:

\documentclass[tikz,border=3mm]{standalone}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\setmainlanguage{spanish}

\usepackage{musixtex} 

\newlength{\musicwidth}%new
\setlength{\musicwidth}{0.75\textwidth}%new, can be set for each instance of a figure environment 


\begin{document}
The lines of the staff are numbered from bottom to top.

\begin{music}
    \font\A=phvb8t at 8pt% added for letter type.
    \instrumentnumber{1}
    \setclefsymbol{1}{\empty}%
    \nostartrule
    \hsize=\musicwidth
    \nobarnumbers
    \sepbarrules%
    \startpiece% i
    \NOTEs\wh{*****egikm}\en
    \endpiece
 \end{music}
 
The spaces between the lines are also numbered from bottom to top.

\begin{music}
    \font\A=phvb8t at 8pt% added for letter type.
    \instrumentnumber{1}
    \setclefsymbol{1}{\empty}%
    \nostartrule
    \hsize=\musicwidth
    \nobarnumbers
    \sepbarrules%
    \startpiece% i
    \NOTEs\wh{*****fhjl}\en
    \endpiece
 \end{music}

\end{document}

当前输出如下: 当前的

预期输出如下(注意需要包含行和空格的编号): 预期的

答案1

本编辑提供了两种使用方法的解决方案\tabfnt,您可以在手册中找到。数字周围有一个小白方块。否则,您必须寻找另一种可用的字体或自己定义一种字体。请注意,我将其更改\endpiece\zendpiece以消除末尾的横线。要使线条适合您的宽度,您必须将分别减小\NOTEs\NOtes\NOTes

  \documentclass[tikz,border=3mm]{standalone}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\usepackage{circledtext}
\setmainlanguage{spanish}

\usepackage{musixtex} 

\newlength{\musicwidth}%new
\setlength{\musicwidth}{0.75\textwidth}%new, can be set for each instance of a figure environment 


\begin{document}
The lines of the staff are numbered from bottom to top.

\begin{music}
    \font\A=phvb8t at 8pt% added for letter type.
    \instrumentnumber{1}%
    \setclefsymbol{1}{\empty}%
    \nostartrule
   \hsize=\musicwidth
    \nobarnumbers
    \sepbarrules%
    \startpiece% i
    \NOtes\hsk\tab{5}{1}\tab{4}{2}\tab{3}{3}\tab{2}{4}\tab{1}{5}\wh{egikm}\en% using standard tab command, which works like this only for lines
    \zendpiece
 \end{music}
 
The spaces between the lines are also numbered from bottom to top.

\begin{music}
    \font\A=phvb8t at 8pt% added for letter type.
    \instrumentnumber{1}
    \setclefsymbol{1}{\empty}%
    \nostartrule
    \hsize=\musicwidth
    \nobarnumbers
    \sepbarrules%
\tabfnt % using tabfnt for all test or numbers, to not do so for every charnote individually
    \startpiece%
    \NOTes\hsk\charnote e{1}\charnote g{2}\charnote i{\tabfnt 3}\charnote k{\tabfnt 4}\wh{fhjl}\en
    \zendpiece
 \end{music}

\end{document}

表位

答案2

\documentclass[tikz,border=3mm]{standalone}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\usepackage{circledtext}
\setmainlanguage{spanish}

\usepackage{musixtex} 

\newlength{\musicwidth}%new
\setlength{\musicwidth}{0.75\textwidth}%new, can be set for each instance of a figure environment 


\begin{document}
The lines of the staff are numbered from bottom to top.

\begin{music}
    \font\A=phvb8t at 7pt% added for letter type.
    \instrumentnumber{1}%
    \setclefsymbol{1}{\empty}%
    \nostartrule
   \hsize=\musicwidth
    \nobarnumbers
    \sepbarrules%
    \startpiece% i
    \NOtes\hsk\tab{5}{\A 1}\tab{4}{\A 2}\tab{3}{\A 3}\tab{2}{\A 4}\tab{1}{\A 5}\wh{egikm}\en% using standard tab command, which works like this only for lines
    \zendpiece
 \end{music}
 
The spaces between the lines are also numbered from bottom to top.

\begin{music}
    \font\A=phvb8t at 7pt% added for letter type.
    \instrumentnumber{1}
    \setclefsymbol{1}{\empty}%
    \nostartrule
    \hsize=\musicwidth
    \nobarnumbers
    \sepbarrules%
\tabfnt % using tabfnt for all test or numbers, to not do so for every charnote individually
    \startpiece%
    \NOTes\hsk\charnote e{\tabfnt \A 1}\charnote g{\A 2}\charnote i{\tabfnt \A 3}\charnote k{\tabfnt \A 4}\wh{fhjl}\en
    \zendpiece
 \end{music}

\end{document}

解决了

相关内容