Excluding WeBWork exercises from a build

6 views
Skip to first unread message

Juan Carlos Bustamante

unread,
Feb 8, 2023, 10:36:22 AM2/8/23
to PreTeXt support
Hello to everyone,

I am incorporating somw EBWWork exercises in our calculus book. As we have not finished so far, I would llike to be able to easily generate versions of the book, but excluding the WeBWork exercises for the time being. No WeBWork exercise is divisional, if that helps. I guess that some string parameter can control this, but I am not able to find it in the guide.

Any suggestion?

Kind regards,
JC

Sean Fitzpatrick

unread,
Feb 8, 2023, 10:59:23 AM2/8/23
to pretext...@googlegroups.com
I think I would do this using components.

If each WeBWorK exercise currently begins with an exercise tag that has an xml:id identifying it as WeBWorK, this can be done quickly.

If you have a pattern like 
<exercise xml:id="ex-ww-foo">, you can do a global find-replace to replace
<exercise xml:id="ex-ww-foo"> with
<exercise xml:id="ex-ww-foo" component="webwork">

This can be done in one step using regular expressions.
You can also do it if the pattern is like
<exercise>
  <webwork>
but being the regex right is slightly harder.

Then these should not show up unless you have include="webwork" at the right point in your publisher file.

for details on using components.

--
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 on the web visit https://groups.google.com/d/msgid/pretext-support/de373d0b-86f7-4e90-a9d6-5c6fcb4581dan%40googlegroups.com.

Rob Beezer

unread,
Feb 8, 2023, 11:50:02 AM2/8/23
to pretext...@googlegroups.com
Thanks, Sean. Yes, version support is the way to go here.

One addition: you need to "opt-in", or else the @component attribute is totally
ignored.

So set include="" to get a version *without* the "webwork" component.

See bullet #3:

Subsection 28.2.2: Forming a Version
https://pretextbook.org/doc/guide/html/publisher-versions.html#subsection-137

Rob
> <mailto:pretext-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/de373d0b-86f7-4e90-a9d6-5c6fcb4581dan%40googlegroups.com <https://groups.google.com/d/msgid/pretext-support/de373d0b-86f7-4e90-a9d6-5c6fcb4581dan%40googlegroups.com?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-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/CAH%2BNcPaezyv1wAebeP6c4L%3DTBDNdPrhazben1Unb4afqskN2aA%40mail.gmail.com <https://groups.google.com/d/msgid/pretext-support/CAH%2BNcPaezyv1wAebeP6c4L%3DTBDNdPrhazben1Unb4afqskN2aA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Juan Carlos Bustamante

unread,
Feb 8, 2023, 2:11:42 PM2/8/23
to pretext...@googlegroups.com
Thanks!

So far my publication.ptx file has  the following lines in it.

<source webwork-problems="../generated/webwork/webwork-representations.xml">
        <directories external="../external" generated="../generated"/>
</source>

Do I need to add a <source> ... </source> tag, or, I add the line 
<version include="webwork"/> (or whatever tag I create)?

Thanks!
JC

To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/MTAwMDAxNi5iZWV6ZXI.1675875000%40quikprotect.

Sean Fitzpatrick

unread,
Feb 8, 2023, 2:16:26 PM2/8/23
to pretext...@googlegroups.com
Below the directories tag, add
<version include=""/>
to omit the webwork exercises, and when you are ready to include them, either remove this tag, or change it to <version include="webwork"/>
Reply all
Reply to author
Forward
0 new messages