\include another .tex file that uses gregorio

62 views
Skip to first unread message

Ian Williams

unread,
May 26, 2022, 7:54:03 AM5/26/22
to Gregorio Users
Hi, I'm a relatively new gregorio an latex user, so forgive me if I'm missing the obvious, or a previous relevant conversation.

I'd like to better manage a large latex document that inporporates many gabc files, by breaking it down into a master tex document and a number of sub-documents, inorprated into main with \include.  Each of the sub-documents has text and one or more invocations of \gregorioscore.

\include requires me to strip all preamble from the included document, i.e. everything up to and including \begin{document}, and \end{document}.

Long story short: when I do this and compile the main document, I get underfill and overfill errors that I didn't get when I compiled the sub-documemnts seperately (with their preamble).  My question is: can I \include sub-documents that emloy gregorio, or is that not possible?

Fr. Anthony VanBerkum, O.P.

unread,
May 26, 2022, 10:49:58 AM5/26/22
to gregori...@googlegroups.com
Does the final output PDF still look as you expected? In my experience, I'll somewhat frequently see underfill and overfill messages but still get a perfectly fine PDF file at the end.

--
Gregorio homepage: http://gregorio-project.github.io
Archives for the old mailing list: http://www.mail-archive.com/gregori...@gna.org/
To report a bug, please post to: https://github.com/gregorio-project/gregorio/issues
---
You received this message because you are subscribed to the Google Groups "Gregorio Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gregorio-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gregorio-users/46ac42d0-ae3e-4c29-89fc-8f91e9c1bd1en%40googlegroups.com.

Ian Williams

unread,
May 27, 2022, 8:37:52 AM5/27/22
to Gregorio Users
Thanks for the reply, Br. Anthony.  Allas, the PDF includes the text from the included .tex file, but not the chant.

Ian Williams

unread,
Jun 25, 2022, 7:08:36 AM6/25/22
to Gregorio Users

'm going to answer my own question, as I worked out what the problem was.

My included sub-document gave a path to the gregorio score (gabc file) relative to the sub-document's location. When I changed the path to give it from the master document's location the compilation succeeded, and a pdf was output which included the gregorio score.

Matthias Bry

unread,
Jul 11, 2022, 11:53:08 AM7/11/22
to gregori...@googlegroups.com
Hello Ian,

If I am not mistaken, this in turn breaks the compilation of the individual .tex files.

A great solution to this problem is the package subfiles, which has a macro to fix relative paths that would otherwise break when building either the master document or one of the individual files.

This is what I use for the Nocturnale Romanum : look at https://github.com/Nocturnale-Romanum/nocturnale-romanum

(Kind of a bad example because the main nocturnale-romanum.tex and the many subfiles are in the same directory, but it should work if they were not.

Shout-out to our very own Rob Leduc for pointing me to this solution at the time I was starting the project.

In Christo,

MB

Le 25 juin 2022 à 13:08, Ian Williams <ianw1...@gmail.com> a écrit :



Ian Williams

unread,
Sep 10, 2022, 7:43:01 AM9/10/22
to Gregorio Users
Thank you, Matthias (and Rob) for this solution, which is much cleaner than mine. 
Reply all
Reply to author
Forward
0 new messages