ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Textbackground with leftframe
@ 2008-09-23 15:40 holzminister
  2008-10-24 21:17 ` mkiv, luatex and tikz Alan BRASLAU
       [not found] ` <200810261045.19152.alan.braslau@cea.fr>
  0 siblings, 2 replies; 9+ messages in thread
From: holzminister @ 2008-09-23 15:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi!

1) I wanted to color some text inside a columnset-environment. That
works fine for text that stays in one column or spans two consecutive
ones. But if there's a pagebreak after the first page, only the left
column gets the background. From page two on everything is fine again.
Any ideas how this comes?

>>>
\setupcolors[state=start]
\definetextbackground[test][
        backgroundcolor=yellow,
        frame=off,
        leftoffset=5mm,
        location=paragraph,
        color=black]

\definecolumnset[example][n=2,distance=5mm]

\starttext
\startcolumnset[example]

\starttextbackground[test]
\dorecurse{12}{\input knuth \par}
\stoptextbackground

\stopcolumnset
\stoptext
>>>

2) And another question: Is there a way to get a leftframe activated
in my defined background?

Have a nice evening,
Eyke
___________________________________________________________________________________
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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* mkiv, luatex and tikz
  2008-09-23 15:40 Textbackground with leftframe holzminister
@ 2008-10-24 21:17 ` Alan BRASLAU
  2008-10-24 22:33   ` luigi scarso
                     ` (2 more replies)
       [not found] ` <200810261045.19152.alan.braslau@cea.fr>
  1 sibling, 3 replies; 9+ messages in thread
From: Alan BRASLAU @ 2008-10-24 21:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Tikz seems to be broken under luatex.
As is, compiling something as simple as
	\usemodule[tikz]
	\starttext
	Hello, world!
	\stoptext
gives errors.

>From the the [Pgf-users] mailing list:
	 
From: Till Tantau <tantau@tc...> - 2008-10-24 10:25
>    Hi!
>
>  arggh....
>
>  Discerning the driver is really a problem in ConTeXt, at least for a
>  non-context-guru like myself.
>
>  As a quick fix, you will have to define the driver yourself by saying
>
>  \def\pgfsysdriver{pgfgsys-pdftex.def}
>
>  or whatever seems appropriate before tikz/pgf are loaded. That should
>  shut up the (not-working) automatic driver detection.
>
>
>  Does some context-guru on the list happen to know what is the right,
>  official way to find out which backend is used?
>
>
>  Best regardsm
>  Till

This won't work with luatex (but it does compile without error messages)
and I cannot (easily) figure out what the correct driver should be...

