gregorio-project / gregorio

The Gregorio Project
http://gregorio-project.github.io
Other
164 stars 43 forks source link

Scribus having trouble with gabc headers in 5.2.1 #1457

Closed domoknight closed 5 years ago

domoknight commented 5 years ago

The score is rendering in Scribus, but the gabc headers appear to be ignored.

Using the sample gabc:

name: myscore; mode: 6; commentary: howdy; %% (c3) Pó(eh/hi)pu(h)lus(h) Si(hi)on,(hgh.)

No mode number is shown. Also, even though I'm using \gresetheadercapture{commentary}{grecommentary[3mm]}{string} no commentary is printed.

An excerpt from the logfile is as follows:

Module gregoriotex Info: capturing header commentary using grecommentary[3mm], s
tring=true, name=nil on input line 24
Module gregoriotex Info: scribus_file-score.gabc has been modified and scribus_f
ile-score-5_2_1.gtex needs to be updated. Recompiling the gabc file. on input li
ne 25
Module gregoriotex Info: compiling the score scribus_file-score.gabc... on input
 line 25
Module gregoriotex Info: will use gregorio-5_2_1 on input line 25

Module gregoriotex Warning: warning:no name specified, put `name:...;' at the be
ginning of the file, can be dangerous with some output formats on input line 25
Module gregoriotex Warning: *** end of warnings for scribus_file-score.gabc *** 
on input line 25
domoknight commented 5 years ago

This appears to be related to the rewrite of the Scribus tool (900_gregorio.xml). Somewhere along the way, the gabc header info is not getting passed along. If I use the 900_gregorio.xml file from the 5.1.1 build, the header data passes through just fine. (annotation text appears and gresetheadercapture works)

rpspringuel commented 5 years ago

Thanks for the info. I’ll have to look into that, but it may not be until after Easter.

Sent with GitHawk

rpspringuel commented 5 years ago

I've had a chance to do some additional investigation, and the problem appears to be the use of the filecontents environment. This environment adds a comment header which uses %% to mark itself and therefore fouls up the executable's ability to detect the proper header (we use %% to mark the transition from headers to score). The correct environment to use is filecontents* which doesn't add the comment header. However, I haven't had the chance to fully test this because of other problems I'm having with my installation. If someone else can test and verify the diagnosis, then I'll put up the PR with a fix. Otherwise this will have to wait until I fully sort out the problem with my system.

domoknight commented 5 years ago

Does testing this involve changing the call to filecontents in the 900 file like this?

    \begin{filecontents*}{scribus_file-score.gabc}
</preamble>
<postamble>
    \end{filecontents*}
rpspringuel commented 5 years ago

Exactly.

domoknight commented 5 years ago

That appears to fix what gets written in the generated *.gabc file, but seems to break other things. See log excerpt below:

Module gregoriotex Warning: error:unrecognized character: " " in definition par t on input line 22 Module gregoriotex Warning: error:unrecognized character: " " in definition par t on input line 22 Module gregoriotex Warning: error:unrecognized character: " " in definition par t on input line 22 Module gregoriotex Warning: error:unrecognized character: " " in definition par t on input line 22 d:/texlive/2018/texmf-dist/tex/latex/base/ltluatex.lua:109: Module gregoriotex Error: (gregoriotex) An error occured when compiling the score file (gregoriotex) 'scribus_file-score.gabc' with gregorio-5_2_1. (gregoriotex) Please check your score file. on input line 22

stack traceback: [C]: in function 'error' d:/texlive/2018/texmf-dist/tex/latex/base/ltluatex.lua:109: in function <d:/te xlive/2018/texmf-dist/tex/latex/base/ltluatex.lua:108> (...tail calls...) ...xlive/texmf-local/tex/luatex/gregoriotex/gregoriotex.lua:827: in function ' compile_gabc' ...xlive/texmf-local/tex/luatex/gregoriotex/gregoriotex.lua:891: in function ' include_score' [\directlua]:1: in main chunk. \gre@gregorioscore ...allowdeprecated@asboolean )} \or \gre@debugmsg {compile...

l.22 \gregorioscore{scribus_file-score}

(./scribus_temp_render_g18936.aux)) (see the transcript file for additional information) 444 words of node memory still in use: 3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 2 glyph, 8 attribute, 49 glue_spec , 8 attribute_list, 2 write, 1 user_defined, 1 pdf_colorstack nodes avail lists: 2:8,3:3,4:1,5:8,7:1,8:1,9:1

warning (pdf backend): no pages of output. Transcript written on scribus_temp_render_g18936.log.

rpspringuel commented 5 years ago

Can you go into the temporary directory that Scribus is creating and copy out the generated scribus_file-score.gabc and post that here for me to look at?

domoknight commented 5 years ago

Here is the .gabc and the .gtex scribus_file-score.zip

rpspringuel commented 5 years ago

Okay, those errors appear to be caused by the introduction of whitespace before name: in the gabc file. I think we have to wreck the indentation of the <preamble> block in 900_gregorio.xml to fix that. It'll make the file harder for a human to read, but what's that compared to making it work?

Let's try the least destructive method first: take lines 51 and 52 and combine them so that line 51 now reads like this:

        \begin{filecontents*}{scribus_file-score.gabc}</preamble>
domoknight commented 5 years ago

Things are still a bit busted. Here's a cat of the log:

This is LuaTeX, Version 1.07.0 (TeX Live 2018/W32TeX) system commands enabled.

(c://AppData/Local/Temp/ScribusPortableTemp/scribus_temp_render_g12 592 LaTeX2e <2018-12-01>

luaotfload | main : initialization completed in 0.239 seconds (d:/texlive/2018/texmf-dist/tex/latex/extsizes/extarticle.cls Document Class: extarticle 1996/10/08 v1.0 Non Standard LaTeX document class (d:/texlive/2018/texmf-dist/tex/latex/base/size11.clo) (d:/texlive/2018/texmf-dist/tex/latex/base/exscale.sty)) (d:/texlive/2018/texmf-dist/tex/latex/geometry/geometry.sty (d:/texlive/2018/texmf-dist/tex/latex/graphics/keyval.sty) (d:/texlive/2018/texmf-dist/tex/generic/oberdiek/ifpdf.sty) (d:/texlive/2018/texmf-dist/tex/generic/oberdiek/ifvtex.sty) (d:/texlive/2018/texmf-dist/tex/generic/ifxetex/ifxetex.sty)) (d:/texlive/texmf-local/tex/lualatex/gregoriotex/gregoriotex.sty (d:/texlive/2018/texmf-dist/tex/latex/xcolor/xcolor.sty (d:/texlive/2018/texmf-dist/tex/latex/graphics-cfg/color.cfg) (d:/texlive/2018/texmf-dist/tex/latex/graphics-def/luatex.def)) (d:/texlive/2018/texmf-dist/tex/latex/oberdiek/kvoptions.sty (d:/texlive/2018/texmf-dist/tex/generic/oberdiek/ltxcmds.sty) (d:/texlive/2018/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty (d:/texlive/2018/texmf-dist/tex/generic/oberdiek/infwarerr.sty) (d:/texlive/2018/texmf-dist/tex/generic/oberdiek/etexcmds.sty (d:/texlive/2018/texmf-dist/tex/generic/oberdiek/ifluatex.sty)))) (d:/texlive/2018/texmf-dist/tex/latex/graphics/graphicx.sty (d:/texlive/2018/texmf-dist/tex/latex/graphics/graphics.sty (d:/texlive/2018/texmf-dist/tex/latex/graphics/trig.sty) (d:/texlive/2018/texmf-dist/tex/latex/graphics-cfg/graphics.cfg))) (d:/texlive/2018/texmf-dist/tex/luatex/luatexbase/luatexbase.sty (d:/texlive/2018/texmf-dist/tex/luatex/ctablestack/ctablestack.sty)) (d:/texlive/2018/texmf-dist/tex/luatex/luamplib/luamplib.sty) (d:/texlive/2018/texmf-dist/tex/generic/xstring/xstring.sty (d:/texlive/2018/texmf-dist/tex/generic/xstring/xstring.tex)) (d:/texlive/texmf-local/tex/luatex/gregoriotex/gregoriotex-main.tex (d:/texlive/texmf-local/tex/luatex/gregoriotex/gregoriotex-common.tex) (scribus_temp_render_g12592.gaux) (d:/texlive/texmf-local/tex/luatex/gregoriotex/gregoriotex-spaces.tex) (d:/texlive/texmf-local/tex/luatex/gregoriotex/gregoriotex-chars.tex) (d:/texlive/texmf-local/tex/luatex/gregoriotex/gregoriotex-signs.tex) (d:/texlive/texmf-local/tex/luatex/gregoriotex/gregoriotex-syllable.tex) (d:/texlive/texmf-local/tex/luatex/gregoriotex/gregoriotex-symbols.tex) (d:/texlive/texmf-local/tex/luatex/gregoriotex/gsp-default.tex) (d:/texlive/texmf-local/tex/luatex/gregoriotex/gregoriotex-nabc.tex))) (d:/texlive/2018/texmf-dist/tex/latex/filecontents/filecontents.sty) (d:/texlive/2018/texmf-dist/tex/latex/fontspec/fontspec.sty (d:/texlive/2018/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (d:/texlive/2018/texmf-dist/tex/latex/l3kernel/expl3.sty (d:/texlive/2018/texmf-dist/tex/latex/l3kernel/expl3-code.tex) (d:/texlive/2018/texmf-dist/tex/latex/l3kernel/l3pdfmode.def))) (d:/texlive/2018/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty (d:/texlive/2018/texmf-dist/tex/latex/base/fontenc.sty (d:/texlive/2018/texmf-dist/tex/latex/base/tuenc.def)) (d:/texlive/2018/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (d:/texlive/2018/texmf-dist/tex/latex/libertine/libertine.sty (d:/texlive/2018/texmf-dist/tex/latex/xkeyval/xkeyval.sty (d:/texlive/2018/texmf-dist/tex/generic/xkeyval/xkeyval.tex (d:/texlive/2018/texmf-dist/tex/generic/xkeyval/xkvutils.tex))) (d:/texlive/2018/texmf-dist/tex/latex/base/textcomp.sty (d:/texlive/2018/texmf-dist/tex/latex/base/ts1enc.def)) (d:/texlive/2018/texmf-dist/tex/latex/libertine/LinLibertine_R.tex) (d:/texlive/2018/texmf-dist/tex/latex/libertine/LinBiolinum_R.tex) (d:/texlive/2018/texmf-dist/tex/latex/libertine/LinBiolinum_K.tex) (d:/texlive/2018/texmf-dist/tex/latex/libertine/LinLibertine_I.tex) (d:/texlive/2018/texmf-dist/tex/latex/libertine/LKey.tex))

LaTeX Warning: Overwriting file `./scribus_file-score.gabc'.

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ...

