ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* pstrics module again
@ 2013-11-25 18:05 DesdeChaves
  2013-11-25 18:55 ` Aditya Mahajan
  0 siblings, 1 reply; 10+ messages in thread
From: DesdeChaves @ 2013-11-25 18:05 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 486 bytes --]

Dear sirs

The pstrics module don't work anymore. I tried to run this simple code but
I found a lot of errors.

\usemodule[pstric]
\starttext
\startPSTRICKS
\pspicture(0,0)(20,20)
\psline(0,0)(20,20)
\psline(1,1)(10,10)
\endpspicture
\stopPSTRICKS
\stoptext


This module is no longer supported?
There is still any hope of being able to use pstric and some of its
extensions (pst-spectra, for example)?

Thanks a lot

Sorry for my persistence about pstrics module.

Thanks a lot

Jorge

[-- Attachment #1.2: Type: text/html, Size: 1403 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pstrics module again
  2013-11-25 18:05 pstrics module again DesdeChaves
@ 2013-11-25 18:55 ` Aditya Mahajan
  2013-11-25 19:19   ` Herbert Voss
  0 siblings, 1 reply; 10+ messages in thread
From: Aditya Mahajan @ 2013-11-25 18:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 25 Nov 2013, DesdeChaves wrote:

> Dear sirs
>
> The pstrics module don't work anymore. I tried to run this simple code but
> I found a lot of errors.
>
> \usemodule[pstric]
> \starttext
> \startPSTRICKS
> \pspicture(0,0)(20,20)
> \psline(0,0)(20,20)
> \psline(1,1)(10,10)
> \endpspicture
> \stopPSTRICKS
> \stoptext

It appears that pstrick files are no longer part of the standalone 
distribution, but if you copy a bunch of files, then the above example 
does work.

> This module is no longer supported?
> There is still any hope of being able to use pstric and some of its
> extensions (pst-spectra, for example)?

This is what I did.

1. Compile the file. You get an error that some pstrick file is missing. 
Locate that file in the texlive directory and copy it to the current 
directory.

2. Repeat until you get an error that \ifx! is not a valid control 
sequence.

3. Run `grep ifx! *.tex` and change all the "\ifx!#1" to "\ifx !#1".

4. Then you get an error that colo-rgb is missing. Copy colo-rgb.mkii to 
the current directory as colo-rgb.tex.

5. Then you get a error message the some .pro file is missing. Find that 
file from the texlive directory and copy it to the current directory. 
Repeat until all errors are resolved.

Finally you'll get the correct output.

So it seems that if pstricks is added back to the minimals (so that errors 
in step 1 and 5 don't happen), then it should be straightforward to get it 
to work with context. (Just load the file with the correct catcode regime, 
so that ! is a other character, and the error in step 2-3 will not 
happen). THe error in step 3 is easy to fix by editing m-pstricks.

Aditya
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pstrics module again
  2013-11-25 18:55 ` Aditya Mahajan
@ 2013-11-25 19:19   ` Herbert Voss
  2013-11-25 20:25     ` Aditya Mahajan
  0 siblings, 1 reply; 10+ messages in thread
From: Herbert Voss @ 2013-11-25 19:19 UTC (permalink / raw)
  To: ntg-context

Am 25.11.2013 19:55, schrieb Aditya Mahajan:

> This is what I did.
>
> 1. Compile the file. You get an error that some pstrick file is missing.
> Locate that file in the texlive directory and copy it to the current
> directory.
>
> 2. Repeat until you get an error that \ifx! is not a valid control
> sequence.
>
> 3. Run `grep ifx! *.tex` and change all the "\ifx!#1" to "\ifx !#1".

why does ConTeXt needs the space before the !  ??