Alan
___________________________________________________________________________________
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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mkiv, luatex and tikz
  2008-10-24 21:17 ` mkiv, luatex and tikz Alan BRASLAU
@ 2008-10-24 22:33   ` luigi scarso
  2008-10-25  7:18     ` luigi scarso
  2008-10-26 13:48   ` Mojca Miklavec
  2008-10-26 22:45   ` Mojca Miklavec
  2 siblings, 1 reply; 9+ messages in thread
From: luigi scarso @ 2008-10-24 22:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2913 bytes --]

On Fri, Oct 24, 2008 at 11:17 PM, Alan BRASLAU <alan.braslau@cea.fr> wrote:

> Tikz seems to be broken under luatex.
> As is, compiling something as simple as
>        \usemodule[tikz]
>        \starttext
>        Hello, world!
>        \stoptext
> gives errors.
>



>
> >From the the [Pgf-users] mailing list:
>
> From: Till Tantau <tantau@tc...> - 2008-10-24 10:25
> >    Hi!
> >
> >  arggh....
> >
> >  Discerning the driver is really a problem in ConTeXt, at least for a
> >  non-context-guru like myself.
> >
> >  As a quick fix, you will have to define the driver yourself by saying
> >
> >  \def\pgfsysdriver{pgfgsys-pdftex.def}
> >
> >  or whatever seems appropriate before tikz/pgf are loaded. That should
> >  shut up the (not-working) automatic driver detection.
> >
> >
> >  Does some context-guru on the list happen to know what is the right,
> >  official way to find out which backend is used?
> >
> >
> >  Best regardsm
> >  Till
>
> This won't work with luatex (but it does compile without error messages)
> and I cannot (easily) figure out what the correct driver should be...
>




I have downloaded pgf from
http://www.ctan.org/tex-archive/help/Catalogue/entries/pgf.html

and unzip base.zip
under
minimals-beta/tex/texmf-context/tex/context/pgf
then
$> context test-alan
It seems to work

minimals-beta
Linux luigicasa-laptop 2.6.24-21-generic #1 SMP Mon Aug 25 17:32:09 UTC 2008
i686 GNU/Linux
This is LuaTeX, Version snapshot-0.30.2-2008102016, build unknown
ConTeXt MtxRun | current version: 2008.10.23 17:32




%% test-alan.tex %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usemodule[tikz]
\setupcolors[state=start]
\starttext
Hello, world!
\blank
\begingroup
\tikz \draw[thick,rounded corners=8pt]
  (0,0) -- (0,2) -- (1,3.25) -- (2,2) -- (2,0) -- (0,2) -- (2,2) -- (0,0) --
(2,0);
\endgroup

\starttikzpicture
  \draw[fill=yellow] (0,0) -- (60:.75cm) arc (60:180:.75cm);
  \draw(120:0.4cm) node {$\alpha$};
  \draw[fill=green!30] (0,0) -- (right:.75cm) arc (0:60:.75cm);
  \draw(30:0.5cm) node {$\beta$};
  \startscope[shift={(60:2cm)}]
    \draw[fill=green!30] (0,0) -- (180:.75cm) arc (180:240:.75cm);
    \draw (30:-0.5cm) node {$\gamma$};
    \draw[fill=yellow] (0,0) -- (240:.75cm) arc (240:360:.75cm);
    \draw (-60:0.4cm) node {$\delta$};
  \stopscope
  \startscope[thick]
    \draw (60:-1cm) node[fill=white] {$E$} -- (60:3cm) node[fill=white]
{$F$};
    \draw[red]                   (-2,0) node[left] {$A$} -- (3,0)
node[right]{$B$};
    \draw[blue,shift={(60:2cm)}] (-3,0) node[left] {$C$} -- (2,0)
node[right]{$D$};
    \draw[shift={(60:1cm)},xshift=4cm]
    node [right,text width=6cm,rounded corners,fill=red!20,inner sep=1ex]
    {
      When we assume that $\color[red]{AB}$ and $\color[blue]{CD}$ are
      parallel, i.\,e., ${\color[red]{AB}} {|} \color[blue]{CD}$,
      then $\alpha = \delta$ and $\beta = \gamma$.
    };
  \stopscope
\stoptikzpicture
\stoptext



-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 4295 bytes --]

[-- Attachment #2: test-alan.pdf --]
[-- Type: application/pdf, Size: 32672 bytes --]

[-- Attachment #3: Type: text/plain, Size: 487 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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mkiv, luatex and tikz
  2008-10-24 22:33   ` luigi scarso
