[pstricks] Transmission grating again

Steffen Wittek steffen.wittek at gmx.net
Mon Jul 15 11:17:32 CEST 2013


Hi Christian,

checked your solution again. It seems that now the coordinates of 
components defined after the grating are not absolute anymore, but are 
shifted instead.
Example:

\documentclass{standalone}

\usepackage[T1]{fontenc}

\usepackage[utf8]{inputenc}

\usepackage{pst-optexp}

\usepackage{fp}

\makeatletter

\newOptexpTripole{transmissiongrating}

\makeatletter

\def\transmissiongrating at ref{%

    \POE at calcAngle

    \FPadd\POE at key@angle{\POE at key@angle0}{90}

    \FPround\POE at key@angle{\POE at key@angle}{5}

    \POE at setref{/@@y\POE at key@gratingwidth\space  0.5 mul def}%

}%

\def\transmissiongrating at nodes{%

    \newOptexpComp{%

      {0 0}\POE at key@gratingwidth\space  0.5 mul dup neg exch

      OEangle 180 sub abs 1e-5 lt {

        trans {1 0}

      } {

        refl {0 1}

      } ifelse

      4 1 roll {PlainIfc} 1}%

}%

\let\transmissiongrating at comp\optgrating at comp

\makeatother

\definecolor[ps]{bl}{rgb}{tx at addDict begin Red Green Blue end}%

\begin{document}

\begin{pspicture}[showgrid](4,3)

    \pnode(1,2){S1}

    \pnode(1,1){G1}\pnode(2,1){G11}

   

    		\transmissiongrating[gratingwidth=1, gratingheight=0.1,angle=15](S1)(G1)(G11)

    		\optprism[prismangle=60,compname=P1,labelalign=t](1,1)(2,2)(3,1)

\end{pspicture}

\end{document}

The prism is a little bit too much to the right. I really cannot figure 
out where the problem is. If you could help me out one more time I would 
be grateful.

Thanks,
Steffen


El 7/13/13 10:58 PM, pstricks-request at tug.org escribió:
> Send PSTricks mailing list submissions to
> 	pstricks at tug.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://tug.org/mailman/listinfo/pstricks
> or, via email, send a message with subject or body 'help' to
> 	pstricks-request at tug.org
>
> You can reach the person managing the list at
> 	pstricks-owner at tug.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of PSTricks digest..."
>
>
> Today's Topics:
>
>     1. Re: PSTricks Digest, Vol 126, Issue 9 (Steffen Wittek)
>     2. Re: PSTricks Digest, Vol 126, Issue 5 (Angelo Rossi)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 13 Jul 2013 12:55:29 +0200
> From: Steffen Wittek <steffen.wittek at gmx.net>
> To: <pstricks at tug.org>
> Subject: Re: [pstricks] PSTricks Digest, Vol 126, Issue 9
> Message-ID: <51E13221.4080505 at gmx.net>
> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
>
> Hi Christian,
>
> that works really well. Thank you very much for your time. Great
> implementation.
>
> Have a nice weekend,
> Steffen
>
> El 7/13/13 12:00 PM, pstricks-request at tug.org escribi?:
>> \documentclass{article}
>> \usepackage{fp}
>> \usepackage{pst-optexp}
>> \makeatletter
>> \newOptexpTripole{transmissiongrating}
>> \def\transmissiongrating at ref{%
>>      \POE at calcAngle
>>      \FPadd\POE at key@angle{\POE at key@angle0}{90}
>>      \FPround\POE at key@angle{\POE at key@angle}{5}
>>      \POE at setref{/@@y \POE at key@gratingwidth\space 0.5 mul def}%
>> }%
>> \def\transmissiongrating at nodes{%
>>      \newOptexpComp{%
>>        {0 0} \POE at key@gratingwidth\space 0.5 mul dup neg exch
>>        OEangle 180 sub abs 1e-5 lt {
>>          trans {1 0}
>>        } {
>>          refl {0 1}
>>        } ifelse
>>        4 1 roll {PlainIfc} 1}%
>> }%
>> \let\transmissiongrating at comp\optgrating at comp
>> \makeatother
>> \begin{document}
>> \begin{pspicture}[showgrid](2.6,2.4)
>>      \pnode(0,1.3){A}\pnode(2,1.3){B}\pnode(1,0.3){C}
>>      \optgrating[reverse, gratingcount=9](A)(B)(C)
>>      \optplane[angle=45](C)
>>      \addtopsstyle{Beam}{ArrowInside=->, ArrowInsidePos=0.8, arrowinset=0,
>> arrowscale=1.5}
>>      \drawbeam[linecolor=black](A){1}
>>      \addtopsstyle{Beam}{loadbeam, savebeam=false}
>>      \drawbeam[linecolor=green]{1-2}
>>      \drawbeam[linecolor=red, beamangle=15]{1-2}
>>      \drawbeam[linecolor=blue, beamangle=-15]{1-2}
>>      \rput[lB](0,2){reflection grating}
>> \end{pspicture}
>> %
>> \hspace*{1cm}
>> \begin{pspicture}[showgrid](5,2.4)
>>      \pnode(0,1.3){A}\pnode(2,1.3){B}\pnode(4,0.5){C}
>>      \transmissiongrating[reverse, gratingcount=9](A)(B)(C)
>>      \optplane[angle=-30](C)
>>      \addtopsstyle{Beam}{ArrowInside=->, ArrowInsidePos=0.8, arrowinset=0,
>> arrowscale=1.5}
>>      \drawbeam[linecolor=black](A){1}
>>      \addtopsstyle{Beam}{loadbeam, savebeam=false}
>>      \drawbeam[linecolor=green]{1-2}
>>      \drawbeam[linecolor=red, beamangle=5]{1-2}
>>      \drawbeam[linecolor=blue, beamangle=-5]{1-2}
>>      \rput[lB](0,2){transmission grating}
>> \end{pspicture}
>> \end{document}
>
>
> ------------------------------
>
> Message: 2
> Date: Sat, 13 Jul 2013 16:54:17 -0400
> From: Angelo Rossi <angelo.raymond.rossi at gmail.com>
> To: <pstricks at tug.org>
> Subject: Re: [pstricks] PSTricks Digest, Vol 126, Issue 5
> Message-ID:
> 	<CAOZGcxzFNdZfGxv8ad0W=xVm0VGU16ATUyT_CESixKmwoGKsLg at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Dear Herbert:
>
> Could you please help me out?
>
> I downloaded your attachment to see if it would run on my debian linux
> system.
>
> But it does not work.
>
> It gives me the document but with the figure not correct.
>
> I am attaching the log file and a console log file because pdflatex gives
> an error to the console that does not appear in the log file.
>
> >From the top of the log file, you can see I am using TexLive 2013 (debian).
>
> I want this to work because I use pstricks a lot.
>
> Kind regards,
>
> angelo
>
>
>
> On Wed, Jul 10, 2013 at 2:25 PM, <pstricks-request at tug.org> wrote:
>
>> Send PSTricks mailing list submissions to
>>          pstricks at tug.org
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>          http://tug.org/mailman/listinfo/pstricks
>> or, via email, send a message with subject or body 'help' to
>>          pstricks-request at tug.org
>>
>> You can reach the person managing the list at
>>          pstricks-owner at tug.org
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of PSTricks digest..."
>>
>>
>> Today's Topics:
>>
>>     1. pst-pdf (Patrice M?GRET)
>>     2. Re: pst-pdf (Herbert Voss)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Wed, 10 Jul 2013 15:50:09 +0000
>> From: Patrice M?GRET <Patrice.MEGRET at umons.ac.be>
>> To: "pstricks at tug.org" <pstricks at tug.org>
>> Subject: [pstricks] pst-pdf
>> Message-ID:
>>          <8EAD3A11C751924B9AB951FA32FD86EB04C05D29 at EXCHANGEDB4.umons.ac.be>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> Dear Herbert,
>> Dear all,
>>
>> I have to extract eps figures for an article and I use pst-pdf.
>>
>> It worked fine on the example but I always get an error in my file (see
>> attached sample code) at the latex compilation.
>> I cannot figure the trouble here. Can you help me?
>>
>> Best regards,
>>
>> Patrice
>>
>>
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <
>> http://tug.org/pipermail/pstricks/attachments/20130710/509799d2/attachment-0001.html
>> -------------- next part --------------
>> A non-text attachment was scrubbed...
>> Name: Document-TeX 1.tex
>> Type: application/x-tex
>> Size: 3285 bytes
>> Desc: Document-TeX 1.tex
>> URL: <
>> http://tug.org/pipermail/pstricks/attachments/20130710/509799d2/attachment-0001.tex
>> ------------------------------
>>
>> Message: 2
>> Date: Wed, 10 Jul 2013 20:18:15 +0200
>> From: Herbert Voss <Herbert.Voss at FU-Berlin.DE>
>> To: <pstricks at tug.org>
>> Subject: Re: [pstricks] pst-pdf
>> Message-ID: <51DDA567.50605 at FU-Berlin.DE>
>> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
>>
>> Am 10.07.2013 17:50, schrieb Patrice M?GRET:
>>
>>> I have to extract eps figures for an article and I use pst-pdf.
>>>
>>> It worked fine on the example but I always get an error in my file (see
>>> attached sample code) at the latex compilation.
>>>
>>> I cannot figure the trouble here. Can you help me?
>> Patrice,
>> you should use auto-pst-pdf, it has some advantages.
>> But you must have filenames without spaces in the name.
>> Only the pspicture environment ist scanned by the
>> package if you use the psgraph environment then put
>> it into
>>
>> \begin{postscript}
>> \psset{...}
>> \begin{psgraph}...
>> ...
>> \ned{psgraph}
>> \end{postscript}
>>
>> Attached my version which runs fine with
>> pdflatex --shell-escape Document-TeX1.tex
>>
>> best
>> Herbert
>> -------------- next part --------------
>> A non-text attachment was scrubbed...
>> Name: Document-TeX1.tex
>> Type: text/x-tex
>> Size: 3271 bytes
>> Desc: not available
>> URL: <
>> http://tug.org/pipermail/pstricks/attachments/20130710/2e4ccdc9/attachment.bin
>> -------------- next part --------------
>> A non-text attachment was scrubbed...
>> Name: Document-TeX1.pdf
>> Type: application/pdf
>> Size: 89125 bytes
>> Desc: not available
>> URL: <
>> http://tug.org/pipermail/pstricks/attachments/20130710/2e4ccdc9/attachment.pdf
>> ------------------------------
>>
>> Subject: Digest Footer
>>
>> _______________________________________________
>> PSTricks mailing list
>> PSTricks at tug.org
>> http://tug.org/mailman/listinfo/pstricks
>>
>>
>> ------------------------------
>>
>> End of PSTricks Digest, Vol 126, Issue 5
>> ****************************************
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://tug.org/pipermail/pstricks/attachments/20130713/008fd8a2/attachment.html>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: attachment-0001_herbert-pics.pdf
> Type: application/pdf
> Size: 1758 bytes
> Desc: not available
> URL: <http://tug.org/pipermail/pstricks/attachments/20130713/008fd8a2/attachment.pdf>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: attachment-0001_herbert.log
> Type: application/octet-stream
> Size: 39326 bytes
> Desc: not available
> URL: <http://tug.org/pipermail/pstricks/attachments/20130713/008fd8a2/attachment.obj>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: attachment-0001_herbert.pdf
> Type: application/pdf
> Size: 61389 bytes
> Desc: not available
> URL: <http://tug.org/pipermail/pstricks/attachments/20130713/008fd8a2/attachment-0001.pdf>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: attachment-0001_herbert_console.log
> Type: application/octet-stream
> Size: 85353 bytes
> Desc: not available
> URL: <http://tug.org/pipermail/pstricks/attachments/20130713/008fd8a2/attachment-0001.obj>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
>
>
> ------------------------------
>
> End of PSTricks Digest, Vol 126, Issue 10
> *****************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20130715/1dda94d4/attachment-0001.html>


More information about the PSTricks mailing list