Re: [NTG-context] adjusting tikz pictures

2019-04-25 Thread Henri Menke
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
___


Re: [NTG-context] adjusting tikz pictures

2019-04-25 Thread Hans Hagen

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
___


Re: [NTG-context] adjusting tikz pictures

2019-04-25 Thread Mojca Miklavec
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
___


Re: [NTG-context] adjusting tikz pictures

2019-04-25 Thread Hans Hagen

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
___


Re: [NTG-context] adjusting tikz pictures

2019-04-25 Thread Mojca Miklavec
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
___


Re: [NTG-context] adjusting tikz pictures

2019-04-25 Thread Gour
On Wed, 24 Apr 2019 12:49:08 -0400 (EDT)
Aditya Mahajan  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
___


Re: [NTG-context] adjusting tikz pictures

2019-04-24 Thread Aditya Mahajan

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.678,
xmax=12.678,
ymin=-13.472,
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.1000149011612] 
(-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  :