@ 2008-10-25  7:18     ` luigi scarso
  0 siblings, 0 replies; 9+ messages in thread
From: luigi scarso @ 2008-10-25  7:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1741 bytes --]

On Sat, Oct 25, 2008 at 12:33 AM, luigi scarso <luigi.scarso@gmail.com>wrote:

>
>
> On Fri, Oct 24, 2008 at 11:17 PM, Alan BRASLAU <alan.braslau@cea.fr>wrote:
>
>> Tikz seems to be broken under luatex.
>> As is, compiling something as simple as
>>        \usemodule[tikz]
>>        \starttext
>>        Hello, world!
>>        \stoptext
>> gives errors.
>>
>
>
>


%%
%%colors fixed  by Akira Kakuto
%%
\usemodule[tikz]
\setupcolors[state=start]


\starttext
Hello, world!
\blank
\begingroup
\tikz \draw[thick,rounded corners=8pt]
  (0,0) -- (0,2) -- (1,3.25) -- (2,2) -- (2,0) -- (0,2) -- (2,2) -- (0,0) --
(2,0);
\endgroup

\starttikzpicture
  \draw[fill=yellow] (0,0) -- (60:.75cm) arc (60:180:.75cm);
  \draw(120:0.4cm) node {$\alpha$};
  \draw[fill=green!30] (0,0) -- (right:.75cm) arc (0:60:.75cm);
  \draw(30:0.5cm) node {$\beta$};
  \startscope[shift={(60:2cm)}]
    \draw[fill=green!30] (0,0) -- (180:.75cm) arc (180:240:.75cm);
    \draw (30:-0.5cm) node {$\gamma$};
    \draw[fill=yellow] (0,0) -- (240:.75cm) arc (240:360:.75cm);
    \draw (-60:0.4cm) node {$\delta$};
  \stopscope
  \startscope[thick]
    \draw (60:-1cm) node[fill=white] {$E$} -- (60:3cm) node[fill=white]
{$F$};
    \draw[red]                   (-2,0) node[left] {$A$} -- (3,0)
node[right]{$B$};
    \draw[blue,shift={(60:2cm)}] (-3,0) node[left] {$C$} -- (2,0)
node[right]{$D$};
    \draw[shift={(60:1cm)},xshift=4cm]
    node [right,text width=6cm,rounded corners,fill=red!20,inner sep=1ex]
    {
      When we assume that \color[red]{$AB$} and \color[blue]{$CD$} are
      parallel, i.\,e., {\color[red]{$AB$}} {$|$} \color[blue]{$CD$},
      then $\alpha = \delta$ and $\beta = \gamma$.
    };
  \stopscope
\stoptikzpicture




\stoptext






-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 2958 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mkiv, luatex and tikz
  2008-10-24 21:17 ` mkiv, luatex and tikz Alan BRASLAU
  2008-10-24 22:33   ` luigi scarso
@ 2008-10-26 13:48   ` Mojca Miklavec
  2008-10-26 22:45   ` Mojca Miklavec
  2 siblings, 0 replies; 9+ messages in thread
From: Mojca Miklavec @ 2008-10-26 13:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Till Tantau

[-- Attachment #1: Type: text/plain, Size: 725 bytes --]

On Fri, Oct 24, 2008 at 10:17 PM, Alan BRASLAU wrote:
> Tikz seems to be broken under luatex.
> As is, compiling something as simple as
>        \usemodule[tikz]
>        \starttext
>        Hello, world!
>        \stoptext
> gives errors.

Hello,

doing some trivial experiments (though I don't really understand them) ...

When fetching pgf from cvs with
    cvs up -D 2008-05-20
it worked, while with
    cvs up -D 2008-05-21
it didn't work.

I reverthe the version on the garden to the one that locally worked,
but it still fails when I now use that version. Maybe I need to clean
up some stuff, but that's the diff between the versions when ConTeXt
support broke completely.

Mojca

(Going out to enjoy the sun now ...)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: tikz.diff --]
[-- Type: text/x-diff; name=tikz.diff, Size: 2169 bytes --]

diff -r old/pgf/doc/generic/pgf/text-en/pgfmanual-en-library-lsystems.tex new/pgf/doc/generic/pgf/text-en/pgfmanual-en-library-lsystems.tex
10c10
< \section{Lindemayer System Drawing Library}
---
> \section{Lindenmayer System Drawing Library}
161c161
< \begin{command}{\pgflsystemstep}
---
> \begin{command}{\pgflsystemcurrentstep}
163,164c163,166
< 	will move foward if required). The value stored in this macro
< 	may be changed if |\pgflsystemrandomizestep| is used (see below). 
---
> 	will move foward if required). This is initially set to the
> 	value in the \TeX-dimensions |\pgflsystemstep|, but the actual 
> 	value may be changed if |\pgflsystemrandomizestep| is used 
> 	(see below). 
184c186
< 	Randomizes the value in |\pgflsystemstep| according to the value of
---
> 	Randomizes the value in |\pgflsystemcurrentstep| according to the value of
199c201
< 	Move forward in the current direction, by |\pgflsystemstep|,
---
> 	Move forward in the current direction, by |\pgflsystemcurrentstep|,
208c210
< 	Move forward in the current direction, by |\pgflsystemstep|,
---
> 	Move forward in the current direction, by |\pgflsystemcurrentstep|,
diff -r old/pgf/generic/pgf/libraries/pgflibrarylindenmayersystems.code.tex new/pgf/generic/pgf/libraries/pgflibrarylindenmayersystems.code.tex
51a52
> \newdimen\pgflsystemstep
66c67,68
< 		\pgfmathsetlengthmacro\pgf@lsystem@step{\pgfkeysvalueof{/pgf/lindenmayer system/step}}%
---
> 		\pgfmathsetlength\pgflsystemstep{\pgfkeysvalueof{/pgf/lindenmayer system/step}}%
> 		\edef\pgf@lsystem@step{\the\pgflsystemstep}%
153c155
< 	\let\pgflsystemstep=\pgf@lsystem@step%
---
> 	\let\pgflsystemcurrentstep=\pgf@lsystem@step%
172,173c174,175
< 		\advance\pgf@x by\pgf@lsystem@step\relax%
< 		\edef\pgflsystemstep{\the\pgf@x}%
---
> 		\advance\pgf@x by\pgflsystemstep\relax%
> 		\edef\pgf@lsystem@step{\the\pgf@x}%
175c177
< 		\let\pgflsystemstep=\pgf@lsystem@step%
---
> 		\edef\pgf@lsystem@step{\the\pgflsystemstep}%
181c183
< 	\pgftransformxshift{+\pgflsystemstep}%
---
> 	\pgftransformxshift{+\pgflsystemcurrentstep}%
186c188
< 	\pgftransformxshift{+\pgflsystemstep}%
---
> 	\pgftransformxshift{+\pgflsystemcurrentstep}%

[-- Attachment #3: Type: text/plain, Size: 487 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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* tikz and metapost
       [not found]   ` <6faad9f00810260346o5eb5893w378c2b72639b15b@mail.gmail.com>
