Elements in multiple components

16 views
Skip to first unread message

Sean Fitzpatrick

unread,
Nov 19, 2025, 3:17:22 PMNov 19
to pretext...@googlegroups.com
I mentioned at drop-in yesterday that I was not aware is a way to include an element in multiple components when using versions, but Matt said he's able to do this. 

As an experiment, I chose an exercise to see if this would work. 

In my publication file I have something like

include="versionA" 

In source, I tried

component="versionA versionB" as an attribute on an exercise. 
(The goal being that another target, using another publication file that includes versionB, would use the same exercise.)

When I built, the exercise did not appear at all. 

So either I guessed correctly that this is not supported, or I'm doing something wrong. 

Either way, I guess I want to know what Matt is doing!

Mitch Keller

unread,
Nov 19, 2025, 3:22:27 PMNov 19
to pretext...@googlegroups.com
Assuming Matt is Matt Boelkins, we have a lot of complicated components for ACS. What you can do is put @component=“versionAB” on that exercise and then use @include=“versionA versionAB” to actually make version A and @include=“versionB versionAB” to actually make version B.

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/CAH%2BNcPaH4PLHms7xumVTyn2t_9f_V8jTFJnE-UPKpb-%3DxjbwiA%40mail.gmail.com.


Sean Fitzpatrick

unread,
Nov 19, 2025, 6:06:48 PMNov 19
to pretext...@googlegroups.com
Right. And I do this in APEX (that is, APEX proper) in one or two places where this comes up. 

If it doesn't create too much clutter, I might also do

<element component="versionA">

<element component="versionB">

Not ideal if they're identical but it does what it needs to. 

This is coming up now because the other PROTEUS books now have a "playground version", so Vilma wants one for APEX, too.

It needs a new document ID for Runestone, and that can't go in the same component as the one for the main PROTEUS version, so a new component is needed. 

Can't include both, so all the exercises in the PROTEUS version get omitted. 
But of course, people want to see both new *and* old questions in the playground course.

I guess what I could do is put the document IDs in components just for the IDs:

<document-id component="proteus-id">

<document-id component="playground-id">

<exercise component="proteus">

<exercise component="playground">

One pub file with include="proteus proteus-id" 

Another pub file with include="playground-id proteus playground" 


Rob Beezer

unread,
Nov 19, 2025, 9:44:10 PMNov 19
to pretext...@googlegroups.com
> guess what I could do is put the document IDs in components just for the IDs:

Right! I was just coming around to this idea at some odd moment last night.
Being a problem I thought was unsolvable. ;-)

Rob
>> <mailto:dsfitz...@gmail.com>> wrote:
>>
>> I mentioned at drop-in yesterday that I was not aware is a way to include
>> an element in multiple components when using versions, but Matt said he's
>> able to do this.
>>
>> As an experiment, I chose an exercise to see if this would work.
>>
>> In my publication file I have something like
>>
>> include="versionA"
>>
>> In source, I tried
>>
>> component="versionA versionB" as an attribute on an exercise.
>> (The goal being that another target, using another publication file that
>> includes versionB, would use the same exercise.)
>>
>> When I built, the exercise did not appear at all.
>>
>> So either I guessed correctly that this is not supported, or I'm doing
>> something wrong.
>>
>> Either way, I guess I want to know what Matt is doing!
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "PreTeXt support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to pretext-suppo...@googlegroups.com <mailto:pretext-
>> support+u...@googlegroups.com>.
>> To view this discussion visit https://groups.google.com/d/msgid/pretext-
>> support/CAH%2BNcPaH4PLHms7xumVTyn2t_9f_V8jTFJnE-UPKpb-
>> %3DxjbwiA%40mail.gmail.com <https://groups.google.com/d/msgid/pretext-
>> support/CAH%2BNcPaH4PLHms7xumVTyn2t_9f_V8jTFJnE-UPKpb-
>> %3DxjbwiA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> Mitch Keller
> mi...@rellek.net <mailto:mi...@rellek.net>
>
> http://www.rellek.net/ <http://www.rellek.net/>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pretext-suppo...@googlegroups.com <mailto:pretext-
> support+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-
> support/DB8FA0F4-97E6-4C6E-961C-291100985A43%40rellek.net <https://
> groups.google.com/d/msgid/pretext-support/
> DB8FA0F4-97E6-4C6E-961C-291100985A43%40rellek.net?
> utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-suppo...@googlegroups.com <mailto:pretext-
> support+u...@googlegroups.com>.
> CAH%2BNcPZ-iZVctM5PRzfUDhbzD23iR%3DRKmFWgiRHcND-tgJZ-Bg%40mail.gmail.com
> <https://groups.google.com/d/msgid/pretext-support/CAH%2BNcPZ-
> iZVctM5PRzfUDhbzD23iR%3DRKmFWgiRHcND-tgJZ-Bg%40mail.gmail.com?
> utm_medium=email&utm_source=footer>.

David Austin

unread,
Nov 20, 2025, 6:17:56 AMNov 20
to pretext...@googlegroups.com
I put the #document-id elements in their own components, as Sean is suggesting.  Works great!

Wait, did I solve a Beezer unsolvable problem?

To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/MTAwMDAwOC5iZWV6ZXI.1763606647%40pnsh.
Reply all
Reply to author
Forward
0 new messages