Re: [NTG-context] colors in pgf within context

2008-02-18 Thread Jesse Alama
Cool, thanks.  It looks like we'll need env-tikz.tex, too :->

Jesse

Aditya Mahajan <[EMAIL PROTECTED]> writes:

> On Mon, 18 Feb 2008, Aditya Mahajan wrote:
>
>> I did that some time back while testing tikz. I will send that file as a
>> reply to this email, since I am not sure if it will go through the mailing
>> list because of its size.
>
> The file is attached. I am sure that there are better ways to convert
> the whole thing to context, but I just followed a quick and dirty
> conversion.


-- 
Jesse Alama ([EMAIL PROTECTED])
___
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
___


Re: [NTG-context] colors in pgf within context

2008-02-18 Thread Jesse Alama
Hi Aditya,

Thanks for the help -- I think I now see why there is such trouble with
colors in pgf and context.  It looks like one can systematically
transform LaTeX-like PGF examples of \color into ConTeXt examples.

The reason why this came up is that I'm trying to go through Till
Tantau's "Example for Karl's Students" tutorial in the PGF/TikZ manual.
Has anyone managed to ConTeXt-ify that example?  The closest that I've come is

  \usemodule[tikz]
  \setupcolors[state=start]
  \starttext
  \starttikzpicture
[scale=3,
 line cap=thin,
 %Styles
 axes/.style=, 
 important line/.style={very thick}, 
 information text/.style={rounded corners,fill=red!10,inner sep=1ex}] 
  % Local definitions 
  \def\costhirty{0.8660256} 
  % The graphic 
  \draw[help lines,step=0.5cm] (-1.4,-1.4) grid (1.4,1.4); 
  \draw (0,0) circle (1cm); 
  \startscope[axes] 
  \draw[->] (-1.5,0) -- (1.5,0) node[right] {$x$} coordinate(x axis); 
  \draw[->] (0,-1.5) -- (0,1.5) node[above] {$y$} coordinate(y axis); 
  \foreach \x/\xtext in {-1, -.5/-\frac{1}{2}, 1} 
  \draw[xshift=\x cm] (0pt,1pt) -- (0pt,-1pt) node[below,fill=white] 
{$\xtext$}; 
  \foreach \y/\ytext in {-1, -.5/-\frac{1}{2}, .5/\frac{1}{2}, 1} 
  \draw[yshift=\y cm] (1pt,0pt) -- (-1pt,0pt) node[left,fill=white] {$\ytext$}; 
  \stopscope
  \filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0pt) 
arc(0:30:3mm); 
  \draw (15:2mm) node[green!50!black] {$\alpha$}; 
  \draw[important line,red] 
  (30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} (30:1cm |- x axis); 
  
  \draw[important line,orange!80!black] (1,0) -- node[right=1pt,fill=white] { 
  $\displaystyle \tan \alpha \color[black]{=}
  \frac{\color[red]{\sin \alpha}}{\color[blue]{\cos \alpha}}$} 
  (intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t); 
  \draw (0,0) -- (t); 
  \draw[xshift=1.85cm] 
  node[right,text width=6cm,information text] 
  { 
  The \color[green!50!black]{angle $\alpha$} is $30^\circ$ in the 
  example ($\pi/6$ in radians). The \color[red]{sine of 
  $\alpha$}, which is the height of the red line, is 
  \startformula
  \color[red]{\sin \alpha} = 1/2.
  \stopformula
  By the Theorem of Pythagoras ... 
  }; 
  \stoptikzpicture
  \stoptext

The example features some \definecolor's which I just did away with
(sadly) by simply substituting their defining values for their
occurences.  (This is unfortunate, but perhaps necessary until some
other mechanism is produced.)  The problem is that the text box to the
right of the picture is supposed to be colored, and with rounded
corners.  But the box is missing.  Look at p. 20 of

  http://altermundus.com/downloads/pgfmanual_cvs.pdf
  
to see what I mean.  Also, the phrase "angle $\alpha$" is supposed to be
in a kind of green, but that's not working either.  What might be
happening?

Thanks,

Jesse

Aditya Mahajan <[EMAIL PROTECTED]> writes:

> I am CCing to the context list also.
>
> On Mon, 18 Feb 2008, Jesse Alama wrote:
>
>> Hi Aditya,
>>
>> I recently came across a thread on the PGF users mailing list in which
>> you mention some problems with ConTeXt, PGF and colors.  For example:
>>
>>  http://article.gmane.org/gmane.comp.tex.pgf.user/38
>>
>> Have these issues beein resolved for your?  I just downloaded PFG 1.18
>> from the modules part of the contextgarden, installed it, and, when
>> trying to compile the following example PGF code
>>
>>  \starttikzpicture[scale=3]
>>\clip (-2,-0.2) rectangle (2,0.8);
>>\draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4);
>>\filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm) arc
>>(0:30:3mm) -- cycle;
>>\draw[->] (-1.5,0) -- (1.5,0) coordinate (x axis);
>>\draw[->] (0,-1.5) -- (0,1.5) coordinate (y axis);
>>\draw (0,0) circle (1cm);
>>
>>\draw[very thick,red]
>>  (30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} (30:1cm |- x 
>> axis);
>>\draw[very thick,blue]
>>  (30:1cm |- x axis) -- node[below=2pt,fill=white] {$\cos \alpha$} (0,0);
>>\draw[very thick,orange]  (1,0) -- node [right=1pt,fill=white]
>>  {$\displaystyle \tan \alpha \color{black}=
>>\frac{{\color[red]\sin \alpha}}{{\color[blue]\cos \alpha}}$}
>>  (intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t);
>>
>>\draw (0,0) -- (t);
>>\foreach \x/\xtext in {-1, -0.5/-\frac{1}{2}, 1}
>>\draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north,fill=white] 
>> {$\xtext$};
>>\foreach \y/\ytext in {-1, -0.5/-\frac{1}{2}, 0.5/\frac{1}{2}, 1}
>>\draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east,fill=white] {$\ytext$};
>>  \stoptikzpicture
>>
>> (which is taken from the PGF manual), I get
>>
>>  ! Use of \color doesn't match its definition.
>>  [EMAIL PROTECTED] ...{$\displaystyle \tan \alpha \color {
>>black}= \frac {{\color 
>> {re...
>>
>>  [EMAIL PROTECTED]@[EMAIL PROTECTED] ...mmand [EMAIL PROTECTED]
>>[EMAIL PROTECTED] 

Re: [NTG-context] colors in pgf within context

2008-02-18 Thread Aditya Mahajan
On Mon, 18 Feb 2008, Jesse Alama wrote:

> Hi Aditya,
>
> Thanks for the help -- I think I now see why there is such trouble with
> colors in pgf and context.  It looks like one can systematically
> transform LaTeX-like PGF examples of \color into ConTeXt examples.
>
> The reason why this came up is that I'm trying to go through Till
> Tantau's "Example for Karl's Students" tutorial in the PGF/TikZ manual.
> Has anyone managed to ConTeXt-ify that example?

I did that some time back while testing tikz. I will send that file as a 
reply to this email, since I am not sure if it will go through the mailing 
list because of its size.

> The example features some \definecolor's which I just did away with
> (sadly) by simply substituting their defining values for their
> occurences.  (This is unfortunate, but perhaps necessary until some
> other mechanism is produced.)  The problem is that the text box to the
> right of the picture is supposed to be colored, and with rounded
> corners.  But the box is missing.  Look at p. 20 of

The TikZ manual make a lot of uses of the xcolor syntax (e.g. 
\color{red!20}). There is no equivalent ConTeXt syntax. You need to define 
a color, say lightred, as follows

\definecolor[lightred][r=0.2]

For tikz key-value options, pgf works behind the scene to define 
appropriate colors, so xcolor syntax works for them. So 
\fill[fillcolor=red!20] will work as expected. However, when using \color 
inside any box, you need to follow ConTeXt syntax. So \color[red!20] will 
not work, you need to define a context color and then use that.

Hope that this clarifies some things.

Aditya
___
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
___


Re: [NTG-context] Bug? Cross referencing and \setuparranging

2008-02-18 Thread Jeff Smith
On Feb 18, 2008 5:42 AM, Hans Hagen <[EMAIL PROTECTED]> wrote:
>
> no, just a side effect ... if you reshuffle the pages, you will get
> different flushing of multipass data
>
> (so, in fact you need to do normal runs, and then a final arrange run
> with --once)
>
> normally, you'll do:
>
> texexec yourdoc --arrange
>
> which will do normal runs followed by an extra run that arranges

Oh, right. This sounds pretty logical.

Thanks!

Jeff
___
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
___


Re: [NTG-context] colors in pgf within context

2008-02-18 Thread Aditya Mahajan
Hi Jesse,

I am CCing to the context list also.

On Mon, 18 Feb 2008, Jesse Alama wrote:

> Hi Aditya,
>
> I recently came across a thread on the PGF users mailing list in which
> you mention some problems with ConTeXt, PGF and colors.  For example:
>
>  http://article.gmane.org/gmane.comp.tex.pgf.user/38
>
> Have these issues beein resolved for your?  I just downloaded PFG 1.18
> from the modules part of the contextgarden, installed it, and, when
> trying to compile the following example PGF code
>
>  \starttikzpicture[scale=3]
>\clip (-2,-0.2) rectangle (2,0.8);
>\draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4);
>\filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm) arc
>(0:30:3mm) -- cycle;
>\draw[->] (-1.5,0) -- (1.5,0) coordinate (x axis);
>\draw[->] (0,-1.5) -- (0,1.5) coordinate (y axis);
>\draw (0,0) circle (1cm);
>
>\draw[very thick,red]
>  (30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} (30:1cm |- x axis);
>\draw[very thick,blue]
>  (30:1cm |- x axis) -- node[below=2pt,fill=white] {$\cos \alpha$} (0,0);
>\draw[very thick,orange]  (1,0) -- node [right=1pt,fill=white]
>  {$\displaystyle \tan \alpha \color{black}=
>\frac{{\color[red]\sin \alpha}}{{\color[blue]\cos \alpha}}$}
>  (intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t);
>
>\draw (0,0) -- (t);
>\foreach \x/\xtext in {-1, -0.5/-\frac{1}{2}, 1}
>\draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north,fill=white] {$\xtext$};
>\foreach \y/\ytext in {-1, -0.5/-\frac{1}{2}, 0.5/\frac{1}{2}, 1}
>\draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east,fill=white] {$\ytext$};
>  \stoptikzpicture
>
> (which is taken from the PGF manual), I get
>
>  ! Use of \color doesn't match its definition.
>  [EMAIL PROTECTED] ...{$\displaystyle \tan \alpha \color {
>black}= \frac {{\color 
> {re...
>
>  [EMAIL PROTECTED]@[EMAIL PROTECTED] ...mmand [EMAIL PROTECTED]
>[EMAIL PROTECTED] [EMAIL 
> PROTECTED]@[EMAIL PROTECTED]@...
>
>  [EMAIL PROTECTED]@[EMAIL PROTECTED] [EMAIL PROTECTED]@onpath
>\fi \afterassignment 
> \tikz...
>  l.86 ...(intersection of 0,0--30:1cm and 1,0--1,1)
> coordinate (t);
>  ?
>
> The problem does seem to be that PGF and ConTeXt both want to define
> \color.
>
> Any ideas how to get around the problem?  As it stands, it seems safe to
> say that, if colors don't work, then PGF is quite crippled in ConTeXt.

No, the reason for the error is more subtle. PGF does try its best to work 
with ConTeXt colors. However, there is a difference between latex and 
context color usage, that gives rise to the error. The culprit in this 
case is:

{$\displaystyle \tan \alpha \color{black}=
\frac{{\color[red]\sin \alpha}}{{\color[blue]\cos \alpha}}$}

Try this in a standalong context file (no pgf) and you will get an error. 
First you need to change \color{black} to \color[black]. Even then you 
will get an error. You need to use

{$\displaystyle \tan \alpha {\color[black]=
\frac{{\color[red]\sin \alpha}}{{\color[blue]\cos \alpha}}}$}


(Notice the {...} around \color[black]). Then everything works fine. Here 
is a working example (latest pgf from cvs, but should also work with 
1.18).

\usemodule[tikz]
\setupcolors[state=start]

\starttext

\starttikzpicture[scale=3]
   \clip (-2,-0.2) rectangle (2,0.8);
   \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4);
   \filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm) arc
   (0:30:3mm) -- cycle;
   \draw[->] (-1.5,0) -- (1.5,0) coordinate (x axis);
   \draw[->] (0,-1.5) -- (0,1.5) coordinate (y axis);
   \draw (0,0) circle (1cm);
   \draw[very thick,red]
 (30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} (30:1cm |- x 
axis);
   \draw[very thick,blue]
 (30:1cm |- x axis) -- node[below=2pt,fill=white] {$\cos \alpha$} 
(0,0);
   \draw[very thick,orange]  (1,0) -- node [right=1pt,fill=white]
 {$\displaystyle \tan \alpha {\color[black]=
   \frac{{\color[red]\sin \alpha}}{{\color[blue]\cos \alpha}}}$}
 (intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t);
   \draw (0,0) -- (t);
   \foreach \x/\xtext in {-1, -0.5/-\frac{1}{2}, 1}
   \draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north,fill=white] 
{$\xtext$};
   \foreach \y/\ytext in {-1, -0.5/-\frac{1}{2}, 0.5/\frac{1}{2}, 1}
   \draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east,fill=white] 
{$\ytext$};
\stoptikzpicture
\stoptext

