@pretextbook/pretext-html 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +106 -10
- package/assets/preview-html.xsl +8 -4
- package/assets/preview-revealjs.xsl +85 -0
- package/assets/upstream.json +1 -1
- package/assets/xsl/LICENSE-pretext +16 -0
- package/assets/xsl/README.md +25 -24
- package/assets/xsl/entities.ent +27 -0
- package/assets/xsl/extract-biblio-csl.xsl +6 -4
- package/assets/xsl/extract-dynamic.xsl +14 -12
- package/assets/xsl/extract-interactive.xsl +2 -2
- package/assets/xsl/extract-pg.xsl +123 -306
- package/assets/xsl/extract-qrcode.xsl +12 -2
- package/assets/xsl/extract-sageplot.xsl +1 -1
- package/assets/xsl/extract-trace.xsl +3 -3
- package/assets/xsl/extract-youtube.xsl +1 -1
- package/assets/xsl/latex/pretext-latex-texstyle.xsl +4 -5
- package/assets/xsl/localizations/README.md +24 -24
- package/assets/xsl/pretext-assembly.xsl +463 -368
- package/assets/xsl/pretext-beamer.xsl +43 -146
- package/assets/xsl/pretext-braille-preprint.xsl +458 -202
- package/assets/xsl/pretext-common.xsl +486 -510
- package/assets/xsl/pretext-epub.xsl +318 -78
- package/assets/xsl/pretext-fo.xsl +80 -96
- package/assets/xsl/pretext-html.xsl +413 -318
- package/assets/xsl/pretext-jupyter.xsl +534 -322
- package/assets/xsl/pretext-latex-classic.xsl +14 -15
- package/assets/xsl/pretext-latex-common.xsl +393 -2397
- package/assets/xsl/pretext-latex.xsl +1995 -5
- package/assets/xsl/pretext-markdown.xsl +919 -0
- package/assets/xsl/pretext-numbers.xsl +57 -39
- package/assets/xsl/pretext-revealjs.xsl +241 -33
- package/assets/xsl/pretext-runestone-fitb.xsl +34 -35
- package/assets/xsl/pretext-runestone-static.xsl +17 -17
- package/assets/xsl/pretext-runestone.xsl +36 -34
- package/assets/xsl/pretext-sage-doctest.xsl +2 -2
- package/assets/xsl/pretext-text-utilities.xsl +69 -1
- package/assets/xsl/pretext-text.xsl +1077 -107
- package/assets/xsl/pretext-view-source.xsl +5 -3
- package/assets/xsl/pretext-ww-problem-sets.xsl +6 -1
- package/assets/xsl/publisher-variables.xsl +397 -477
- package/assets/xsl/support/play-button/README.md +1 -3
- package/assets/xsl/tests/README.md +1 -1
- package/assets/xsl/utilities/README.md +6 -8
- package/assets/xsl/utilities/report-publisher-variables.xsl +15 -0
- package/assets/xsl-bundle.json +1 -1
- package/dist/cli-DZsyZERX.js +694 -0
- package/dist/cli.js +1 -1
- package/dist/index.browser.d.ts +5 -0
- package/dist/index.browser.js +499 -344
- package/dist/index.d.ts +5 -0
- package/dist/index.js +23 -18
- package/dist/publication.d.ts +26 -12
- package/dist/renderer.d.ts +68 -0
- package/dist/reveal.d.ts +77 -0
- package/dist/reveal.js +110 -0
- package/dist/target.d.ts +34 -0
- package/package.json +12 -1
- package/dist/cli-CzoinNle.js +0 -639
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<!-- data for how PG should be processed. This tree will be used by -->
|
|
41
41
|
<!-- pretext.py in conjuction with some form of renderer (webwork2, local -->
|
|
42
42
|
<!-- PG, or the standalone renderer) to write, for each webwork exercise, -->
|
|
43
|
-
<!-- a file of representations of that problem (named by @assembly-id).
|
|
43
|
+
<!-- a file of representations of that problem (named by @pi:assembly-id). -->
|
|
44
44
|
|
|
45
45
|
<!-- The top of the ephemeral XML tree has some global attributes. -->
|
|
46
46
|
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
|
|
61
61
|
<!-- The pretext/pretext script (-c webwork) uses all this to write, for -->
|
|
62
62
|
<!-- each webwork exercise, an XML file of representations of that problem -->
|
|
63
|
-
<!-- (named by @assembly-id). The script must be re-run whenever the
|
|
63
|
+
<!-- (named by @pi:assembly-id). The script must be re-run whenever the -->
|
|
64
64
|
<!-- author source for a webwork exercise, a .pg file, or some -->
|
|
65
65
|
<!-- configuration changes. -->
|
|
66
66
|
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
|
|
176
176
|
<xsl:template match="webwork[@source|statement|task|text()]" mode="extraction">
|
|
177
177
|
<xsl:variable name="problem">
|
|
178
|
-
<xsl:value-of select="../@assembly-id"/>
|
|
178
|
+
<xsl:value-of select="../@pi:assembly-id"/>
|
|
179
179
|
</xsl:variable>
|
|
180
180
|
<problem>
|
|
181
181
|
<xsl:attribute name="id">
|
|
@@ -192,10 +192,13 @@
|
|
|
192
192
|
</xsl:when>
|
|
193
193
|
</xsl:choose>
|
|
194
194
|
</xsl:attribute>
|
|
195
|
-
<!-- 1b. if this problem is a copy, record what it was copied from
|
|
196
|
-
|
|
195
|
+
<!-- 1b. if this problem is a copy, record what it was copied from. -->
|
|
196
|
+
<!-- The source is the tree stamp, in the internal namespace; the copy is -->
|
|
197
|
+
<!-- a plain attribute, since this file is an interchange format read by -->
|
|
198
|
+
<!-- the Python routines, which know it as "copied-from". -->
|
|
199
|
+
<xsl:if test="@pi:copied-from">
|
|
197
200
|
<xsl:attribute name="copied-from">
|
|
198
|
-
<xsl:value-of select="id(@copied-from)/../@assembly-id"/>
|
|
201
|
+
<xsl:value-of select="id(@pi:copied-from)/../@pi:assembly-id"/>
|
|
199
202
|
</xsl:attribute>
|
|
200
203
|
</xsl:if>
|
|
201
204
|
<!-- 2. a seed for randomization (with a default explicitly declared) -->
|
|
@@ -298,15 +301,12 @@
|
|
|
298
301
|
<!-- but in the PG source we can't really form a link to a target outside -->
|
|
299
302
|
<!-- the problem. -->
|
|
300
303
|
|
|
301
|
-
<!-- This routine
|
|
302
|
-
<!--
|
|
303
|
-
<!-- arrive at the link template. One solution is to remove the (nice) -->
|
|
304
|
-
<!-- device of showing the main title in the human forms of the problem -->
|
|
304
|
+
<!-- This routine could be replaced with the one in -common if we remove -->
|
|
305
|
+
<!-- the device of showing the main title. -->
|
|
305
306
|
|
|
306
307
|
<xsl:template match="*" mode="xref-link">
|
|
307
308
|
<xsl:param name="content" />
|
|
308
309
|
<xsl:param name="xref" />
|
|
309
|
-
<xsl:param name="b-human-readable" />
|
|
310
310
|
<xsl:copy-of select="$content" />
|
|
311
311
|
<xsl:if test="/mathbook/book|/mathbook/article">
|
|
312
312
|
<xsl:text> in </xsl:text>
|
|
@@ -367,22 +367,18 @@
|
|
|
367
367
|
|
|
368
368
|
<xsl:template match="webwork[statement]">
|
|
369
369
|
<xsl:param name="b-human-readable" />
|
|
370
|
-
<xsl:
|
|
371
|
-
|
|
372
|
-
<xsl:call-template name="webwork-metadata" />
|
|
373
|
-
</xsl:if>
|
|
370
|
+
<xsl:call-template name="converter-blurb-webwork" />
|
|
371
|
+
<xsl:call-template name="webwork-metadata" />
|
|
374
372
|
<xsl:text>DOCUMENT();
</xsl:text>
|
|
375
373
|
<xsl:apply-templates select="." mode="pg-macros">
|
|
376
374
|
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
377
375
|
</xsl:apply-templates>
|
|
378
|
-
<xsl:
|
|
379
|
-
|
|
380
|
-
<xsl:
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
<xsl:apply-templates select="description"/>
|
|
385
|
-
</xsl:if>
|
|
376
|
+
<xsl:text>COMMENT('</xsl:text>
|
|
377
|
+
<xsl:apply-templates select="." mode="type-name">
|
|
378
|
+
<xsl:with-param name="string-id" select="'authored'"/>
|
|
379
|
+
</xsl:apply-templates>
|
|
380
|
+
<xsl:text>');
</xsl:text>
|
|
381
|
+
<xsl:apply-templates select="description"/>
|
|
386
382
|
<xsl:call-template name="pg-header">
|
|
387
383
|
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
388
384
|
</xsl:call-template>
|
|
@@ -398,30 +394,24 @@
|
|
|
398
394
|
<xsl:apply-templates select="solution">
|
|
399
395
|
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
400
396
|
</xsl:apply-templates>
|
|
401
|
-
<xsl:call-template name="end-problem"
|
|
402
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
403
|
-
</xsl:call-template>
|
|
397
|
+
<xsl:call-template name="end-problem"/>
|
|
404
398
|
</xsl:template>
|
|
405
399
|
|
|
406
400
|
<xsl:template match="webwork[task]">
|
|
407
401
|
<xsl:param name="b-human-readable" />
|
|
408
|
-
<xsl:
|
|
409
|
-
|
|
410
|
-
<xsl:call-template name="webwork-metadata" />
|
|
411
|
-
</xsl:if>
|
|
402
|
+
<xsl:call-template name="converter-blurb-webwork" />
|
|
403
|
+
<xsl:call-template name="webwork-metadata" />
|
|
412
404
|
<xsl:text>DOCUMENT();
</xsl:text>
|
|
413
405
|
<xsl:apply-templates select="." mode="pg-macros">
|
|
414
406
|
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
415
407
|
</xsl:apply-templates>
|
|
416
|
-
<xsl:
|
|
417
|
-
|
|
418
|
-
<xsl:
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
<xsl:apply-templates select="description"/>
|
|
424
|
-
</xsl:if>
|
|
408
|
+
<xsl:text>COMMENT('</xsl:text>
|
|
409
|
+
<xsl:apply-templates select="." mode="type-name">
|
|
410
|
+
<xsl:with-param name="string-id" select="'authored'"/>
|
|
411
|
+
</xsl:apply-templates>
|
|
412
|
+
<xsl:text>');
</xsl:text>
|
|
413
|
+
<xsl:text>COMMENT('This problem is scaffolded with multiple parts');
</xsl:text>
|
|
414
|
+
<xsl:apply-templates select="description"/>
|
|
425
415
|
<xsl:call-template name="pg-header">
|
|
426
416
|
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
427
417
|
</xsl:call-template>
|
|
@@ -430,7 +420,6 @@
|
|
|
430
420
|
</xsl:apply-templates>
|
|
431
421
|
<xsl:call-template name="begin-block">
|
|
432
422
|
<xsl:with-param name="block-title">Body</xsl:with-param>
|
|
433
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
434
423
|
</xsl:call-template>
|
|
435
424
|
<xsl:if test="ancestor::exercisegroup/introduction|introduction">
|
|
436
425
|
<xsl:text>
BEGIN_PGML
</xsl:text>
|
|
@@ -446,7 +435,6 @@
|
|
|
446
435
|
</xsl:if>
|
|
447
436
|
<xsl:call-template name="begin-block">
|
|
448
437
|
<xsl:with-param name="block-title">Scaffold</xsl:with-param>
|
|
449
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
450
438
|
</xsl:call-template>
|
|
451
439
|
<xsl:text>Scaffold::Begin(</xsl:text>
|
|
452
440
|
<xsl:text>numbered => 1,</xsl:text>
|
|
@@ -461,19 +449,13 @@
|
|
|
461
449
|
</xsl:otherwise>
|
|
462
450
|
</xsl:choose>
|
|
463
451
|
<xsl:text>);</xsl:text>
|
|
464
|
-
<xsl:
|
|
465
|
-
<xsl:text>
</xsl:text>
|
|
466
|
-
</xsl:if>
|
|
452
|
+
<xsl:text>
</xsl:text>
|
|
467
453
|
<xsl:apply-templates select="task">
|
|
468
454
|
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
469
455
|
</xsl:apply-templates>
|
|
470
|
-
<xsl:
|
|
471
|
-
<xsl:text>
</xsl:text>
|
|
472
|
-
</xsl:if>
|
|
456
|
+
<xsl:text>
</xsl:text>
|
|
473
457
|
<xsl:text>Scaffold::End();</xsl:text>
|
|
474
|
-
<xsl:
|
|
475
|
-
<xsl:text>
</xsl:text>
|
|
476
|
-
</xsl:if>
|
|
458
|
+
<xsl:text>
</xsl:text>
|
|
477
459
|
<xsl:if test="conclusion">
|
|
478
460
|
<xsl:text>
BEGIN_PGML
</xsl:text>
|
|
479
461
|
<xsl:apply-templates select="conclusion">
|
|
@@ -481,25 +463,20 @@
|
|
|
481
463
|
</xsl:apply-templates>
|
|
482
464
|
<xsl:text>
END_PGML
</xsl:text>
|
|
483
465
|
</xsl:if>
|
|
484
|
-
<xsl:call-template name="end-problem"
|
|
485
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
486
|
-
</xsl:call-template>
|
|
466
|
+
<xsl:call-template name="end-problem"/>
|
|
487
467
|
</xsl:template>
|
|
488
468
|
|
|
489
469
|
<xsl:template match="task[statement]">
|
|
490
470
|
<xsl:param name="b-human-readable" />
|
|
491
471
|
<xsl:call-template name="begin-block">
|
|
492
472
|
<xsl:with-param name="block-title">Section</xsl:with-param>
|
|
493
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
494
473
|
</xsl:call-template>
|
|
495
474
|
<xsl:text>Section::Begin("</xsl:text>
|
|
496
475
|
<xsl:if test="title">
|
|
497
476
|
<xsl:apply-templates select="." mode="title-xref"/>
|
|
498
477
|
</xsl:if>
|
|
499
478
|
<xsl:text>");</xsl:text>
|
|
500
|
-
<xsl:
|
|
501
|
-
<xsl:text>
</xsl:text>
|
|
502
|
-
</xsl:if>
|
|
479
|
+
<xsl:text>
</xsl:text>
|
|
503
480
|
<xsl:apply-templates select="statement">
|
|
504
481
|
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
505
482
|
</xsl:apply-templates>
|
|
@@ -509,29 +486,22 @@
|
|
|
509
486
|
<xsl:apply-templates select="solution">
|
|
510
487
|
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
511
488
|
</xsl:apply-templates>
|
|
512
|
-
<xsl:
|
|
513
|
-
<xsl:text>
</xsl:text>
|
|
514
|
-
</xsl:if>
|
|
489
|
+
<xsl:text>
</xsl:text>
|
|
515
490
|
<xsl:text>Section::End();</xsl:text>
|
|
516
|
-
<xsl:
|
|
517
|
-
<xsl:text>
</xsl:text>
|
|
518
|
-
</xsl:if>
|
|
491
|
+
<xsl:text>
</xsl:text>
|
|
519
492
|
</xsl:template>
|
|
520
493
|
|
|
521
494
|
<xsl:template match="task[task]">
|
|
522
495
|
<xsl:param name="b-human-readable" />
|
|
523
496
|
<xsl:call-template name="begin-block">
|
|
524
497
|
<xsl:with-param name="block-title">Section</xsl:with-param>
|
|
525
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
526
498
|
</xsl:call-template>
|
|
527
499
|
<xsl:text>Section::Begin("</xsl:text>
|
|
528
500
|
<xsl:if test="title">
|
|
529
501
|
<xsl:apply-templates select="." mode="title-xref"/>
|
|
530
502
|
</xsl:if>
|
|
531
503
|
<xsl:text>");</xsl:text>
|
|
532
|
-
<xsl:
|
|
533
|
-
<xsl:text>
</xsl:text>
|
|
534
|
-
</xsl:if>
|
|
504
|
+
<xsl:text>
</xsl:text>
|
|
535
505
|
<xsl:if test="introduction">
|
|
536
506
|
<xsl:text>
BEGIN_PGML
</xsl:text>
|
|
537
507
|
<xsl:apply-templates select="introduction">
|
|
@@ -541,22 +511,15 @@
|
|
|
541
511
|
</xsl:if>
|
|
542
512
|
<xsl:call-template name="begin-block">
|
|
543
513
|
<xsl:with-param name="block-title">Scaffold</xsl:with-param>
|
|
544
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
545
514
|
</xsl:call-template>
|
|
546
515
|
<xsl:text>Scaffold::Begin(numbered=>1);</xsl:text>
|
|
547
|
-
<xsl:
|
|
548
|
-
<xsl:text>
</xsl:text>
|
|
549
|
-
</xsl:if>
|
|
516
|
+
<xsl:text>
</xsl:text>
|
|
550
517
|
<xsl:apply-templates select="task">
|
|
551
518
|
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
552
519
|
</xsl:apply-templates>
|
|
553
|
-
<xsl:
|
|
554
|
-
<xsl:text>
</xsl:text>
|
|
555
|
-
</xsl:if>
|
|
520
|
+
<xsl:text>
</xsl:text>
|
|
556
521
|
<xsl:text>Scaffold::End();</xsl:text>
|
|
557
|
-
<xsl:
|
|
558
|
-
<xsl:text>
</xsl:text>
|
|
559
|
-
</xsl:if>
|
|
522
|
+
<xsl:text>
</xsl:text>
|
|
560
523
|
<xsl:if test="conclusion">
|
|
561
524
|
<xsl:text>
BEGIN_PGML
</xsl:text>
|
|
562
525
|
<xsl:apply-templates select="conclusion">
|
|
@@ -564,33 +527,26 @@
|
|
|
564
527
|
</xsl:apply-templates>
|
|
565
528
|
<xsl:text>
END_PGML
</xsl:text>
|
|
566
529
|
</xsl:if>
|
|
567
|
-
<xsl:
|
|
568
|
-
<xsl:text>
</xsl:text>
|
|
569
|
-
</xsl:if>
|
|
530
|
+
<xsl:text>
</xsl:text>
|
|
570
531
|
<xsl:text>Section::End();</xsl:text>
|
|
571
|
-
<xsl:
|
|
572
|
-
<xsl:text>
</xsl:text>
|
|
573
|
-
</xsl:if>
|
|
532
|
+
<xsl:text>
</xsl:text>
|
|
574
533
|
</xsl:template>
|
|
575
534
|
|
|
576
535
|
<xsl:template match="webwork" mode="pg-code">
|
|
577
536
|
<xsl:param name="b-human-readable" />
|
|
578
537
|
<xsl:call-template name="begin-block">
|
|
579
538
|
<xsl:with-param name="block-title">PG Setup Code</xsl:with-param>
|
|
580
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
581
539
|
</xsl:call-template>
|
|
582
540
|
<!-- All our problems load MathObjects, and so should have at least -->
|
|
583
541
|
<!-- one explicit Context() load. -->
|
|
584
|
-
<xsl:if test="not(contains(
|
|
542
|
+
<xsl:if test="not(contains(pg-code,'Context('))">
|
|
585
543
|
<xsl:text>Context('Numeric');</xsl:text>
|
|
586
|
-
<xsl:
|
|
587
|
-
<xsl:text>
</xsl:text>
|
|
588
|
-
</xsl:if>
|
|
544
|
+
<xsl:text>
</xsl:text>
|
|
589
545
|
</xsl:if>
|
|
590
546
|
<!-- pg-code verbatim, but trim indentation -->
|
|
591
|
-
<xsl:if test="
|
|
547
|
+
<xsl:if test="pg-code">
|
|
592
548
|
<xsl:call-template name="sanitize-text">
|
|
593
|
-
<xsl:with-param name="text" select="
|
|
549
|
+
<xsl:with-param name="text" select="pg-code" />
|
|
594
550
|
</xsl:call-template>
|
|
595
551
|
</xsl:if>
|
|
596
552
|
<!-- if there are latex-image in the problem, put their code here -->
|
|
@@ -606,7 +562,6 @@
|
|
|
606
562
|
<xsl:param name="b-human-readable" />
|
|
607
563
|
<xsl:call-template name="begin-block">
|
|
608
564
|
<xsl:with-param name="block-title">Body</xsl:with-param>
|
|
609
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
610
565
|
</xsl:call-template>
|
|
611
566
|
<xsl:text>
BEGIN_PGML
</xsl:text>
|
|
612
567
|
<xsl:if test="$b-human-readable">
|
|
@@ -634,7 +589,6 @@
|
|
|
634
589
|
<xsl:param name="b-human-readable" />
|
|
635
590
|
<xsl:call-template name="begin-block">
|
|
636
591
|
<xsl:with-param name="block-title">Solution</xsl:with-param>
|
|
637
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
638
592
|
</xsl:call-template>
|
|
639
593
|
<xsl:text>
BEGIN_PGML_SOLUTION
</xsl:text>
|
|
640
594
|
<xsl:apply-templates select="*">
|
|
@@ -645,14 +599,10 @@
|
|
|
645
599
|
|
|
646
600
|
<!-- default template, for hint -->
|
|
647
601
|
<xsl:template match="hint">
|
|
648
|
-
<xsl:param name="b-human-readable" />
|
|
649
602
|
<xsl:call-template name="begin-block">
|
|
650
603
|
<xsl:with-param name="block-title">Hint</xsl:with-param>
|
|
651
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
652
604
|
</xsl:call-template>
|
|
653
|
-
<xsl:
|
|
654
|
-
<xsl:text>#Set value of $showHint in PGcourse.pl for course-wide attempt threshhold for revealing hints
</xsl:text>
|
|
655
|
-
</xsl:if>
|
|
605
|
+
<xsl:text>#Set value of $showHint in PGcourse.pl for course-wide attempt threshhold for revealing hints
</xsl:text>
|
|
656
606
|
<xsl:text>
BEGIN_PGML_HINT
</xsl:text>
|
|
657
607
|
<xsl:apply-templates select="*"/>
|
|
658
608
|
<xsl:text>
END_PGML_HINT
</xsl:text>
|
|
@@ -772,9 +722,7 @@
|
|
|
772
722
|
<xsl:param name="b-human-readable" />
|
|
773
723
|
<xsl:call-template name="begin-block">
|
|
774
724
|
<xsl:with-param name="block-title">Header</xsl:with-param>
|
|
775
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
776
725
|
</xsl:call-template>
|
|
777
|
-
<xsl:text>TEXT(beginproblem());
</xsl:text>
|
|
778
726
|
<xsl:if test="not($b-human-readable)">
|
|
779
727
|
<!-- see select-latex-macros template -->
|
|
780
728
|
<xsl:variable name="macros">
|
|
@@ -804,9 +752,7 @@
|
|
|
804
752
|
<xsl:text>));
</xsl:text>
|
|
805
753
|
</xsl:if>
|
|
806
754
|
</xsl:if>
|
|
807
|
-
<xsl:
|
|
808
|
-
<xsl:text>
</xsl:text>
|
|
809
|
-
</xsl:if>
|
|
755
|
+
<xsl:text>
</xsl:text>
|
|
810
756
|
</xsl:template>
|
|
811
757
|
|
|
812
758
|
|
|
@@ -815,15 +761,11 @@
|
|
|
815
761
|
<!-- ############## -->
|
|
816
762
|
|
|
817
763
|
<xsl:template name="end-problem">
|
|
818
|
-
<xsl:param name="b-human-readable" />
|
|
819
764
|
<xsl:call-template name="begin-block">
|
|
820
765
|
<xsl:with-param name="block-title">End Problem</xsl:with-param>
|
|
821
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
822
766
|
</xsl:call-template>
|
|
823
767
|
<xsl:text>
ENDDOCUMENT();</xsl:text>
|
|
824
|
-
<xsl:
|
|
825
|
-
<xsl:text>
</xsl:text>
|
|
826
|
-
</xsl:if>
|
|
768
|
+
<xsl:text>
</xsl:text>
|
|
827
769
|
</xsl:template>
|
|
828
770
|
|
|
829
771
|
<!-- ############## -->
|
|
@@ -837,18 +779,15 @@
|
|
|
837
779
|
|
|
838
780
|
<xsl:call-template name="begin-block">
|
|
839
781
|
<xsl:with-param name="block-title">Load Macros</xsl:with-param>
|
|
840
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
841
782
|
</xsl:call-template>
|
|
842
783
|
|
|
843
784
|
<!-- two standard macros always used -->
|
|
844
785
|
<xsl:variable name="standard-macros">
|
|
845
786
|
<xsl:call-template name="macro-padding">
|
|
846
787
|
<xsl:with-param name="string" select="'PGstandard.pl'"/>
|
|
847
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
848
788
|
</xsl:call-template>
|
|
849
789
|
<xsl:call-template name="macro-padding">
|
|
850
790
|
<xsl:with-param name="string" select="'PGML.pl'"/>
|
|
851
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
852
791
|
</xsl:call-template>
|
|
853
792
|
</xsl:variable>
|
|
854
793
|
|
|
@@ -862,7 +801,6 @@
|
|
|
862
801
|
<xsl:if test="$pg.answer.form.help = 'yes'">
|
|
863
802
|
<xsl:call-template name="macro-padding">
|
|
864
803
|
<xsl:with-param name="string" select="'AnswerFormatHelp.pl'"/>
|
|
865
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
866
804
|
</xsl:call-template>
|
|
867
805
|
</xsl:if>
|
|
868
806
|
|
|
@@ -872,25 +810,21 @@
|
|
|
872
810
|
<xsl:if test=".//tabular">
|
|
873
811
|
<xsl:call-template name="macro-padding">
|
|
874
812
|
<xsl:with-param name="string" select="'niceTables.pl'"/>
|
|
875
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
876
813
|
</xsl:call-template>
|
|
877
814
|
</xsl:if>
|
|
878
815
|
<xsl:if test=".//image[@pg-name]">
|
|
879
816
|
<xsl:call-template name="macro-padding">
|
|
880
817
|
<xsl:with-param name="string" select="'PGgraphmacros.pl'"/>
|
|
881
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
882
818
|
</xsl:call-template>
|
|
883
819
|
</xsl:if>
|
|
884
820
|
<xsl:if test=".//latex-image or ($b-human-readable and ancestor::exercisegroup/introduction//latex-image)">
|
|
885
821
|
<xsl:call-template name="macro-padding">
|
|
886
822
|
<xsl:with-param name="string" select="'PGlateximage.pl'"/>
|
|
887
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
888
823
|
</xsl:call-template>
|
|
889
824
|
</xsl:if>
|
|
890
825
|
<xsl:if test="task">
|
|
891
826
|
<xsl:call-template name="macro-padding">
|
|
892
827
|
<xsl:with-param name="string" select="'scaffold.pl'"/>
|
|
893
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
894
828
|
</xsl:call-template>
|
|
895
829
|
</xsl:if>
|
|
896
830
|
|
|
@@ -900,13 +834,11 @@
|
|
|
900
834
|
<xsl:if test=".//instruction or contains($pg-code,'RandomVariableName') or contains($pg-code,'RandomName') or contains($pg-code,'numberWord')">
|
|
901
835
|
<xsl:call-template name="macro-padding">
|
|
902
836
|
<xsl:with-param name="string" select="'PCCmacros.pl'"/>
|
|
903
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
904
837
|
</xsl:call-template>
|
|
905
838
|
</xsl:if>
|
|
906
839
|
<xsl:if test=".//var[@form='essay'] or contains($pg-code,'explanation_box')">
|
|
907
840
|
<xsl:call-template name="macro-padding">
|
|
908
841
|
<xsl:with-param name="string" select="'PGessaymacros.pl'"/>
|
|
909
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
910
842
|
</xsl:call-template>
|
|
911
843
|
</xsl:if>
|
|
912
844
|
|
|
@@ -915,19 +847,16 @@
|
|
|
915
847
|
<xsl:if test="contains($pg-code,'AnswerHints')">
|
|
916
848
|
<xsl:call-template name="macro-padding">
|
|
917
849
|
<xsl:with-param name="string" select="'answerHints.pl'"/>
|
|
918
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
919
850
|
</xsl:call-template>
|
|
920
851
|
</xsl:if>
|
|
921
852
|
<xsl:if test="contains($pg-code,'bizarro')">
|
|
922
853
|
<xsl:call-template name="macro-padding">
|
|
923
854
|
<xsl:with-param name="string" select="'bizarroArithmetic.pl'"/>
|
|
924
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
925
855
|
</xsl:call-template>
|
|
926
856
|
</xsl:if>
|
|
927
857
|
<xsl:if test="contains($pg-code,'NchooseK')">
|
|
928
858
|
<xsl:call-template name="macro-padding">
|
|
929
859
|
<xsl:with-param name="string" select="'PGchoicemacros.pl'"/>
|
|
930
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
931
860
|
</xsl:call-template>
|
|
932
861
|
</xsl:if>
|
|
933
862
|
|
|
@@ -963,7 +892,6 @@
|
|
|
963
892
|
<xsl:if test="contains($pg-code, .)">
|
|
964
893
|
<xsl:call-template name="macro-padding">
|
|
965
894
|
<xsl:with-param name="string" select="concat('parser', ., '.pl')"/>
|
|
966
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
967
895
|
</xsl:call-template>
|
|
968
896
|
</xsl:if>
|
|
969
897
|
</xsl:for-each>
|
|
@@ -973,25 +901,21 @@
|
|
|
973
901
|
<xsl:if test="contains($pg-code, 'parserFunction')">
|
|
974
902
|
<xsl:call-template name="macro-padding">
|
|
975
903
|
<xsl:with-param name="string" select="'parserFunction.pl'"/>
|
|
976
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
977
904
|
</xsl:call-template>
|
|
978
905
|
</xsl:if>
|
|
979
906
|
<xsl:if test="contains($pg-code, 'parser::Prime')">
|
|
980
907
|
<xsl:call-template name="macro-padding">
|
|
981
908
|
<xsl:with-param name="string" select="'parserPrime.pl'"/>
|
|
982
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
983
909
|
</xsl:call-template>
|
|
984
910
|
</xsl:if>
|
|
985
911
|
<xsl:if test="contains($pg-code, 'parser::Root')">
|
|
986
912
|
<xsl:call-template name="macro-padding">
|
|
987
913
|
<xsl:with-param name="string" select="'parserRoot.pl'"/>
|
|
988
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
989
914
|
</xsl:call-template>
|
|
990
915
|
</xsl:if>
|
|
991
916
|
<xsl:if test="contains($pg-code, 'Overline') or contains($pg-code, 'BoldMath' or contains($pg-code, 'non_zero_point') or contains($pg-code, 'non_zero_vector'))">
|
|
992
917
|
<xsl:call-template name="macro-padding">
|
|
993
918
|
<xsl:with-param name="string" select="'parserVectorUtils.pl'"/>
|
|
994
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
995
919
|
</xsl:call-template>
|
|
996
920
|
</xsl:if>
|
|
997
921
|
|
|
@@ -1037,7 +961,6 @@
|
|
|
1037
961
|
<xsl:if test="contains($pg-code, .)">
|
|
1038
962
|
<xsl:call-template name="macro-padding">
|
|
1039
963
|
<xsl:with-param name="string" select="concat('context', ., '.pl')"/>
|
|
1040
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
1041
964
|
</xsl:call-template>
|
|
1042
965
|
</xsl:if>
|
|
1043
966
|
</xsl:for-each>
|
|
@@ -1076,7 +999,6 @@
|
|
|
1076
999
|
<xsl:otherwise>
|
|
1077
1000
|
<xsl:call-template name="macro-padding">
|
|
1078
1001
|
<xsl:with-param name="string" select="."/>
|
|
1079
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
1080
1002
|
</xsl:call-template>
|
|
1081
1003
|
</xsl:otherwise>
|
|
1082
1004
|
</xsl:choose>
|
|
@@ -1097,22 +1019,18 @@
|
|
|
1097
1019
|
</xsl:variable>
|
|
1098
1020
|
<xsl:call-template name="macro-padding">
|
|
1099
1021
|
<xsl:with-param name="string" select="$ptx-pg-macros-filename"/>
|
|
1100
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
1101
1022
|
</xsl:call-template>
|
|
1102
1023
|
</xsl:variable>
|
|
1103
1024
|
<!-- always finish with PG course macro -->
|
|
1104
1025
|
<xsl:variable name="course-macros">
|
|
1105
1026
|
<xsl:call-template name="macro-padding">
|
|
1106
1027
|
<xsl:with-param name="string" select="'PGcourse.pl'"/>
|
|
1107
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
1108
1028
|
</xsl:call-template>
|
|
1109
1029
|
</xsl:variable>
|
|
1110
1030
|
<!-- put them together with a wrapper -->
|
|
1111
1031
|
<xsl:variable name="load-macros">
|
|
1112
1032
|
<xsl:text>loadMacros(</xsl:text>
|
|
1113
|
-
<xsl:
|
|
1114
|
-
<xsl:text>
</xsl:text>
|
|
1115
|
-
</xsl:if>
|
|
1033
|
+
<xsl:text>
</xsl:text>
|
|
1116
1034
|
<xsl:value-of select="$standard-macros" />
|
|
1117
1035
|
<xsl:value-of select="$implied-macros" />
|
|
1118
1036
|
<xsl:value-of select="$user-macros" />
|
|
@@ -1121,9 +1039,7 @@
|
|
|
1121
1039
|
</xsl:if>
|
|
1122
1040
|
<xsl:value-of select="$course-macros" />
|
|
1123
1041
|
<xsl:text>);</xsl:text>
|
|
1124
|
-
<xsl:
|
|
1125
|
-
<xsl:text>
</xsl:text>
|
|
1126
|
-
</xsl:if>
|
|
1042
|
+
<xsl:text>
</xsl:text>
|
|
1127
1043
|
</xsl:variable>
|
|
1128
1044
|
<xsl:value-of select="$load-macros" />
|
|
1129
1045
|
<!-- if images are used, explicitly refresh or stale images will be used in HTML -->
|
|
@@ -1134,16 +1050,11 @@
|
|
|
1134
1050
|
|
|
1135
1051
|
<xsl:template name="macro-padding">
|
|
1136
1052
|
<xsl:param name="string"/>
|
|
1137
|
-
<xsl:
|
|
1138
|
-
<xsl:if test="$b-human-readable">
|
|
1139
|
-
<xsl:text> </xsl:text>
|
|
1140
|
-
</xsl:if>
|
|
1053
|
+
<xsl:text> </xsl:text>
|
|
1141
1054
|
<xsl:text>"</xsl:text>
|
|
1142
1055
|
<xsl:value-of select="$string"/>
|
|
1143
1056
|
<xsl:text>",</xsl:text>
|
|
1144
|
-
<xsl:
|
|
1145
|
-
<xsl:text>
</xsl:text>
|
|
1146
|
-
</xsl:if>
|
|
1057
|
+
<xsl:text>
</xsl:text>
|
|
1147
1058
|
</xsl:template>
|
|
1148
1059
|
|
|
1149
1060
|
<!-- ############## -->
|
|
@@ -1172,10 +1083,7 @@
|
|
|
1172
1083
|
<!-- PGML answer input -->
|
|
1173
1084
|
<!-- Example: [_____]{$ans} -->
|
|
1174
1085
|
<xsl:template match="statement//var[@width|@form]">
|
|
1175
|
-
<xsl:
|
|
1176
|
-
<xsl:apply-templates select="." mode="field">
|
|
1177
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
1178
|
-
</xsl:apply-templates>
|
|
1086
|
+
<xsl:apply-templates select="." mode="field"/>
|
|
1179
1087
|
<xsl:apply-templates select="." mode="form-help"/>
|
|
1180
1088
|
</xsl:template>
|
|
1181
1089
|
|
|
@@ -1183,7 +1091,6 @@
|
|
|
1183
1091
|
<!-- with variant for MathObjects like Matrix, Vector, ColumnVector -->
|
|
1184
1092
|
<!-- where the shape of the MathObject guides the array of answer blanks -->
|
|
1185
1093
|
<xsl:template match="var[@width|@form]" mode="field">
|
|
1186
|
-
<xsl:param name="b-human-readable" />
|
|
1187
1094
|
<xsl:variable name="width">
|
|
1188
1095
|
<xsl:choose>
|
|
1189
1096
|
<xsl:when test="@width">
|
|
@@ -1232,12 +1139,8 @@
|
|
|
1232
1139
|
<!-- Requires: PGessaymacros.pl, automatically loaded -->
|
|
1233
1140
|
<!-- http://webwork.maa.org/moodle/mod/forum/discuss.php?d=3370 -->
|
|
1234
1141
|
<xsl:template match="var[@form='essay']" mode="field">
|
|
1235
|
-
<xsl:param name="b-human-readable" />
|
|
1236
1142
|
<xsl:text>[@ANS(essay_cmp());</xsl:text>
|
|
1237
|
-
|
|
1238
|
-
<xsl:if test="$b-human-readable">
|
|
1239
|
-
<xsl:text> </xsl:text>
|
|
1240
|
-
</xsl:if>
|
|
1143
|
+
<xsl:text> </xsl:text>
|
|
1241
1144
|
<xsl:text>essay_box(</xsl:text>
|
|
1242
1145
|
<xsl:choose>
|
|
1243
1146
|
<xsl:when test="@height">
|
|
@@ -1532,16 +1435,13 @@
|
|
|
1532
1435
|
<!-- use will be caught by a deprectation warning -->
|
|
1533
1436
|
<!-- as well as fail a schema validation. -->
|
|
1534
1437
|
<xsl:template match="image|tabular|sidebyside">
|
|
1535
|
-
<xsl:param name="b-human-readable" />
|
|
1536
1438
|
<xsl:if test="preceding-sibling::p">
|
|
1537
1439
|
<xsl:call-template name="potential-list-indent" />
|
|
1538
1440
|
</xsl:if>
|
|
1539
1441
|
<xsl:if test="not(ancestor::li)">
|
|
1540
1442
|
<xsl:text>>> </xsl:text>
|
|
1541
1443
|
</xsl:if>
|
|
1542
|
-
<xsl:apply-templates select="self::image|self::tabular|self::sidebyside/image|self::sidebyside/tabular" mode="components"
|
|
1543
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
1544
|
-
</xsl:apply-templates>
|
|
1444
|
+
<xsl:apply-templates select="self::image|self::tabular|self::sidebyside/image|self::sidebyside/tabular" mode="components"/>
|
|
1545
1445
|
<xsl:if test="not(ancestor::li)">
|
|
1546
1446
|
<xsl:text> <<</xsl:text>
|
|
1547
1447
|
</xsl:if>
|
|
@@ -1630,11 +1530,9 @@
|
|
|
1630
1530
|
<xsl:template match="md[not(@pi:authored-one-line)]" mode="body">
|
|
1631
1531
|
<xsl:param name="b-human-readable"/>
|
|
1632
1532
|
<xsl:variable name="complete-latex">
|
|
1633
|
-
<xsl:
|
|
1634
|
-
|
|
1635
|
-
<xsl:
|
|
1636
|
-
<xsl:call-template name="potential-list-indent" />
|
|
1637
|
-
</xsl:if>
|
|
1533
|
+
<xsl:text>
</xsl:text>
|
|
1534
|
+
<xsl:if test="ancestor::ul|ancestor::ol">
|
|
1535
|
+
<xsl:call-template name="potential-list-indent" />
|
|
1638
1536
|
</xsl:if>
|
|
1639
1537
|
<xsl:text>\begin{</xsl:text>
|
|
1640
1538
|
<xsl:apply-templates select="." mode="displaymath-alignment"/>
|
|
@@ -1754,20 +1652,28 @@
|
|
|
1754
1652
|
|
|
1755
1653
|
<xsl:template match="dblbrackets">
|
|
1756
1654
|
<xsl:param name="b-human-readable" />
|
|
1757
|
-
<xsl:call-template name="
|
|
1655
|
+
<xsl:call-template name="character">
|
|
1656
|
+
<xsl:with-param name="name" select="'ldblbracket'"/>
|
|
1657
|
+
</xsl:call-template>
|
|
1758
1658
|
<xsl:apply-templates>
|
|
1759
1659
|
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
1760
1660
|
</xsl:apply-templates>
|
|
1761
|
-
<xsl:call-template name="
|
|
1661
|
+
<xsl:call-template name="character">
|
|
1662
|
+
<xsl:with-param name="name" select="'rdblbracket'"/>
|
|
1663
|
+
</xsl:call-template>
|
|
1762
1664
|
</xsl:template>
|
|
1763
1665
|
|
|
1764
1666
|
<xsl:template match="angles">
|
|
1765
1667
|
<xsl:param name="b-human-readable" />
|
|
1766
|
-
<xsl:call-template name="
|
|
1668
|
+
<xsl:call-template name="character">
|
|
1669
|
+
<xsl:with-param name="name" select="'langle'"/>
|
|
1670
|
+
</xsl:call-template>
|
|
1767
1671
|
<xsl:apply-templates>
|
|
1768
1672
|
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
1769
1673
|
</xsl:apply-templates>
|
|
1770
|
-
<xsl:call-template name="
|
|
1674
|
+
<xsl:call-template name="character">
|
|
1675
|
+
<xsl:with-param name="name" select="'rangle'"/>
|
|
1676
|
+
</xsl:call-template>
|
|
1771
1677
|
</xsl:template>
|
|
1772
1678
|
|
|
1773
1679
|
|
|
@@ -1784,7 +1690,7 @@
|
|
|
1784
1690
|
<!-- warning if there is no content -->
|
|
1785
1691
|
<xsl:if test="not(descendant::unit) and not(descendant::per) and not(descendant::mag)">
|
|
1786
1692
|
<xsl:message>
|
|
1787
|
-
<xsl:text>PTX:
|
|
1693
|
+
<xsl:text>PTX:ERROR: magnitude or units needed</xsl:text>
|
|
1788
1694
|
</xsl:message>
|
|
1789
1695
|
</xsl:if>
|
|
1790
1696
|
<!-- print magnitude if there is one -->
|
|
@@ -1865,7 +1771,7 @@
|
|
|
1865
1771
|
</xsl:when>
|
|
1866
1772
|
<xsl:otherwise>
|
|
1867
1773
|
<xsl:message>
|
|
1868
|
-
<xsl:text>PTX:
|
|
1774
|
+
<xsl:text>PTX:ERROR: base unit needed</xsl:text>
|
|
1869
1775
|
</xsl:message>
|
|
1870
1776
|
</xsl:otherwise>
|
|
1871
1777
|
</xsl:choose>
|
|
@@ -1931,28 +1837,12 @@
|
|
|
1931
1837
|
|
|
1932
1838
|
<!-- TeX logo -->
|
|
1933
1839
|
<xsl:template match="tex">
|
|
1934
|
-
<xsl:
|
|
1935
|
-
<xsl:choose>
|
|
1936
|
-
<xsl:when test="$b-human-readable">
|
|
1937
|
-
<xsl:text>[@MODES(HTML => '\(\mathrm\TeX\)', TeX => '\TeX', PTX => '<tex/>')@]*</xsl:text>
|
|
1938
|
-
</xsl:when>
|
|
1939
|
-
<xsl:otherwise>
|
|
1940
|
-
<xsl:text>[@MODES(HTML=>'\(\mathrm\TeX\)',TeX=>'\TeX', PTX=>'<tex/>')@]*</xsl:text>
|
|
1941
|
-
</xsl:otherwise>
|
|
1942
|
-
</xsl:choose>
|
|
1840
|
+
<xsl:text>[@MODES(HTML => '\(\mathrm\TeX\)', TeX => '\TeX', PTX => '<tex/>')@]*</xsl:text>
|
|
1943
1841
|
</xsl:template>
|
|
1944
1842
|
|
|
1945
1843
|
<!-- LaTeX logo -->
|
|
1946
1844
|
<xsl:template match="latex">
|
|
1947
|
-
<xsl:
|
|
1948
|
-
<xsl:choose>
|
|
1949
|
-
<xsl:when test="$b-human-readable">
|
|
1950
|
-
<xsl:text>[$LATEX]*</xsl:text>
|
|
1951
|
-
</xsl:when>
|
|
1952
|
-
<xsl:otherwise>
|
|
1953
|
-
<xsl:text>[$TEX]*</xsl:text>
|
|
1954
|
-
</xsl:otherwise>
|
|
1955
|
-
</xsl:choose>
|
|
1845
|
+
<xsl:text>[$LATEX]*</xsl:text>
|
|
1956
1846
|
</xsl:template>
|
|
1957
1847
|
|
|
1958
1848
|
<!-- PGML is content with "dumb" quotes and will do -->
|
|
@@ -2057,12 +1947,6 @@
|
|
|
2057
1947
|
<!-- * \ Always escape backslash. -->
|
|
2058
1948
|
<!-- #################################################### -->
|
|
2059
1949
|
|
|
2060
|
-
<!-- Ellipsis -->
|
|
2061
|
-
<!-- Just three periods -->
|
|
2062
|
-
<xsl:template name="ellipsis-character">
|
|
2063
|
-
<xsl:text>...</xsl:text>
|
|
2064
|
-
</xsl:template>
|
|
2065
|
-
|
|
2066
1950
|
<!-- ############### -->
|
|
2067
1951
|
<!-- Text Processing -->
|
|
2068
1952
|
<!-- ############### -->
|
|
@@ -2194,33 +2078,23 @@
|
|
|
2194
2078
|
<xsl:text>```

</xsl:text>
|
|
2195
2079
|
</xsl:template>
|
|
2196
2080
|
|
|
2197
|
-
<!--
|
|
2198
|
-
<!--
|
|
2199
|
-
<!--
|
|
2200
|
-
|
|
2201
|
-
<!--
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
</xsl:template>
|
|
2215
|
-
|
|
2216
|
-
<!-- The abstract template for "mdash" consults a publisher option -->
|
|
2217
|
-
<!-- for thin space, or no space, surrounding an em-dash. So the -->
|
|
2218
|
-
<!-- "thin-space-character" is needed for that purpose, and does -->
|
|
2219
|
-
<!-- not have an associated empty PTX element. -->
|
|
2220
|
-
<!-- Cannot find such a thing documented for PGML, so just normal -->
|
|
2221
|
-
|
|
2222
|
-
<xsl:template name="thin-space-character">
|
|
2223
|
-
<xsl:text> </xsl:text>
|
|
2081
|
+
<!-- Each character reads the "webwork" column of the representation -->
|
|
2082
|
+
<!-- table in pretext-common.xsl. The space and dash entries are -->
|
|
2083
|
+
<!-- WW macros that PGML will format properly for WW HTML or LaTeX -->
|
|
2084
|
+
<!-- output; the thin space has no documented PGML form, so it is a -->
|
|
2085
|
+
<!-- normal space. A character without a column entry warns, so the -->
|
|
2086
|
+
<!-- gaps stay visible. -->
|
|
2087
|
+
<xsl:template match="char" mode="character">
|
|
2088
|
+
<xsl:choose>
|
|
2089
|
+
<xsl:when test="@webwork">
|
|
2090
|
+
<xsl:value-of select="@webwork"/>
|
|
2091
|
+
</xsl:when>
|
|
2092
|
+
<xsl:otherwise>
|
|
2093
|
+
<xsl:call-template name="warn-unimplemented-character">
|
|
2094
|
+
<xsl:with-param name="char-name" select="@name"/>
|
|
2095
|
+
</xsl:call-template>
|
|
2096
|
+
</xsl:otherwise>
|
|
2097
|
+
</xsl:choose>
|
|
2224
2098
|
</xsl:template>
|
|
2225
2099
|
|
|
2226
2100
|
|
|
@@ -2325,36 +2199,18 @@
|
|
|
2325
2199
|
<!-- Tables -->
|
|
2326
2200
|
<!-- ###### -->
|
|
2327
2201
|
|
|
2328
|
-
<xsl:template match="table">
|
|
2329
|
-
<xsl:param name="b-human-readable" />
|
|
2330
|
-
<xsl:apply-templates select="*[not(self::caption)]">
|
|
2331
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
2332
|
-
</xsl:apply-templates>
|
|
2333
|
-
</xsl:template>
|
|
2334
|
-
|
|
2335
2202
|
<xsl:template match="tabular" mode="components">
|
|
2336
|
-
<xsl:param name="b-human-readable" />
|
|
2337
|
-
|
|
2338
2203
|
<xsl:text>[@DataTable(</xsl:text>
|
|
2339
|
-
<xsl:
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
<xsl:text> </xsl:text>
|
|
2343
|
-
</xsl:if>
|
|
2204
|
+
<xsl:text>
</xsl:text>
|
|
2205
|
+
<xsl:call-template name="potential-list-indent" />
|
|
2206
|
+
<xsl:text> </xsl:text>
|
|
2344
2207
|
<xsl:text>[</xsl:text>
|
|
2345
|
-
<xsl:
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
<xsl:
|
|
2349
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable" />
|
|
2350
|
-
</xsl:apply-templates>
|
|
2351
|
-
<xsl:if test="$b-human-readable">
|
|
2352
|
-
<xsl:call-template name="potential-list-indent" />
|
|
2353
|
-
<xsl:text> </xsl:text>
|
|
2354
|
-
</xsl:if>
|
|
2208
|
+
<xsl:text>
</xsl:text>
|
|
2209
|
+
<xsl:apply-templates select="row"/>
|
|
2210
|
+
<xsl:call-template name="potential-list-indent" />
|
|
2211
|
+
<xsl:text> </xsl:text>
|
|
2355
2212
|
<xsl:text>],</xsl:text>
|
|
2356
2213
|
<xsl:call-template name="key-value">
|
|
2357
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
2358
2214
|
<xsl:with-param name="key" select="'align'"/>
|
|
2359
2215
|
<xsl:with-param name="value">
|
|
2360
2216
|
<xsl:apply-templates select="." mode="texalignment"/>
|
|
@@ -2363,7 +2219,6 @@
|
|
|
2363
2219
|
<!-- niceTables default for valign is top -->
|
|
2364
2220
|
<xsl:if test="@valign = str:tokenize('bottom middle') or not(@valign) or @valign = ''">
|
|
2365
2221
|
<xsl:call-template name="key-value">
|
|
2366
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
2367
2222
|
<xsl:with-param name="key" select="'valign'"/>
|
|
2368
2223
|
<xsl:with-param name="value">
|
|
2369
2224
|
<xsl:choose>
|
|
@@ -2380,7 +2235,6 @@
|
|
|
2380
2235
|
<!-- is there a top border? -->
|
|
2381
2236
|
<xsl:if test="@top = str:tokenize('minor medium major', ' ')">
|
|
2382
2237
|
<xsl:call-template name="key-value">
|
|
2383
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
2384
2238
|
<xsl:with-param name="key" select="'top'"/>
|
|
2385
2239
|
<xsl:with-param name="value">
|
|
2386
2240
|
<xsl:call-template name="pg-hrule-specification">
|
|
@@ -2389,9 +2243,7 @@
|
|
|
2389
2243
|
</xsl:with-param>
|
|
2390
2244
|
</xsl:call-template>
|
|
2391
2245
|
</xsl:if>
|
|
2392
|
-
<xsl:
|
|
2393
|
-
<xsl:call-template name="potential-list-indent" />
|
|
2394
|
-
</xsl:if>
|
|
2246
|
+
<xsl:call-template name="potential-list-indent" />
|
|
2395
2247
|
<xsl:text>);@]*</xsl:text>
|
|
2396
2248
|
</xsl:template>
|
|
2397
2249
|
|
|
@@ -2496,34 +2348,22 @@
|
|
|
2496
2348
|
<xsl:value-of select="concat(number(substring-before($percent-width,'%')) div 100 * 6.25, 'in')"/>
|
|
2497
2349
|
</xsl:template>
|
|
2498
2350
|
|
|
2499
|
-
|
|
2500
2351
|
<xsl:template match="tabular/row">
|
|
2501
|
-
<xsl:
|
|
2502
|
-
<xsl:
|
|
2503
|
-
<xsl:call-template name="potential-list-indent" />
|
|
2504
|
-
<xsl:text> </xsl:text>
|
|
2505
|
-
</xsl:if>
|
|
2352
|
+
<xsl:call-template name="potential-list-indent" />
|
|
2353
|
+
<xsl:text> </xsl:text>
|
|
2506
2354
|
<xsl:text>[</xsl:text>
|
|
2507
|
-
<xsl:
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
<xsl:
|
|
2511
|
-
<xsl:call-template name="potential-list-indent" />
|
|
2512
|
-
<xsl:text> </xsl:text>
|
|
2513
|
-
</xsl:if>
|
|
2355
|
+
<xsl:text>
</xsl:text>
|
|
2356
|
+
<xsl:apply-templates select="cell"/>
|
|
2357
|
+
<xsl:call-template name="potential-list-indent" />
|
|
2358
|
+
<xsl:text> </xsl:text>
|
|
2514
2359
|
<xsl:text>],</xsl:text>
|
|
2515
|
-
<xsl:
|
|
2516
|
-
<xsl:text>
</xsl:text>
|
|
2517
|
-
</xsl:if>
|
|
2360
|
+
<xsl:text>
</xsl:text>
|
|
2518
2361
|
</xsl:template>
|
|
2519
2362
|
|
|
2520
2363
|
|
|
2521
2364
|
<xsl:template match="cell">
|
|
2522
|
-
<xsl:
|
|
2523
|
-
<xsl:
|
|
2524
|
-
<xsl:call-template name="potential-list-indent" />
|
|
2525
|
-
<xsl:text> </xsl:text>
|
|
2526
|
-
</xsl:if>
|
|
2365
|
+
<xsl:call-template name="potential-list-indent" />
|
|
2366
|
+
<xsl:text> </xsl:text>
|
|
2527
2367
|
|
|
2528
2368
|
<!-- A goal is to minimize length of code, so we work hard here to ascertain -->
|
|
2529
2369
|
<!-- when a given cell specification like valign can be omitted, because the -->
|
|
@@ -2715,9 +2555,7 @@
|
|
|
2715
2555
|
<xsl:text>PGML(</xsl:text>
|
|
2716
2556
|
<xsl:apply-templates select="." mode="delimit"/>
|
|
2717
2557
|
<xsl:text>),</xsl:text>
|
|
2718
|
-
<xsl:
|
|
2719
|
-
<xsl:text>
</xsl:text>
|
|
2720
|
-
</xsl:if>
|
|
2558
|
+
<xsl:text>
</xsl:text>
|
|
2721
2559
|
</xsl:when>
|
|
2722
2560
|
<xsl:otherwise>
|
|
2723
2561
|
<xsl:text>[PGML(</xsl:text>
|
|
@@ -2726,7 +2564,6 @@
|
|
|
2726
2564
|
<!-- declare rowbottom if needed -->
|
|
2727
2565
|
<xsl:if test="$row-bottom != 'none' and not(preceding-sibling::cell)">
|
|
2728
2566
|
<xsl:call-template name="key-value">
|
|
2729
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
2730
2567
|
<xsl:with-param name="key" select="'rowbottom'"/>
|
|
2731
2568
|
<xsl:with-param name="value">
|
|
2732
2569
|
<xsl:call-template name="pg-hrule-specification">
|
|
@@ -2736,7 +2573,6 @@
|
|
|
2736
2573
|
</xsl:call-template>
|
|
2737
2574
|
<!-- this is redundant, but it here for backward compatibility -->
|
|
2738
2575
|
<xsl:call-template name="key-value">
|
|
2739
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
2740
2576
|
<xsl:with-param name="key" select="'midrule'"/>
|
|
2741
2577
|
<xsl:with-param name="value" select="1"/>
|
|
2742
2578
|
</xsl:call-template>
|
|
@@ -2744,7 +2580,6 @@
|
|
|
2744
2580
|
<!-- declare bottom if needed -->
|
|
2745
2581
|
<xsl:if test="$cell-bottom != $row-bottom">
|
|
2746
2582
|
<xsl:call-template name="key-value">
|
|
2747
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
2748
2583
|
<xsl:with-param name="key" select="'bottom'"/>
|
|
2749
2584
|
<xsl:with-param name="value">
|
|
2750
2585
|
<xsl:call-template name="pg-hrule-specification">
|
|
@@ -2756,7 +2591,6 @@
|
|
|
2756
2591
|
<!-- declare valign if needed -->
|
|
2757
2592
|
<xsl:if test="$row-valign != $tabular-valign and not(preceding-sibling::cell)">
|
|
2758
2593
|
<xsl:call-template name="key-value">
|
|
2759
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
2760
2594
|
<xsl:with-param name="key" select="'valign'"/>
|
|
2761
2595
|
<xsl:with-param name="value" select="$row-valign"/>
|
|
2762
2596
|
</xsl:call-template>
|
|
@@ -2764,7 +2598,6 @@
|
|
|
2764
2598
|
<!-- declare halign if needed -->
|
|
2765
2599
|
<xsl:if test="$cell-halign != $col-halign and not(ancestor::tabular[1]/col[$left-col]/@width) or ($row-left != $tabular-left and not(preceding-sibling::cell)) or ($cell-right != $col-right)">
|
|
2766
2600
|
<xsl:call-template name="key-value">
|
|
2767
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
2768
2601
|
<xsl:with-param name="key" select="'halign'"/>
|
|
2769
2602
|
<xsl:with-param name="value">
|
|
2770
2603
|
<xsl:if test="$row-left != $tabular-left and not(preceding-sibling::cell)">
|
|
@@ -2786,16 +2619,13 @@
|
|
|
2786
2619
|
<!-- declare colspan if present-->
|
|
2787
2620
|
<xsl:if test="@colspan">
|
|
2788
2621
|
<xsl:call-template name="key-value">
|
|
2789
|
-
<xsl:with-param name="b-human-readable" select="$b-human-readable"/>
|
|
2790
2622
|
<xsl:with-param name="key" select="'colspan'"/>
|
|
2791
2623
|
<xsl:with-param name="value" select="@colspan"/>
|
|
2792
2624
|
</xsl:call-template>
|
|
2793
2625
|
</xsl:if>
|
|
2794
2626
|
<!-- close cell's array reference bracket -->
|
|
2795
2627
|
<xsl:text>],</xsl:text>
|
|
2796
|
-
<xsl:
|
|
2797
|
-
<xsl:text>
</xsl:text>
|
|
2798
|
-
</xsl:if>
|
|
2628
|
+
<xsl:text>
</xsl:text>
|
|
2799
2629
|
</xsl:otherwise>
|
|
2800
2630
|
</xsl:choose>
|
|
2801
2631
|
</xsl:template>
|
|
@@ -2815,7 +2645,7 @@
|
|
|
2815
2645
|
<xsl:text>!{\vrule width 0.11em}</xsl:text>
|
|
2816
2646
|
</xsl:when>
|
|
2817
2647
|
<xsl:otherwise>
|
|
2818
|
-
<xsl:message>PTX:
|
|
2648
|
+
<xsl:message>PTX:FALLBACK: left or right attribute not recognized: use none, minor, medium, major</xsl:message>
|
|
2819
2649
|
</xsl:otherwise>
|
|
2820
2650
|
</xsl:choose>
|
|
2821
2651
|
</xsl:template>
|
|
@@ -2838,30 +2668,20 @@
|
|
|
2838
2668
|
<xsl:text>3</xsl:text>
|
|
2839
2669
|
</xsl:when>
|
|
2840
2670
|
<xsl:otherwise>
|
|
2841
|
-
<xsl:message>PTX:
|
|
2671
|
+
<xsl:message>PTX:FALLBACK: top or bottom attribute not recognized: use none, minor, medium, major</xsl:message>
|
|
2842
2672
|
</xsl:otherwise>
|
|
2843
2673
|
</xsl:choose>
|
|
2844
2674
|
</xsl:template>
|
|
2845
2675
|
|
|
2846
2676
|
|
|
2847
2677
|
<xsl:template name="key-value">
|
|
2848
|
-
<xsl:param name="b-human-readable"/>
|
|
2849
2678
|
<xsl:param name="key"/>
|
|
2850
2679
|
<xsl:param name="value"/>
|
|
2851
|
-
<xsl:
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
<xsl:text> </xsl:text>
|
|
2855
|
-
</xsl:if>
|
|
2680
|
+
<xsl:text>
</xsl:text>
|
|
2681
|
+
<xsl:call-template name="potential-list-indent" />
|
|
2682
|
+
<xsl:text> </xsl:text>
|
|
2856
2683
|
<xsl:value-of select="$key"/>
|
|
2857
|
-
<xsl:
|
|
2858
|
-
<xsl:when test="$b-human-readable">
|
|
2859
|
-
<xsl:text> => </xsl:text>
|
|
2860
|
-
</xsl:when>
|
|
2861
|
-
<xsl:otherwise>
|
|
2862
|
-
<xsl:text>=></xsl:text>
|
|
2863
|
-
</xsl:otherwise>
|
|
2864
|
-
</xsl:choose>
|
|
2684
|
+
<xsl:text> => </xsl:text>
|
|
2865
2685
|
<xsl:text>'</xsl:text>
|
|
2866
2686
|
<xsl:value-of select="$value"/>
|
|
2867
2687
|
<xsl:text>',</xsl:text>
|
|
@@ -2875,15 +2695,12 @@
|
|
|
2875
2695
|
<!-- Very good for readability, very bad for base64 length -->
|
|
2876
2696
|
<xsl:template name="begin-block">
|
|
2877
2697
|
<xsl:param name="block-title"/>
|
|
2878
|
-
<xsl:
|
|
2879
|
-
<xsl:
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
<xsl:text>
</xsl:text>
|
|
2885
|
-
<xsl:text>############################################################
</xsl:text>
|
|
2886
|
-
</xsl:if>
|
|
2698
|
+
<xsl:text>
</xsl:text>
|
|
2699
|
+
<xsl:text>############################################################
</xsl:text>
|
|
2700
|
+
<xsl:text># </xsl:text>
|
|
2701
|
+
<xsl:value-of select="$block-title"/>
|
|
2702
|
+
<xsl:text>
</xsl:text>
|
|
2703
|
+
<xsl:text>############################################################
</xsl:text>
|
|
2887
2704
|
</xsl:template>
|
|
2888
2705
|
|
|
2889
2706
|
<!-- Base indentation for lines of code in the middle of a list -->
|