5

I am trying to rewrite a simple piece of melody in MusixTEX. The problem is that bar lines and end line width does not automatically align the way they're supposed to. The problem, lines and bar does not align correctly

I want them to be aligned like this:

How I want it to be formatted

Here is my code:

\documentclass[a4paper]{article}
\usepackage{musixtex}
\usepackage[a4paper]{geometry}

\begin{document}
\begin{music}%
\elemskip%    
\normalmusicsize%
\instrumentnumber{1}%
\nobarnumbers%
\setstaffs1{1}%
\generalmeter{\meterfrac{4}4}%
\generalsignature{5}%
\parindent0pt%
\startpiece%
\NOtes\Dqbl{k}{j}\en\NOTesp\hup{g}\en\bar%
\NOtes\Dqbl{k}{j}\en\NOTesp\hup{g}\en\bar%
\NOtes\Dqbl{k}{j}\en\NOTesp\hup{g}\en\bar%
\NOTEs\pause\en\bar%
\NOtes\Dqbu{d}{c}\en\NOTesp\hup{N}\en\bar%
\NOtes\Dqbu{d}{c}\en\NOTes\hu{N}\en\NOtes\Dqbu{a}{b}\en\bar%
\NOtes\Dqbu{d}{c}\en\NOTes\ha{N}\en\bar%
\Endpiece%
\end{music}%
\end{document}

I have followed the instructions to compile accoringly to the MusiXTEX manual (http://ftp.acc.umu.se/mirror/CTAN/macros/musixtex/doc/musixdoc.pdf#page.145) and my compile script is:

#!/bin/sh
# tex file is main.tex

latex main.tex
musixtex  -l -x main
latex main.tex
makeindex main
latex main.tex
latex main.tex
dvips -e0 main
ps2pdf main.ps

rm -f *.aux
rm -f *.ps
rm -f *.dvi
rm -f *.idx
rm -f *.ilg
rm -f *.ind
rm -f *.mx1
rm -f *.mx2
rm -f *.log
rm -f *.toc
rm -f *.bbl
rm -f *.blg
rm -f *.out
rm -f make/bib

I have tried several solutions, none of which has been working:

  1. MusiXTex problem with musixflx
  2. Musixtex end of line bar problem
  3. Harmonize width of MusiXTex extracts automatically

I have been extra careful to not have any spaces after the end of each line, hence the "%". I do not know where the problem lies not how to fix it. Any help is appreciated!.

1 Answer 1

5

The manual describes this issue on page 6. There an example is given of unevenly spaced music, followed by After running musixflx and TEX-ing the second time you'll get: and then an image of evenly spaced music. The compile sequence is described in more detail on the previous page, stating that there is a three pass compilation sequence: etex jobname, musixflx jobname and etex jobname again. Substituting etex for pdflatex I get the following compile sequence and result on your MWE:

pdflatex testfile.tex
musixflx testfile
pdflatex testfile.tex

enter image description here

Note that the extra bar line in the last bar is not supposed to be present, I have removed the \bar in your code to remove the line from the output.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .