Just taking a look at this PR now, with an eye to suggesting a "repair" of the
deprecation by the pre-processor.
Edit to the sample article now hard-codes the directory named "ext" (which is
the name of the "external" directory), which is purposely *not* named "external"
to test the relocatable (or replaceable for a version) nature of this directory.
So that cannot stand as-is, not at all correct to have "ext" hard-coded into
source. And suggests a "repair" is going to be difficult.
I'll admit to not having followed this discussion closely, given preparations
for JMM, and will not soon have time to dig deeper. But it seems there is a
philosophical bent to this:
A. Is a datafile part of your source, like a #p or a #theorem? Then it lives
with your source files (near or below main.ptx) and it is appropriate to
xi:include it, or just author it right inside datafile/pre.
B. Or is a datafile an external file that you bring to your project, like a
JPEG image? Then it lives int eh "external" directory and it is consistent with
other markup to point at it with @source.
Perhaps I should have looked closer at the original complaint about handling
special characters, but it feels like this has moved off into other directions.
Rob
>>>
https://github.com/PreTeXtBook/pretext/issues/2755 <
https://github.com/
>>> PreTeXtBook/pretext/issues/2755>
>>>
>>> Andrew
>>>
>>> On Mon, Dec 29, 2025 at 8:02 AM Charilaos Skiadas <
cski...@gmail.com
>>> <mailto:
cski...@gmail.com>> wrote:
>>>
>>> Update: xi:include made the examples work on my end (a tad annoying that
>>> I had to change the path a little bit as xi:include is relative to the
>>> processed file, but that makes sense).
>>> I would still like to know if there is a better approach to having some
>>> code that lives in a separate file, that is available for #include in a
>>> C-program, and which is not otherwise visible to the book reader, than
>>> using the datafile @hide=“yes” option. But I can live with the current
>>> approach, even if it’s misusing datafile a bit.
>>>
>>> But in the meantime I set off to adjust the sample book and guide so they
>>> don’t suggest pre@source as the appropriate approach, and ran into a
>>> snag. When I changed
https://github.com/PreTeXtBook/pretext/
>>> blob/0340cc4228e0a978abc8942dc7a25e2af9b5642a/examples/sample-book/
>>> rune.xml#L877 <
https://github.com/PreTeXtBook/pretext/
>>> blob/0340cc4228e0a978abc8942dc7a25e2af9b5642a/examples/sample-book/
>>> rune.xml#L877>
>>> email to
pretext-dev...@googlegroups.com <mailto:
pretext-
>>>
dev+uns...@googlegroups.com>.
>>> dev/8E9BC386-0CC6-4674-8C2A-69B38A9DE9D9%
40gmail.com <https://
>>>
groups.google.com/d/msgid/pretext-
>>> dev/8E9BC386-0CC6-4674-8C2A-69B38A9DE9D9%
40gmail.com?
>>> utm_medium=email&utm_source=footer>.
>>>> <mailto:
cski...@gmail.com>> wrote:
>>>>
>>>> Ah ok and I see in that discussion that the pre-source thing should be
>>>> getting deprecated, which sounds good. I wonder why I didn’t find that
>>>> when I searched in the issues for datafile, I guess it’s because it’s
>>>> actually a pull request instead.
>>>>
>>>> So my problem is that I don’t want these files to be visible anywhere in
>>>> the book, and I think that having them as listings/programs would make
>>>> them visible in some way, am I wrong in that? They are meant to be
>>>> solely there so that #include in the exercise program preamble can find
>>>> them. So they are simply extra source files that the jobe server should
>>>> have around when trying to compile and run the student code, and should
>>>> not be visible anywhere else.
>>>>
>>>> I’ll try the xi:include approach and see if that fixes my problems at
>>>> least in terms of using datafile.
>>>>
>>>> Charilaos Skiadas
>>>> Department of Mathematics
>>>> Hanover College
>>>>
>>>>
>>>>> On Dec 28, 2025, at 4:38 PM, Andrew Scholer <
asch...@chemeketa.edu
>>>>> <mailto:
asch...@chemeketa.edu>> wrote:
>>>>>
>>>>> On fone, so brief...
>>>>>
>>>>> IMO datafiles are for data. Code should be in a program or pf.
>>>>>
>>>>> Runestone programs that run server side can include other programs,
>>>>> even ones that are not activecodes.
>>>>>
>>>>> See Listing 5.2.18: add.h (version 1)
>>>>>
https://runestone.academy/ns/books/published/PTXSB/
>>>>> activecode.html#addh-v1-listing <
https://runestone.academy/ns/books/
>>>>> published/PTXSB/activecode.html#addh-v1-listing>
>>>>>
>>>>> For data file/pre I recommend you not use @source. Instead do an
>>>>> xi:include inside the pre.
>>>>>
>>>>> See
https://github.com/PreTeXtBook/pretext/pull/2615 <https://
>>>>>
github.com/PreTeXtBook/pretext/pull/2615>
>>>>> issues/2754 <
https://github.com/PreTeXtBook/pretext/issues/2754>
>>>>>
>>>>> But thought I’d post here as well. My situation is that I ha ve a
>>>>> C-header file that naturally contains a bunch of < symbols, and I
>>>>> would like to be able to #include it, so I thought the datafile +
>>>>> pre route was the way to go. Even if there is an alternative, the
>>>>> problem would still remain in the case of any text files containing
>>>>> < or other similarly special characters.
>>>>>
>>>>> Currently during the asset generation process this file’s code is
>>>>> read as is and plucked into a <pi:text-file xmlns:pi="http://
>>>>>
pretextbook.org/2020/pretext/internal <
http://pretextbook.org/2020/
>>>>> pretext/internal>">{}</pi:text-file>
>>>>> container which would result in invalid xml, and in my case
>>>>> spurious runestone errors about not being able to locate the file.
>>>>>
>>>>> Hoping folks can verify that this is a bug or point me in the right
>>>>> direction.
>>>>>
>>>>> Charilaos Skiadas
>>>>> Department of Mathematics
>>>>> Hanover College
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> 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
>>>>> <mailto:
pretext-dev...@googlegroups.com>.
>>>>> pretext-dev/F56AB760-BBC7-46BA-9926-F06B2E7BEA40%
40gmail.com
>>>>> <
https://groups.google.com/d/msgid/pretext-dev/F56AB760-
>>>>> BBC7-46BA-9926-F06B2E7BEA40%
40gmail.com?
>>>>> utm_medium=email&utm_source=footer>.
>>>>>
>>>>>
>>>>> --
>>>>> 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 <mailto:
pretext-
>>>>>
dev+uns...@googlegroups.com>.
>>>>> CACm44N9f%3D0yXWBBbsH6Yn9qCTVmg_tAbub1Mu2hWZhWde_vnPQ%
40mail.gmail.com
>>>>> <
https://groups.google.com/d/msgid/pretext-dev/
>>>>> CACm44N9f%3D0yXWBBbsH6Yn9qCTVmg_tAbub1Mu2hWZhWde_vnPQ%
40mail.gmail.com?
>>>>> utm_medium=email&utm_source=footer>.
>>>>
>>>
>>>
>>> --
>>> 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 <mailto:
pretext-
>>>
dev+uns...@googlegroups.com>.
>>> dev/8E9BC386-0CC6-4674-8C2A-69B38A9DE9D9%
40gmail.com <https://
>>>
groups.google.com/d/msgid/pretext-
>>> dev/8E9BC386-0CC6-4674-8C2A-69B38A9DE9D9%
40gmail.com?
>>> utm_medium=email&utm_source=footer>.
>>>
>>>
>>> --
>>> 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 <mailto:
pretext-
>>>
dev+uns...@googlegroups.com>.
>>> CACm44N8yKuarXvCDUjp%2BTE-N6XXBw%3DMTXn1jDBxEfsoD%3Dy69dw%
40mail.gmail.com
>>> <
https://groups.google.com/d/msgid/pretext-dev/CACm44N8yKuarXvCDUjp%2BTE-
>>> N6XXBw%3DMTXn1jDBxEfsoD%3Dy69dw%
40mail.gmail.com?
>>> utm_medium=email&utm_source=footer>.
>>
>
> --
> 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 <mailto:
pretext-
>
dev+uns...@googlegroups.com>.
> C0BCFC35-E6B2-4A5D-AF80-A65BFE27B2E4%
40gmail.com <
https://groups.google.com/d/
> msgid/pretext-dev/C0BCFC35-E6B2-4A5D-AF80-A65BFE27B2E4%
40gmail.com?
> utm_medium=email&utm_source=footer>.