3

The following code should output an image similar to this one from the manual enter image description here

\documentclass[english]{article}
\usepackage[T1]{fontenc}

\makeatletter
\usepackage{pstricks}
\usepackage{pst-3d}
\usepackage{pst-diffraction}
\makeatother

\usepackage{babel}
\begin{document}
\begin{pspicture}(-1.5,-2.5)(3.5,3.5)
\psdiffractionRectangle[IIID=true,Alpha=30,f=2.5,colorMode=1]
\end{pspicture}
\end{document}

Unfortunately it does not render anything in the pdf. I am using XeTeX and Lyx. (Also another minor question, when copy pasting code into a textbox to ask a question on the stackexchange, is there a way to have the 4 spaces come up before every line or do I have to manually add it)

Link to package: here

7
  • Wild guess: where to get the data from?
    – albert
    Aug 5, 2018 at 12:20
  • Sorry I should've added a link to the package documentation if that is what you are referring to
    – sab hoque
    Aug 5, 2018 at 12:23
  • Useful, but I think the images have some data / measurements that give the values and I think these are needed. At first glanceI did't see the data in the pdf either so probably it is in one of the sites / papers mentioned.
    – albert
    Aug 5, 2018 at 12:29
  • The other diffraction images work and render as expected, it is only when the option IIID is true that it does not render. Hence I do not believe there is a deficiency in data
    – sab hoque
    Aug 5, 2018 at 12:34
  • Interesting observation, also the plain IIIID does not work for me. No idea here.
    – albert
    Aug 5, 2018 at 12:40

1 Answer 1

1

With xelatex or latex->dvips>ps2pdf or use package auto-pst-pdf

\documentclass{article}
\usepackage{pst-diffraction}
\begin{document}

\begin{pspicture}(-4,-1)(4,1) 
\psdiffractionRectangle[IIID,a=0.5e-3,k=10,f=10,pixel=0.5,lambda=650,twoSlit,s=2e-3] 
\end{pspicture} 
\end{document}

enter image description here

The code listing in the documentation is missing the IIID. However, every package has also the source as part of your TeX Distribution, so you can have a look how it was really done.

5
  • 1
    IIID might be missing in the documentation, but in the question it is present (and it was also present in the tests I ran).
    – albert
    Aug 6, 2018 at 7:59
  • I ran the above code you proposed and unfortunately it does not work. Also IIID is not missing from the documentation. You will notice that they have two codes underneath each other, and so whenever there is a 3D image they have IIID in the option settings which is the same as how I have set IIID=true
    – sab hoque
    Aug 6, 2018 at 8:23
  • Correct me if I'm wrong but if I am compiling using XeTeX, there is no need for auto-pst-pdf is there?
    – sab hoque
    Aug 6, 2018 at 8:25
  • I should have said: auto-pst-pdf for a run with pdflatex.
    – user2478
    Aug 6, 2018 at 11:09
  • If you get no output, then show your log file.
    – user2478
    Aug 6, 2018 at 11:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .