* adjusting tikz pictures @ 2019-04-24 10:51 Gour 2019-04-24 16:49 ` Aditya Mahajan 2019-04-25 13:29 ` Mojca Miklavec 0 siblings, 2 replies; 10+ messages in thread From: Gour @ 2019-04-24 10:51 UTC (permalink / raw) To: ntg-context 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. ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: adjusting tikz pictures 2019-04-24 10:51 adjusting tikz pictures Gour @ 2019-04-24 16:49 ` Aditya Mahajan 2019-04-25 9:18 ` Gour 2019-04-25 13:29 ` Mojca Miklavec 1 sibling, 1 reply; 10+ messages in thread From: Aditya Mahajan @ 2019-04-24 16:49 UTC (permalink / raw) To: mailing list for ConTeXt users 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 > ___________________________________________________________________________________ ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: adjusting tikz pictures 2019-04-24 16:49 ` Aditya Mahajan @ 2019-04-25 9:18 ` Gour 0 siblings, 0 replies; 10+ messages in thread From: Gour @ 2019-04-25 9:18 UTC (permalink / raw) To: ntg-context On Wed, 24 Apr 2019 12:49:08 -0400 (EDT) Aditya Mahajan <adityam@umich.edu> wrote: > 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. ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: adjusting tikz pictures 2019-04-24 10:51 adjusting tikz pictures Gour 2019-04-24 16:49 ` Aditya Mahajan @ 2019-04-25 13:29 ` Mojca Miklavec 2019-04-25 14:23 ` Hans Hagen 2019-04-25 21:44 ` Henri Menke 1 sibling, 2 replies; 10+ messages in thread From: Mojca Miklavec @ 2019-04-25 13:29 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: adjusting tikz pictures 2019-04-25 13:29 ` Mojca Miklavec @ 2019-04-25 14:23 ` Hans Hagen 2019-04-25 14:31 ` Mojca Miklavec 2019-04-25 21:44 ` Henri Menke 1 sibling, 1 reply; 10+ messages in thread From: Hans Hagen @ 2019-04-25 14:23 UTC (permalink / raw) To: Mojca Miklavec, mailing list for ConTeXt users 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 ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: adjusting tikz pictures 2019-04-25 14:23 ` Hans Hagen @ 2019-04-25 14:31 ` Mojca Miklavec 2019-04-25 14:46 ` Hans Hagen 0 siblings, 1 reply; 10+ messages in thread From: Mojca Miklavec @ 2019-04-25 14:31 UTC (permalink / raw) To: Hans Hagen; +Cc: mailing list for ConTeXt users 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.) 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: adjusting tikz pictures 2019-04-25 14:31 ` Mojca Miklavec @ 2019-04-25 14:46 ` Hans Hagen 0 siblings, 0 replies; 10+ messages in thread From: Hans Hagen @ 2019-04-25 14:46 UTC (permalink / raw) To: Mojca Miklavec; +Cc: mailing list for ConTeXt users 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 ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: adjusting tikz pictures 2019-04-25 13:29 ` Mojca Miklavec 2019-04-25 14:23 ` Hans Hagen @ 2019-04-25 21:44 ` Henri Menke 2019-04-26 7:29 ` GeoGebrra support (was Re: adjusting tikz pictures) Gour 1 sibling, 1 reply; 10+ messages in thread From: Henri Menke @ 2019-04-25 21:44 UTC (permalink / raw) To: ntg-context 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/15e0fccd656e4b8628daa29ebdba975828de27f8/common/src/main/java/org/geogebra/common/export/pstricks/GeoGebraToPgf.java#L77 > > 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 > ___________________________________________________________________________________ > ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* GeoGebrra support (was Re: adjusting tikz pictures) 2019-04-25 21:44 ` Henri Menke @ 2019-04-26 7:29 ` Gour 2019-04-26 9:11 ` Arthur Reutenauer 0 siblings, 1 reply; 10+ messages in thread From: Gour @ 2019-04-26 7:29 UTC (permalink / raw) To: ntg-context [-- Attachment #1: Type: text/plain, Size: 786 bytes --] On Fri, 26 Apr 2019 09:44:03 +1200 Henri Menke <henrimenke@gmail.com> wrote: > 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. [-- Attachment #2: Capture.PNG --] [-- Type: image/png, Size: 55046 bytes --] [-- Attachment #3: Type: text/plain, Size: 493 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: GeoGebrra support (was Re: adjusting tikz pictures) 2019-04-26 7:29 ` GeoGebrra support (was Re: adjusting tikz pictures) Gour @ 2019-04-26 9:11 ` Arthur Reutenauer 0 siblings, 0 replies; 10+ messages in thread From: Arthur Reutenauer @ 2019-04-26 9:11 UTC (permalink / raw) To: Mailing list for ConTeXt users 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 ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2019-04-26 9:11 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-04-24 10:51 adjusting tikz pictures Gour 2019-04-24 16:49 ` Aditya Mahajan 2019-04-25 9:18 ` Gour 2019-04-25 13:29 ` Mojca Miklavec 2019-04-25 14:23 ` Hans Hagen 2019-04-25 14:31 ` Mojca Miklavec 2019-04-25 14:46 ` Hans Hagen 2019-04-25 21:44 ` Henri Menke 2019-04-26 7:29 ` GeoGebrra support (was Re: adjusting tikz pictures) Gour 2019-04-26 9:11 ` Arthur Reutenauer
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).