gregorio-project / gregorio

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

Change to line 51 of 900_gregorio.xml to make it work in Scribus #1523

Closed EagerDSC closed 3 years ago

EagerDSC commented 3 years ago

When using gregorio with the latest version of Scribus and the latest version of TexLive, I needed to change line 51 of 900_gregorio.xml to read

\begin{filecontents}[force]{scribus_file-score.gabc}

Without this addition of the [force] option, LaTex would refuse to overwrite scribus_file-score.gabc, so that I was only able to make render frames with the default preview score. It looks like it is due to changes in the way that the LaTex kernel handles the filecontents package. See here: https://www.latex-project.org/news/latex2e-news/ltnews30.pdf

rpspringuel commented 3 years ago

@EagerDSC Please review #1524

EagerDSC commented 3 years ago

This version of the file causes a LaTex error. I believe this is because the [overwrite] option must come after {filecontents}.

The error is fixed when I move [overwrite] between {filecontents} and {scribus_file-score.gabc}, like so:

\begin{filecontents}[overwrite]{scribus_file-score.gabc}

EagerDSC commented 3 years ago

Once the above change made it possible to overwrite the file, I found that the filecontents environment automatically added a header toscribus_file-score.gabc that included %%, causing the gabc headers that I entered into the Scribus render frame editor to be ignored. I thus used the filecontents* environment to remove that automated header. This strangely prepends exactly 4 spaces to the beginning of the file contents for scribus_file-score.gabc. Given this input for the Scribus render frame editor NoBlankLine, the resulting scribus_file-score.gabc file is

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

These four leading spaces cause gregorio to throw an error. I tried removing white space from various parts of the XML, but none of it was related to those 4 spaces. Ultimately the workaround was to add a blank line to the top of my gabc code in the Scribus render frame editor like this: WithBlankLine . This results in a blank line at the beginning of the scribus_file-score.gabc file (but no spaces), which gregorio seems to handle fine, and all of the gabc headers that I enter into the render frame editor work as well. The only changes to the XML file were in lines 51 and 54, so that lines 51-54 now look like this:

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

@EagerDSC I've updated the PR. Hopefully I found those spaces that you were talking about and eliminated the need for the blank line.