From 23abc2d6d20bfdff9037343ab0604f0ea24d5093 Mon Sep 17 00:00:00 2001 From: dbrianwalton Date: Tue, 30 Jul 2024 10:04:39 -0400 Subject: [PATCH 1/4] Geogebra: Use assembly-processor to convert interactive with geogebra material-id to use the slate/applet approach in order to fix sizing issues --- xsl/pretext-assembly.xsl | 102 ++++++++++++++++++++++++++++++++++++++- xsl/pretext-html.xsl | 78 ++++++++++++++++++++++++++---- 2 files changed, 170 insertions(+), 10 deletions(-) diff --git a/xsl/pretext-assembly.xsl b/xsl/pretext-assembly.xsl index 1dbf1deed8..4e89ef7647 100644 --- a/xsl/pretext-assembly.xsl +++ b/xsl/pretext-assembly.xsl @@ -176,6 +176,12 @@ along with PreTeXt. If not, see . + + + + + + @@ -329,8 +335,13 @@ along with PreTeXt. If not, see . + + + + + - + @@ -1697,6 +1708,95 @@ along with PreTeXt. If not, see . + + + + + + + + + + + + + + + + 800 + + + + + + + + + + + + + + + + + + + + + + + + geogebra + + + + + + + + + + + + -ggb-slate + + + geogebra + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsl/pretext-html.xsl b/xsl/pretext-html.xsl index 538e12c02b..de5ce73f6e 100644 --- a/xsl/pretext-html.xsl +++ b/xsl/pretext-html.xsl @@ -9976,18 +9976,78 @@ along with MathBook XML. If not, see . ", - - - - - - perspective:" - - ", - + + + + + + perspective:" + + ", + + + showToolBar: + + + true + + + false + + + , + + + showAlgebraInput: + + + true + + + false + + + , + + + showResetIcon: + + + true + + + false + + + , + + + enableShiftDragZoom: + + + true + + + false + + + , + + + showZoomButtons: + + + true + + + false + + + , + width: , height: From 5be2b0de97f3c571dd37e8679082b0212de7ec3b Mon Sep 17 00:00:00 2001 From: dbrianwalton Date: Tue, 30 Jul 2024 10:06:15 -0400 Subject: [PATCH 2/4] Geogebra: Remove the original template for interactive with geogebra material-id --- xsl/pretext-html.xsl | 81 -------------------------------------------- 1 file changed, 81 deletions(-) diff --git a/xsl/pretext-html.xsl b/xsl/pretext-html.xsl index de5ce73f6e..00a84900b4 100644 --- a/xsl/pretext-html.xsl +++ b/xsl/pretext-html.xsl @@ -9479,87 +9479,6 @@ along with MathBook XML. If not, see . - - - - - - - - true - - - false - - - - - - - true - - - false - - - - - - - true - - - false - - - - - - - true - - - false - - - - - - - - - - 800 - - - - - - - - - - - - - - - - - - - - - - - - - - - From 952cd39fa0f46103261f81e0dfafc40bdc19e413 Mon Sep 17 00:00:00 2001 From: dbrianwalton Date: Tue, 30 Jul 2024 12:11:51 -0400 Subject: [PATCH 3/4] Geogebra: update sample-article explanation for geogebra material references --- examples/sample-article/sample-article.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/examples/sample-article/sample-article.xml b/examples/sample-article/sample-article.xml index f22dd7e1d1..90086db31e 100644 --- a/examples/sample-article/sample-article.xml +++ b/examples/sample-article/sample-article.xml @@ -8203,6 +8203,16 @@ along with MathBook XML. If not, see .

Then mimic the examples that follow, using GeoGebra API commands documented at Geogebra API Manual, but do not include the ggbApplet. or applet. used in examples to prefix the functionsthat part of the code will be provided automatically by .

+