Herbert

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pstrics module again
  2013-11-25 19:19   ` Herbert Voss
@ 2013-11-25 20:25     ` Aditya Mahajan
  2013-11-25 20:28       ` Herbert Voss
  0 siblings, 1 reply; 10+ messages in thread
From: Aditya Mahajan @ 2013-11-25 20:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 25 Nov 2013, Herbert Voss wrote:

> Am 25.11.2013 19:55, schrieb Aditya Mahajan:
>
>> This is what I did.
>> 
>> 1. Compile the file. You get an error that some pstrick file is missing.
>> Locate that file in the texlive directory and copy it to the current
>> directory.
>> 
>> 2. Repeat until you get an error that \ifx! is not a valid control
>> sequence.
>> 
>> 3. Run `grep ifx! *.tex` and change all the "\ifx!#1" to "\ifx !#1".
>
> why does ConTeXt needs the space before the !  ??

ConTeXt has two catcode regimes: the "standard" catcode regime and the 
"unprotected" catcode regime.

In the "unprotected" catcode regime, !, _, and @ are also letters. This is 
done so that one can use csnames such as \c!width, \!!plusone, etc. 
(Similar to \makeatletter in LaTeX).

I haven't looked at the actual code, but I am guessing that at some place, 
the following code is being called:

\unprotect
\input pstricks
\protect

and therefore when ConTeXt sees \ifx!#1 it thinks that \ifx! is a csname. 
Adding a space after \ifx avoids that.

As I said in my previous message, this is easy to fix at ConTeXt end 
defining an appropriate catcode regime before inputing pstricks.

So, the pstricks package does not need to be changed, but the ConTeXt code 
that is calling the package needs to be adapted.

Aditya
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pstrics module again
  2013-11-25 20:25     ` Aditya Mahajan
@ 2013-11-25 20:28       ` Herbert Voss
  2013-11-25 22:24         ` DesdeChaves
  0 siblings, 1 reply; 10+ messages in thread
From: Herbert Voss @ 2013-11-25 20:28 UTC (permalink / raw)
  To: ntg-context

Am 25.11.2013 21:25, schrieb Aditya Mahajan:

> \unprotect
> \input pstricks
> \protect
>
> and therefore when ConTeXt sees \ifx!#1 it thinks that \ifx! is a
> csname. Adding a space after \ifx avoids that.
>
> As I said in my previous message, this is easy to fix at ConTeXt end
> defining an appropriate catcode regime before inputing pstricks.
>
> So, the pstricks package does not need to be changed, but the ConTeXt
> code that is calling the package needs to be adapted.

ok, understood.

thanks,
Herbert
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pstrics module again
  2013-11-25 20:28       ` Herbert Voss
@ 2013-11-25 22:24         ` DesdeChaves
  2013-11-25 23:08           ` DesdeChaves
  0 siblings, 1 reply; 10+ messages in thread
From: DesdeChaves @ 2013-11-25 22:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1487 bytes --]

 radical solution

 Download and unpack the PSTRicks-TDS.tar to a directory
 cp ./PSTricks-TDS/tex/generic/*/*.tex .
 perl -pi.back -e 's/\ifx!#1/\ifx !#1/g;' *.tex
 rm -rf *.back
 cp /usr/local/texlive/2013/texmf-dist/tex/context/base/colo-rgb.mkii
./colo-rgb.tex
 run context

 change in m-pstric.* files ps2pdf to pstopdf

tanks a lot

Jorge


2013/11/25 Herbert Voss <Herbert.Voss@fu-berlin.de>

> Am 25.11.2013 21:25, schrieb Aditya Mahajan:
>
>
>  \unprotect
>> \input pstricks
>> \protect
>>
>> and therefore when ConTeXt sees \ifx!#1 it thinks that \ifx! is a
>> csname. Adding a space after \ifx avoids that.
>>
>> As I said in my previous message, this is easy to fix at ConTeXt end
>> defining an appropriate catcode regime before inputing pstricks.
>>
>> So, the pstricks package does not need to be changed, but the ConTeXt
>> code that is calling the package needs to be adapted.
>>
>
> ok, understood.
>
> thanks,
> Herbert
>
> ____________________________________________________________
> _______________________
> 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  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ____________________________________________________________
> _______________________
>



-- 
Atentamente

DesdeChaves

[-- Attachment #1.2: Type: text/html, Size: 2672 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pstrics module again
  2013-11-25 22:24         ` DesdeChaves
