ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: ConTeXt + asymptote
Date: Tue, 25 Apr 2006 09:04:45 +0200	[thread overview]
Message-ID: <444DCA0D.5080505@wxs.nl> (raw)
In-Reply-To: <E1FYFHb-00012B-Kw@approximate.corpus.cam.ac.uk>

Sanjoy Mahajan wrote:
>> context parses the ps code and converts it to pdf and in the process
>> uses tex to do the fonts
>>     
>
>   %%Page: 1 1
>    0 0.5 dtransform truncate idtransform setlinewidth pop
>   1 setlinecap
>   1 setlinejoin
>   gsave
>    0 0 translate
>   newpath 273.998159 412.742829 moveto
>    338.001841 412.742829 lineto
>   
...
>    stroke
>   showpage
>   
looks parsable
>   asy -t tex labelbox.asy [make eps, use plain tex for labels]
>   
> which is failing, I think, in this line from the intermediate
> labelbox_.tex file:
>
>   \setbox\ASYpsbox=\hbox{\epsfbox{labelbox_0.eps}}%
>
> But I haven't figured out who generates labelbox_0.eps and why it isn't
> being generated when using tex but is when using latex.  Obviously I
> haven't found all the places where latex is hardwired into asymptote.
>
> And even what I did is incomplete.  The latex interface code spits out
> e.g. \fontsize{12}{14.4}, which I just ignore if plain tex is being
> used.
>
> Compared to the monster .eps files that asymptote produces, I now love
> metapost's simple postscript files and one-line, easily parsed font
> commands.
>   
if metapost had path bound specials and a few more features ...
> From: "Mojca Miklavec" <mojca.miklavec.lists@gmail.com>
>   
>> But I've given up once I saw how harcoded LaTeX was in there.
>>     
>
> I've pretty much given up too.
>   
from what you describe it sounds like generic usage was not one part of 
the design
>   
>> Metapost support in ConTeXt is much deeper and I wonder how much work
>> should be invested into making as good support for Asymptote in
>> ConTeXt as it is now for metapost.
>>     
>
> Whoever is game can start with the diff below, but I'm also not sure
> it's worth it.  My ideal figure program:
>
> 1. Agnostic about the tex engine (tex/latex/context), easy to integrate
>    with any of them.  MP is good here.
> 2. 3D built in.
> 3. Modern color models (cmyk, transparency)
>   
and even then, most of that has to take place in the backend in order to 
get proper integration (efficiency and such),  so if for instance mp had 
a model for arbitrary collections, like:

(r,g,b) == (c,m,y,k) => (a,b,c,d,...)

actually, colors in mp are just triplets
> 4. Decent syntax.  MP is a bit ghastly, and writing macros is horrible
>    esp. with vardefs.  I prefer a non-macro language, and asymptote is
>    good that way
>   
well, mp misses a few things but should not be compared to tex 
(different model for globals, grouping, functions)
> But it's a lot of work to get it right.
>
> -Sanjoy
>
> `A society of sheep must in time beget a government of wolves.'
>    - Bertrand de Jouvenal
>
>
> diff -r 57c230047c98 base/babel.asy
> --- a/base/babel.asy	Tue Feb 07 23:34:29 2006 -0500
> +++ b/base/babel.asy	Tue Apr 25 00:28:42 2006 -0400
> @@ -1,4 +1,6 @@ void babel(string s)
>  void babel(string s) 
>  {
> +  if (texengine == "tex")
> +    abort("No babel package in plain TeX.");
>    texpreamble("\usepackage["+s+"]{babel}");
>  }
>   
such code should not be inline, but in a config file or variable, seeing 
this i'd say: for the moment forget about patching since it's hard to 
keep up with such changes

btw, it should be:

  if texengine == latex then texpreamble ...

else you need an abort for each macro package
> diff -r 57c230047c98 base/fontsize.asy
> --- a/base/fontsize.asy	Tue Feb 07 23:34:29 2006 -0500
> +++ b/base/fontsize.asy	Tue Apr 25 00:28:42 2006 -0400
> @@ -1,1 +1,3 @@ texpreamble("\usepackage{type1cm}");
> +
etc

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

  reply	other threads:[~2006-04-25  7:04 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-21 15:49 Renaud AUBIN
2006-04-21 16:17 ` Renaud AUBIN
2006-04-21 16:45   ` Hans Hagen
2006-04-21 18:29     ` Jilani Khaldi
2006-04-21 18:52       ` Renaud AUBIN
2006-04-21 19:11         ` Hans Hagen
2006-04-21 19:13         ` Hans Hagen
2006-04-21 19:25           ` Renaud AUBIN
2006-04-22  8:38             ` Hans Hagen
2006-04-22  9:16               ` andrea valle
2006-04-21 19:10       ` Hans Hagen
2006-04-21 19:20         ` Renaud AUBIN
2006-04-21 19:52           ` Hans Hagen
2006-04-23 18:51             ` Renaud AUBIN
2006-04-23 20:28               ` Hans Hagen
2006-04-23 21:02                 ` Renaud AUBIN
2006-04-23 21:50                   ` Hans Hagen
2006-04-23 22:33                     ` Renaud AUBIN
2006-04-24  0:54                       ` Sanjoy Mahajan
2006-04-24  7:33                       ` Hans Hagen
2006-04-25  4:36                         ` Sanjoy Mahajan
2006-04-25  7:04                           ` Hans Hagen [this message]
2006-04-25  8:02                             ` Taco Hoekwater
2006-04-25 15:17                             ` Sanjoy Mahajan
2006-04-21 20:00         ` ConTeXt +Tioga Jilani Khaldi
2006-04-21 20:49           ` Sanjoy Mahajan
2006-04-22  7:47           ` Hans Hagen
2006-04-22  9:47             ` Taco Hoekwater
2006-04-22 12:12               ` Jilani Khaldi
2006-04-22 15:56                 ` andrea valle
2006-04-21 19:37     ` ConTeXt + asymptote Sanjoy Mahajan
2006-04-21 23:30       ` Mojca Miklavec
2006-04-25  7:52 ` Taco Hoekwater
2006-06-29 13:40 John Bowman
2006-06-29 18:05 ` Hans Hagen
2006-06-30  1:12 ` Sanjoy Mahajan
2006-06-30  8:16   ` Hans Hagen
2006-10-15  5:04 John Bowman

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=444DCA0D.5080505@wxs.nl \
    --to=pragma@wxs.nl \
    --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).