\import help when gabc is involved

14 views
Skip to first unread message

Noah Lovins

unread,
Jul 8, 2025, 8:56:10 AMJul 8
to Gregorio Users
Hello all,

I am creating a liturgical booklet for our patron's feast day, and I have the office and mass files in separate directories. All my gabc and tex files for the office are in the `office` folder, but I'd like to insert the Mass into the booklet after terce, which is in a separate `mass` folder. I was able to use \import to get the tex file into the project, but it won't take the gabc files with it. It's saying the gabc files don't exist (they do, they're just in the `mass` folder). Does anyone have any ideas?

Thanks!
-Noah

Gregory Robert Barnes

unread,
Jul 8, 2025, 9:09:47 AMJul 8
to gregori...@googlegroups.com
For me it works to keep all the gabc files in the project root. An imported Tex file always looks in the directory relative to the importing file, not the imported file. "Nested imports" are not too intuitive.


--
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 visit https://groups.google.com/d/msgid/gregorio-users/52748ede-f55a-446a-8de8-8529781760a2n%40googlegroups.com.
Message has been deleted

Noah Lovins

unread,
Jul 10, 2025, 7:54:39 AMJul 10
to Gregorio Users
That seems really shady to not be able to work with sorted directories easily; our project is nearly 80 pages. I'd rather keep my files in their separate folders organized nice and properly. If things get complicated, so be it. Do you know how to work around it?

-Noah

Fr. Anthony VanBerkum, O.P.

unread,
Jul 10, 2025, 9:36:46 AMJul 10
to gregori...@googlegroups.com
You just need to think carefully about how you write the import: eg maybe
write a macro that prepends the proper directory structure. It'll
probably take some trial and error to figure out what the working
directory is each time you include a score, but it shouldn't be too
complex. My guess is that in mass/index.tex you want to be loading
mass/score.gabc (including 'mass/').

Remember that LaTeX is basically doing a find-and-replace on your base
.tex file until all the backslashes are gone. It doesn't know that some
of the "replace" side of that came from a subdirectory. (I'm sure this is
an even grosser oversimplification than I think it is, but it helps me
think through file structures when working with LaTeX.)

(If you want to also be able to build mass/index.tex on its own, then you
probably need a more complex macro that checks a flag set in both
/index.tex and mass/index.tex.)

I haven't used gregorio in a while, but I did always keep the gabc in a
subdirectory, and it worked fine.

Jul 10, 2025 13:54:40 Noah Lovins <noahlov...@gmail.com>:
>> http://www.mail-archive.com/gregori...@gna.org/[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 visit
>> https://groups.google.com/d/msgid/gregorio-users/52748ede-f55a-446a-8de8-8529781760a2n%40googlegroups.com[https://groups.google.com/d/msgid/gregorio-users/52748ede-f55a-446a-8de8-8529781760a2n%40googlegroups.com?utm_medium=email&utm_source=footer].
>
> --
> 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 visit
> https://groups.google.com/d/msgid/gregorio-users/0f490f13-6a61-41c1-a3c1-726d92010e8cn%40googlegroups.com[https://groups.google.com/d/msgid/gregorio-users/0f490f13-6a61-41c1-a3c1-726d92010e8cn%40googlegroups.com?utm_medium=email&utm_source=footer].

Matthias Bry

unread,
Jul 10, 2025, 9:40:43 AMJul 10
to gregori...@googlegroups.com
You can take a look at how https://github.com/Nocturnale-Romanum/nocturnale-romanum/ works, for an example of a very large project.

The subfile package is used to share headers among multiple tex files that can be built independently or collectively.
The gabc is in a subfolder (in this case, it's flat, but subfolders can be nested as needed).

In Christo,
Matthias

rled...@gmail.com

unread,
Jul 10, 2025, 9:55:43 AMJul 10
to gregori...@googlegroups.com

\import apparently can accept a path and filename but they appear to be different arguments? E.g. 

\import{Christmas}{Introit}

To include the file Introit.tex in subdirectory ./Christmas, where . is the location of your main Tex file. You could give a full path instead to be sure but generally relative paths are better for if you move things around.

Import has been modified so that the path no longer needs to end with \ but it used to.

See this link for some discussion on the topic:

I find texexchange to be very useful for Tex questions although they know nothing of Gregorio in general.

Rob

No dia 10 de jul. de 2025, às 8:36 AM, Fr. Anthony VanBerkum, O.P. <antho...@gmail.com> escreveu:

You just need to think carefully about how you write the import: eg maybe write a macro that prepends the proper directory structure. It'll probably take some trial and error to figure out what the working directory is each time you include a score, but it shouldn't be too complex. My guess is that in mass/index.tex you want to be loading mass/score.gabc (including 'mass/').
Reply all
Reply to author
Forward
0 new messages