General ⇒ MusixTeX: How to add number and label to music extract?
MusixTeX: How to add number and label to music extract?
I'm wondering how to add labels, numbering andreferences to music extracts. I'd like to have something like I have for pictures. Is sometthing similar available in MusixTeX?
Thx.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10361
- Joined: Mon Mar 10, 2008 9:44 pm
MusixTeX: How to add number and label to music extract?
figure
environment also for pieces of music. It doesn't have to be a picture. So you can have a caption and numbering.Second option, you could use a
theorem
environment for music. That's a tool for any numbered environment, not only for theorems or definitions. Quick example:Code: Select all
\documentclass[a4paper,12pt]{article}
\usepackage[T1]{polski}
\usepackage[cp1250]{inputenc}
\usepackage{pslatex}
\usepackage{graphicx}
\usepackage{framed}
\usepackage{musixtex}
\usepackage[top=1cm,left=2cm,right=2cm,bottom=1cm]{geometry}
\newtheorem{mus}{Music}
\newcommand{\musicref}[1]{(Music \ref{#1})}
\include{musixlyr}
\begin{document}
\begin{mus}
\label{music:1}
\begin{music}
\setlength\parindent{0pt}
\generalsignature{2}
% use smallest available size:
\smallmusicsize
\renewcommand*\writebarno{\textit{\the\barno}}
\systemnumbers
\setlyrics{text}{%
Ra-dosť krás-na isk-ra bo-hov E-ly-zej-ská dcé-ra ty, o-má-me-ní
}
\assignlyrics1{text}
\startextract
\NOtes\qu{ffgh}\enotes
\barre
\NOTes\qu{hgfe}\enotes
\barre
\NOtes\qu{ddef}\enotes
\barre
\NOTes\qup f\cu e\hu e\enotes
\barre
\NOtes\qu{ffgh}\enotes
\endextract
\end{music}
\end{mus}
\begin{mus}
\label{music:2}
\begin{music}
\setlength\parindent{0pt}
\generalsignature{2}
% use smallest available size:
\smallmusicsize
\renewcommand*\writebarno{\textit{\the\barno}}
\systemnumbers
%\setlyrics{text}{
% Ra-dosť krás-na isk-ra bo-hov E-ly-zej-ská dcé-ra ty, o-má-me-ní
% }
%\assignlyrics1{text}
%\setlyrics{text}{
% Ra-dosť krás-na isk-ra bo-hov E-ly-zej-ská dcé-ra ty, o-má-me-ní
% }
\assignlyrics1{}
\startextract
\NOtes\qu{ffgh}\enotes
\barre
\NOTes\qu{hgfe}\enotes
\barre
\NOtes\qu{ddef}\enotes
\barre
\NOTes\qup f\cu e\hu e\enotes
\barre
\NOtes\qu{ffgh}\enotes
\endextract
\end{music}
\end{mus}
See \musicref{music:1} and \musicref{music:2}.
\end{document}
MusixTeX: How to add number and label to music extract?
But when I compile the piece you presented I got ?? instead of numbers when I refer to my music pieces.
Instead having Music 1 and Music 2 I've got Music ?? and Music ??
- Stefan Kottwitz
- Site Admin
- Posts: 10361
- Joined: Mon Mar 10, 2008 9:44 pm
MusixTeX: How to add number and label to music extract?
1. Using theorem environment how I can move Music 1 under my piece of music to the middle?
2. Using theorem environment how I can modify that Music 1 to be not bold and smaller font?
3. Using figure environment how I can change the name 'Figure' to 'Piece music'?
Thanks
MusixTeX: How to add number and label to music extract?
Stefan Kottwitz wrote:Compile two times,
Stefan
Great
- Stefan Kottwitz
- Site Admin
- Posts: 10361
- Joined: Mon Mar 10, 2008 9:44 pm
MusixTeX: How to add number and label to music extract?

Code: Select all
\documentclass[a4paper,12pt]{article}
\usepackage[T1]{polski}
\usepackage[utf8]{inputenc}
\usepackage{pslatex}
\usepackage{graphicx}
\usepackage{framed}
\usepackage{musixtex}
\usepackage[top=1cm,left=2cm,right=2cm,bottom=1cm]{geometry}
\include{musixlyr}
\usepackage{float}
\renewcommand{\figurename}{Music}
\begin{document}
\begin{figure}[H]
\begin{music}
\setlength\parindent{0pt}
\generalsignature{2}
% use smallest available size:
\smallmusicsize
\renewcommand*\writebarno{\textit{\the\barno}}
\systemnumbers
\setlyrics{text}{%
Ra-dosť krás-na isk-ra bo-hov E-ly-zej-ská dcé-ra ty, o-má-me-ní
}
\assignlyrics1{text}
\startextract
\NOtes\qu{ffgh}\enotes
\barre
\NOTes\qu{hgfe}\enotes
\barre
\NOtes\qu{ddef}\enotes
\barre
\NOTes\qup f\cu e\hu e\enotes
\barre
\NOtes\qu{ffgh}\enotes
\endextract
\end{music}
\caption{First one.}
\label{music:1}
\end{figure}
\begin{figure}[H]
\begin{music}
\setlength\parindent{0pt}
\generalsignature{2}
% use smallest available size:
\smallmusicsize
\renewcommand*\writebarno{\textit{\the\barno}}
\systemnumbers
%\setlyrics{text}{
% Ra-dosť krás-na isk-ra bo-hov E-ly-zej-ská dcé-ra ty, o-má-me-ní
% }
%\assignlyrics1{text}
%\setlyrics{text}{
% Ra-dosť krás-na isk-ra bo-hov E-ly-zej-ská dcé-ra ty, o-má-me-ní
% }
\assignlyrics1{}
\startextract
\NOtes\qu{ffgh}\enotes
\barre
\NOTes\qu{hgfe}\enotes
\barre
\NOtes\qu{ddef}\enotes
\barre
\NOTes\qup f\cu e\hu e\enotes
\barre
\NOtes\qu{ffgh}\enotes
\endextract
\end{music}
\caption{Second one.}
\label{music:2}
\end{figure}
See \ref{music:1} and \ref{music:2}.
\end{document}