Using a local .pg file or what's best way to go?

Skip to first unread message

Juan Carlos Bustamante

Oct 19, 2022, 1:03:42 PM10/19/22
to PreTeXt support
Hi all,

I started including some WeBWork problems in my Multivariable book. We set up a WeBWorK serverfor this sake.

So far, what I've been doing is to include the problems by doing, for instance

  <webwork source ="BPL/CCDMD/Calcul_avance-02derivation/"/>

Lots of problems are on local/... because they are translated to french or adapted. This works, but has a downside : when I'll share my sources, I'll need to take care of all those files as well, and if someone wants to reuse the code, it will not be so easy, since that person will need to play with another server... 

Now, I also read in the documentation that at some point one may be able to use local .pg files (I guess here "local" means my own laptop). Is it possible to do it as of right now, but the documentation is still not written?  To be honest, what I know from WeBWork and the way it interacts with pretext is far below what is needed to make the adaptation from a generic problem in the opl to the .ptx code.

In the next few weeks we plan to put a considerable amount of work / time on that WeBworK portion, so I wonder what is the most efficient way to go.

I see the option of working with local copies quite interesting mainly because it simplifies the whole process, mainly the sharing of the code part. I would like to have a folder Source/Wewbork-problems in which we include the .pg files and include them from the relevant parts of the .ptx code.  

Any hints? 

Kind regards,


Alex Jordan

Oct 19, 2022, 1:53:06 PM10/19/22
Hi JC,

Sorry to write so much. I have a recommendation based on:
* what I do with ORCCA
* your situation as you described well
* what is currently possible

Your WW server has a host course, and in its local/ folder you are
building exercises. Instead, make a folder that is specific to your
project and put locally edited OPL problems there. It will be cleaner
for you and anyone working with your source files to not worry about
mixing problem files from this project with whatever else might be in
a local/ folder on some host course. Periodically, use WeBWorK to make
an archive file of this folder. Download it, and distribute it with
your source files. Maybe it makes sense to include it in your git repo
for the project.

Now someone who is forking your project, who is using a different
server, will have to upload the archive file to the host course they
are using. But they shouldn't have any trouble as long as they are
using a relatively recent WW version.

I hope it's not too late, but please check the licensing on any OPL
problems you have translated/modified and are using in your project.
The default licensing on OPL problems is CC BY-NC-SA. Sometimes a
contributor includes a file at their institutions's root folder that
specifies a different license. If you are fully following the Creative
Commons rules, then that "SA" bit obligates you to release your entire
project with the same license. Not just the SA clause, but for example
if the problem is CC BY-NC-SA, then you are supposed to put CC
BY-NC-SA on your entire project too. And the "BY" obligates you to
somehow acknowledge the original problem author and give a reference
to that exercise's original source code.

It's an ugly mess, I'm afraid. One of the biggest issues I have with
the OPL. If you are concerned, you can also reach out to contributors
and ask for a special license just for you for your project.

About keeping the files locally instead of hosting them in the course.
In theory, we could make that possible by grabbing the local file,
translating it to base64, and sending it to the host course as a URL
parameter like we do with PTX-authored exercises. But these OPL
problems will occasionally (often?) be a lot larger than PTX-authored
problems. And the URL will exceed a standardized cap on URL length. So
it's not really a solution.

The other thing on the horizon is using a *local PG processor*. We're
working on that. It's almost ready. There would be no host course for
making WW representations, just the local PG processor as a utility.
If we also work out how to use a standalone PG processor on your
book's webserver, then we have the solution for the future. It needs
some more time though.

> --
> 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
> To view this discussion on the web visit

Juan Carlos

Oct 20, 2022, 8:00:39 AM10/20/22
Hi Alex,

Thank you very much. I will proceed as you suggest, and at some point
later on I will take a look at the usage of a local PG processor.

Kind regards,

Reply all
Reply to author
0 new messages