Aditya
___
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/contextre

Re: [NTG-context] Bug? Cross referencing and \setuparranging

2008-02-18 Thread Hans Hagen
Jeff Smith wrote:
> Hi,
> 
> There seems to be a bug with the current ConTeXt (2008.01.28).
> 
> When using \setuparranging (I've tried more than one setup),
> cross-referencing doesn't work. You get ?? instead of whatever number
> you should get. It happens to me with this simple dummy document:
> 
> \setuppapersize[A5][A3]
> \setuparranging[2UP,doublesided]
> \starttext
> \chapter[chap1]{Chapter One}
> \dorecurse{4}{\input knuth \par}
> \chapter[chap2]{Chapter Two}
> \dorecurse{4}{\input knuth \par}
> \chapter[chap3]{Chapter Three}
> In chapter \in[chap1] of this document, there was something to read.
> \stoptext
> 
> If you comment out the \setuparranging command, the \in command will
> work. If you don't, the log shows the following:
> 
> chapter : 3 Chapter Three
> references  : unknown reference [][chap1]
> 
> This looks like a bug?

no, just a side effect ... if you reshuffle the pages, you will get 
different flushing of multipass data

(so, in fact you need to do normal runs, and then a final arrange run 
with --once)

normally, you'll do:

texexec yourdoc --arrange

which will do normal runs followed by an extra run that arranges

Hans


-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | 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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] latest release doesn't "make"

