![](https://secure.gravatar.com/avatar/ddde52a9403be027f2eca49514f3148c.jpg?s=120&d=mm&r=g)
Hello, I believe that using GeoGebra for drawing, exporting to TikZ is the most approachable method for me to be able to create mathematic-related material like exams for the children in the primary school, but need some info how to adjust GeoGebra's TikZ output (suitable for LaTeX) for ConTeXt? The link on the wiki's page (https://wiki.contextgarden.net/TikZ) fior the manual is dead.. Here is the simple example: \documentclass[10pt]{article} \usepackage{pgf,tikz,pgfplots} \pgfplotsset{compat=1.15} \usepackage{mathrsfs} \usetikzlibrary{arrows} \pagestyle{empty} \begin{document} \definecolor{zzttqq}{rgb}{0.6,0.2,0} \definecolor{ududff}{rgb}{0.30196078431372547,0.30196078431372547,1} \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm] \begin{axis}[ x=1cm,y=1cm, axis lines=middle, ymajorgrids=true, xmajorgrids=true, xmin=-12.679999999999998, xmax=12.679999999999998, ymin=-13.470000000000002, ymax=8.91, xtick={-12,-11,...,12}, ytick={-13,-12,...,8},] \clip(-12.68,-13.47) rectangle (12.68,8.91); \fill[line width=2pt,color=zzttqq,fill=zzttqq,fill opacity=0.10000000149011612] (-7.7,2.75) -- (0.88,2.57) -- (-3.04,-3.37) -- cycle; \draw [line width=2pt,color=zzttqq] (-7.7,2.75)-- (0.88,2.57); \draw [line width=2pt,color=zzttqq] (0.88,2.57)-- (-3.04,-3.37); \draw [line width=2pt,color=zzttqq] (-3.04,-3.37)-- (-7.7,2.75); \draw [line width=2pt,domain=-12.68:12.68] plot(\x,{(--25.3932-4.84*\x)/0.04}); \draw [line width=2pt,domain=-12.68:12.68] plot(\x,{(-13.78-3.92*\x)/5.94}); \draw [line width=2pt,domain=-12.68:12.68] plot(\x,{(--29.7366--8.58*\x)/0.18}); \begin{scriptsize} \draw [fill=ududff] (-7.7,2.75) circle (2.5pt); \draw[color=ududff] (-7.54,3.18) node {$A$}; \draw [fill=ududff] (0.88,2.57) circle (2.5pt); \draw[color=ududff] (1.04,3) node {$B$}; \draw [fill=ududff] (-3.04,-3.37) circle (2.5pt); \draw[color=ududff] (-2.88,-2.94) node {$C$}; \draw[color=zzttqq] (-3.34,2.58) node {$c$}; \draw[color=zzttqq] (-1.28,0.02) node {$a$}; \draw[color=zzttqq] (-5.04,0.12) node {$b$}; \draw [fill=ududff] (5.2,5.63) circle (2.5pt); \draw[color=ududff] (5.36,6.06) node {$D$}; \draw [fill=ududff] (5.24,0.79) circle (2.5pt); \draw[color=ududff] (5.4,1.22) node {$E$}; \draw[color=black] (4.92,8.82) node {$f$}; \draw [fill=ududff] (-2,-1) circle (2.5pt); \draw[color=ududff] (-1.84,-0.56) node {$F$}; \draw[color=black] (-12.5,5.84) node {$g$}; \draw[color=black] (-3.04,8.82) node {$h$}; \end{scriptsize} \end{axis} \end{tikzpicture} \end{document} How would such example be adjusted to be used with ConTeXt? Sincerely, Gour -- As the embodied soul continuously passes, in this body, from boyhood to youth to old age, the soul similarly passes into another body at death. A sober person is not bewildered by such a change.
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Wed, 24 Apr 2019, Gour wrote:
Hello,
I believe that using GeoGebra for drawing, exporting to TikZ is the most approachable method for me to be able to create mathematic-related material like exams for the children in the primary school, but need some info how to adjust GeoGebra's TikZ output (suitable for LaTeX) for ConTeXt?
You need to change \begin{tikzpicture} ... \end{tikpicture} to \starttikzpicture ... \stoptikzpicture and any other \begin{...} ... \end{...} pairs that occur in tikz (like \begin{axis}, \begin{scope}, etc) to \start... \stop... pairs. There are a few other quirks which have simple workarounds. I am not sure if they are documented anywhere. If you are more comfortable using a visual tool like GeoGebra than writing the tikz/metapost code by hand, then I'd say that simply process the generate latex code through latex to generate standalone pdfs and include them in your context document using \externalfigure[...]. There are benefits of using the tikz/metapost code in the tex document. The main advantage is that your images and main text use the same fonts, but that can be handled by using the same fonts in latex when generating the image. The other advantages such as consistent look and feel across multiple images go away when you copy-paste auto-generated code. So, simply including the generated figures using \externalfigure[...] will allow you to get productive right away. If and when you start noticing the limitations of this approach, then you can learn metapost/tikz :-) If you follow this route, then I would add \usepackage[pdftex,active,tightpage]{preview} \setlength\PreviewBorder{2mm} \PreviewEnvironment{tikzpicture} in the latex preamble. This will create standalone pages that are the same size the tikzpicture, so that you don't have to crop manually.
Here is the simple example:
\documentclass[10pt]{article} \usepackage{pgf,tikz,pgfplots} \pgfplotsset{compat=1.15} \usepackage{mathrsfs} \usetikzlibrary{arrows} \pagestyle{empty} \begin{document} \definecolor{zzttqq}{rgb}{0.6,0.2,0} \definecolor{ududff}{rgb}{0.30196078431372547,0.30196078431372547,1} \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm] \begin{axis}[ x=1cm,y=1cm, axis lines=middle, ymajorgrids=true, xmajorgrids=true, xmin=-12.679999999999998, xmax=12.679999999999998, ymin=-13.470000000000002, ymax=8.91, xtick={-12,-11,...,12}, ytick={-13,-12,...,8},] \clip(-12.68,-13.47) rectangle (12.68,8.91); \fill[line width=2pt,color=zzttqq,fill=zzttqq,fill opacity=0.10000000149011612] (-7.7,2.75) -- (0.88,2.57) -- (-3.04,-3.37) -- cycle; \draw [line width=2pt,color=zzttqq] (-7.7,2.75)-- (0.88,2.57); \draw [line width=2pt,color=zzttqq] (0.88,2.57)-- (-3.04,-3.37); \draw [line width=2pt,color=zzttqq] (-3.04,-3.37)-- (-7.7,2.75); \draw [line width=2pt,domain=-12.68:12.68] plot(\x,{(--25.3932-4.84*\x)/0.04}); \draw [line width=2pt,domain=-12.68:12.68] plot(\x,{(-13.78-3.92*\x)/5.94}); \draw [line width=2pt,domain=-12.68:12.68] plot(\x,{(--29.7366--8.58*\x)/0.18}); \begin{scriptsize} \draw [fill=ududff] (-7.7,2.75) circle (2.5pt); \draw[color=ududff] (-7.54,3.18) node {$A$}; \draw [fill=ududff] (0.88,2.57) circle (2.5pt); \draw[color=ududff] (1.04,3) node {$B$}; \draw [fill=ududff] (-3.04,-3.37) circle (2.5pt); \draw[color=ududff] (-2.88,-2.94) node {$C$}; \draw[color=zzttqq] (-3.34,2.58) node {$c$}; \draw[color=zzttqq] (-1.28,0.02) node {$a$}; \draw[color=zzttqq] (-5.04,0.12) node {$b$}; \draw [fill=ududff] (5.2,5.63) circle (2.5pt); \draw[color=ududff] (5.36,6.06) node {$D$}; \draw [fill=ududff] (5.24,0.79) circle (2.5pt); \draw[color=ududff] (5.4,1.22) node {$E$}; \draw[color=black] (4.92,8.82) node {$f$}; \draw [fill=ududff] (-2,-1) circle (2.5pt); \draw[color=ududff] (-1.84,-0.56) node {$F$}; \draw[color=black] (-12.5,5.84) node {$g$}; \draw[color=black] (-3.04,8.82) node {$h$}; \end{scriptsize} \end{axis} \end{tikzpicture} \end{document}
How would such example be adjusted to be used with ConTeXt?
Sincerely, Gour
-- As the embodied soul continuously passes, in this body, from boyhood to youth to old age, the soul similarly passes into another body at death. A sober person is not bewildered by such a change.
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
![](https://secure.gravatar.com/avatar/ddde52a9403be027f2eca49514f3148c.jpg?s=120&d=mm&r=g)
On Wed, 24 Apr 2019 12:49:08 -0400 (EDT)
Aditya Mahajan
You need to change \begin{tikzpicture} ... \end{tikpicture} to \starttikzpicture ... \stoptikzpicture and any other \begin{...} ... \end{...} pairs that occur in tikz (like \begin{axis}, \begin{scope}, etc) to \start... \stop... pairs. There are a few other quirks which have simple workarounds. I am not sure if they are documented anywhere.
OK.
If you are more comfortable using a visual tool like GeoGebra than writing the tikz/metapost code by hand, then I'd say that simply process the generate latex code through latex to generate standalone pdfs and include them in your context document using \externalfigure[...].
:-)
So, simply including the generated figures using \externalfigure[...] will allow you to get productive right away. If and when you start noticing the limitations of this approach, then you can learn metapost/tikz :-)
Heh...I also got some offline replies and it looks that using metapost is a way to go. Sincerely, Gour -- Perform your prescribed duty, for doing so is better than not working. One cannot even maintain one's physical body without work.
![](https://secure.gravatar.com/avatar/6114858d84b0f40cf715f12237ab67a1.jpg?s=120&d=mm&r=g)
On Wed, 24 Apr 2019 at 12:51, Gour wrote:
Hello,
I believe that using GeoGebra for drawing, exporting to TikZ is the most approachable method for me to be able to create mathematic-related material like exams for the children in the primary school, but need some info how to adjust GeoGebra's TikZ output (suitable for LaTeX) for ConTeXt?
Ideally someone should fix Geogebra to allow outputting ConTeXt-friendly TikZ images. The differences should be small enough that this should be doable. Mojca
![](https://secure.gravatar.com/avatar/46562c7d27388490d62e8d7a5bc960dd.jpg?s=120&d=mm&r=g)
On 4/25/2019 3:29 PM, Mojca Miklavec wrote:
On Wed, 24 Apr 2019 at 12:51, Gour wrote:
Hello,
I believe that using GeoGebra for drawing, exporting to TikZ is the most approachable method for me to be able to create mathematic-related material like exams for the children in the primary school, but need some info how to adjust GeoGebra's TikZ output (suitable for LaTeX) for ConTeXt?
Ideally someone should fix Geogebra to allow outputting ConTeXt-friendly TikZ images.
or just efficient metapost
The differences should be small enough that this should be doable. Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/46562c7d27388490d62e8d7a5bc960dd.jpg?s=120&d=mm&r=g)
On 4/25/2019 4:31 PM, Mojca Miklavec wrote:
On Thu, 25 Apr 2019 at 16:23, Hans Hagen wrote:
Ideally someone should fix Geogebra to allow outputting ConTeXt-friendly TikZ images.
or just efficient metapost
Oh, sure! (That might require a bit more work, but probably worth doing if someone wants to go that way.) i see that there is also svg export which is quiet ok (i seem to have lost my experimental svg interpreter)
Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/60f3cc97f94fa3690ba406f8c1a7fc4f.jpg?s=120&d=mm&r=g)
On 26/04/19 1:29 AM, Mojca Miklavec wrote:
On Wed, 24 Apr 2019 at 12:51, Gour wrote:
Hello,
I believe that using GeoGebra for drawing, exporting to TikZ is the most approachable method for me to be able to create mathematic-related material like exams for the children in the primary school, but need some info how to adjust GeoGebra's TikZ output (suitable for LaTeX) for ConTeXt?
Ideally someone should fix Geogebra to allow outputting ConTeXt-friendly TikZ images.
Apparently you can already do that. In the source there is a switch to use ConTeXt. https://github.com/geogebra/geogebra/blob/15e0fccd656e4b8628daa29ebdba975828...
The differences should be small enough that this should be doable.
Mojca ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
![](https://secure.gravatar.com/avatar/ddde52a9403be027f2eca49514f3148c.jpg?s=120&d=mm&r=g)
On Fri, 26 Apr 2019 09:44:03 +1200
Henri Menke
Apparently you can already do that.
You're right! I've contacted their technical support and received the following reply: "You can access that in GeoGebra Classic 5, see attached screenshot. Sorry, but I have no idea how much is supported in the ConTeXt export as we haven't touched that code for several years." I'm including screenshot... That feature is available in Classic4 which I now installed on my machine and, according to the message, it's also in Classic5, but is not there ƣn the latest Classic5. :-( Sincerely, Gour -- Whatever action a great man performs, common men follow. And whatever standards he sets by exemplary acts, all the world pursues.
![](https://secure.gravatar.com/avatar/a0f6b595b0e3b7f3abba19eeb8261fc2.jpg?s=120&d=mm&r=g)
On Fri, Apr 26, 2019 at 09:29:38AM +0200, Gour wrote:
That feature is available in Classic4 which I now installed on my machine and, according to the message, it's also in Classic5, but is not there ƣn the latest Classic5. :-(
Then Mojca’s message still apply: someone should fix GeoGebra to update ConTeXt-friendly TikZ images :-) Since it already exists in earlier versions it shouldn’t be too much work. Best, Arthur
participants (6)
-
Aditya Mahajan
-
Arthur Reutenauer
-
Gour
-
Hans Hagen
-
Henri Menke
-
Mojca Miklavec