Embedded geogebra sizing problem

41 views
Skip to first unread message

Anna Davis

unread,
Jul 17, 2024, 8:19:54 PM7/17/24
to PreTeXt support
I am trying to embed the following GeoGebra into my preTeXt document:


I am using the following code to embed:


<
p> <interactive geogebra="p44hf4cs" width="150%" aspect="9:5"/> </p>

The following is the web output that I get:


As you can see, the right-hand screen with sliders does not get included.  I tried different percentages for the width.  The figure shrinks and grows, but the right screen never shows up.

Thank you!

Anna

D. Brian Walton

unread,
Jul 17, 2024, 9:38:57 PM7/17/24
to pretext...@googlegroups.com
This seems to be a new issue that hasn't been raised before. The referenced page actually has two interacting panels. The iframe that PreTeXt embeds only addresses the panel on the left. Directly following the link that is found in the page source of the PreTeXt document is specific to that panel. I don't see a way for the reference to account for the second panel on the original resource.

Brian

--
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/6cfcd4e3-d709-4c02-badb-c81d7594e2ccn%40googlegroups.com.

Rob Beezer

unread,
Jul 18, 2024, 10:59:30 AM7/18/24
to pretext...@googlegroups.com
I suggested Anna take the embed code from the Geogebra-hosted version and paste
that into the PreTeXt version on top of whatever we are doing - to see if that
behaves better. Maybe we need to catch up with some GeoGebra changes.

Rob

On 7/17/24 18:38, D. Brian Walton wrote:
> This seems to be a new issue that hasn't been raised before. The referenced page
> actually has two interacting panels. The iframe that PreTeXt embeds only
> addresses the panel on the left. Directly following the link that is found in
> the page source of the PreTeXt document is specific to that panel. I don't see a
> way for the reference to account for the second panel on the original resource.
>
> Brian
>
> On Wed, Jul 17, 2024 at 8:19 PM Anna Davis <mrsclar...@gmail.com
> <mailto:mrsclar...@gmail.com>> wrote:
>
> I am trying to embed the following GeoGebra into my preTeXt document:
>
> https://www.geogebra.org/m/p44hf4cs <https://www.geogebra.org/m/p44hf4cs>
>
> I am using the following code to embed:
>
>
> <p><interactivegeogebra="p44hf4cs"width="150%"aspect="9:5"/></p>
>
> The following is the web output that I get:
>
> https://annadavismath.github.io/LinesOfSightPreTeXt/sec-section-name.html
> <https://annadavismath.github.io/LinesOfSightPreTeXt/sec-section-name.html>
>
> As you can see, the right-hand screen with sliders does not get included.  I
> tried different percentages for the width.  The figure shrinks and grows,
> but the right screen never shows up.
>
> Thank you!
>
> Anna
>
> --
> 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/6cfcd4e3-d709-4c02-badb-c81d7594e2ccn%40googlegroups.com <https://groups.google.com/d/msgid/pretext-support/6cfcd4e3-d709-4c02-badb-c81d7594e2ccn%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> 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/CAH7VRoLc%3Ddobv%2BO1fLKpCB3OAfLf5M3ie%3D%2BoNLto%3DQDFMveu7g%40mail.gmail.com <https://groups.google.com/d/msgid/pretext-support/CAH7VRoLc%3Ddobv%2BO1fLKpCB3OAfLf5M3ie%3D%2BoNLto%3DQDFMveu7g%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Mark Fitch

unread,
Jul 18, 2024, 11:49:36 AM7/18/24
to pretext...@googlegroups.com
Quick solution is to put those sliders in the same Geogebra window. I
have many like this. There is a downside: placement is a bit tricky, but
it does work.

D. Brian Walton

unread,
Jul 18, 2024, 12:59:36 PM7/18/24
to pretext...@googlegroups.com
Anna,

After doing some digging, I may have a direction for a solution. It will require some revisions to the underlying PreTeXt code, but here is a strategy.

I believe you are currently including the material using <interactive geogebra="p44hf4cs"/>.

There is an alternative approach that requires adding a #slate using the following approach:
<interactive platform="geogebra" aspect="1368:736">
<slate xml:id="ggb-slate" surface="geogebra" material="p44hf4cs" aspect="1368:736"/>
</interactive>
This creates an iframe (hidden HTML file that actually has the content which is cast into your page). The dimensions of this iframe are based on the viewing width of your actual page. Currently, this does not show both parts either. The Geogebra content is somehow based on absolute dimensions of the original material, and so scaled perspectives don't work. We need to modify the PreTeXt to allow the slate itself to have arbitrary internal width/height to match the absolute size of the original content, separate from the display width/height that we are going to work with in the PreTeXt book.

After the changes, the implementation would require something like:
<interactive platform="geogebra" aspect="1368:736">
<slate xml:id="ggb-slate" surface="geogebra" material="p44hf4cs" slate-width="1368" slate-height="736"/>
</interactive>

I will be opening a separate thread on pretext-dev to talk about implementation details.

Brian

D. Brian Walton

unread,
Jul 19, 2024, 12:46:19 AM7/19/24
to pretext...@googlegroups.com
Anna,

Using the most up-to-date version of PreTeXt that incorporates the changes that I mentioned earlier, there was a slight change to my proposed change. I believe that you should use the following new syntax to get that particular Geogebra material to work.

<interactive platform="geogebra" aspect="1368:736">
<slate xml:id="ggb-slate" surface="geogebra" material="p44hf4cs" material-width="1368" material-height="736"/>
</interactive>

Change the slate's xml:id to be something more specific to your example.

- Brian

Anna Davis

unread,
Jul 19, 2024, 9:04:14 AM7/19/24
to PreTeXt support
Brian,

I tried your solution.  Now I have both windows displaying, but the second one is empty.  I tried changing the size of the slate, but my input of width and height do not affect the output.


Thank you!
Anna

D. Brian Walton

unread,
Jul 19, 2024, 10:17:57 AM7/19/24
to pretext...@googlegroups.com
Anna,

I think that the PreTeXt you are running with does not yet have the update as it was only integrated last night. Or possibly you used my preliminary guess with labels "slate-width" and "slate-height". That needs to change to "material-width" and "material-height". I think I read you were at the small documents workshop. Maybe someone there can help you get that updated.

You can see what it *should* look like if you go into the following file that PreTeXt generates: output/web/sec-section-name-4-1-if.html and you will see 8 lines from the bottom:

width:600,
height:600,

The updated PreTeXt should use the values assigned by material-width="1368" and material-width="736" to create the file with the following values:

width:1368,
height:736,

To get a sneak peak at what it will look like when done correctly with an updated PreTeXt, change the numbers by hand. (It will be overwritten the next time you try to use pretext build.)

Hope this helps,
Brian

Mark Fitch

unread,
Jul 19, 2024, 12:07:31 PM7/19/24
to pretext...@googlegroups.com

Additionally, the coordinates Geogebra is told to display in each window matter. I have needed to carefully set the coordinates passed to Geogebra to ensure sliders show up. In the example below note the setCoordSystem command. Mine do not use two Geogebra windows though.

    <figure xml:id="interactive-rolles-discover">
        <caption>Illustration of Rolle's Theorem</caption>
        <interactive platform="geogebra" width="100%" aspect="4:3" preview="images/RollesExperiment.png" label="interactive-rolles-discover">
            <slate xml:id="geogebra-rolles-discover" surface="geogebra" material="ybkahymm" aspect="4:3">
                    setCoordSystem(-1, 6, 0, 8);
                    enableShiftDragZoom(true);
            </slate>
            <instructions>
                <p>Move point A from point C to point D. Note the direction the tangent vector points.</p>
            </instructions>
        </interactive>
    </figure>

Reply all
Reply to author
Forward
0 new messages