2008-02-18 Thread Henning Hraban Ramm
Am 2008-02-17 um 20:12 schrieb Taco Hoekwater:
> Running 0.20.2 0r 0.22.0 ? I eased the pattern file rules a bit for
> 0.22.0, it could be that is why Hans has no problems?

Whatever the version is that I get at 2007-02-17 22:11 via ctxtools  
still shows the problem.

My setup is TeX Live 2007 without additional binaries (LuaTeX) on  
MacOS X 10.4


Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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
___


[NTG-context] Bug? Cross referencing and \setuparranging

2008-02-18 Thread Jeff Smith
Hi,

There seems to be a bug with the current ConTeXt (2008.01.28).

When using \setuparranging (I've tried more than one setup),
cross-referencing doesn't work. You get ?? instead of whatever number
you should get. It happens to me with this simple dummy document:

\setuppapersize[A5][A3]
\setuparranging[2UP,doublesided]
\starttext
\chapter[chap1]{Chapter One}
\dorecurse{4}{\input knuth \par}
\chapter[chap2]{Chapter Two}
\dorecurse{4}{\input knuth \par}
\chapter[chap3]{Chapter Three}
In chapter \in[chap1] of this document, there was something to read.
\stoptext

If you comment out the \setuparranging command, the \in command will
work. If you don't, the log shows the following:

chapter : 3 Chapter Three
references  : unknown reference [][chap1]

This looks like a bug?

Jeff
___
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
___