From 84acf62ee810621c194347f37962f45f6d911e71 Mon Sep 17 00:00:00 2001 From: Haris Skiadas Date: Tue, 15 Jul 2025 17:10:23 -0400 Subject: [PATCH 1/5] Add example of a title for the introduction in an exercise group. --- examples/sample-article/sample-article.xml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/sample-article/sample-article.xml b/examples/sample-article/sample-article.xml index 23afa0bd9f..be405841c2 100644 --- a/examples/sample-article/sample-article.xml +++ b/examples/sample-article/sample-article.xml @@ -926,7 +926,7 @@ along with MathBook XML. If not, see .

Does the first statement imply the second?

- + The <q>middle</q> case

Does the second statement imply the third?

@@ -15563,9 +15563,12 @@ along with MathBook XML. If not, see . -

- Now with one column, do things to the following. -

+ Title of introduction of an exercise group + +

+ Now with one column, do things to the following. +

+
From b4ac4702e99684d3b022259e726838ccae1c52cc Mon Sep 17 00:00:00 2001 From: Haris Skiadas Date: Tue, 15 Jul 2025 17:38:40 -0400 Subject: [PATCH 2/5] Add a minimal literate programming example --- examples/sample-article/sample-article.xml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/examples/sample-article/sample-article.xml b/examples/sample-article/sample-article.xml index be405841c2..d205e03bd9 100644 --- a/examples/sample-article/sample-article.xml +++ b/examples/sample-article/sample-article.xml @@ -12924,6 +12924,28 @@ along with MathBook XML. If not, see . +
+ Literate Programming +

There is support for literate programming using the fragment tag. It should always contain an @xml:id or a @filename attribute, and may contain code segments as well as fragref segments referencing other fragments. The final code is to be assembled starting from a fragment with a filename attribute and traversing the tree of fragment references.

+

For example here is the gcd algorithm in Python. Note that indentation is hard to get right at the moment.

+ + The GCD algorithm + + def gcd(a, b): + while(b): + + + return a + +

The key part is the inner part of the loop

: + + The key loop part + + a, b = b, a % b + + +

This double assignment changes both a and b.