@ 2013-11-25 23:08           ` DesdeChaves
  2013-11-25 23:45             ` Aditya Mahajan
  2013-11-26  8:21             ` Herbert Voss
  0 siblings, 2 replies; 10+ messages in thread
From: DesdeChaves @ 2013-11-25 23:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2016 bytes --]

I d'ont know how to fix the picture size.
No errors at all, but the figure size isn't correct.

\usemodule[pstric]

\starttext


Hydrogen spectrum

\startPSTRICKS
\input pst-spectra.tex
\input pstricks-add.tex
\pspicture(0,-2.5)(\textwidth,1.6)
\psspectrum[element=H, emission](0,0)(\textwidth,1.5)
\rput(2,1){Hydrogen spetrum}
\endpspicture
\stopPSTRICKS




\stoptext


2013/11/25 DesdeChaves <desdechaves@gmail.com>

>  radical solution
>
>  Download and unpack the PSTRicks-TDS.tar to a directory
>  cp ./PSTricks-TDS/tex/generic/*/*.tex .
>  perl -pi.back -e 's/\ifx!#1/\ifx !#1/g;' *.tex
>  rm -rf *.back
>  cp /usr/local/texlive/2013/texmf-dist/tex/context/base/colo-rgb.mkii
> ./colo-rgb.tex
>  run context
>
>  change in m-pstric.* files ps2pdf to pstopdf
>
> tanks a lot
>
> Jorge
>
>
> 2013/11/25 Herbert Voss <Herbert.Voss@fu-berlin.de>
>
>> Am 25.11.2013 21:25, schrieb Aditya Mahajan:
>>
>>
>>  \unprotect
>>> \input pstricks
>>> \protect
>>>
>>> and therefore when ConTeXt sees \ifx!#1 it thinks that \ifx! is a
>>> csname. Adding a space after \ifx avoids that.
>>>
>>> As I said in my previous message, this is easy to fix at ConTeXt end
>>> defining an appropriate catcode regime before inputing pstricks.
>>>
>>> So, the pstricks package does not need to be changed, but the ConTeXt
>>> code that is calling the package needs to be adapted.
>>>
>>
>> ok, understood.
>>
>> thanks,
>> Herbert
>>
>> ____________________________________________________________
>> _______________________
>> 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  : http://foundry.supelec.fr/projects/contextrev/
>> wiki     : http://contextgarden.net
>> ____________________________________________________________
>> _______________________
>>
>
>
>
> --
> Atentamente
>
> DesdeChaves
>



-- 
Atentamente

DesdeChaves

[-- Attachment #1.2: Type: text/html, Size: 3799 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pstrics module again
  2013-11-25 23:08           ` DesdeChaves
@ 2013-11-25 23:45             ` Aditya Mahajan
  2013-11-25 23:53               ` Aditya Mahajan
  2013-11-26  8:21             ` Herbert Voss
  1 sibling, 1 reply; 10+ messages in thread
From: Aditya Mahajan @ 2013-11-25 23:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 25 Nov 2013, DesdeChaves wrote:

> I d'ont know how to fix the picture size.
> No errors at all, but the figure size isn't correct.

Confirmed.

> \usemodule[pstric]
>
> \starttext
>
> Hydrogen spectrum
>
> \startPSTRICKS
> \input pst-spectra.tex
> \input pstricks-add.tex
> \pspicture(0,-2.5)(\textwidth,1.6)
> \psspectrum[element=H, emission](0,0)(\textwidth,1.5)
> \rput(2,1){Hydrogen spetrum}
> \endpspicture
> \stopPSTRICKS
>
> \stoptext

The proper interface is

\usemodule[pstricks]

\usePSTRICKSmodule[pst-add]
\usePSTRICKSmodule[pst-spectra]

When you run the above file, ConTeXt creates the following temp file:

\starttext
     \pushcatcodetable
     \setcatcodetable\texcatcodes
     \usemodule[pstric]
     \readfile{pst-add}{}{}
\readfile{pst-spectra}{}{}
     \popcatcodetable
     \startTEXpage
         \hbox\bgroup
             \ignorespaces
\pspicture(0,-2.5)(\textwidth,1.6)
\psspectrum[element=H, emission](0,0)(\textwidth,1.5)
\rput(2,1){Hydrogen spetrum}
\endpspicture
             \removeunwantedspaces
         \egroup
         \obeydepth % temp hack as we need to figure this out
     \stopTEXpage
\stoptext

runs ""mtxrun --script texexec %s --once --dvips <filename>"
and then runs "ps2pdf inputname outputname"

but that generates the file with the wrong size. dvips gives the following 
error message:

' TeX output 2013.11.25:1841' -> test-pstricks-0001.ps
Page 1 may be too complex to print
dvips: no match for special paper size found; using default

(and that is the reason for the wrong paper size).

It has been years since I used dvips, so I don't remember how to correct 
that. Basically, the "bug" is with the following file:

\starttext
\startTEXpage
   What will happen now
\stopTEXpage
\stoptext

Process using "mtxrun --script test --dvips" and then "ps2pdf" and the 
resulting pdf file has the wrong bounding box.

Aditya

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pstrics module again
  2013-11-25 23:45             ` Aditya Mahajan
