from latex & pstricks to context
Bonjour, i am transferring sources from latex to context. so i write separate files for every pstricks part and compile in a pdf-file (tex -> dvips -> epstopdf) with a script; finally the graphics go into the the text by \externalfigure ... 1. is there a better way ? 2. is there a way to translate Latex -> Context ? PS: i dont like metapost René Bastian --
On Mon, Jul 13, 2009 at 9:55 AM, R. Bastian
Bonjour,
i am transferring sources from latex to context.
so i write separate files for every pstricks part and compile in a pdf-file (tex -> dvips -> epstopdf) with a script; finally the graphics go into the the text by \externalfigure ...
1. is there a better way ?
no, or I don't know anything better Maybe you can write your own macro in context using \executesystemcommand
2. is there a way to translate Latex -> Context ?
AFAIK, not in an automatic fashion
PS: i dont like metapost
hmm, you should change your mind here.. metapost and context are very well integrated :) -- luigi
On Mon, 13 Jul 2009 10:11:33 +0200
luigi scarso
On Mon, Jul 13, 2009 at 9:55 AM, R. Bastian
wrote: Bonjour,
[...]
PS: i dont like metapost
hmm, you should change your mind here.. metapost and context are very well integrated :)
yo lo sé, and i regreat ;-)
-- luigi
--
On Mon, Jul 13, 2009 at 11:05 AM, R. Bastian
On Mon, 13 Jul 2009 10:11:33 +0200 luigi scarso
scribit: On Mon, Jul 13, 2009 at 9:55 AM, R. Bastian
wrote: Bonjour,
[...]
PS: i dont like metapost
hmm, you should change your mind here.. metapost and context are very well integrated :)
yo lo sé, and i regreat ;-)
..e su dai, dagli una possibilità.... :) -- luigi
Am 13.07.2009 um 09:55 schrieb R. Bastian:
Bonjour,
i am transferring sources from latex to context.
so i write separate files for every pstricks part and compile in a pdf-file (tex -> dvips -> epstopdf) with a script; finally the graphics go into the the text by \externalfigure ...
1. is there a better way ?
\usemodule[pstricks] \startPSTRICKS ... \stopPSTRICKS Wolfgang
On Mon, Jul 13, 2009 at 10:19 AM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
Am 13.07.2009 um 09:55 schrieb R. Bastian:
Bonjour,
i am transferring sources from latex to context.
so i write separate files for every pstricks part and compile in a pdf-file (tex -> dvips -> epstopdf) with a script; finally the graphics go into the the text by \externalfigure ...
1. is there a better way ?
\usemodule[pstricks]
\startPSTRICKS ... \stopPSTRICKS
which is an elaborate wrapper around \executesystemcommand -- luigi
On Mon, 13 Jul 2009 10:19:32 +0200
Wolfgang Schuster
Am 13.07.2009 um 09:55 schrieb R. Bastian:
Bonjour,
i am transferring sources from latex to context.
so i write separate files for every pstricks part and compile in a pdf-file (tex -> dvips -> epstopdf) with a script; finally the graphics go into the the text by \externalfigure ...
1. is there a better way ?
\usemodule[pstricks]
"are you schuhr ? (c)" Nebenbei : the doc http://source.contextgarden.net/m-pstric.tex says "%M \usemodule[pstric] etc" i tried \usemodule[pstricks] and:
\startPSTRICKS ... \stopPSTRICKS
Wolfgang
but the result is the same : dummy What is the sense of \startPSTRICKS ... \stopPSTRICKS ? rb --
On Mon, Jul 13, 2009 at 11:05 AM, R. Bastian
What is the sense of \startPSTRICKS ... \stopPSTRICKS ?
A wrapper around \executesystemcommand, \long\def\dostartPSTRICKS[#1]#2\stopPSTRICKS {\doifelse{\jobsuffix}{dvi} % will some day move to app as switch {\hbox{#2}} {\startTEXapplication[#1]{\usemodule[pstric]}#2\stopTEXapplication}} for \startTEXapplication see page-app.tex \long\def\dostartTEXapplication[#1]#2#3\stopTEXapplication {\bgroup \bgroup \let\f!temporaryextension\c!tex \setbuffer[\@@texapp]% \starttext #2% preamble \startTEXpage[#1]% \topskip\zeropoint \setbox\scratchbox\hbox{#3}% \saveTEXapplication02% dimensions \box\scratchbox \stopTEXpage \stoptext \endbuffer \egroup \doifelse\jobsuffix{dvi}\donetrue\donefalse \executesystemcommand{texexec \bufferprefix\@@texapp.tex --once --batch}% \ifdone % eps \executesystemcommand{dvips -E* -o \@@texapp.eps \@@texapp}% \else % pdf \executesystemcommand{dvips \bufferprefix\@@texapp}% \executesystemcommand{ps2pdf \bufferprefix\@@texapp.ps\bufferprefix\@@texapp.pdf}% % \executesystemcommand{texmfstart pstopdf \bufferprefix\@@texapp.ps\bufferprefix\@@texapp.pdf}% \fi \restoreTEXapplication % dimensions \doifelse\jobsuffix{dvi}\donetrue\donefalse \setbox\scratchbox\hbox {\expanded{\externalfigure [\bufferprefix\@@texapp.\ifdone eps\else pdf\fi] [\c!object=\v!no]}}% \setbox\scratchbox\hbox {\lower\ht\scratchbox\hbox{\raise\dimen2\box\scratchbox}}% \wd\scratchbox\dimen0 \ht\scratchbox\dimen2 \dp\scratchbox\zeropoint \box\scratchbox \egroup} I suppose that works ok in mkii, but maybe not in mkiv so the actually the best way is (imho) make pdf images using traditional way (latex+dvips) and include them by \externalfigure -- luigi
On Mon, Jul 13, 2009 at 11:23 AM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
Am 13.07.2009 um 11:14 schrieb luigi scarso:
\executesystemcommand{texexec \bufferprefix\@@texapp.tex --once
--batch}%
I suppose that works ok in mkii, but maybe not in mkiv
You're wrong, it will only work when you enable the dvi/dvips backend.
not so sure by default \executesystemcommand{texexec \bufferprefix\@@texapp.tex --once --batch}% (line 151 on page-app.tex) gives a dvi file ( \executesystemcommand{texexec --pdf \bufferprefix\@@texapp.tex --once --batch}% gives a pdf ) -- luigi
Am 13.07.2009 um 11:37 schrieb luigi scarso:
by default \executesystemcommand{texexec \bufferprefix\@@texapp.tex --once -- batch}% (line 151 on page-app.tex) gives a dvi file ( \executesystemcommand{texexec --pdf \bufferprefix\@@texapp.tex --once --batch}% gives a pdf )
that's weird because 'texexec file' without any parameter gives for me pdf since many years and this is also what I got when I tried the pstricks module in the past Wolfgang
Wolfgang Schuster wrote:
Am 13.07.2009 um 11:37 schrieb luigi scarso:
by default \executesystemcommand{texexec \bufferprefix\@@texapp.tex --once --batch}% (line 151 on page-app.tex) gives a dvi file ( \executesystemcommand{texexec --pdf \bufferprefix\@@texapp.tex --once --batch}% gives a pdf )
that's weird because 'texexec file' without any parameter gives for me pdf since many years and this is also what I got when I tried the pstricks module in the past
This was changed a while back: texexec by default generates pdf these days (I've been bitten by that as well)
On Mon, Jul 13, 2009 at 11:53 AM, Taco Hoekwater
that's weird because 'texexec file' without any parameter gives for me pdf since many years and this is also what I got when I tried the
pstricks
module in the past
This was changed a while back: texexec by default generates pdf these days (I've been bitten by that as well)
true nowadays imho, it's better include pdf externalfigure made in traditional way . -- luigi
Thanks for your answers. I will compile the old figures in the traditional way and include the pdf with \externalfigure \usemodule[pstricks] \startPSTRICKS ... \stopPSTRICKS does not work on my Minimal installation. For the new figures, I must ... metapost, metaobj, tikz, but also with pyx & reportlab. René Bastian --
On Mon, 13 Jul 2009 18:03:19 +0200
luigi scarso
but also with pyx & reportlab.
Beware of proper fonts inclusion when you use these tools
Yes, I suppose the best is to make figures without any font. In my case, the canvas concept of pyx is a very good tool to draw scores which expand over n pages.
-- luigi
--
Am 13.07.2009 um 17:12 schrieb R. Bastian:
Thanks for your answers.
I will compile the old figures in the traditional way and include the pdf with \externalfigure
\usemodule[pstricks] \startPSTRICKS ... \stopPSTRICKS does not work on my Minimal installation.
As I said the pstricks was never updated to changes in ConTeXt a few years ago where pdf was set as default output and with uninterested after the module didn't work at the first time this will never change. Wolfgang
Am 13.07.2009 um 11:05 schrieb R. Bastian:
1. is there a better way ?
\usemodule[pstricks]
"are you schuhr ? (c)"
Yes I am.
Nebenbei : the doc http://source.contextgarden.net/m-pstric.tex says "%M \usemodule[pstric] etc"
'pstricks' is a synonym for 'pstric' and there are more of them for the many presentation styles.
i tried \usemodule[pstricks] and:
\startPSTRICKS ... \stopPSTRICKS
but the result is the same : dummy
I explained why this happen a while ago in a longer thread, the short version is: ConTeXt produce pdf files by default while pstricks requires dvi -> ps and to do this modifications in the pstricks module have to be done.
What is the sense of \startPSTRICKS ... \stopPSTRICKS ?
The code between \startPSTRICKS ... \stopPSTRICKS is written to a external file which is then converted to pdf and afterwards included as figure (the same procedure as the pst-pdf or whatever is the current method use). Wolfgang
What is the sense of \startPSTRICKS ... \stopPSTRICKS ?
Maybe he meant: \startpspicture \stoppspicture The actual macros of pstricks are defined in pstricks.tex and that is all Plain TeX. I myself generally would do something like this in Plain TeX \input pstricks \pspicture(0,0)(2,2) \psline(1,1)(2,2) \endpspicture \bye and In LaTeX actually if you want to define an environment, you can use \def\environment and \def\endenvironment. I guess then you could probably use it in ConTeXt as \startpspicture \stoppspicture and you can probable load pstricks by saying \usemodule[pstricks] or anything that context uses.
On Mon, Jul 13, 2009 at 09:55, R. Bastian wrote:
Bonjour,
i am transferring sources from latex to context.
so i write separate files for every pstricks part and compile in a pdf-file (tex -> dvips -> epstopdf) with a script; finally the graphics go into the the text by \externalfigure ...
1. is there a better way ?
2. is there a way to translate Latex -> Context ?
PS: i dont like metapost
If you don't like metapost, you could take a look at TikZ. It's very similar to PStricks, more portable and extremely poverful. Mojca
On Mon, 13 Jul 2009 10:46:53 +0200
Mojca Miklavec
On Mon, Jul 13, 2009 at 09:55, R. Bastian wrote:
Bonjour,
i am transferring sources from latex to context.
so i write separate files for every pstricks part and compile in a pdf-file (tex -> dvips -> epstopdf) with a script; finally the graphics go into the the text by \externalfigure ...
1. is there a better way ?
2. is there a way to translate Latex -> Context ?
PS: i dont like metapost
If you don't like metapost, you could take a look at TikZ. It's very similar to PStricks, more portable and extremely poverful.
I tried the example http://wiki.contextgarden.net/TikZ texexec compiled it but with an error on "coordinate" Thanks for the tip.
Mojca ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
--
On Mon, Jul 13, 2009 at 11:23, R. Bastian
On Mon, 13 Jul 2009 10:46:53 +0200 Mojca Miklavec
scribit: On Mon, Jul 13, 2009 at 09:55, R. Bastian wrote:
Bonjour,
i am transferring sources from latex to context.
so i write separate files for every pstricks part and compile in a pdf-file (tex -> dvips -> epstopdf) with a script; finally the graphics go into the the text by \externalfigure ...
1. is there a better way ?
2. is there a way to translate Latex -> Context ?
PS: i dont like metapost
If you don't like metapost, you could take a look at TikZ. It's very similar to PStricks, more portable and extremely poverful.
I tried the example http://wiki.contextgarden.net/TikZ
texexec compiled it but with an error on "coordinate"
Thanks for the tip.
Mojca ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
--
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
(I'm sorry, problems with computer, I'm afraid that I just sent an empty reply ...) On Mon, Jul 13, 2009 at 11:23, R. Bastian wrote:
I tried the example http://wiki.contextgarden.net/TikZ
texexec compiled it but with an error on "coordinate"
I think it's best to ask the author. When compiling with MKIV (context filename) it doesn't report any error, but it doesn't draw the line either. I have no idea what could possibly go wrong. You may uncomment these two lines \draw[important line,orange!80!black] (1,0) -- node[right=1pt,fill=white] { $\displaystyle \tan \alpha \black = \frac{{\red \sin \alpha}}{\blue \cos \alpha}$} (intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t); \draw (0,0) -- (t); and the rest should work. I mean: under normal usage, most things that you'll want to try will work. If not, the author usually fixes the bugs rather quickly. (I was testing with ConTeXt ver: 2009.06.14 21:01.) Mojca
R. Bastian a écrit :
2. is there a way to translate Latex -> Context ?
PS: i dont like metapost Salut,
From my humble experience, I have faced the very same dilemna (back in 2003) and... I have switched to metapost... Did you try to use metapost + metaobj ? See sections 10.3 and 7.7 of http://tex.loria.fr/prod-graph/momanual.pdf. What's the complexity of your graphics? Did you use special pst-circ stuffs or others? If you choose "to get stuck" with pstricks because you don't like metapost, you should use \externalfigure. Renaud
participants (7)
-
luigi scarso
-
Mojca Miklavec
-
R. Bastian
-
Renaud Aubin
-
Taco Hoekwater
-
Vafa Khalighi
-
Wolfgang Schuster