Merging publication files

17 views
Skip to first unread message

Steven Clontz

unread,
May 27, 2026, 8:34:54 PM (3 days ago) May 27
to PreTeXt development
If one has multiple output targets, it's not uncommon that one needs several publication files that are only slightly different from one another -- often there's several core settings that all targets share, with slight tweaks from target-to-target.

However, I believe there's no way to "override" settings set in one publication file by xi:include-ing another.

One idea: when looking up publication file settings, we could support several nested `<publication/>` tags. That is, when looking for `/publication/common/tableofcontents`, we could also match `/publication/publication/common/tableofcontents` or `/publication/publication/publication/common/tableofcontents` or...

When multiple are present, then we prefer the least nested. That allows for a pattern like this:

<!-- tweaked settings publication file that only chnages the level of the tableofcontents -->
<publication xmlns:xi="http://www.w3.org/2001/XInclude">
  <common>
    <tableofcontents level="2" />
    <xi:include href="./main-publication.xml"/> <!-- has root #publication element -->
  </common>
</publication>


See also the mess happening at https://github.com/TeamBasedInquiryLearning/library/pull/1036/changes where I have duplicate so much for our project with 15+ targets. If there's an existing solution that doesn't require any changes to core pretext, I'm all ears. 😅

Sean Fitzpatrick

unread,
May 27, 2026, 9:12:08 PM (3 days ago) May 27
to PreTeXt development
APEX (and its 14 publication files) is in this post, and I don't like it.  ;-)

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/667c29ed-7392-41b5-b7f4-548e29b1dd42n%40googlegroups.com.

Rob Beezer

unread,
May 27, 2026, 11:16:13 PM (3 days ago) May 27
to prete...@googlegroups.com
The sectioning of the publication files (#common, #latex, #html, etc) was meant to allow you to mix and match via xi:include without a lot of duplication. I take it that is not working satisfactorily?

You vould build a shell script to make your 14 or 15 targets. You know, like the good old days.

Rob
>> <https://groups.google.com/d/msgid/pretext-dev/667c29ed-7392-41b5-b7f4-548e29b1dd42n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
Reply all
Reply to author
Forward
0 new messages