There are some optional control elements that Geogebra provides, such as the presence of the toolbar and the reset button. These can be controlled by adding the following additional attributes to the slate and are automatically included in the initialization for the Geogebra applet. +

    +
  • toolbar="yes": add the Geogebra toolbar above the material

  • +
  • algebra-input="yes": add an entry box below the material to add graphical objects using algebra formulas or Geogebra graphical commands

  • +
  • reset-icon="yes": enable the reset icon

  • +
  • shift-drag-zoom="yes": enable ability to drag and zoom the viewing context

  • +
  • zoom-buttons="yes": enable buttons that control zoom

  • +
+

+

Jack Green created an applet on the Classroom Resources site with ID D4s2v4ft, which you may view at . Suppose you would like to use this in your project, but change something about it. We will change something trivial, making the y-axis ticks be separated 5 apart instead of 10 apart. We also decide we want a different aspect ratio and overall width. One gotcha: the original applet is loaded and then uses width and aspect attributes to resize the viewing window using the top left corner as an anchor. This does not rescale axes and that may leave you with important elements missing from the viewing window. So here we reset the viewing window to return to values that are in the original. Lastly, we disable zooming, which is not helpful for this applet. To do each of these things, we rely on the GeoGebra API manual at Geogebra API Manual. It is important to use one command per line.

@@ -8577,7 +8587,7 @@ along with MathBook XML. If not, see .

Once you find a material that looks instructive, it will be at a URL such ashttps://www.geogebra.org/m/KGn2d4Qd and you want to pick off the identifier on the end, in this case KGn2d4Qd. Then author<interactive geogebra="KGn2d4Qd" /> At this writing (2018-02-04) you will want to place this inside a figure, with a caption, as we do right now with material KGn2d4Qd.

-

The shape of the material will be fixed, so guess (or measure with an on-screen ruler), the aspect ratio and use that in the interactive element. If the width of the original material is anything other than 800 pixels, you should add material-width with the actual material width (units are pixels).

+

The shape of the material will be fixed, so determine the dimensions (measure with an on-screen ruler or inspect the underlying definition). Use material-width and material-height with the actual material width and height (units are pixels). These are treated by Geogebra as internal coordinate dimensions and are separate from the physical layout dimensions that appear in your text. In the absence of these attributes, default values are 800 pixels for the width and a height based on the provied aspect ratio.

Right Triangle Paradox @@ -8590,6 +8600,7 @@ along with MathBook XML. If not, see .
  • algebra-input="yes": add an entry box below the material to add graphical objects using algebra formulas or Geogebra graphical commands

  • reset-icon="yes": enable the reset icon

  • shift-drag-zoom="yes": enable ability to drag and zoom the viewing context

  • +
  • zoom-buttons="yes": enable buttons that control zoom

  • From 240f6e49a91a6df26ea67724adbcc5a8185b3634 Mon Sep 17 00:00:00 2001 From: dbrianwalton Date: Thu, 1 Aug 2024 22:06:52 -0400 Subject: [PATCH 4/4] Move geogebra conversion step into enrichment stage --- xsl/pretext-assembly.xsl | 191 ++++++++++++++++++--------------------- 1 file changed, 90 insertions(+), 101 deletions(-) diff --git a/xsl/pretext-assembly.xsl b/xsl/pretext-assembly.xsl index 4e89ef7647..ba6c9dcace 100644 --- a/xsl/pretext-assembly.xsl +++ b/xsl/pretext-assembly.xsl @@ -176,12 +176,6 @@ along with PreTeXt. If not, see . - - - - - - @@ -335,13 +329,8 @@ along with PreTeXt. If not, see . - - - - - - + @@ -979,6 +968,95 @@ along with PreTeXt. If not, see . + + + + + + + + + + + + + + + + 800 + + + + + + + + + + + + + + + + + + + + + + + + geogebra + + + + + + + + + + + + -ggb-slate + + + geogebra + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1708,95 +1786,6 @@ along with PreTeXt. If not, see . - - - - - - - - - - - - - - - - 800 - - - - - - - - - - - - - - - - - - - - - - - - geogebra - - - - - - - - - - - - -ggb-slate - - - geogebra - - - - - - - - - - - - - - - - - - - - - - - - - - - -