* Re: ConTeXt + asymptote @ 2006-10-15 5:04 John Bowman 0 siblings, 0 replies; 32+ messages in thread From: John Bowman @ 2006-10-15 5:04 UTC (permalink / raw) Hi all, As requested some time ago on this list, Asymptote 1.14 (a modern MetaPost replacement) now supports alternate TeX engines via the -tex option: -tex engine TeX engine ("latex|pdflatex|tex|pdftex|none") ["latex"] Other engines (presumably including ConTeXt) can easily be added in settings.cc. General affine transforms and clipping of labels is now implemented via PostScript or PDF specials (as appropriate). So if ConTeXt can handle TeX specials, adding support for it should be straightforward. We also input the tex graphics and picture packages; presumably something like them is accessible to ConTeXt too. If someone comes up with a diff for ConTeXt, please post it (as a patch under the link News) at asymptote.sourceforge.net Regards, -- John Bowman University of Alberta ^ permalink raw reply [flat|nested] 32+ messages in thread
* ConTeXt + asymptote @ 2006-06-29 13:40 John Bowman 2006-06-29 18:05 ` Hans Hagen 2006-06-30 1:12 ` Sanjoy Mahajan 0 siblings, 2 replies; 32+ messages in thread From: John Bowman @ 2006-06-29 13:40 UTC (permalink / 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 ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-06-29 13:40 John Bowman @ 2006-06-29 18:05 ` Hans Hagen 2006-06-30 1:12 ` Sanjoy Mahajan 1 sibling, 0 replies; 32+ messages in thread From: Hans Hagen @ 2006-06-29 18:05 UTC (permalink / raw) John Bowman wrote: > 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. > i cannot answer for other users but i guess that they want a more integrated approach, i.e. include a code in the doc source, write style info at runtime, etc latex and context differ too much from what users wrote to this list, i understood that much tex related stuff in asymptote is hard coded, so it's probably enough when all the strings (in the c source) that now contain latex code can be configured; there is no need for you to look into context, when things can be configured, the users will do that for you > 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 > indeed, esp when they use the so called minimal distributions; > 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). > in context dvips is not used for mp graphics; context comes with an integrated mp output parser; this means that integration is also efficient (handy when you have a couple of hundred mp graphics) esp with regards to resources i suppose that others can comment on the rest of your mail 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 ----------------------------------------------------------------- ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 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 1 sibling, 1 reply; 32+ messages in thread From: Sanjoy Mahajan @ 2006-06-30 1:12 UTC (permalink / raw) > In regard to the remark I saw posted about "monster eps" files That was from me. The size was one issue and probably, as you say, disappears in the size of the final pdf file (I didn't test it extensively but I think that happened). However, a related issue to the size is that ConTeXt parses the metapost output inline, doable since metapost puts out such a restricted subset of postscript. So it is easy (at least for tex wizards!) to integrate metapost with ConTeXt (i.e. for inline metapost code, like the asymptote environment in latex). The asymptote eps files, because of including fonts and using pstricks, are full postscript and would be harder to parse. > We will need to replace pstricks (which is used only for rotating text) > There is a rotate.tex package in dvips but it would have to be > modified to typeset at arbitrary angles... Won't pstricks eventually have to go when asymptote produces pdf directly? Hmm, I wonder how metapost does the rotating. Actually, here's a test: beginfig(1) draw thelabel(btex hello etex, origin) rotated 70; endfig; end produces this metapost eps file: %!PS %%BoundingBox: -7 -11 7 11 %%HiResBoundingBox: -6.75279 -10.8051 6.75278 10.80508 %%Creator: MetaPost 0.901 %%CreationDate: 2006.06.29:2102 %%Pages: 1 %*Font: cmr10 9.96265 9.96265 65:912 %%BeginProlog %%EndProlog %%Page: 1 1 gsave [0.34203 0.9397 -0.9397 0.34203 -0.2515 -10.8051 ] concat 0 0 moveto (hello) cmr10 9.96265 fshow grestore showpage %%EOF So it uses raw postscript to make an affine coordinate transform and avoids using an external tex/latex package. The resulting postscript is nice for parsing. > 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? That also was me. I have almost no experience of LaTeX and have always used \epsfbox from plain TeX days. But that may just be a bad habit or a preference for the simplicity of \epsfbox. > Another issue I would be happy to discuss sometime is the need for > implicit equation solving. I don't know if I can make a good case for it. But the declarative/implicit style matches how I think about drawing technical figures (perhaps because the feature exists!): specify a bunch of constraints and let the computer figure it out. But it's probably a lot of work to implement, not least because it would require a new operator. Maybe ?= for implicit equals and = for regular equals? -Sanjoy `Never underestimate the evil of which men of power are capable.' --Bertrand Russell, _War Crimes in Vietnam_, chapter 1. ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-06-30 1:12 ` Sanjoy Mahajan @ 2006-06-30 8:16 ` Hans Hagen 0 siblings, 0 replies; 32+ messages in thread From: Hans Hagen @ 2006-06-30 8:16 UTC (permalink / raw) Sanjoy Mahajan wrote: > Won't pstricks eventually have to go when asymptote produces pdf > directly? > why is pstricks needed anyway, i suppose that asymptote does the graphics > Hmm, I wonder how metapost does the rotating. Actually, here's a > test: > > beginfig(1) > draw thelabel(btex hello etex, origin) rotated 70; > endfig; > end > indeed, rotation is part of the graphic system > > > That also was me. I have almost no experience of LaTeX and have > always used \epsfbox from plain TeX days. But that may just be a bad > habit or a preference for the simplicity of \epsfbox. > in context we have our own inclusion macros; they also manage resources and such (please cc to bowman@math.ualberta.ca) Hans ^ permalink raw reply [flat|nested] 32+ messages in thread
* ConTeXt + asymptote @ 2006-04-21 15:49 Renaud AUBIN 2006-04-21 16:17 ` Renaud AUBIN 2006-04-25 7:52 ` Taco Hoekwater 0 siblings, 2 replies; 32+ messages in thread From: Renaud AUBIN @ 2006-04-21 15:49 UTC (permalink / raw) [-- Attachment #1.1: Type: text/plain, Size: 806 bytes --] Hi all, I like metapost but, according to the following mail (on the metapost ML): [metapost] MP vs. Asymptote I don't want to start a flame, but since someone posted a message some time ago mentioning Asymptote I got curious and I have to say that I was very impressed, even if I still have some problems with it. However, it seems a net improvement over MP, or not? Is there anyone with an informed opinion over Asymptote? Might Asymptote be the killer of MP? Cheers, (and always thanks for the help I got here now and then...) Maurizio _______________________________________________ metapost mailing list http://tug.org/mailman/listinfo/metapost I wonder if someone has already tried to use asymptote with ConTeXt... IMHO, this doesn't seem obvious at all but I'm maybe wrong... Cheers Renaud [-- Attachment #1.2: Type: text/html, Size: 1215 bytes --] [-- Attachment #2: Type: text/plain, Size: 139 bytes --] _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-21 15:49 Renaud AUBIN @ 2006-04-21 16:17 ` Renaud AUBIN 2006-04-21 16:45 ` Hans Hagen 2006-04-25 7:52 ` Taco Hoekwater 1 sibling, 1 reply; 32+ messages in thread From: Renaud AUBIN @ 2006-04-21 16:17 UTC (permalink / raw) [-- Attachment #1.1: Type: text/plain, Size: 7563 bytes --] Ouch, grep latex * on the source returns ChangeLog: * doc/asymptote.texi, doc/latexusage.tex: ChangeLog: * configure.ac: Use kpsewhich to help find default latex path. ChangeLog: Force quiet mode with running embedded latex files. ChangeLog: * doc/latexusage.tex, base/plain.asy, doc/asymptote.texi, ChangeLog: * doc/generalaxis.asy, doc/generalaxis3.asy, doc/latexusage.tex, ChangeLog: * doc/latexusage.tex, patches/README, patches/dvipdf, drawlabel.cc, ChangeLog: * doc/latexusage.tex: Updated axis call. ChangeLog: * doc/generalaxis.asy, doc/helix.asy, doc/latexusage.tex, ChangeLog: * doc/latexusage.tex, doc/parametricgraph.asy, doc/surface.asy, ChangeLog: * doc/asymptote.texi, doc/latexusage.tex, base/graph.asy, ChangeLog: * doc/asymptote.texi, doc/latexusage.tex: ChangeLog: Fixed texpreamble for multiple files and latex asy environment. ChangeLog: * doc/latexusage.tex, doc/lineargraph.asy, doc/lineargraph0.asy, ChangeLog: * doc/image.asy, doc/latexusage.tex, doc/mosquito.asy, ChangeLog: * examples/venn.asy, doc/latexusage.tex: ChangeLog: pipe and final latex processing and to ensure tex pipe font is properly ChangeLog: * doc/latexusage.tex, doc/lineargraph.asy, doc/linetype.asy, ChangeLog: * Makefile.in, doc/asymptote.texi: Fixed location of latexusage.tex. ChangeLog: * Makefile.in, doc/asymptote.texi: Fixed location of latexusage.tex. ChangeLog: * doc/asymptote.texi, doc/latexusage.tex, examples/sqrtx01.asy, ChangeLog: Included correct latexusage file in documentation. ChangeLog: * doc/asymptote.texi, doc/latexusage.tex, examples/Pythagoras.asy, ChangeLog: Install latexusage.tex with examples. ChangeLog: * doc/labelsquare.asy, doc/latexusage.tex, examples/geometry.asy, ChangeLog: * doc/asymptote.texi, doc/latexusage.tex, ChangeLog: doc/datagraph.asy, doc/latexusage.tex, examples/Pythagoras.asy, ChangeLog: * doc/asymptote.texi, doc/latexusage.tex, examples/lever.asy, ChangeLog: * picture.cc: Improved latex diagnostics. ChangeLog: * picture.cc: Improved latex diagnostics. ChangeLog: * doc/latexusage.tex: updated coordinate ChangeLog: doc/asymptote.texi, doc/diatom.asy, doc/latexusage.tex: Fixed ChangeLog: /usr/share/texmf/tex/latex/ (./configure --with-latex=PATH to ChangeLog: * configure.ac: Fixed -with-latex=PATH. ChangeLog: * Makefile.in, configure.ac: Added --with-latex=PATH configuration ChangeLog: * doc/asymptote.texi, doc/latexusage.tex, base/plain.asy: Updated ChangeLog: * doc/latexusage.tex, base/plain.asy, doc/asymptote.sty, ChangeLog: * doc/asymptote.texi, doc/latexusage.tex: Made import graph local ChangeLog: to each figure in latexusage. ChangeLog: * doc/latexusage.tex: Example of latex usage. ChangeLog: examples/latexusage.tex, doc/asymptote.sty, doc/asymptote.texi, configure:ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION Datadir kpsewhich latexdir LEX CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT LEXLIB LEX_OUTPUT_ROOT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CC CFLAGS ac_ct_CC SET_MAKE YACC CXXCPP EGREP getopt GCDIR GCLIBS INCL OPTIONS LIBOBJS LTLIBOBJS' configure: --with-latex=PATH specify path to LaTeX installation configure:# Check whether --with-latex or --without-latex was given. configure:if test "${with_latex+set}" = set; then configure: withval="$with_latex" configure: latexdir=$withval configure: latexdir=`kpsewhich base/latex.ltx` configure: latexdir=`echo $latexdir | sed -e 's;/base/latex.ltx;;'` configure: latexdir=$prefix/share/texmf/tex/latex configure: as_ac_File=`echo "ac_cv_file_$latexdir/base/latex.ltx" | $as_tr_sh` configure:echo "$as_me:$LINENO: checking for $latexdir/base/latex.ltx" >&5 configure:echo $ECHO_N "checking for $latexdir/base/latex.ltx... $ECHO_C" >&6 configure:if test -r "$latexdir/base/latex.ltx"; then configure: latexdir=/usr/share/texmf/tex/latex configure: as_ac_File=`echo "ac_cv_file_$latexdir/base/latex.ltx" | $as_tr_sh` configure:echo "$as_me:$LINENO: checking for $latexdir/base/latex.ltx" >&5 configure:echo $ECHO_N "checking for $latexdir/base/latex.ltx... $ECHO_C" >&6 configure:if test -r "$latexdir/base/latex.ltx"; then configure:latexdir=$latexdir/asymptote configure:{ echo "$as_me:$LINENO: Using $latexdir for LaTeX style file" >&5 configure:echo "$as_me: Using $latexdir for LaTeX style file" >&6;} configure:s,@latexdir@,$latexdir,;t t configure.ac:AC_ARG_WITH(latex, configure.ac: [ --with-latex=PATH specify path to LaTeX installation ], configure.ac: latexdir=$withval configure.ac: latexdir=`kpsewhich base/latex.ltx` configure.ac: latexdir=`echo $latexdir | sed -e 's;/base/latex.ltx;;'` configure.ac: latexdir=$prefix/share/texmf/tex/latex configure.ac: AC_CHECK_FILE($latexdir/base/latex.ltx,, configure.ac: [latexdir=/usr/share/texmf/tex/latex configure.ac: AC_CHECK_FILE($latexdir/base/latex.ltx,,)]) configure.ac:latexdir=$latexdir/asymptote configure.ac:AC_MSG_NOTICE([Using $latexdir for LaTeX style file]) configure.ac:AC_SUBST(latexdir) Makefile.in:latexdir = @latexdir@ Makefile.in: -${INSTALL} -d $(latexdir) Makefile.in: doc/*.asy doc/*.csv doc/*.dat doc/latexusage.tex $(exampledir) Makefile.in: -${INSTALL} -m644 doc/asymptote.sty $(latexdir) Makefile.in: latexusage.tex Makefile.in: -rm -f $(latexdir)/asymptote.sty Makefile.in: -rmdir $(latexdir) picture.cc:texstream tex; // Bi-directional pipe to latex (to find label bbox) picture.cc: tex.open(getSetting<mem::string>("latex").c_str(),"latex","latex"); picture.cc: cmd << "'" << getSetting<mem::string>("latex") << "'" picture.cc: status=System(cmd,quiet,"latex"); picture.cc: if(quiet) status=System(cmd,false,"latex"); picture.h:extern texstream tex; // Bi-directional pipe to latex (to find label bbox) settings.cc: addOption(new envSetting("latex", "latex")); Renaud AUBIN a écrit : >Hi all, > >I like metapost but, according to the following mail (on the metapost ML): > >[metapost] MP vs. Asymptote >I don't want to start a flame, but since someone posted a message some >time ago mentioning Asymptote I got curious and I have to say that I was >very impressed, even if I still have some problems with it. However, it >seems a net improvement over MP, or not? Is there anyone with an >informed opinion over Asymptote? Might Asymptote be the killer of MP? > >Cheers, >(and always thanks for the help I got here now and then...) > >Maurizio >_______________________________________________ >metapost mailing list >http://tug.org/mailman/listinfo/metapost > >I wonder if someone has already tried to use asymptote with ConTeXt... IMHO, this doesn't seem obvious at all but I'm maybe wrong... > >Cheers > >Renaud > > > > >------------------------------------------------------------------------ > >_______________________________________________ >ntg-context mailing list >ntg-context@ntg.nl >http://www.ntg.nl/mailman/listinfo/ntg-context > > [-- Attachment #1.2: Type: text/html, Size: 9940 bytes --] [-- Attachment #2: Type: text/plain, Size: 139 bytes --] _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-21 16:17 ` Renaud AUBIN @ 2006-04-21 16:45 ` Hans Hagen 2006-04-21 18:29 ` Jilani Khaldi 2006-04-21 19:37 ` Sanjoy Mahajan 0 siblings, 2 replies; 32+ messages in thread From: Hans Hagen @ 2006-04-21 16:45 UTC (permalink / raw) Renaud AUBIN wrote: > Ouch, grep latex * on the source returns i downloade it, and indeed it seems that calling latex is hard coded into the source of course you can make a batch file latex.cmd that runs context -) integrating does not look that problematic but without proper label support ... . so maybe you can convince the authors to make the --tex switch accept a format 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 ----------------------------------------------------------------- ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 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:10 ` Hans Hagen 2006-04-21 19:37 ` Sanjoy Mahajan 1 sibling, 2 replies; 32+ messages in thread From: Jilani Khaldi @ 2006-04-21 18:29 UTC (permalink / raw) >i downloade it, and indeed it seems that calling latex is hard coded into the source > >of course you can make a batch file latex.cmd that runs context -) > >integrating does not look that problematic but without proper label support ... . > >so maybe you can convince the authors to make the --tex switch accept a format > > Have a look at this: http://www.kitp.ucsb.edu/~paxton/tioga.html and, please, tell us what do you think about it. jk -- Jilani KHALDI http://jkhaldi.oltrelinux.com ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 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:10 ` Hans Hagen 1 sibling, 2 replies; 32+ messages in thread From: Renaud AUBIN @ 2006-04-21 18:52 UTC (permalink / raw) Tioga looks very nice for 2D plots but IMHO, asymptote could provide a good transition for metaposters. Moreover, asymptote is a "all-in-one" tool with 3D support and 2D plots of reasonable quality... The discussion is now, what do you prefer: an integrated tool with a great variety of features (even if a small amount of us are interested by "three" or "graph" in asymptote) or a better tool but with less features ? It is already possible to do 3D with metapost by using featpost, m3d or others but IMHO asymptote seems great because it integrates nativelly this kind of features. I have just send a mail to Andy Hammer to ask him what he thinks about using plainTeX format instead of hardcoded latex calls... Cheers, Renaud Jilani Khaldi a écrit : > >Have a look at this: >http://www.kitp.ucsb.edu/~paxton/tioga.html >and, please, tell us what do you think about it. >jk > >-- >Jilani KHALDI >http://jkhaldi.oltrelinux.com > >_______________________________________________ >ntg-context mailing list >ntg-context@ntg.nl >http://www.ntg.nl/mailman/listinfo/ntg-context > > > > ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-21 18:52 ` Renaud AUBIN @ 2006-04-21 19:11 ` Hans Hagen 2006-04-21 19:13 ` Hans Hagen 1 sibling, 0 replies; 32+ messages in thread From: Hans Hagen @ 2006-04-21 19:11 UTC (permalink / raw) Renaud AUBIN wrote: > I have just send a mail to Andy Hammer to ask him what he thinks about > using plainTeX format instead of hardcoded latex calls... > or configurable calls, i see no reason for binding to whatever format 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 ----------------------------------------------------------------- ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 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 1 sibling, 1 reply; 32+ messages in thread From: Hans Hagen @ 2006-04-21 19:13 UTC (permalink / raw) Renaud AUBIN wrote: > The discussion is now, what do you prefer: an integrated tool with a > great variety of features (even if a small amount of us are interested > by "three" or "graph" in asymptote) or a better tool but with less > features ? > or multiple tools -) 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 ----------------------------------------------------------------- ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-21 19:13 ` Hans Hagen @ 2006-04-21 19:25 ` Renaud AUBIN 2006-04-22 8:38 ` Hans Hagen 0 siblings, 1 reply; 32+ messages in thread From: Renaud AUBIN @ 2006-04-21 19:25 UTC (permalink / raw) I agree with you, and this is what I do for my document (I use featpost, metaobj and context term of gnuplot). But sometimes, there is some conflicts... That's the reason why I think that an integrated and expandable solution could be interesting. That's my humble opinion ;) Hans Hagen a écrit : >or multiple tools -) > >Hans > > ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-21 19:25 ` Renaud AUBIN @ 2006-04-22 8:38 ` Hans Hagen 2006-04-22 9:16 ` andrea valle 0 siblings, 1 reply; 32+ messages in thread From: Hans Hagen @ 2006-04-22 8:38 UTC (permalink / raw) there's also: ftp://tug.ctan.org/pub/tex-archive/graphics/pgf (although for context i'd rewrite the backend drivers a bit in order to be more integrated) 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 ----------------------------------------------------------------- ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-22 8:38 ` Hans Hagen @ 2006-04-22 9:16 ` andrea valle 0 siblings, 0 replies; 32+ messages in thread From: andrea valle @ 2006-04-22 9:16 UTC (permalink / raw) I discovered conTeXt+metapost because I was not satisfied with the limited capabilties of pgf for my graph music project. I have to say that I was forcing pgf beyond its scope, but in any case it is not intended as a complex, global plotting system, as far as I understand. Best -a- On 22 Apr 2006, at 10:38, Hans Hagen wrote: > ftp://tug.ctan.org/pub/tex-archive/graphics/pgf Andrea Valle DAMS - Facoltà di Scienze della Formazione Università degli Studi di Torino http://www.semiotiche.it/andrea andrea.valle@unito.it ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-21 18:29 ` Jilani Khaldi 2006-04-21 18:52 ` Renaud AUBIN @ 2006-04-21 19:10 ` Hans Hagen 2006-04-21 19:20 ` Renaud AUBIN 1 sibling, 1 reply; 32+ messages in thread From: Hans Hagen @ 2006-04-21 19:10 UTC (permalink / raw) Jilani Khaldi wrote: >> i downloade it, and indeed it seems that calling latex is hard coded into the source >> >> of course you can make a batch file latex.cmd that runs context -) >> >> integrating does not look that problematic but without proper label support ... . >> >> so maybe you can convince the authors to make the --tex switch accept a format >> >> >> > Have a look at this: > http://www.kitp.ucsb.edu/~paxton/tioga.html > and, please, tell us what do you think about it. > interesting (i assume that it produced pdf) 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 ----------------------------------------------------------------- ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-21 19:10 ` Hans Hagen @ 2006-04-21 19:20 ` Renaud AUBIN 2006-04-21 19:52 ` Hans Hagen 0 siblings, 1 reply; 32+ messages in thread From: Renaud AUBIN @ 2006-04-21 19:20 UTC (permalink / raw) [-- Attachment #1.1: Type: text/plain, Size: 982 bytes --] Ok, but how to deal with asymptote like with metapost. For example, if I produce a pdf with asymptote (with embed fonts) and use this pdf into my ConTeXt document with the same fonts... Is the fonts included twice ? I assume that this is the case... Maybe it could be interesting to "integrate" asymptote. I don't know how hard it is at all... It's only an idea... >interesting (i assume that it produced pdf) > >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 >----------------------------------------------------------------- > >_______________________________________________ >ntg-context mailing list >ntg-context@ntg.nl >http://www.ntg.nl/mailman/listinfo/ntg-context > > > > [-- Attachment #1.2: Type: text/html, Size: 1629 bytes --] [-- Attachment #2: Type: text/plain, Size: 139 bytes --] _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-21 19:20 ` Renaud AUBIN @ 2006-04-21 19:52 ` Hans Hagen 2006-04-23 18:51 ` Renaud AUBIN 0 siblings, 1 reply; 32+ messages in thread From: Hans Hagen @ 2006-04-21 19:52 UTC (permalink / raw) Renaud AUBIN wrote: > Ok, but how to deal with asymptote like with metapost. > For example, if I produce a pdf with asymptote (with embed fonts) and use this pdf into my ConTeXt document with the same fonts... Is the fonts included twice ? I assume that this is the case... > Maybe it could be interesting to "integrate" asymptote. > > I don't know how hard it is at all... It's only an idea... > it depends, if asymptote outputs a parsable format ... 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 ----------------------------------------------------------------- ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-21 19:52 ` Hans Hagen @ 2006-04-23 18:51 ` Renaud AUBIN 2006-04-23 20:28 ` Hans Hagen 0 siblings, 1 reply; 32+ messages in thread From: Renaud AUBIN @ 2006-04-23 18:51 UTC (permalink / raw) [-- Attachment #1.1: Type: text/plain, Size: 1314 bytes --] asy -inlinetex results in: - an eps graphics - latex code to use (I've not checked but seems) with asymptote.sty So, we can maybe imagine an -inlinecontext option to add asymptote support in context (???) Hans Hagen a écrit : >Renaud AUBIN wrote: > > >>Ok, but how to deal with asymptote like with metapost. >>For example, if I produce a pdf with asymptote (with embed fonts) and use this pdf into my ConTeXt document with the same fonts... Is the fonts included twice ? I assume that this is the case... >>Maybe it could be interesting to "integrate" asymptote. >> >>I don't know how hard it is at all... It's only an idea... >> >> >> >it depends, if asymptote outputs a parsable format ... > >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 >----------------------------------------------------------------- > >_______________________________________________ >ntg-context mailing list >ntg-context@ntg.nl >http://www.ntg.nl/mailman/listinfo/ntg-context > > > > [-- Attachment #1.2: Type: text/html, Size: 2001 bytes --] [-- Attachment #2: Type: text/plain, Size: 139 bytes --] _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-23 18:51 ` Renaud AUBIN @ 2006-04-23 20:28 ` Hans Hagen 2006-04-23 21:02 ` Renaud AUBIN 0 siblings, 1 reply; 32+ messages in thread From: Hans Hagen @ 2006-04-23 20:28 UTC (permalink / raw) Renaud AUBIN wrote: > asy -inlinetex results in: > - an eps graphics > - latex code to use (I've not checked but seems) with asymptote.sty > > So, we can maybe imagine an -inlinecontext option to add asymptote > support in context (???) no, what is needed is an isolation of the tex part, so that the macro package has/can to implement certain 'features'; otherwise it's unmaintainable 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 ----------------------------------------------------------------- ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-23 20:28 ` Hans Hagen @ 2006-04-23 21:02 ` Renaud AUBIN 2006-04-23 21:50 ` Hans Hagen 0 siblings, 1 reply; 32+ messages in thread From: Renaud AUBIN @ 2006-04-23 21:02 UTC (permalink / raw) [-- Attachment #1.1: Type: text/plain, Size: 379 bytes --] Hans Hagen a écrit : >no, what is needed is an isolation of the tex part, so that the macro package has/can to implement certain 'features'; otherwise it's unmaintainable > >Hans > > euh... The isolation of the tex part is performed for LaTeX with inlinetex option... (an eps file without any text + a tex file) Isn't this kind of isolation sufficient ? Renaud [-- Attachment #1.2: Type: text/html, Size: 727 bytes --] [-- Attachment #2: Type: text/plain, Size: 139 bytes --] _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-23 21:02 ` Renaud AUBIN @ 2006-04-23 21:50 ` Hans Hagen 2006-04-23 22:33 ` Renaud AUBIN 0 siblings, 1 reply; 32+ messages in thread From: Hans Hagen @ 2006-04-23 21:50 UTC (permalink / raw) Renaud AUBIN wrote: > Hans Hagen a écrit : >> no, what is needed is an isolation of the tex part, so that the macro package has/can to implement certain 'features'; otherwise it's unmaintainable >> >> Hans >> > euh... The isolation of the tex part is performed for LaTeX with > inlinetex option... (an eps file without any text + a tex file) > Isn't this kind of isolation sufficient ? i meant the 'hard coded parts' but then, i must admit that i never saw any real asymptote code -) 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 ----------------------------------------------------------------- _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 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 0 siblings, 2 replies; 32+ messages in thread From: Renaud AUBIN @ 2006-04-23 22:33 UTC (permalink / raw) [-- Attachment #1.1: Type: text/plain, Size: 638 bytes --] Hans Hagen a écrit : >i meant the 'hard coded parts' but then, i must admit that i never saw any real asymptote code -) > >Hans > > Since asymptote uses gs to generate eps or pdf output, I wander if the generated code can be used by ConTeXt... To integrate asymptote to ConTeXt, what is needed (from the ConTeXt pov I mean) ? I ask that because I don't know ConTeXt internals well... What's the integration scheme for a MPgraphic for example ? (I know that ConTeXt finally use a .mp and a .mpx) I assume after reading a .log that a ps file is needed... but it seems that a "font name mngt" is needed too... Renaud [-- Attachment #1.2: Type: text/html, Size: 999 bytes --] [-- Attachment #2: Type: text/plain, Size: 139 bytes --] _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-23 22:33 ` Renaud AUBIN @ 2006-04-24 0:54 ` Sanjoy Mahajan 2006-04-24 7:33 ` Hans Hagen 1 sibling, 0 replies; 32+ messages in thread From: Sanjoy Mahajan @ 2006-04-24 0:54 UTC (permalink / raw) > To integrate asymptote to ConTeXt, what is needed (from the ConTeXt > pov I mean) ? I'm curious about that too. I'm just going through my asymptote diffs (against v0.99) for it to work with plain TeX, and I'm not sure any of my changes will make it easier to integrate with ConTeXt the way MP is integrated. It's depressing how wedded asymptote is to LaTeX, and maybe it's impossible to get it all out (e.g. it uses \minipage and \fontsize). -Sanjoy `Never underestimate the evil of which men of power are capable.' --Bertrand Russell, _War Crimes in Vietnam_, chapter 1. ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 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 1 sibling, 1 reply; 32+ messages in thread From: Hans Hagen @ 2006-04-24 7:33 UTC (permalink / raw) Renaud AUBIN wrote: > Hans Hagen a écrit : >> i meant the 'hard coded parts' but then, i must admit that i never saw any real asymptote code -) >> >> Hans >> > Since asymptote uses gs to generate eps or pdf output, I wander if the > generated code can be used by ConTeXt... > To integrate asymptote to ConTeXt, what is needed (from the ConTeXt > pov I mean) ? I ask that because I don't know ConTeXt internals well... > What's the integration scheme for a MPgraphic for example ? (I know > that ConTeXt finally use a .mp and a .mpx) > I assume after reading a .log that a ps file is needed... but it seems > that a "font name mngt" is needed too... context parses the ps code and converts it to pdf and in the process uses tex to do the fonts 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 ----------------------------------------------------------------- _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-24 7:33 ` Hans Hagen @ 2006-04-25 4:36 ` Sanjoy Mahajan 2006-04-25 7:04 ` Hans Hagen 0 siblings, 1 reply; 32+ messages in thread From: Sanjoy Mahajan @ 2006-04-25 4:36 UTC (permalink / raw) > context parses the ps code and converts it to pdf and in the process > uses tex to do the fonts Maybe then it's not worth finishing my modifications for asymptote to use plain tex. The following .asy file (labelbox.asy in the distributed examples/): real margin=2mm; frame b1,b2; box(b1,Label("small box",(0,0)),margin); box(b2,Label("LARGER BOX",(0,-2cm)),margin); add(b1); add(b2); draw(point(b1,S)--point(b2,N),currentpen); produces an 810-line .eps file that includes fonts (cmr12) and the pstricks headers. The actual page material is: %%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 338.001841 435.883567 lineto 273.998159 435.883567 lineto 273.998159 412.742829 lineto closepath [ 1 0 0 1 0 0] concat stroke grestore gsave 0 0 translate newpath 258.635763 356.116433 moveto 353.364237 356.116433 lineto 353.364237 379.124359 lineto 258.635763 379.124359 lineto 258.635763 356.116433 lineto closepath [ 1 0 0 1 0 0] concat stroke grestore newpath 306 412.242829 moveto 306 379.624359 lineto stroke showpage But I've attached the half-working diff (some would say the glass is half-broken), against asymptote 0.99. The result is supposed to work as follows: asy labelbox.asy [make eps file; use latex for labels] asy -t latex labelbox.asy [same as above] asy -t tex labelbox.asy [make eps, use plain tex for labels] My patches don't break the first or second uses, which is good, but the third isn't working yet: $ asy -t tex labelbox.asy /usr/local/share/asymptote/shipout.asy: 73.10: runtime: camp: shipout failed 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. 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. > 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) 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 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}"); } 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}"); +if (texengine == "tex") + abort("No fontsize package in plain TeX."); texpreamble("\usepackage{type1cm}"); diff -r 57c230047c98 base/latin1.asy --- a/base/latin1.asy Tue Feb 07 23:34:29 2006 -0500 +++ b/base/latin1.asy Tue Apr 25 00:28:42 2006 -0400 @@ -1,2 +1,4 @@ texpreamble("\usepackage[T1]{fontenc}"); +if (texengine == "tex") + abort("No T1 or latin1 packages in plain TeX."); texpreamble("\usepackage[T1]{fontenc}"); texpreamble("\usepackage[latin1]{inputenc}"); diff -r 57c230047c98 base/plain.asy --- a/base/plain.asy Tue Feb 07 23:34:29 2006 -0500 +++ b/base/plain.asy Tue Apr 25 00:28:42 2006 -0400 @@ -7,6 +7,9 @@ *****/ include constants; + +// tex, latex, or none (for the future: or pdftex, pdflatex, context) +public string texengine = TEXENGINE(); // what variant will typeset the labels access version; if(version.VERSION != VERSION()) { diff -r 57c230047c98 base/strings.asy --- a/base/strings.asy Tue Feb 07 23:34:29 2006 -0500 +++ b/base/strings.asy Tue Apr 25 00:28:42 2006 -0400 @@ -81,12 +81,16 @@ string math(string s) string includegraphics(string name, string options="") { + if (texengine == "tex") + return "\hbox{\epsfbox"+"{"+name+"}}"; if(options != "") options="["+options+"]"; return "\includegraphics"+options+"{"+name+"}"; } string minipage(string s, real width=100pt) { + if (texengine == "tex") + abort("No minipage environment in plain TeX."); return "\begin{minipage}{"+(string) (width*pt)+"pt}"+s+"\end{minipage}"; } diff -r 57c230047c98 base/unicode.asy --- a/base/unicode.asy Tue Feb 07 23:34:29 2006 -0500 +++ b/base/unicode.asy Tue Apr 25 00:28:42 2006 -0400 @@ -1,2 +1,4 @@ texpreamble("\usepackage{ucs}"); +if (texengine == "tex") + abort("No unicode (ucs,utf8x) packages in plain TeX."); texpreamble("\usepackage{ucs}"); texpreamble("\usepackage[utf8x]{inputenc}"); diff -r 57c230047c98 doc/asy.1 --- a/doc/asy.1 Tue Feb 07 23:34:29 2006 -0500 +++ b/doc/asy.1 Tue Apr 25 00:28:42 2006 -0400 @@ -35,7 +35,7 @@ View output file. View output file. .TP .B -a, -align C|B|T|Z -Center, Bottom, Top or Zero page alignment; Z => -notex. +Center, Bottom, Top or Zero page alignment; Z => -tex none. .TP .B -autoplain Enable automatic importing of plain (default). @@ -106,8 +106,8 @@ Convert cmyk colors to rgb. .B -safe Disable system call (default). .TP -.B -tex -Enable LaTeX label postprocessing (default). +.B -t, -tex engine +TeX engine for processing labels: one of latex (default), tex, none. .TP .B -s, -translate Translate test. diff -r 57c230047c98 doc/asymptote.texi --- a/doc/asymptote.texi Tue Feb 07 23:34:29 2006 -0500 +++ b/doc/asymptote.texi Tue Apr 25 00:28:42 2006 -0400 @@ -5286,7 +5286,7 @@ Usage: asy [options] [file ...] Options: -V,-View View output files --a,-align C|B|T|Z Center, Bottom, Top or Zero page alignment; Z => -notex +-a,-align C|B|T|Z Center, Bottom, Top or Zero page alignment; Z => -tex none -autoplain Enable automatic importing of plain (default) -batchMask Mask fpu exceptions in batch mode -batchView View output files in batch mode @@ -5310,7 +5310,7 @@ Options: -p,-parseonly Parse test -rgb Convert cmyk colors to rgb -safe Disable system call (default) --tex Enable LaTeX label postprocessing (default) +-t, -tex engine TeX engine for processing labels (default: latex). -s,-translate Translate test -unsafe Enable system call -v,-verbose Increase verbosity level diff -r 57c230047c98 drawlabel.cc --- a/drawlabel.cc Tue Feb 07 23:34:29 2006 -0500 +++ b/drawlabel.cc Tue Apr 25 00:28:42 2006 -0400 @@ -70,7 +70,8 @@ void drawLabel::bounds(bbox& b, iopipest void drawLabel::bounds(bbox& b, iopipestream& tex, boxvector& labelbounds, bboxlist&) { - if(!settings::getSetting<bool>("tex")) {b += position; return;} + if(settings::getSetting<mem::string>("tex") == "none") + {b += position; return;} pair rotation=expi(radians(angle)); pen Pentype=pentype; static const double fuzz=1.0+Pentype.size()/24.0; @@ -79,9 +80,12 @@ void drawLabel::bounds(bbox& b, iopipest havebounds=true; if(Pentype.size() != lastpen.size() || Pentype.Lineskip() != lastpen.Lineskip()) { - tex << "\\fontsize{" << Pentype.size() << "}{" << Pentype.Lineskip() - << "}\\selectfont\n"; - tex.wait("\n*","! "); + // need to fix if not using latex (change fontsize and baselineskip) + if(settings::getSetting<mem::string>("tex") == "latex") { + tex << "\\fontsize{" << Pentype.size() << "}{" << Pentype.Lineskip() + << "}\\selectfont\n"; + tex.wait("\n*","! "); + } } string font=Pentype.Font(); @@ -93,8 +97,10 @@ void drawLabel::bounds(bbox& b, iopipest p += scaled.length(); fontscale=atof(font.substr(p,string::npos).c_str())/1000.0; } - tex << font << "\n"; - tex.wait("\n*","! "); + if(settings::getSetting<mem::string>("tex") == "latex") { + tex << font << "\n"; // need to change fonts differently in tex + tex.wait("\n*","! "); + } } lastpen=Pentype; diff -r 57c230047c98 examples/conicurv.asy --- a/examples/conicurv.asy Tue Feb 07 23:34:29 2006 -0500 +++ b/examples/conicurv.asy Tue Apr 25 00:28:42 2006 -0400 @@ -4,7 +4,8 @@ import three; import math; -texpreamble("\usepackage{bm}"); +if (texengine != "tex") + texpreamble("\usepackage{bm}"); size(300,0); diff -r 57c230047c98 picture.cc --- a/picture.cc Tue Feb 07 23:34:29 2006 -0500 +++ b/picture.cc Tue Apr 25 00:28:42 2006 -0400 @@ -83,7 +83,7 @@ bool picture::havelabels() bool picture::havelabels() { size_t n=nodes.size(); - if(n > lastnumber && !labels && getSetting<bool>("tex")) { + if(n > lastnumber && !labels && getSetting<mem::string>("tex") != "none") { // Check to see if there are any labels yet nodelist::iterator p=nodes.begin(); for(size_t i=0; i < lastnumber; ++i) ++p; @@ -131,7 +131,9 @@ void picture::texinit() return; } - tex.open(getSetting<mem::string>("latex").c_str(),"latex","latex"); + tex.open(getSetting<mem::string>("tex").c_str(), + getSetting<mem::string>("tex").c_str(), + getSetting<mem::string>("tex").c_str()); texdocumentclass(tex,true); texdefines(tex,TeXpipepreamble,true); @@ -152,12 +154,12 @@ bool picture::texprocess(const string& t if(outfile) { outfile.close(); ostringstream cmd; - cmd << getSetting<mem::string>("latex") + cmd << getSetting<mem::string>("tex") << " \\scrollmode\\input " << texname; bool quiet=verbose <= 1; - status=System(cmd,quiet,true,"latex"); + status=System(cmd,quiet,true,getSetting<mem::string>("tex").c_str()); if(status) { - if(quiet) status=System(cmd,true,"latex"); + if(quiet) status=System(cmd,true,getSetting<mem::string>("tex").c_str()); return false; } @@ -360,7 +362,8 @@ bool picture::shipout(picture *preamble, bbox bpos=b; - bool TeXmode=getSetting<bool>("inlinetex") && getSetting<bool>("tex"); + bool TeXmode=getSetting<bool>("inlinetex") && + (getSetting<mem::string>("tex") == "latex"); bool Labels=labels || TeXmode; if(deconstruct) { diff -r 57c230047c98 runtime.cc --- a/runtime.cc Tue Feb 07 23:34:29 2006 -0500 +++ b/runtime.cc Tue Apr 25 00:28:42 2006 -0400 @@ -2599,8 +2599,16 @@ void gen226(stack *Stack) {Stack->push<string>(VERSION); return;} } +// for exporting to the .asy world how labels are to be processed +// string TEXENGINE(); +void gen227(stack *Stack) +{ + + {Stack->push<string>(getSetting<mem::string>("tex")); return;} +} + // void quiet(bool v); -void gen227(stack *Stack) +void gen228(stack *Stack) { bool v = vm::pop<bool>(Stack); @@ -2610,7 +2618,7 @@ void gen227(stack *Stack) } // void atexit(callable *f); -void gen228(stack *Stack) +void gen229(stack *Stack) { callable * f = vm::pop<callable *>(Stack); @@ -2618,7 +2626,7 @@ void gen228(stack *Stack) } // callable* atexit(); -void gen229(stack *Stack) +void gen230(stack *Stack) { {Stack->push<callable*>(atExitFunction); return;} @@ -2627,7 +2635,7 @@ void gen229(stack *Stack) // Merge output files // int merge(stringarray *files, string *args, string *format, bool keep); -void gen230(stack *Stack) +void gen231(stack *Stack) { bool keep = vm::pop<bool>(Stack); string * format = vm::pop<string *>(Stack); @@ -2922,7 +2930,7 @@ void arraySequence(stack *Stack) // Return the array {0,1,...n-1} // intarray* sequence(int n); -void gen251(stack *Stack) +void gen252(stack *Stack) { int n = vm::pop<int>(Stack); @@ -2951,7 +2959,7 @@ void arrayFunction(stack *Stack) } // bool all(boolarray *a); -void gen253(stack *Stack) +void gen254(stack *Stack) { boolarray * a = vm::pop<boolarray *>(Stack); @@ -2963,7 +2971,7 @@ void gen253(stack *Stack) } // boolarray* !(boolarray* a); -void gen254(stack *Stack) +void gen255(stack *Stack) { boolarray* a = vm::pop<boolarray*>(Stack); @@ -2975,7 +2983,7 @@ void gen254(stack *Stack) } // int sum(boolarray *a); -void gen255(stack *Stack) +void gen256(stack *Stack) { boolarray * a = vm::pop<boolarray *>(Stack); @@ -3044,7 +3052,7 @@ void array2Transpose(stack *Stack) // In a boolean array, find the index of the nth true value or -1 if not found // If n is negative, search backwards. // int find(boolarray *a, int n=1); -void gen260(stack *Stack) +void gen261(stack *Stack) { int n = vm::pop<int>(Stack,1); boolarray * a = vm::pop<boolarray *>(Stack); @@ -3103,7 +3111,7 @@ void arrayConditional(stack *Stack) // [ ... ] // [ c[n-1] a[n-1] b[n-1] ] // realarray* tridiagonal(realarray *a, realarray *b, realarray *c, realarray *f); -void gen262(stack *Stack) +void gen263(stack *Stack) { realarray * f = vm::pop<realarray *>(Stack); realarray * c = vm::pop<realarray *>(Stack); @@ -3232,7 +3240,7 @@ void pairArrayFFT(stack *Stack) // File operations // bool ==(file *a, file *b); -void gen264(stack *Stack) +void gen265(stack *Stack) { file * b = vm::pop<file *>(Stack); file * a = vm::pop<file *>(Stack); @@ -3241,7 +3249,7 @@ void gen264(stack *Stack) } // bool !=(file *a, file *b); -void gen265(stack *Stack) +void gen266(stack *Stack) { file * b = vm::pop<file *>(Stack); file * a = vm::pop<file *>(Stack); @@ -3262,7 +3270,7 @@ void nullFile(stack *Stack) } // file* input(string name, bool check=true, string comment=commentchar); -void gen268(stack *Stack) +void gen269(stack *Stack) { string comment = vm::pop<string>(Stack,commentchar); bool check = vm::pop<bool>(Stack,true); @@ -3275,7 +3283,7 @@ void gen268(stack *Stack) } // file* output(string name, bool append=false); -void gen269(stack *Stack) +void gen270(stack *Stack) { bool append = vm::pop<bool>(Stack,false); string name = vm::pop<string>(Stack); @@ -3286,7 +3294,7 @@ void gen269(stack *Stack) } // file* xinput(string name, bool check=true); -void gen270(stack *Stack) +void gen271(stack *Stack) { bool check = vm::pop<bool>(Stack,true); string name = vm::pop<string>(Stack); @@ -3300,7 +3308,7 @@ void gen270(stack *Stack) } // file* xoutput(string name, bool append=false); -void gen271(stack *Stack) +void gen272(stack *Stack) { bool append = vm::pop<bool>(Stack,false); string name = vm::pop<string>(Stack); @@ -3314,7 +3322,7 @@ void gen271(stack *Stack) } // bool eof(file *File); -void gen272(stack *Stack) +void gen273(stack *Stack) { file * File = vm::pop<file *>(Stack); @@ -3322,7 +3330,7 @@ void gen272(stack *Stack) } // bool eol(file *File); -void gen273(stack *Stack) +void gen274(stack *Stack) { file * File = vm::pop<file *>(Stack); @@ -3330,7 +3338,7 @@ void gen273(stack *Stack) } // bool error(file *File); -void gen274(stack *Stack) +void gen275(stack *Stack) { file * File = vm::pop<file *>(Stack); @@ -3338,7 +3346,7 @@ void gen274(stack *Stack) } // void clear(file *File); -void gen275(stack *Stack) +void gen276(stack *Stack) { file * File = vm::pop<file *>(Stack); @@ -3346,7 +3354,7 @@ void gen275(stack *Stack) } // void close(file *File); -void gen276(stack *Stack) +void gen277(stack *Stack) { file * File = vm::pop<file *>(Stack); @@ -3354,7 +3362,7 @@ void gen276(stack *Stack) } // void precision(file *File, int digits); -void gen277(stack *Stack) +void gen278(stack *Stack) { int digits = vm::pop<int>(Stack); file * File = vm::pop<file *>(Stack); @@ -3363,7 +3371,7 @@ void gen277(stack *Stack) } // void flush(file *File); -void gen278(stack *Stack) +void gen279(stack *Stack) { file * File = vm::pop<file *>(Stack); @@ -3371,7 +3379,7 @@ void gen278(stack *Stack) } // string getc(file *File); -void gen279(stack *Stack) +void gen280(stack *Stack) { file * File = vm::pop<file *>(Stack); @@ -3384,7 +3392,7 @@ void gen279(stack *Stack) // Set file dimensions // file* dimension(file *File, int nx); -void gen280(stack *Stack) +void gen281(stack *Stack) { int nx = vm::pop<int>(Stack); file * File = vm::pop<file *>(Stack); @@ -3394,7 +3402,7 @@ void gen280(stack *Stack) } // file* dimension(file *File, int nx, int ny); -void gen281(stack *Stack) +void gen282(stack *Stack) { int ny = vm::pop<int>(Stack); int nx = vm::pop<int>(Stack); @@ -3405,7 +3413,7 @@ void gen281(stack *Stack) } // file* dimension(file *File, int nx, int ny, int nz); -void gen282(stack *Stack) +void gen283(stack *Stack) { int nz = vm::pop<int>(Stack); int ny = vm::pop<int>(Stack); @@ -3418,7 +3426,7 @@ void gen282(stack *Stack) // Set file to read comma-separated values // file* csv(file *File, bool b=true); -void gen283(stack *Stack) +void gen284(stack *Stack) { bool b = vm::pop<bool>(Stack,true); file * File = vm::pop<file *>(Stack); @@ -3429,7 +3437,7 @@ void gen283(stack *Stack) // Set file to read arrays in line-at-a-time mode // file* line(file *File, bool b=true); -void gen284(stack *Stack) +void gen285(stack *Stack) { bool b = vm::pop<bool>(Stack,true); file * File = vm::pop<file *>(Stack); @@ -3440,7 +3448,7 @@ void gen284(stack *Stack) // Set file to read/write single-precision XDR values. // file* single(file *File, bool b=true); -void gen285(stack *Stack) +void gen286(stack *Stack) { bool b = vm::pop<bool>(Stack,true); file * File = vm::pop<file *>(Stack); @@ -3451,7 +3459,7 @@ void gen285(stack *Stack) // Set file to read an array1 (1 int size followed by a 1d array) // file* read1(file *File); -void gen286(stack *Stack) +void gen287(stack *Stack) { file * File = vm::pop<file *>(Stack); @@ -3461,7 +3469,7 @@ void gen286(stack *Stack) // Set file to read an array2 (2 int sizes followed by a 2d array) // file* read2(file *File); -void gen287(stack *Stack) +void gen288(stack *Stack) { file * File = vm::pop<file *>(Stack); @@ -3471,7 +3479,7 @@ void gen287(stack *Stack) // Set file to read an array3 (3 int sizes followed by a 3d array) // file* read3(file *File); -void gen288(stack *Stack) +void gen289(stack *Stack) { file * File = vm::pop<file *>(Stack); @@ -3672,39 +3680,40 @@ void gen_base_venv(venv &ve) addFunc(ve, run::gen224, primReal(), "cubiclength", formal(primTriple(), "z0", false, false), formal(primTriple(), "z0p", false, false), formal(primTriple(), "z1m", false, false), formal(primTriple(), "z1", false, false), formal(primReal(), "goal", false, false)); addFunc(ve, run::gen225, primPair(), "intersect", formal(tripleArray(), "pre1", false, false), formal(tripleArray(), "point1", false, false), formal(tripleArray(), "post1", false, false), formal(tripleArray(), "pre2", false, false), formal(tripleArray(), "point2", false, false), formal(tripleArray(), "post2", false, false), formal(primReal(), "fuzz", false, false)); addFunc(ve, run::gen226, primString() , "VERSION"); - addFunc(ve, run::gen227, primVoid(), "quiet", formal(primBoolean(), "v", false, false)); - addFunc(ve, run::gen228, primVoid(), "atexit", formal(voidFunction(), "f", false, false)); - addFunc(ve, run::gen229, voidFunction(), "atexit"); - addFunc(ve, run::gen230, primInt(), "merge", formal(stringArray(), "files", false, false), formal(primString(), "args", false, false), formal(primString(), "format", false, false), formal(primBoolean(), "keep", false, false)); - addFunc(ve, run::gen251, intArray(), "sequence", formal(primInt(), "n", false, false)); - addFunc(ve, run::gen253, primBoolean(), "all", formal(boolArray(), "a", false, false)); - addFunc(ve, run::gen254, boolArray(), "!", formal(boolArray(), "a", false, false)); - addFunc(ve, run::gen255, primInt(), "sum", formal(boolArray(), "a", false, false)); - addFunc(ve, run::gen260, primInt(), "find", formal(boolArray(), "a", false, false), formal(primInt(), "n", true, false)); - addFunc(ve, run::gen262, realArray(), "tridiagonal", formal(realArray(), "a", false, false), formal(realArray(), "b", false, false), formal(realArray(), "c", false, false), formal(realArray(), "f", false, false)); - addFunc(ve, run::gen264, primBoolean(), "==", formal(primFile(), "a", false, false), formal(primFile(), "b", false, false)); - addFunc(ve, run::gen265, primBoolean(), "!=", formal(primFile(), "a", false, false), formal(primFile(), "b", false, false)); - addFunc(ve, run::gen268, primFile(), "input", formal(primString() , "name", false, false), formal(primBoolean(), "check", true, false), formal(primString() , "comment", true, false)); - addFunc(ve, run::gen269, primFile(), "output", formal(primString() , "name", false, false), formal(primBoolean(), "append", true, false)); - addFunc(ve, run::gen270, primFile(), "xinput", formal(primString() , "name", false, false), formal(primBoolean(), "check", true, false)); - addFunc(ve, run::gen271, primFile(), "xoutput", formal(primString() , "name", false, false), formal(primBoolean(), "append", true, false)); - addFunc(ve, run::gen272, primBoolean(), "eof", formal(primFile(), "file", false, false)); - addFunc(ve, run::gen273, primBoolean(), "eol", formal(primFile(), "file", false, false)); - addFunc(ve, run::gen274, primBoolean(), "error", formal(primFile(), "file", false, false)); - addFunc(ve, run::gen275, primVoid(), "clear", formal(primFile(), "file", false, false)); - addFunc(ve, run::gen276, primVoid(), "close", formal(primFile(), "file", false, false)); - addFunc(ve, run::gen277, primVoid(), "precision", formal(primFile(), "file", false, false), formal(primInt(), "digits", false, false)); - addFunc(ve, run::gen278, primVoid(), "flush", formal(primFile(), "file", false, false)); - addFunc(ve, run::gen279, primString() , "getc", formal(primFile(), "file", false, false)); - addFunc(ve, run::gen280, primFile(), "dimension", formal(primFile(), "file", false, false), formal(primInt(), "nx", false, false)); - addFunc(ve, run::gen281, primFile(), "dimension", formal(primFile(), "file", false, false), formal(primInt(), "nx", false, false), formal(primInt(), "ny", false, false)); - addFunc(ve, run::gen282, primFile(), "dimension", formal(primFile(), "file", false, false), formal(primInt(), "nx", false, false), formal(primInt(), "ny", false, false), formal(primInt(), "nz", false, false)); - addFunc(ve, run::gen283, primFile(), "csv", formal(primFile(), "file", false, false), formal(primBoolean(), "b", true, false)); - addFunc(ve, run::gen284, primFile(), "line", formal(primFile(), "file", false, false), formal(primBoolean(), "b", true, false)); - addFunc(ve, run::gen285, primFile(), "single", formal(primFile(), "file", false, false), formal(primBoolean(), "b", true, false)); - addFunc(ve, run::gen286, primFile(), "read1", formal(primFile(), "file", false, false)); - addFunc(ve, run::gen287, primFile(), "read2", formal(primFile(), "file", false, false)); - addFunc(ve, run::gen288, primFile(), "read3", formal(primFile(), "file", false, false)); + addFunc(ve, run::gen227, primString() , "TEXENGINE"); + addFunc(ve, run::gen228, primVoid(), "quiet", formal(primBoolean(), "v", false, false)); + addFunc(ve, run::gen229, primVoid(), "atexit", formal(voidFunction(), "f", false, false)); + addFunc(ve, run::gen230, voidFunction(), "atexit"); + addFunc(ve, run::gen231, primInt(), "merge", formal(stringArray(), "files", false, false), formal(primString(), "args", false, false), formal(primString(), "format", false, false), formal(primBoolean(), "keep", false, false)); + addFunc(ve, run::gen252, intArray(), "sequence", formal(primInt(), "n", false, false)); + addFunc(ve, run::gen254, primBoolean(), "all", formal(boolArray(), "a", false, false)); + addFunc(ve, run::gen255, boolArray(), "!", formal(boolArray(), "a", false, false)); + addFunc(ve, run::gen256, primInt(), "sum", formal(boolArray(), "a", false, false)); + addFunc(ve, run::gen261, primInt(), "find", formal(boolArray(), "a", false, false), formal(primInt(), "n", true, false)); + addFunc(ve, run::gen263, realArray(), "tridiagonal", formal(realArray(), "a", false, false), formal(realArray(), "b", false, false), formal(realArray(), "c", false, false), formal(realArray(), "f", false, false)); + addFunc(ve, run::gen265, primBoolean(), "==", formal(primFile(), "a", false, false), formal(primFile(), "b", false, false)); + addFunc(ve, run::gen266, primBoolean(), "!=", formal(primFile(), "a", false, false), formal(primFile(), "b", false, false)); + addFunc(ve, run::gen269, primFile(), "input", formal(primString() , "name", false, false), formal(primBoolean(), "check", true, false), formal(primString() , "comment", true, false)); + addFunc(ve, run::gen270, primFile(), "output", formal(primString() , "name", false, false), formal(primBoolean(), "append", true, false)); + addFunc(ve, run::gen271, primFile(), "xinput", formal(primString() , "name", false, false), formal(primBoolean(), "check", true, false)); + addFunc(ve, run::gen272, primFile(), "xoutput", formal(primString() , "name", false, false), formal(primBoolean(), "append", true, false)); + addFunc(ve, run::gen273, primBoolean(), "eof", formal(primFile(), "file", false, false)); + addFunc(ve, run::gen274, primBoolean(), "eol", formal(primFile(), "file", false, false)); + addFunc(ve, run::gen275, primBoolean(), "error", formal(primFile(), "file", false, false)); + addFunc(ve, run::gen276, primVoid(), "clear", formal(primFile(), "file", false, false)); + addFunc(ve, run::gen277, primVoid(), "close", formal(primFile(), "file", false, false)); + addFunc(ve, run::gen278, primVoid(), "precision", formal(primFile(), "file", false, false), formal(primInt(), "digits", false, false)); + addFunc(ve, run::gen279, primVoid(), "flush", formal(primFile(), "file", false, false)); + addFunc(ve, run::gen280, primString() , "getc", formal(primFile(), "file", false, false)); + addFunc(ve, run::gen281, primFile(), "dimension", formal(primFile(), "file", false, false), formal(primInt(), "nx", false, false)); + addFunc(ve, run::gen282, primFile(), "dimension", formal(primFile(), "file", false, false), formal(primInt(), "nx", false, false), formal(primInt(), "ny", false, false)); + addFunc(ve, run::gen283, primFile(), "dimension", formal(primFile(), "file", false, false), formal(primInt(), "nx", false, false), formal(primInt(), "ny", false, false), formal(primInt(), "nz", false, false)); + addFunc(ve, run::gen284, primFile(), "csv", formal(primFile(), "file", false, false), formal(primBoolean(), "b", true, false)); + addFunc(ve, run::gen285, primFile(), "line", formal(primFile(), "file", false, false), formal(primBoolean(), "b", true, false)); + addFunc(ve, run::gen286, primFile(), "single", formal(primFile(), "file", false, false), formal(primBoolean(), "b", true, false)); + addFunc(ve, run::gen287, primFile(), "read1", formal(primFile(), "file", false, false)); + addFunc(ve, run::gen288, primFile(), "read2", formal(primFile(), "file", false, false)); + addFunc(ve, run::gen289, primFile(), "read3", formal(primFile(), "file", false, false)); } } // namespace trans diff -r 57c230047c98 runtime.in --- a/runtime.in Tue Feb 07 23:34:29 2006 -0500 +++ b/runtime.in Tue Apr 25 00:28:42 2006 -0400 @@ -1878,6 +1878,12 @@ string VERSION() return VERSION; } \f +// for exporting to the .asy world how labels are to be processed +string TEXENGINE() +{ + return getSetting<mem::string>("tex"); +} +\f void quiet(bool v) { Setting("interactiveView")= diff -r 57c230047c98 settings.cc --- a/settings.cc Tue Feb 07 23:34:29 2006 -0500 +++ b/settings.cc Tue Apr 25 00:28:42 2006 -0400 @@ -399,7 +399,7 @@ struct alignSetting : public argumentSet value=(int)BOTTOM; else if (str=="Z") { value=(int)ZERO; - Setting("tex")=false; + Setting("tex")="none"; } else { error("invalid argument for option"); @@ -631,9 +631,11 @@ void initSettings() { addOption(new incrementSetting("verbose", 'v', "Increase verbosity level", &verbose)); addOption(new boolSetting("keep", 'k', "Keep intermediate files")); - addOption(new boolSetting("tex", 0, - "Enable LaTeX label postprocessing (default)", - true)); + // changing tex from bool to string means that '-notex' no longer works. + // instead: '-tex none' + addOption(new stringSetting("tex", 't', "engine", + "TeX engine for labels: tex, latex (default), none", + "latex")); addOption(new boolSetting("inlinetex", 0, "")); addOption(new boolSetting("parseonly", 'p', "Parse test")); addOption(new boolSetting("translate", 's', "Translate test")); @@ -669,7 +671,6 @@ void initSettings() { addOption(new envSetting("pdfviewer", defaultPDFViewer)); addOption(new envSetting("psviewer", defaultPSViewer)); addOption(new envSetting("gs", defaultGhostscript)); - addOption(new envSetting("latex", "latex")); addOption(new envSetting("dvips", "dvips")); addOption(new envSetting("convert", "convert")); addOption(new envSetting("display", defaultDisplay)); diff -r 57c230047c98 texfile.cc --- a/texfile.cc Tue Feb 07 23:34:29 2006 -0500 +++ b/texfile.cc Tue Apr 25 00:28:42 2006 -0400 @@ -41,19 +41,39 @@ void texfile::prologue() void texfile::prologue() { texdefines(*out); - if(!getSetting<bool>("inlinetex")) - *out << "\\pagestyle{empty}" << newl - << "\\textheight=2048pt" << newl - << "\\textwidth=\\textheight" << newl - << "\\begin{document}" << newl; + if(!getSetting<bool>("inlinetex")) { + if (getSetting<mem::string>("tex") == "tex") + *out << "\\nopagenumbers" << newl + << "\\hsize=2048pt" << newl + << "\\vsize=\\hsize" << newl; + else if (getSetting<mem::string>("tex") == "latex") + *out << "\\pagestyle{empty}" << newl + << "\\textheight=2048pt" << newl + << "\\textwidth=\\textheight" << newl + << "\\begin{document}" << newl; + else { // unknown engine + cerr << "Unknown engine: " << getSetting<mem::string>("tex") << newl; + abort(); + } + } *out << "\\psset{unit=1pt}" << newl; } void texfile::beginlayer(const string& psname) { - *out << "\\setbox\\ASYpsbox=\\hbox{\\includegraphics{" << psname << "}}%" + string includecmd; + + if (getSetting<mem::string>("tex") == "tex") + includecmd = "\\epsfbox{"; + else if (getSetting<mem::string>("tex") == "latex") + includecmd = "\\includegraphics{"; + else { // + cerr << "Unknown engine: " << getSetting<mem::string>("tex") << newl; + abort (); + } + *out << "\\setbox\\ASYpsbox=\\hbox{" << includecmd << psname << "}}%" << newl - << "\\includegraphics{" << psname << "}%" << newl; + << includecmd << psname << "}%" << newl; } void texfile::endlayer() @@ -90,12 +110,13 @@ void texfile::setpen(pen p) } if(p.size() != lastpen.size() || p.Lineskip() != lastpen.Lineskip()) { + // need to fix if not using latex (change fontsize and baselineskip) *out << "\\fontsize{" << p.size() << "}{" << p.Lineskip() << "}\\selectfont" << newl; } if(p.Font() != lastpen.Font()) { - *out << p.Font() << "%" << newl; + *out << p.Font() << "%" << newl; // need to change fonts differently in tex } offset=pair(box.right,box.bottom); diff -r 57c230047c98 texfile.h --- a/texfile.h Tue Feb 07 23:34:29 2006 -0500 +++ b/texfile.h Tue Apr 25 00:28:42 2006 -0400 @@ -55,8 +55,14 @@ template<class T> template<class T> void texdocumentclass(T& out, bool pipe=false) { - if(pipe || !settings::getSetting<bool>("inlinetex")) - out << "\\documentclass[12pt]{article}" << newl; + if(pipe || !settings::getSetting<bool>("inlinetex")) { + if (settings::getSetting<mem::string>("tex") == "latex") + out << "\\documentclass[12pt]{article}" << newl; + else if (settings::getSetting<mem::string>("tex") != "tex") { + cerr << "Unknown engine: " << settings::getSetting<mem::string>("tex") << newl; + abort(); + } + } } template<class T> @@ -85,8 +91,17 @@ void texdefines(T& out, stringlist& prea << "\\def\\ASYscale(#1,#2)(#3,#4)(#5,#6)#7#8{%" << newl << "\\ASYalign(#1,#2)(#3,#4){#7}{\\scalebox{#5}[#6]{#8}}}%" << newl; - if(pipe || !settings::getSetting<bool>("inlinetex")) - out << "\\usepackage{pstricks,graphicx}" << newl; + if(pipe || !settings::getSetting<bool>("inlinetex")) { + if (settings::getSetting<mem::string>("tex") == "tex") + out << "\\input epsf" << newl + << "\\input pstricks" << newl; + else if (settings::getSetting<mem::string>("tex") == "latex") + out << "\\usepackage{pstricks,graphicx}" << newl; + else { + cerr << "Unknown engine: " << settings::getSetting<mem::string>("tex") << newl; + abort (); + } + } } class texfile : public gc { diff -r 57c230047c98 .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Tue Apr 25 00:28:42 2006 -0400 @@ -0,0 +1,3 @@ +syntax: glob +*~ +*.o ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 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 0 siblings, 2 replies; 32+ messages in thread From: Hans Hagen @ 2006-04-25 7:04 UTC (permalink / raw) 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 ----------------------------------------------------------------- ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-25 7:04 ` Hans Hagen @ 2006-04-25 8:02 ` Taco Hoekwater 2006-04-25 15:17 ` Sanjoy Mahajan 1 sibling, 0 replies; 32+ messages in thread From: Taco Hoekwater @ 2006-04-25 8:02 UTC (permalink / raw) Hans Hagen wrote: > > looks parsable But you see only a small bit of the actual output ;-) From Mojca: >>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. I've asked this to a wide range of people and have never, ever gotten an answer that is even close to usable for development purposes: What is actually needed to make it easy to do 3D in MP? >>3. Modern color models (cmyk, transparency) cmyk color model is older.much than rgb :-) It would not be hard to add the cmyk color space, but transparancy can not easily be done in PostScript output (it would require overlap removal code, and that is not present at all). >>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 >> True. But then again, you do not _really_ need vardef macros. Cheers, Taco ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-25 7:04 ` Hans Hagen 2006-04-25 8:02 ` Taco Hoekwater @ 2006-04-25 15:17 ` Sanjoy Mahajan 1 sibling, 0 replies; 32+ messages in thread From: Sanjoy Mahajan @ 2006-04-25 15:17 UTC (permalink / raw) From: Hans Hagen <pragma@wxs.nl> > [asymptote eps] looks parsable Those lines are only a bit of the output. It's preceded by horrible pstricks and font code to parse (about 800 lines in that eps file). I'm not sure why asymptote decided to use pstricks. I think it's for figure inclusion, but there have to be other, less hacky ways. >> + if (texengine == "tex") >> + abort("No babel package in plain TeX."); >> texpreamble("\usepackage["+s+"]{babel}"); > btw, it should be: > if texengine == latex then texpreamble ... > else you need an abort for each macro package Yeah, I'm not proud of it. By that point in the patching, I mostly despaired of finding all the hardcoded latex spots and just added the quickest hack to get something to work ("When the going gets tough, the tough lower their standards.") Not that it worked in the end. From: Taco Hoekwater <taco@elvenkind.com> > It would not be hard to add the cmyk color space, but transparancy > can not easily be done in PostScript output (it would require > overlap removal code, and that is not present at all). That's true, and the pdfmark hack added to postscript doesn't support sending transparency information to a distiller (e.g. ps2pdf or Acrobat distiller). At least, it doesn't from what I could tell by looking in the PDFmark reference manual from Adobe: <http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/pdf_creation_apis_and_specs/pdfmarkReference.pdf> Maybe it's time to abandon postscript and generate pdf directly? About the only reason I sometimes run (non-pdf)tex is because I was too lazy to convert metapost figures to pdf and hadn't added the scons or Makefile rules to convert them automatically. > I've been browsing a bit and I now know it has more of a C++ style > of doing things, but personally I don't see that as a big advantage. I agree. Although perhaps related to the new syntax or the new implementation: it's useful to have many mathematical functions ready to use for graphing -- the asymptote authors keep adding functions from the GNU scientific library -- instead of having to divide or multiply by 256 (the metapost log and exp functions) or worry about overrunning the integer range (and use the sarith package in MP). > But more importantly, most of my illustrations depend heavily on the > equation solving capabilities of MetaPost. I got the impression > Asymptote cannot do that (but I may have missed something). Right, I like the implicit equation solving in MP and find it very intuitive and matched to how I think about figures. Asymptote has only explicit equation solving. Laurence said (on the metapost list) that his 3D package for MP doesn't have implicit solving either -- I guess because the 3D objects are not native to MP so they don't benefit from the built-in equation solver. Maybe making 3d points native to MP is part of an answer to: What is actually needed to make it easy to do 3D in MP? But I'm far from an expert in 3D drawings or MP, and maybe one of the MP experts has more useful thoughts. -Sanjoy `Never underestimate the evil of which men of power are capable.' --Bertrand Russell, _War Crimes in Vietnam_, chapter 1. ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-21 16:45 ` Hans Hagen 2006-04-21 18:29 ` Jilani Khaldi @ 2006-04-21 19:37 ` Sanjoy Mahajan 2006-04-21 23:30 ` Mojca Miklavec 1 sibling, 1 reply; 32+ messages in thread From: Sanjoy Mahajan @ 2006-04-21 19:37 UTC (permalink / raw) I started rewriting the asymptote code to use plain TeX -- I had never used ConTeXt back then, so didn't even try to make that work. But maybe the TeX changes will help those more expert in ConTeXt to make them. I'll dig out my half-finished changes for public onsumption. The asymptote authors said that they welcome asymptote working with other tex formats (someone else had asked about ConTeXt), and prefer, rather than their having to modify it themselves, that users of those formats submit the changes (they use LaTeX themselves). -Sanjoy ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-21 19:37 ` Sanjoy Mahajan @ 2006-04-21 23:30 ` Mojca Miklavec 0 siblings, 0 replies; 32+ messages in thread From: Mojca Miklavec @ 2006-04-21 23:30 UTC (permalink / raw) On 4/21/06, Sanjoy Mahajan wrote: > I started rewriting the asymptote code to use plain TeX -- I had never > used ConTeXt back then, so didn't even try to make that work. But > maybe the TeX changes will help those more expert in ConTeXt to make > them. I'll dig out my half-finished changes for public onsumption. > > The asymptote authors said that they welcome asymptote working with > other tex formats (someone else had asked about ConTeXt), Probably me ;) But I've given up once I saw how harcoded LaTeX was in there. 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. For me Asymptote to Metapost is like XeTeX to TeX: I think that the first one is better, but I "can't" use it. (3D, animation & big numbers support would be more than urgent for metapost, but it's so complex to modify the code that I can understand why it's easier to write a new engine like Asymptote than extending the old metapost.) There's a very similar situation with hardcoded LaTeX in PyX, Wiki2PDF, ... Well, people who write those don't write it with anything else but LaTeX in mind which is a pitty. > and prefer, > rather than their having to modify it themselves, that users of those > formats submit the changes (they use LaTeX themselves). And thanks to Jilani for pointing out the existence of Tioga. Mojca ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: ConTeXt + asymptote 2006-04-21 15:49 Renaud AUBIN 2006-04-21 16:17 ` Renaud AUBIN @ 2006-04-25 7:52 ` Taco Hoekwater 1 sibling, 0 replies; 32+ messages in thread From: Taco Hoekwater @ 2006-04-25 7:52 UTC (permalink / raw) I've posted this to the metapost list as well: > I like metapost but, according to the following mail (on the metapost ML): > > [metapost] MP vs. Asymptote > I don't want to start a flame, but since someone posted a message some > time ago mentioning Asymptote I got curious and I have to say that I was > very impressed, even if I still have some problems with it. However, it > seems a net improvement over MP, or not? Is there anyone with an > informed opinion over Asymptote? Might Asymptote be the killer of MP? I am extremely interested in what you feel the improvements are in Asymptote compared to MP, because it would give some clues to the direction MP development should take. I've been browsing a bit and I now know it has more of a C++ style of doing things, but personally I don't see that as a big advantage. Just like Laurence, I simply like the MF/MP 'feel'. But more importantly, most of my illustrations depend heavily on the equation solving capabilities of MetaPost. I got the impression Asymptote cannot do that (but I may have missed something). Cheers, Taco ^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2006-10-15 5:04 UTC | newest] Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2006-10-15 5:04 ConTeXt + asymptote John Bowman -- strict thread matches above, loose matches on Subject: below -- 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-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
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).