How to define questions that you don't want visible in the ebook page. You only want to use them for select questions.

32 views
Skip to first unread message

Barbara Ericson

unread,
May 29, 2026, 3:59:37 PMMay 29
to PreTeXt support
I have the source for the questions in a different file than the page that I want visible.  I want to define the questions, but not have them visible in the page as exercises.  I only want to use the questions in a select question.  

In the past I put these questions in a file that wasn't in the toctree.  They still got created but where not visible in the ebook until they were added to select questions.  That doesn't seem to work in PreText.

Chrissy Safranski

unread,
May 30, 2026, 9:26:33 AMMay 30
to PreTeXt support
I think the only way we've found to do this is to build the book on Runestone with the questions visible so that they get added to the Runestone database, and then immediately modify the source to make those questions not visible and rebuild on Runestone.  We've discussed having a "manifest only" attribute or something, but as far as I'm aware, that hasn't happened.

For example, you could add a pretext section that contains the questions, build and deploy, then comment out that section, rebuild and redeploy. Or use a PreTeXt component for all the sections you want as non-visible exercises and then have two publication files.  

Would that work?

Chrissy

Sean Fitzpatrick

unread,
May 30, 2026, 11:37:02 AMMay 30
to pretext...@googlegroups.com
You could use versions to put those questions in a component. Have one publication file that includes them, and one that doesn't. Build once with the questions, then again without them. 

--
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/fd5ff233-5c7f-427e-940a-759f8d227dc9n%40googlegroups.com.

Barbara Ericson

unread,
Jun 19, 2026, 11:00:47 AM (4 days ago) Jun 19
to PreTeXt support
Wouldn't it be better to add a new tag on an activity (or exercise) that means go ahead and build it in the database, but don't make it visible in the publication.  This is needed for select questions, exam questions, peer instruction questions, and questions used in experiments.   

Barbara Ericson

unread,
Jun 19, 2026, 11:08:02 AM (4 days ago) Jun 19
to PreTeXt support
To do this with versions would the best way be to build once with the hidden files in the toctree and a version of 1 and then remove the hidden files from the toctree and change the version to 2 in the toctree?
<?xml version="1.0" encoding="UTF-8"?>
<chapter xmlns:xi="http://www.w3.org/2001/XInclude" xml:lang="en-US" xml:id="ch-turtles">
<title>Turtles: An Introduction to Objects and Classes</title>
<xi:include href='./names4turtles.ptx' />
<xi:include href='./turtleFAP.ptx' />
<xi:include href='./multTurtles.ptx' />
<xi:include href='./repeatturtles.ptx' />
<xi:include href='./turtleGeom.ptx' />
<xi:include href='./patterns.ptx' />
<xi:include href='./stamp.ptx' />
<xi:include href='./functionsWithTurtles.ptx' />
<xi:include href='./summary.ptx' />
<xi:include href='./Exercises.ptx' />
<xi:include href='./mixedupcode.ptx' />
<xi:include href='./mixedupcode_orig.ptx'>
<xi:include href='./WriteCode.ptx' />
</chapter>

Mitch Keller

unread,
Jun 19, 2026, 11:11:58 AM (4 days ago) Jun 19
to pretext...@googlegroups.com
Don’t remove anything. Use the component attribute on the things that you don’t want visible in the main book. See, for instance, line 1 of this file.

You then just modify your Runestone publication file to decide if you want to include those sections or not, as you can see in this file.

My process is to edit my publication file to put runestone-PI into the version/@include, push to Github, build and deploy in the RS author interface. This gets the questions into the database and temporarily makes them visible in the book. Then remove runestone-PI from version/@include, push to Github, build and deploy in the RS author interface. This leaves them in the database but they are no longer visible in the book.

Reply all
Reply to author
Forward
0 new messages