@ 2008-10-26 15:24     ` Alan BRASLAU
  2008-10-26 16:15       ` Jean Magnan de Bornier
  2008-10-28  9:01       ` Mojca Miklavec
  0 siblings, 2 replies; 9+ messages in thread
From: Alan BRASLAU @ 2008-10-26 15:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Following some exchange off-list (trying to figure out how tikz under context 
got broken), the subject of understanding pgf/tikz with respect to metapost 
came up. I am posting a follow-up here as it may be of interest to others on 
the mailing list, those who know metapost very well as well as those, like 
myself, who are still learning how to use different graphics tools.

On Sunday 26 October 2008 11:46:22 Mojca Miklavec wrote:
> > I am just starting to learn about metapost, and I can't judge yet
> > what pgf/tikz has as advantages and disadvantages.
>
> Advantages of TikZ:
> 1.) many many many many "libraries" that are ready-to-use. Just take a
> glimpse through the manual and it will be evident to you in the first
> glimpse. If you want to draw a graph, you can do it with a few
> commands. (one command draws you axis, one for function, ...)
> You can achieve the same with metapost, but you need to do everything
> from scratch. However, it's really easy to write your own libraries.
> 2.) some special effects like smooth shading works in metapost only
> conditionally (does not work with XeTeX at the moment), and you have a
> wider range with TikZ
>
> Advantages of metapost:
> 1.) rich mathematical machinery (you can write a set of equations and
> metapost will calculate your coordinates)
> 2.) easy to write your own macros

I thought that a major interest of pgf/tikz was the production of portable 
graphics (using many different motors). 

> I use metapost when I need to program something, and TikZ when I need
> to do something fancy very quickly. Another option is export to TikZ
> in Geogebra.



> > As an experiment, I did try comparing making a graph using
> > pgfplot and metagraph, and I did *not* like the result of the second.
>
> metagraph is old as earth.

graph.mp,v 1.2 2004/09/19
Current estimates place the age of the earth at around 4.6 billion years...

> If I draw graphs is meapost, I do that
> manually. Or I use gnuplot module to draw graphs for me, but graph
> drawing is much easier & more flexible with TikZ if you have
> datapoints ready. 

I myself find gnuplot to be fatally flawed and have never liked using it.

(I still sometimes produce graphics using an old program written in K&R C that 
generates HPGL for pen plotters, with a filter that then creates postscript.
Now THAT is almost stone age! But this program can also handle an arbitrary 
number of points VERY efficiently, only limited by the size of your storage 
device.)

> If you need some complex curve, TikZ is improving in
> that area, but in metapost it's out-of-the-box to draw it.

Why did Till Tantau write pgf/tikz? Clearly he knew metapost, so another route 
could have been to develop a standard library of metapost macros. I'm asking 
these questions here as there seems to be a preference (or prejudice) towards 
metapost amongst the context community. Indeed, it appears pretty powerful.  
But as Mojca wrote about glimpsing at the pgf/tikz manual, it too is very rich 
and I have yet to learn about all of the new features that were introduced in 
pgf-2.0.

Thus, I am trying to figure out where to invest my learning efforts. Do any 
other metapost and/or pgf-tikz experts have something to contribute to this 
query?

-- 
Alan Braslau
___________________________________________________________________________________
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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: tikz and metapost
  2008-10-26 15:24     ` tikz and metapost Alan BRASLAU
