ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Gour <gour@atmarama.com>
Subject: Re: tikz is not found
Date: Wed, 24 Apr 2019 13:15:14 -0400 (EDT)	[thread overview]
Message-ID: <nycvar.YAK.7.76.44.1904241308170.7626@ervasbepr.pvz.zptvyy.pn> (raw)
In-Reply-To: <f57120b4-2a4a-5aa3-6be3-649d458dd407@gmail.com>

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

On Wed, 24 Apr 2019, Wolfgang Schuster wrote:

> Gour schrieb am 24.04.2019 um 18:57:
>> That I spotted and corrected, but I'm getting another error, I suppose:
>> $ cat  mp.tex
>> \starttext
>> Lorem Ipsum…
>>
>> \startMPcode
>> draw ( (0,0)--(1,0)--(0,1)) with color red ;
> Change "with color" to "withcolor" (no space).

Here is a more detailed example that mimics the tikz code that you sent in 
the other email.

\definecolor[myblue][r=0.3,g=0.3,b=1]
\definecolor[myred][r=0.6,g=0.2,b=0]

\starttext
\startMPpage
   newpair A, B, C;

   A := (-7.7, 2.75)*1cm;
   B := (0.88, 2.57)*1cm;
   C := (-3.04, -3.37)*1cm;

   newpath triangle;
   triangle := A -- B -- C -- cycle;
   fill triangle withcolor "myred" withtransparency("normal", 0.1);
   draw triangle withpen pencircle scaled 2pt
                 withcolor "myred";

   dotlabeldiam := 5pt;
   dotlabel.lft("A", A) withcolor "myblue";
   dotlabel.rt ("B", B) withcolor "myblue";
   dotlabel.bot("C", C) withcolor "myblue";

\stopMPpage
\stoptext

In ConTeXt, if you put quotes around the name of a color, it looks at the 
colors defined in tex rather than colors defined in metapost. This allows 
you to easily share the same colors in text and figures.

As an elegent example of this see this excellent imitation of Byrne's 
Euclid: 
https://github.com/jemmybutton/byrne-euclid/releases/download/0.6%2B0.3/byrne_context.pdf

(Source at https://github.com/jemmybutton/byrne-euclid)

Aditya

[-- Attachment #2: 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
___________________________________________________________________________________

  reply	other threads:[~2019-04-24 17:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24 10:42 Gour
2019-04-24 15:29 ` Alan Braslau
2019-04-24 16:57   ` Gour
2019-04-24 17:08     ` Wolfgang Schuster
2019-04-24 17:15       ` Aditya Mahajan [this message]
2019-04-24 19:56         ` Hans Hagen
2019-04-25  9:25         ` Gour
2019-04-25  8:24       ` Saša Janiška

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.YAK.7.76.44.1904241308170.7626@ervasbepr.pvz.zptvyy.pn \
    --to=adityam@umich.edu \
    --cc=gour@atmarama.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).