lewdlime / abcm2ps

abcm2ps is a command line program which converts ABC to music sheet in PostScript or SVG format. It is an extension of abc2ps which may handle many voices per staff. abcm2ps is Copyright © 2014-2016 Jean-Francois Moine.
http://moinejf.free.fr/
GNU General Public License v3.0
84 stars 31 forks source link

multicol text with a blank line (for paragraph) confuses abcm2ps parser #116

Closed be1 closed 9 months ago

be1 commented 9 months ago

Hello, Following is a small abc test file that confuses abcm2ps when used with flag -e because of a blank line at line 9:

X:1
T:test 1
K:C
C8|]
%
%%multicol start
%%begintext
test with a blank line 1

test text part 1
%%endtext
%%multicol new
%%begintext
test without a blank line 2
test text par 2
%%endtext
%%multicol end

X:2
T:test 2
K:C
C8|]
$ abcm2ps test.abc => OK
$ abcm2ps test.abc -e 1 => OK
$ abcm2ps test.abc -e 2 => KO (messy postscript layout)
File test.abc
test.abc:12:0: error: %%multicol new without start
test.abc:17:0: error: %%multicol end without start
Output written on Out.ps (1 page, 1 title, 20010 bytes)
moinejf commented 9 months ago

In a ABC file, the tunes start on a X: line and stop on an empty line.

There can be empty lines inside a tune when these ones are wrapped by some mechanism as %%multicol, %%beginxxx. But this is not standard. The correct way is to start such empty lines by a comment '%' or '%%'.

Here is how your example can work:

X:1
T:test 1
K:C
C8|]
%
%%multicol start
%%begintext
test with a blank line 1
%%
test text part 1
%%endtext
%%multicol new
%%leftmargin 10cm
%%rightmargin 5cm
%%begintext
test without a blank line 2
test text par 2
%%endtext
%%multicol end

X:2
T:test 2
K:C
C8|]
be1 commented 9 months ago

The correct way is to start such empty lines by a comment '%' or '%%'.

Thank you for your reply. This is okay now.