@ 2008-10-26 16:15       ` Jean Magnan de Bornier
  2008-10-28  9:01       ` Mojca Miklavec
  1 sibling, 0 replies; 9+ messages in thread
From: Jean Magnan de Bornier @ 2008-10-26 16:15 UTC (permalink / raw)
  To: ntg-context

Le 26 octobre à 16:24:40 Alan BRASLAU <alan.braslau@cea.fr> écrit notamment:

| Thus, I am trying to figure out where to invest my learning efforts. Do any 
| other metapost and/or pgf-tikz experts have something to contribute to this 
| query?

Well, I'm certainly not an expert, but I want to draw your attention to
metafun, an extension to metapost for use within context; so context users
have more than just metapost.

Regards,
-- 
Jean
___________________________________________________________________________________
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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mkiv, luatex and tikz
  2008-10-24 21:17 ` mkiv, luatex and tikz Alan BRASLAU
  2008-10-24 22:33   ` luigi scarso
  2008-10-26 13:48   ` Mojca Miklavec
@ 2008-10-26 22:45   ` Mojca Miklavec
  2 siblings, 0 replies; 9+ messages in thread
From: Mojca Miklavec @ 2008-10-26 22:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Till Tantau

On Fri, Oct 24, 2008 at 10:17 PM, Alan BRASLAU wrote:
> Tikz seems to be broken

I fixed the version on minimals.contextgarden.net (I need to figure
out what to do with the one on modules.contextgarden.net) and I'll
send the patch to the author.

A tiny patch

< 2008-05-14 Till Tantau
<
< 	- Completely rewrote driver detection in plain and context
< 	  mode.

seems to have broken functionality of TikZ in ConTeXt completely, but
nobody has noticed that for months until I accidentally ran "update
TikZ" script manually (it was supposed to be in cron, but I forgot to
add it there). Sorry.

(The version in TeX Live works OK.)

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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: tikz and metapost
  2008-10-26 15:24     ` tikz and metapost Alan BRASLAU
  2008-10-26 16:15       ` Jean Magnan de Bornier
