ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: John Bowman <bowman@math.ualberta.ca>
Subject: ConTeXt + asymptote
Date: 29 Jun 2006 07:40:39 -0600	[thread overview]
Message-ID: <20060629134039.12300.qmail@wizard.math.ualberta.ca> (raw)

In regard to adding support for ConTeXt or plain TeX to Asymptote, it
should be no problem to do this, but perhaps someone on this list can help
provide some preliminary information, particularly regarding item 1 below
on how best to rotate text at an arbitrary angle. Also, since I am not sure
what the precise planned use of a plain tex/ConTeXt engine here is, it isn't
clear to me whether the miniltx solution below would be an acceptable solution.

Perhaps someone can also explain why so many context users are interested in
this feature? Why exactly can't they let Asymptote do its typesetting with
latex behind the scenes and then import the resulting ps or pdf files in
context? Is the issue just that latex might not be installed? If so, the
miniltx style file (which appears to be part of plain tex) seems like a
viable and simple solution.

In regard to the remark I saw posted about "monster eps" files, use the 
-aZ option and you will see that Asymptote output files are as compact as
those of MetaPost. If you want tex labels, you have to process MetaPost output
through dvips, etc. Asymptote simply does this automatically, perhaps giving
some users the illusion that Asymptote files are bigger. In other words, you
should compare the final postscript files that MetaPost produces, not the
intermediate ones (I recall that there is a MetaPost command for running
MetaPost output through dvips too).

Another issue I would be happy to discuss sometime is the need for implicit
equation solving. We could add it, given an appropriate syntax, but the
majority of uses I have seen for it are covered by the extension function
in math.asy. I find the latter more explicit and less confusing to new
users. But we could be persuaded to add something similar if someone can
justify the need. Asymptote already includes an explicit linear solver that
uses LU decomposition.

Anyway here are the two features we would need from a plain tex/ConTeXt engine:

1. We will need to replace pstricks (which is used only for rotating text)
with PostScript or PDF \special commands. There is a rotate.tex package in
dvips but it would have to be modified to typeset at arbitrary angles...

2. We could use epsf to include PostScript figures or else the miniltx
package. I see from some posts that some ConTeXt users are thinking
of using \epsfbox instead of \includegraphics. Any preferences here?
Alternatively, here is the miniltx solution, which would be trivial to
provide support for in an upcoming release of Asymptote:

Here's an example:

asy -k venn

Edit venn_.tex to look like this (then tex+dvips):

\input miniltx
\input graphicx
\input pstricks
\newbox\ASYbox
\newdimen\ASYdimen
\def\ASYbase#1#2{\setbox\ASYbox=\hbox{#1}\ASYdimen=\ht\ASYbox%
\setbox\ASYbox=\hbox{#2}\lower\ASYdimen\box\ASYbox}
\def\ASYalign(#1,#2)(#3,#4)#5#6{%
\setbox\ASYbox=\hbox{#6}%
\rput[lB]{#5}(#1,#2){\ASYdimen=\ht\ASYbox%
\advance\ASYdimen by\dp\ASYbox\kern#3\wd\ASYbox\raise#4\ASYdimen\box\ASYbox}}
\def\ASYscale(#1,#2)(#3,#4)(#5,#6)#7#8{%
\ASYalign(#1,#2)(#3,#4){#7}{\scalebox{#5}[#6]{#8}}}%
\psset{unit=1pt}
\includegraphics[bb=228.608356 320.125000 382.391644 470.875000]{venn_0.eps}%
\ASYalign(-104.955775,75.657656)(-0.500000,-0.500000){0.000000}{$A$}
\ASYalign(-49.404200,75.657656)(-0.500000,-0.500000){0.000000}{$B$}
\ASYalign(-77.179988,134.822731)(-0.500000,0.000000){0.000000}{$A\cap B$}
\ASYalign(-77.179988,16.492581)(-0.500000,-1.000000){0.000000}{$A\cup B$}
\bye


-- John Bowman
Department of Mathematical and Statistical Sciences
University of Alberta

             reply	other threads:[~2006-06-29 13:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-29 13:40 John Bowman [this message]
2006-06-29 18:05 ` Hans Hagen
2006-06-30  1:12 ` Sanjoy Mahajan
2006-06-30  8:16   ` Hans Hagen
  -- strict thread matches above, loose matches on Subject: below --
2006-10-15  5:04 John Bowman
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
2006-04-25  8:02                             ` Taco Hoekwater
2006-04-25 15:17                             ` Sanjoy Mahajan
2006-04-21 19:37     ` Sanjoy Mahajan
2006-04-21 23:30       ` Mojca Miklavec
2006-04-25  7:52 ` Taco Hoekwater

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=20060629134039.12300.qmail@wizard.math.ualberta.ca \
    --to=bowman@math.ualberta.ca \
    --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).