Answers in the back :-)

120 views
Skip to first unread message

Sean Fitzpatrick

unread,
Aug 19, 2020, 3:47:04 PM8/19/20
to PreTeXt support
Just checking to see how close my understanding of the documentation is:

For producing PDF via LaTeX, where we don't want answers/solutions to appear along side divisional exercises:

1. Put exercise.divisional.answer="no" and exercise.divisional.solution="no"
2. Put a <solutions> division in the backmatter.

Will the solutions be populated even if answer/solution stringparams are set to "no"?
And does <solutions> print the answer if that's all that's available?

Also, my understanding is that answers to "odd" exercises is not implemented.
Is it achievable with some extra xsl? I have a feeling Greg's going to ask for this in APEX.

Rob Beezer

unread,
Aug 19, 2020, 4:08:44 PM8/19/20
to pretext...@googlegroups.com
The string parameters refer to the appearance where authored, in main matter.

A "solutions" division might be implemented today with the "assembly"
pre-processor. It requires attributes to say just what will be produced. Study
sample article and/or AATA.

You can do arithmetic on the result of the "serial-number" template to see
even/odd. Uncertain just where (which template) you would do the test to kill
the even ones. Alex may have done this since maybe he's given up asking for it.

Rob
> --
> 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/596a808b-bbf8-42f6-8f2d-e3597063f90eo%40googlegroups.com
> <https://groups.google.com/d/msgid/pretext-support/596a808b-bbf8-42f6-8f2d-e3597063f90eo%40googlegroups.com?utm_medium=email&utm_source=footer>.

Sean Fitzpatrick

unread,
Aug 19, 2020, 5:38:10 PM8/19/20
to PreTeXt support

Alex Jordan

unread,
Aug 19, 2020, 7:10:29 PM8/19/20
to pretext...@googlegroups.com
Yes and no. That stylesheet does not tamper with the "solutions" element. Rather,
it processes chapters and sections of the book like normal, but kills all content
except "exercises". And then with each exercise, if it is even, skips over it, and
if it is odd, just prints the answer. It works well enough for local faculty who wanted

It leaves blanks for the even exercises. A byproduct of the hack, but actually
some students use it as a place to record their work. So for some, a surprise
feature.

--
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/a1340869-a362-4ccc-a70f-a8cf363b8fd9o%40googlegroups.com.

Robert van de Geijn

unread,
Aug 21, 2020, 3:56:14 PM8/21/20
to PreTeXt support
I have a related question.  

I use "exploration" rather than "exercise" for inline exercises, because I want them to be numbered differently than remarks, etc.  However, I would now like to create a version of the PDF that does not have answers or solutions to these explorations.

I am willing to change them to inline exercises so I can use exercise.divisional.answer="no" and exercise.divisional.solution="no", but would then need to know how to force the numbering the way I prefer, OR I need a way of turning off the inclusion of answers and exercises for explorations.

Ideally, I would then be able to generate the solutions either at the end of the document or in a separate manual.

Mitch Keller

unread,
Aug 21, 2020, 3:59:23 PM8/21/20
to pretext...@googlegroups.com
Use project.answer and such to control exploration’s hint/answer/solution visibility. exploration, activity, and project run on the same counter and all obey the project settings together. (They are “PROJECT-LIKE” in PreTeXt lingo.)
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/d88aa98d-77ae-4034-a94c-e43a2ce3a3e9n%40googlegroups.com.


Mitch Keller
mi...@rellek.net

Robert van de Geijn

unread,
Aug 23, 2020, 12:11:37 PM8/23/20
to PreTeXt support
Mitch,

thank you for your quick response.  This got me one the hump.  Some comments:

- I had to insert     <solutions project="answer solution">  in the backwater.   (Wasn't hard to find in the documentation, but just a comment.)

- I get a bit of strange behavior in the Appendix that is generated.  See    

It starts with

Orthogonality

1 · Norms

2 · The Singular Value Decomposition 

3 · The QR Decomposition

4 · Linear Least Squares

Orthogonality is the title of Part I of the book.

It then lists the titles of the first four chapters (which are in Part I).  And then moves on to lists sections, subsections, and the answers and solutions found in those.

- I really like the fact that there is a hyperlink back to the question in the solution appendix.  It would also be really nice if a hyperlink were created from the exploration (which I entitled Homework) to the answers and solutions in the back of the book, to further mimic the look and feel of the webpages.  

I have a further question, but I am going to create a separate post to keep this somewhat short.

Robert

Rob Beezer

unread,
Aug 23, 2020, 2:19:06 PM8/23/20
to pretext...@googlegroups.com
Dear Robert,

As usual, thanks for the report.

You will see that Part II also has extraneous chapter titles, and a very crummy
looking title for the part.

There is rather complicated logic to print a heading in a "solutions" division
if and only if someplace within there is a requested hint, answer, etc. So -
all necessary headings, but not a pile of unnecessary ones either.

I'm pretty sure that logic is not considering "part" properly. So maybe an easy
fix? On my list now.

Rob
> <mailto:pretext-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/6d21ba0f-dfd7-49bd-8561-c114d226c6a6n%40googlegroups.com
> <https://groups.google.com/d/msgid/pretext-support/6d21ba0f-dfd7-49bd-8561-c114d226c6a6n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Rob Beezer

unread,
Aug 23, 2020, 2:40:51 PM8/23/20
to pretext...@googlegroups.com
On 8/23/20 9:11 AM, Robert van de Geijn wrote:
> - I really like the fact that there is a hyperlink back to the question in the
> solution appendix.  It would also be really nice if a hyperlink were created
> from the exploration (which I entitled Homework) to the answers and solutions in
> the back of the book, to further mimic the look and feel of the webpages.

I considered this strongly at the time. It is a bit tricky, since at the birth
of an "activity" you need to determine if it even has a hint/answer/solution
that is going to be made visible *somewhere*, which could be a "solutions"
division placed in some awkward (unreasonable) location (not just back matter,
or even nearby). And if the author elects to make the solution visible right
there, then a hyperlink is silly. Then you have to tag it so a cross-reference
can find it.

Now, it is also possible to have the same answer be requested two places. Which
should we point to?

I considered it so strongly, there is a temporary Easter-egg switch, backed by
real code. String parameter

debug.exercises.forward set to 'yes'

It should point to a main matter solution before it points to a back matter
solution. Should not point to solutions present at birth, and may point to the
earliest across all main matter "solutions" divisions. But I think you are in
the clear with simply a back matter "solutions".

Would you like to test and report? Both before and after I fix "part"?

Rob


Alex Jordan

unread,
Aug 23, 2020, 3:43:54 PM8/23/20
to pretext...@googlegroups.com
Naive question: when is it preferable to have links from the original exercise to the
answer in the back of the book instead of just having a knowled answer where the
original exercise is?

(And substitute hint|solution for answer. Substitute project etc for exercise.)

--
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.

Robert van de Geijn

unread,
Aug 23, 2020, 3:49:14 PM8/23/20
to PreTeXt support
This works.  Very, very nice.

Robert van de Geijn

unread,
Aug 23, 2020, 3:49:51 PM8/23/20
to PreTeXt support
This is for the PDF rather than the html version.

Rob Beezer

unread,
Aug 26, 2020, 2:37:18 PM8/26/20
to pretext...@googlegroups.com
Headings for "part" in a "solutions" division should now be rational.

There was one careless omission of "part", and fixing that then exposed a much
more fundamental problem with parts (again fixed with just one small addition).

@Robert - when the first-week chaos settles down, can you test that the odd
duplicate headings now are singles and make sense typographically? I'm willing
to let the doubled-up solutions rest for now, unless you (or somebody else!) can
duplicate it, since the test "sample book" seems to be behaving (with, and
without, parts).

Thanks for the report, and keep 'em coming. Parts were a late bolt-on, and do
not get as much use, so there still could be some structural or numbering bugs
out there.

Rob

Robert van de Geijn 2

unread,
Aug 26, 2020, 3:52:50 PM8/26/20
to pretext...@googlegroups.com
Rob,

In the PDF version, all looks great.

In the html version, I would expect <solutions> to not generate anything
if solutions etc. already are created for the exercises. Also, I am not
sure if you want to print "Chapter" there (it doesn't in the PDF, which
is what I would expect).

Robert

Sean Fitzpatrick

unread,
Aug 27, 2020, 11:49:52 AM8/27/20
to PreTeXt support
I must be doing something wrong: my solutions are coming out empty in both HTML and PDF.
In my backmatter I have <solutions divisional="answer solution"><title>blah</title></solutions>

Each section has an <exercises> division, and most exercises are within an <exercisegroup>,
except for a few sections where Alex has restructured using <subexercises>.

Do I need something in the publisher file (other than pointing to webwork extraction)?

Rob Beezer

unread,
Aug 27, 2020, 12:10:36 PM8/27/20
to pretext...@googlegroups.com
That doesn't sound right to me, and I've just been testing them carefully for
Robert vdG.

Try running the xsl/pretext-solution-manual-latex.xsl template against your
source, with no extra XSL, as a test. (Check stylesheet name's spelling.) You
can test on just a subset of chapters.

exercisegroup and subexercises are accounted for. subexercises may not have
seen much testing.

If you are killing hint/answer/solution at birth that should not affect
"solutions", but maybe you should check?

"Sample book" has backmatter solutions - look there to compare?

Rob
> --
> 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/9a29742a-062a-4153-89c4-fb377b24b949o%40googlegroups.com
> <https://groups.google.com/d/msgid/pretext-support/9a29742a-062a-4153-89c4-fb377b24b949o%40googlegroups.com?utm_medium=email&utm_source=footer>.

Sean Fitzpatrick

unread,
Aug 27, 2020, 1:34:31 PM8/27/20
to PreTeXt support
The solution manual template does what it should -- I get solutions.
If I run the latex template all that I get in the .tex file is:

\typeout{************************************************}\typeout{Appendix A Answers and Solutions to Selected Exercises}
\typeout{************************************************}
%
%
\appendix
%
\begin{solutions-chapter}{Answers and Solutions to Selected Exercises}{}{Answers and Solutions to Selected Exercises}{}{}{g:solutions:idp240}
\end{solutions-chapter}
%
%
\typeout{************************************************}
\typeout{Appendix B Quick Reference}
\typeout{************************************************}
%



This is true with or without my stylesheet applied on top.

The sample book has things loaded the same way that I do, except that I left out hints.

Sean Fitzpatrick

unread,
Aug 27, 2020, 3:50:26 PM8/27/20
to PreTeXt support
Tried adding hint, and running with hint/answer/solution turned on.
I still don't get anything. 

I suppose if I really need the solutions in the back I can run the solution manual processor and add it in.
But mostly I just want to understand why it doesn't work!

Rob Beezer

unread,
Aug 28, 2020, 12:27:08 PM8/28/20
to pretext...@googlegroups.com
I've got nothing better to suggest than to ask you to make available your
*complete* source. Either I debug a real PTX problem or fix your local problem.

Include *everything*, but don't include images. I think my email can handle up
to a 10MB zip file. And I have a secondary address if an attachment bounces.
Posting via a URL works too, of course.

On 8/27/20 12:50 PM, Sean Fitzpatrick wrote:
> Tried adding hint, and running with hint/answer/solution turned on.
> I still don't get anything.
>
> I suppose if I really need the solutions in the back I can run the solution
> manual processor and add it in.
> But mostly I just want to understand why it doesn't work!
>
> On Thursday, August 27, 2020 at 11:34:31 AM UTC-6, Sean Fitzpatrick wrote:
>
> The solution manual template does what it should -- I get solutions.
> If I run the latex template all that I get in the .tex file is:
>
> |
> \typeout{************************************************}\typeout{AppendixA
> AnswersandSolutionsto SelectedExercises}
> \typeout{************************************************}
> %
> %
> \appendix
> %
> \begin{solutions-chapter}{AnswersandSolutionsto
> SelectedExercises}{}{AnswersandSolutionsto
> SelectedExercises}{}{}{g:solutions:idp240}
> --
> 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/ebe14383-36bc-4c63-849d-e00780c0f333o%40googlegroups.com
> <https://groups.google.com/d/msgid/pretext-support/ebe14383-36bc-4c63-849d-e00780c0f333o%40googlegroups.com?utm_medium=email&utm_source=footer>.

Sean Fitzpatrick

unread,
Aug 28, 2020, 2:21:26 PM8/28/20
to pretext...@googlegroups.com
Right now I'm building from the following source:

I'm off camping for the weekend, and back at work Tuesday.

I was testing with chapter 1. Not sure it's relevant but pretty much every problem there is a WeBWorK problem.

Rob Beezer

unread,
Aug 28, 2020, 3:34:25 PM8/28/20
to pretext...@googlegroups.com
On 8/28/20 11:21 AM, Sean Fitzpatrick wrote:
> I was testing with chapter 1. Not sure it's relevant but pretty much every
> problem there is a WeBWorK problem.

"Pretty much" or *every*? Possible we are missing those, I'll look now. Seems
possible they are not being considered.

You are providing the file of WW representations, via your publisher file?

Commented out every chapter, except the third. Hit "apex.ptx" with minimal
xsltproc invocation.

Got some "answer" in the back matter.

\typeout{************************************************}
\typeout{Appendix A Answers and Solutions to Selected Exercises}
\typeout{************************************************}
%
%
\appendix
%
\begin{solutions-chapter}{Answers and Solutions to Selected Exercises}{}{Answers
and Solutions to Selected Exercises}{}{}{g:solutions:idp247
}
\par\smallskip
\noindent\textbf{\Large{}1\space\textperiodcentered\space{}The Graphical
Behavior of Functions}
\par\smallskip
\par\smallskip
\noindent\textbf{\Large{}1.1\space\textperiodcentered\space{}Extreme Values}
\par\smallskip
\par\smallskip
\noindent\textbf{\Large{}1.1.1\space\textperiodcentered\space{}Exercises}
\par\smallskip
\begin{exercisegroup}
\begin{divisionsolutioneg}{1.1.1.2}{}{g:exercise:idp16}%
\textbf{\blocktitlefont Answer}.\hypertarget{g:answer:idp17-back}\quad{}Answers
will vary.%
\end{divisionsolutioneg}%
\begin{divisionsolutioneg}{1.1.1.4}{}{g:exercise:idp19}%
\textbf{\blocktitlefont Answer}.\hypertarget{g:answer:idp20-back}\quad{}Answers
will vary.%
\end{divisionsolutioneg}%
\begin{divisionsolutioneg}{1.1.1.6}{}{g:exercise:idp22}%
\textbf{\blocktitlefont Answer}.\hypertarget{g:answer:idp23-back}\quad{}Where
\(\fp(x)\) is equal to \emph{0} or where \(\fp(x)\) is \emph{undefined}.%
\end{divisionsolutioneg}%
\end{exercisegroup}

Sean Fitzpatrick

unread,
Aug 29, 2020, 12:12:57 PM8/29/20
to pretext...@googlegroups.com
Hmm. Could be that WeBWorK is getting missed. Chapter 3 has some that are not WeBWorK because they have TikZ images.
I'll look when I get home.

--
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/f52adebf-c7a2-cb32-849b-92a351bd3bbb%40ups.edu.

Rob Beezer

unread,
Aug 29, 2020, 2:33:22 PM8/29/20
to pretext...@googlegroups.com
On 8/29/20 9:12 AM, Sean Fitzpatrick wrote:
> I'll look when I get home.

Possible it'll be fixed by then. WW "sample chapter" has a "solutions" that is
empty. Uncertain how that came to pass (or when?).

Rob Beezer

unread,
Aug 30, 2020, 11:26:39 PM8/30/20
to pretext...@googlegroups.com
I suspect we have a new development technique: Sean goes camping with his
family and when he gets home there are major improvements to his work on APEX
Calculus. ;-)

Enough testing to believe that WW exercises simply are not being recognized as
having hint, answer, or solution as necessary to (a) provoke headers for
containing divisions (thus *nothing* if WW-only) and (b) to have the necessary
parts of the exercise itself render.

But this provokes enough questions to start a new thread on -dev, and also get
Alex involved.

Rob

On 8/29/20 9:12 AM, Sean Fitzpatrick wrote:
> <mailto:pretext-support%2Bunsu...@googlegroups.com>.
> --
> 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%2BNcPYerkerxmTT8SHiLSWummqGKfeYF9Au4SoiLmPuaymbEg%40mail.gmail.com
> <https://groups.google.com/d/msgid/pretext-support/CAH%2BNcPYerkerxmTT8SHiLSWummqGKfeYF9Au4SoiLmPuaymbEg%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Alex Jordan

unread,
Aug 31, 2020, 12:25:28 AM8/31/20
to pretext...@googlegroups.com
Let me guess: it is looking for exercise/solution, not exercise//solution or exercise/webwork-reps/static/solution.

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/ddd4b56d-eebf-b504-8a80-901c364b7f2b%40ups.edu.

Rob Beezer

unread,
Aug 31, 2020, 1:04:31 AM8/31/20
to pretext...@googlegroups.com
Pretty close. Stages are considered, but vanilla problems are being missed.

Rob Beezer

unread,
Aug 31, 2020, 3:54:52 PM8/31/20
to pretext...@googlegroups.com
WeBWorK problems should now be properly recognized when they have hints,
answers, and solutions for inclusion into "solutions" divisions. Various notes
in the LaTeX conversion anticipating the inclusion of answers coming back from
the WW server and incorporated in the assembly phase:

"2018-09-21: WW answers may become available"

I did some minor formatting improvements to the formatting of all hints,
answers, and solutions for LaTeX output. I won't claim there is not more that
could be done, but I think it is much improved.

Absolutely zero checking of the impact on HTML and no changes to HTML-specific
code. Please report any oddities observed there.

Rob

Sean Fitzpatrick

unread,
Sep 1, 2020, 2:12:12 PM9/1/20
to PreTeXt support
Brilliant! I'll generate a copy of APEX with a solutions division and let you know how it goes.
Thanks. I'd go camping more often but soon it'll be too cold. And I'm supposed to work or something.
Reply all
Reply to author
Forward
0 new messages