@ 2008-10-28  9:01       ` Mojca Miklavec
  1 sibling, 0 replies; 9+ messages in thread
From: Mojca Miklavec @ 2008-10-28  9:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, Oct 26, 2008 at 4:24 PM, Alan BRASLAU wrote:
> Following some exchange off-list (trying to figure out how tikz under context
> got broken), the subject of understanding pgf/tikz with respect to metapost
> came up. I am posting a follow-up here as it may be of interest to others on
> the mailing list, those who know metapost very well as well as those, like
> myself, who are still learning how to use different graphics tools.
>
> On Sunday 26 October 2008 11:46:22 Mojca Miklavec wrote:
>> > I am just starting to learn about metapost, and I can't judge yet
>> > what pgf/tikz has as advantages and disadvantages.
>>
>> Advantages of TikZ:
>> 1.) many many many many "libraries" that are ready-to-use. Just take a
>> glimpse through the manual and it will be evident to you in the first
>> glimpse. If you want to draw a graph, you can do it with a few
>> commands. (one command draws you axis, one for function, ...)
>> You can achieve the same with metapost, but you need to do everything
>> from scratch. However, it's really easy to write your own libraries.
>> 2.) some special effects like smooth shading works in metapost only
>> conditionally (does not work with XeTeX at the moment), and you have a
>> wider range with TikZ
>>
>> Advantages of metapost:
>> 1.) rich mathematical machinery (you can write a set of equations and
>> metapost will calculate your coordinates)
>> 2.) easy to write your own macros
>
> I thought that a major interest of pgf/tikz was the production of portable
> graphics (using many different motors).

Right. That's also true, but portability is more about "the source
code of TikZ only had to be written once" and "you only need to learn
it once" when you write with both LaTeX and ConTeXt.

Usually you don't need to exchange the same figures between LaTeX and
ConTeXt documents anyway. But if you do need to convert, portable code
indeed helps a lot.

>> > As an experiment, I did try comparing making a graph using
>> > pgfplot and metagraph, and I did *not* like the result of the second.
>>
>> metagraph is old as earth.
>
> graph.mp,v 1.2 2004/09/19
> Current estimates place the age of the earth at around 4.6 billion years...

Compared to 4.6 billion years it would not matter, but I guess that
mpgraph has been written by Hobby, and the most recent reference that
he's quoting is from 1994. The date you see might be as trivial thing
as Karl Berry adding the svn id on top of file (though I would not
know it).

And in computers 14 years with (almost) no modification ... speaks for itself.

>> If I draw graphs is meapost, I do that
>> manually. Or I use gnuplot module to draw graphs for me, but graph
>> drawing is much easier & more flexible with TikZ if you have
>> datapoints ready.
>
> I myself find gnuplot to be fatally flawed and have never liked using it.

Flawed with/like?
(I started using it since I didn't need to bother about anything. It
just worked out of the box. I don't like most terminals, but with the
right terminal it's quite ok.)

> (I still sometimes produce graphics using an old program written in K&R C that
> generates HPGL for pen plotters, with a filter that then creates postscript.
> Now THAT is almost stone age! But this program can also handle an arbitrary
> number of points VERY efficiently, only limited by the size of your storage
> device.)

And by the memory your printer has when you try to print that file ... :) :) :)
(I need to draw some scatter plots now and need to figure a way to
forget about all the tools that I know for creating nice vector plots
... Back to the nice old bitmaps!)

>> If you need some complex curve, TikZ is improving in
>> that area, but in metapost it's out-of-the-box to draw it.
>
> Why did Till Tantau write pgf/tikz? Clearly he knew metapost, so another route
> could have been to develop a standard library of metapost macros.

Before mplib came to existance metapost meant that TeX had to:
- write mp code into file
- run metapost to convert your file into PostScript
- run other TeX jobs in background in order to get labels on MP figures

And that is *awfuly* slow when you have to process multiple graphics
with some text labels. Apart from that, you need to have some switch
enabled (write18) that means a security issue when other people submit
code to your server.

The way TikZ is implemented runs faster than metapost with
old-fashioned labels in mkii. Metapost in mkiv is comparable - you
don't need any external program to generate graphics.

What Till Tantau did whas bringing portability and efficiency of
drawing into all formats and all engines of TeX. With a standard
library for metapost he wouldn't gain on portability/efficiency,
though he could clearly implement  a library of the same strength much
easier. TikZ is now *the* choice for drawing anything in (La)TeX.

> I'm asking
> these questions here as there seems to be a preference (or prejudice) towards
> metapost amongst the context community.

- TikZ is rather new
- Hans has a large collection of own macros already (everything that
he ever needed), so there's no point of rewriting everything into
TikZ.
- Moreover, he would loose control (if TikZ changes in some way or if
someone has no TikZ installed). Metafun should always work, at least
in theory.
- Once you master one tool, it takes time to learn another one. If
there are no huge differences, it doesn't pay off.
- Metapost has some strengths that TikZ is lacking.

According to what Jean Magnan says: metafun is usable with plain
metapost as well.

> Indeed, it appears pretty powerful.
> But as Mojca wrote about glimpsing at the pgf/tikz manual, it too is very rich
> and I have yet to learn about all of the new features that were introduced in
> pgf-2.0.
>
> Thus, I am trying to figure out where to invest my learning efforts.

Start reading "Learning METAPOST by Doing" and start reading the
wonderful TikZ manual. If you need a powerful programming language
that's easy to learn, take metapost. If you need to do fancy stuff or
draw graphs in a few keystrokes, go for TikZ. Or simply learn both.

(But do not forget to consider that *any* tool with GUI that can draw
you a graph or image can do the job as well. If you want your texts in
TeX, you can stil import figures from external sources.)

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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-10-28  9:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-23 15:40 Textbackground with leftframe holzminister
2008-10-24 21:17 ` mkiv, luatex and tikz Alan BRASLAU
2008-10-24 22:33   ` luigi scarso
2008-10-25  7:18     ` luigi scarso
2008-10-26 13:48   ` Mojca Miklavec
2008-10-26 22:45   ` Mojca Miklavec
     [not found] ` <200810261045.19152.alan.braslau@cea.fr>
     [not found]   ` <6faad9f00810260346o5eb5893w378c2b72639b15b@mail.gmail.com>
2008-10-26 15:24     ` tikz and metapost Alan BRASLAU
2008-10-26 16:15       ` Jean Magnan de Bornier
2008-10-28  9:01       ` Mojca Miklavec

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).