+
Atomic Objects From e253a405eb8ddbdb1e7cebea7c08dd5755b80c12 Mon Sep 17 00:00:00 2001 From: Haris Skiadas Date: Mon, 14 Jul 2025 18:11:07 -0400 Subject: [PATCH 3/5] Make all computations of hN variable go through the hN template. --- xsl/pretext-html.xsl | 96 +++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 59 deletions(-) diff --git a/xsl/pretext-html.xsl b/xsl/pretext-html.xsl index 27098ae6a9..1c1824f2e7 100644 --- a/xsl/pretext-html.xsl +++ b/xsl/pretext-html.xsl @@ -1363,15 +1363,9 @@ along with MathBook XML. If not, see . - h - - - 6 - - - - - + + + @@ -1966,31 +1960,39 @@ along with MathBook XML. If not, see . + 1 0 - - + + + + + + + + + - + h6 - + @@ -2000,17 +2002,9 @@ along with MathBook XML. If not, see . - - - h6 - - - - - - - - + + + @@ -2101,17 +2095,9 @@ along with MathBook XML. If not, see . - - - h6 - - - - - - - - + + + @@ -2123,9 +2109,9 @@ along with MathBook XML. If not, see . - - - + + + @@ -2298,17 +2284,9 @@ along with MathBook XML. If not, see . - - - h6 - - - - - - - - + + + From dcb6385fafe55222c17ecf4040cbfc169e5c8a55 Mon Sep 17 00:00:00 2001 From: Haris Skiadas Date: Mon, 14 Jul 2025 19:49:07 -0400 Subject: [PATCH 4/5] Redirect all generations of headings to new heading-generic helper --- xsl/pretext-html.xsl | 543 ++++++++++++++++++++----------------------- 1 file changed, 253 insertions(+), 290 deletions(-) diff --git a/xsl/pretext-html.xsl b/xsl/pretext-html.xsl index 1c1824f2e7..753e6c4f89 100644 --- a/xsl/pretext-html.xsl +++ b/xsl/pretext-html.xsl @@ -1227,16 +1227,12 @@ along with MathBook XML. If not, see . - - - - - - heading - - - - + + + + + + @@ -1362,23 +1358,20 @@ along with MathBook XML. If not, see . - - - - - - - - heading + + + hide-type - - + + - - - + + + + + @@ -2001,47 +1994,42 @@ along with MathBook XML. If not, see . - - - - - - - - heading - - - - - - - - - - - - - - - - - - - ( - - ) - - - - - - - - - + + + + + - - + + + + + + + + + + + + + + + ( + + ) + + + + + + + + + + + + + @@ -2089,105 +2077,117 @@ along with MathBook XML. If not, see . - - - - + + + + + + + + + - + heading + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + + - - - - - - heading - - - - - - - - - + + + + + - - + + + + + + + + - - - - - - heading - - - - - - - - - - + + + + + - - + + + - - + + + + + + + + - - - - - - heading - - - ( - - ) - - - - - + + + + ( + + ) - - + + + + + + + + @@ -2195,80 +2195,68 @@ along with MathBook XML. If not, see . - - - - - - heading - - - + + + + + + + + + + + + - - - - + + + + - - - - - - - - - + + - - - - - - heading - - - - - + + + + + + + - - - - - - heading - - - - - - - - - - - - - - - - - -  ( - - ) - - + + + + + + + + + + + + + + + + + + +  ( + + ) + + + @@ -2283,19 +2271,14 @@ along with MathBook XML. If not, see . - - - - - - - - heading - - - - - + + + + + + + + @@ -2304,17 +2287,13 @@ along with MathBook XML. If not, see . - - - - - - heading - - - - - + + + + + + + @@ -2359,40 +2338,36 @@ along with MathBook XML. If not, see . - - - - - - heading - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -2419,22 +2394,18 @@ along with MathBook XML. If not, see . - - - - - - heading - - - - - - - - - - + + + + + + + + + + + + @@ -4915,21 +4886,17 @@ along with MathBook XML. If not, see . - - - - - - heading - - - - - - - - - + + + + + + + + + + + Root of file: @@ -5564,16 +5531,12 @@ along with MathBook XML. If not, see . - - - - - - heading - - - - + + + + + + From 47e34318251a958c72344809de92a876741991b2 Mon Sep 17 00:00:00 2001 From: Haris Skiadas Date: Thu, 17 Jul 2025 10:03:23 -0400 Subject: [PATCH 5/5] Add backlinks to elements in solutions sections. Ref #2606 --- xsl/pretext-html.xsl | 77 +++++++++++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 22 deletions(-) diff --git a/xsl/pretext-html.xsl b/xsl/pretext-html.xsl index 753e6c4f89..4ab1d07f9b 100644 --- a/xsl/pretext-html.xsl +++ b/xsl/pretext-html.xsl @@ -1356,9 +1356,15 @@ along with MathBook XML. If not, see . + + + + + + @@ -1993,8 +1999,10 @@ along with MathBook XML. If not, see . + + @@ -2082,11 +2090,13 @@ along with MathBook XML. If not, see . + + @@ -2102,7 +2112,19 @@ along with MathBook XML. If not, see . - + + + + + + + + + + + + + @@ -2110,8 +2132,10 @@ along with MathBook XML. If not, see . + + @@ -3594,6 +3618,22 @@ along with MathBook XML. If not, see . + + + + + + + + + + + + + + + + @@ -3760,6 +3800,15 @@ along with MathBook XML. If not, see . + + + + + + + + + @@ -3855,27 +3904,10 @@ along with MathBook XML. If not, see . - - - - - - - - - - - - - - - - - - - - - + + + + @@ -4105,6 +4137,7 @@ along with MathBook XML. If not, see .
+