l.14 ...gin{filecontents*}{scribus_file-score.gabc}n ame: myscore;

LaTeX Warning: Writing text ` ' before \end{filecontents*} as last line of scribus_file-score.gabc on input line 18.

(./scribus_temp_render_g12592.aux) (d:/texlive/2018/texmf-dist/tex/latex/base/ts1cmr.fd) geometry driver: auto-detecting geometry detected driver: luatex (d:/texlive/2018/texmf-dist/tex/context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] ) (d:/texlive/2018/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty (d:/texlive/2018/texmf-dist/tex/latex/oberdiek/grfext.sty (d:/texlive/2018/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty)) (d:/texlive/2018/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty) (d:/texlive/2018/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg)) Module gregoriotex Warning: warning:no name specified, put `name:...;' at the b eginning of the file, can be dangerous with some output formats on input line 2 2 Module gregoriotex Warning: end of warnings for scribus_file-score.gabc on input line 22 (./scribus_file-score-5_2_1.gtex) [1{d:/texlive/2018/texmf-var/fonts/map/pdftex /updmap/pdftex.map}] (./scribus_temp_render_g12592.aux)) (see the transcript file for additional information) 2729 words of node memory still in use: 68 hlist, 11 vlist, 41 rule, 3 local_par, 45 glue, 53 kern, 11 penalty, 22 g lyph, 214 attribute, 64 glue_spec, 42 attribute_list, 1 write, 1 user_defined n odes avail lists: 2:476,3:49,4:5,5:73,6:15,7:75,8:8,9:34 Module gregoriotex Warning: Line heights or variable brace lengths may have cha nged. Rerun to fix. on input line 0 <d:/texlive/texmf-local/fonts/truetype/public/gregoriotex/greciliae.ttf><d:/tex live/2018/texmf-dist/fonts/opentype/public/libertine/LinLibertine_RB.otf><d:/te xlive/2018/texmf-dist/fonts/opentype/public/libertine/LinLibertine_R.otf> Output written on scribus_temp_render_g12592.pdf (1 page, 9512 bytes). Transcript written on scribus_temp_render_g12592.log.

rpspringuel commented 5 years ago

Okay, it seems that there must be a line ending after \begin{filecontents*}{<file-name>}.

So, try having lines 51 and 52 read this way:

        \begin{filecontents*}{scribus_file-score.gabc}
</preamble>

I also note a warning about the last line scribus_file-score.gabc in that log, so make line 54 read:

\end{filecontents*}

(i.e. delete all the spaces at the beginning of the line.)

domoknight commented 5 years ago

Success!

Lines 51-54:

        \begin{filecontents*}{scribus_file-score.gabc}
</preamble>
<postamble>
\end{filecontents*}
rpspringuel commented 5 years ago

Excellent. I'll work up the PR now.

domoknight commented 5 years ago

Does the "nonstopmode" mentioned on line 25 force all the render panes in a single Scribus file to use the same gregorio options? I ask because this fix may have exposed something else for a new thread...

rpspringuel commented 5 years ago

nonstopmode simply means that LuaTeX should continue to try and create the pdf if it encounters an error instead of halting and waiting for user input (which, in some cases, can correct the error). This is to prevent the rendering tool from hanging, waiting for input that the user is unable to provide given the interface available. It should not affect the way that Scribus sets and makes use of the various options in the tool.