rfhh / lily-contribs

Contributions (converters, patches, ...) to Lilypond
2 stars 0 forks source link

Exception "Unknown TeX parameter type', '='" #1

Open mauritslamers opened 8 years ago

mauritslamers commented 8 years ago

First of all: great work!!

When trying to convert the included 'choral1.pmx', an exception is thrown. It is most likely causes by the line

\\\assignlyrics2{choral1}\stdbarrules\advance\barno by -2\

as removing \barno by -2\ causes a successful conversion. At first I though that it might have been caused by the custom barno function as the original is replaced in the mychoral.tex file, but removing either the assignment itself or the definition as a whole doesn't make the exception going away.

The source of the material is http://www1.cpdl.org/wiki/index.php/St_Matthew_Passion,_BWV_244_%28Johann_Sebastian_Bach%29

The conversion log is:

pmx2ly from LilyPond 2.18.0
Processing `choral1.pmx'
FIXME: need to include file 'musixtex'
FIXME: need to include file 'pmx'
FIXME: need to include file 'musixlyr'
Now consider instrument 

 = 

Now consider instrument 

 = 

Now clef b
Now clef t
FIXME: need to include file 'mychoral\line{}\'
FIXME: unsupported TeX function '\interstaff', hope it does not take parameters
FIXME: unsupported TeX function '\relax', hope it does not take parameters
FIXME: implement TeX function '\songtop'
FIXME: implement TeX function '\songbottom'
FIXME: unsupported TeX function '\palbie', hope it does not take parameters
FIXME: unsupported TeX function '\PAR', hope it does not take parameters
FIXME: unsupported TeX function '\ss', hope it does not take parameters
FIXME: unsupported TeX function '\tin', hope it does not take parameters
Ignore: no ornament positioning
Ignore: no horizontal shift
Ignore: no alteration shift
Assign lyrics{choral1} to staff[2]
FIXME: unsupported TeX function '\stdbarrules', hope it does not take parameters
FIXME: unsupported TeX function '\advance', hope it does not take parametersTraceback (most recent call last):
  File "../pmx2ly.py", line 3253, in <module>
    left = e.parse(f)
  File "../pmx2ly.py", line 3145, in parse
    self.parse_body(left)
  File "../pmx2ly.py", line 3035, in parse_body
    (left, result, post) = self.parse_tex_function(left)
  File "../pmx2ly.py", line 2329, in parse_tex_function
    (left, params) = self.tex_params(left, params)
  File "../pmx2ly.py", line 2268, in tex_params
    raise Exception("Unknown TeX parameter type", params[i])
Exception: ('Unknown TeX parameter type', '=')

Edit: fix grammar. choral1.zip

rfhh commented 8 years ago

\advance is a TeX command. pmx supports full TeX, and I am afraid there is no way that pmx2ly can fully mimic that. pmx2ly knows about quite a number of TeX commands, but \advance is not one of them. Two ways to cope with this: 1) remove the \advance command and its argument(s) 2) add \advance to the list of TeX commands recognized, and most probably ignored, by pxm2ly.

I had added to the TODO for pmx2ly: a run-time flag to define/ignore TeX commands. This would help: you then would be able to invoke: $ pmx2ly -U\advance 2 or something like that. But, as I said, this is Future Work(TM)

Anyway, you might consider whether just removing this increment to \barno isn't easier to fix, or is automatically handled, by Lilypond after the fact; then you would choose "solution" 1).

Rutger

On 03/31/2016 11:59 AM, Maurits Lamers wrote:

First of all: great work!!

When trying to convert the included 'choral1.pmx', an exception is thrown. It is most likely causes by the line

|\assignlyrics2{choral1}\stdbarrules\advance\barno by -2\ |

as removing |\barno by -2| causes a successful conversion. At first I though that it might have been caused by the custom barno function as the original is replaced in the mychoral.tex file, but removing either the assignment itself or the definition as a whole don't make the exception going away.

The source of the material is http://www1.cpdl.org/wiki/index.php/St_Matthew_Passion,_BWV_244_%28Johann_Sebastian_Bach%29

The conversion log is:

|pmx2ly from LilyPond 2.18.0 Processing `choral1.pmx' FIXME: need to include file 'musixtex' FIXME: need to include file 'pmx' FIXME: need to include file 'musixlyr' Now consider instrument = Now consider instrument = Now clef b Now clef t FIXME: need to include file 'mychoral\line{}\' FIXME: unsupported TeX function '\interstaff', hope it does not take parameters FIXME: unsupported TeX function '\relax', hope it does not take parameters FIXME: implement TeX function '\songtop' FIXME: implement TeX function '\songbottom' FIXME: unsupported TeX function '\palbie', hope it does not take parameters FIXME: unsupported TeX function '\PAR', hope it does not take parameters FIXME: unsupported TeX function '\ss', hope it does not take parameters FIXME: unsupported TeX function '\tin', hope it does not take parameters Ignore: no ornament positioning Ignore: no horizontal shift Ignore: no alteration shift Assign lyrics{choral1} to staff[2] FIXME: unsupported TeX function '\stdbarrules', hope it does not take parameters FIXME: unsupported TeX function '\advance', hope it does not take parametersTraceback (most recent call last): File "../pmx2ly.py", line 3253, in left = e.parse(f) File "../pmx2ly.py", line 3145, in parse self.parse_body(left) File "../pmx2ly.py", line 3035, in parse_body (left, result, post) = self.parse_tex_function(left) File "../pmx2ly.py", line 2329, in parse_tex_function (left, params) = self.tex_params(left, params) File "../pmx2ly.py", line 2268, in tex_params raise Exception("Unknown TeX parameter type", params[i]) Exception: ('Unknown TeX parameter type', '=') |

choral1.zip https://github.com/rfhh/lily-contribs/files/197369/choral1.zip

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/rfhh/lily-contribs/issues/1