@ 2013-11-25 23:53               ` Aditya Mahajan
  0 siblings, 0 replies; 10+ messages in thread
From: Aditya Mahajan @ 2013-11-25 23:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 25 Nov 2013, Aditya Mahajan wrote:

> It has been years since I used dvips, so I don't remember how to correct 
> that. Basically, the "bug" is with the following file:
>
> \starttext
> \startTEXpage
>  What will happen now
> \stopTEXpage
> \stoptext
>
> Process using "mtxrun --script test --dvips" and then "ps2pdf" and the 
> resulting pdf file has the wrong bounding box.

The file processes correctly (but in landscape orientation) when using 
pstopdf, so it is just a bug of ps2pdf.

The header of the ps file is:

%!PS-Adobe-2.0
%%Creator: dvips(k) 5.993 Copyright 2013 Radical Eye Software
%%Title: test.dvi
%%CreationDate: Mon Nov 25 18:43:15 2013
%%Pages: 1
%%PageOrder: Ascend
%%Orientation: Landscape
%%BoundingBox: 0 0 15 117
%%DocumentFonts: LMRoman12-Regular
%%EndComments
%DVIPSWebPage: (www.radicaleye.com)
%DVIPSCommandLine: dvips -u +original-base -u +original-ams-base -u
%+ +original-public-lm -u +lm-ec -u +lm-math -u +lm-rm -u
%+ +original-ams-euler test
%DVIPSParameters: dpi=600
%DVIPSSource:  TeX output 2013.11.25:1843
%%BeginProcSet: tex.pro 0 0
%!

Why is dvips adding Orientation: Landscape in the header?
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pstrics module again
  2013-11-25 23:08           ` DesdeChaves
  2013-11-25 23:45             ` Aditya Mahajan
@ 2013-11-26  8:21             ` Herbert Voss
  1 sibling, 0 replies; 10+ messages in thread
From: Herbert Voss @ 2013-11-26  8:21 UTC (permalink / raw)
  To: ntg-context

Am 26.11.2013 00:08, schrieb DesdeChaves:
> I d'ont know how to fix the picture size.
> No errors at all, but the figure size isn't correct.

did you used "ps2pdf -dAutoRotatePages=/None <file> "  ??

Herbert

>
> \usemodule[pstric]
>
> \starttext
>
>
> Hydrogen spectrum
>
> \startPSTRICKS
> \input pst-spectra.tex
> \input pstricks-add.tex
> \pspicture(0,-2.5)(\textwidth,1.6)
> \psspectrum[element=H, emission](0,0)(\textwidth,1.5)
> \rput(2,1){Hydrogen spetrum}
> \endpspicture
> \stopPSTRICKS
>
>
>
>
> \stoptext

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-11-26  8:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-25 18:05 pstrics module again DesdeChaves
2013-11-25 18:55 ` Aditya Mahajan
2013-11-25 19:19   ` Herbert Voss
2013-11-25 20:25     ` Aditya Mahajan
2013-11-25 20:28       ` Herbert Voss
2013-11-25 22:24         ` DesdeChaves
2013-11-25 23:08           ` DesdeChaves
2013-11-25 23:45             ` Aditya Mahajan
2013-11-25 23:53               ` Aditya Mahajan
2013-11-26  8:21             ` Herbert Voss

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