4

I would like to use pst-optic to create some figures in a A4 landscape page and use the full size of the paper.

I have a two lenses system that I would like to draw.

The code I wrote is the following :

\documentclass[a4paper,12pt,landscape]{report}
\usepackage{auto-pst-pdf}
\usepackage{pst-optic}
\begin{document}
\begin{pspicture*}(-7.5,-5)(8,8)
    \rput(0,0){\lens[lensScale=1.5,yBottom=-5,yTop=5,XO=-4,focus=1.5,OA=-2.5,AB=2,lensGlass=false, lensWidth=0.05]}
    \Transform
    \rput(0,0){\lens[lensScale=1.5,yBottom=-5,yTop=5,XO=3.5,focus=2,lensTwo=true,lensGlass=false,lensWidth=0.05]}
\end{pspicture*}
\end{document}

My problems are the following:

  1. Whatever the size I enter in the pspicture command, I can't obtain the full drawing of the rays in the picture
  2. I can't change the size of the pspicture environment to occupy the full size of the page

Can someone explain to me how to fix this ? Best regards

1 Answer 1

2

use the optional argument showgrid ant the star version of pspicture. Then yiu can easily see what coordinates for pspicture are useful. By the way, I always use lualatex, then I get directly a pdf output and do not need auto-pst-pdf:

\documentclass[a4paper,12pt,landscape]{report}
\usepackage{geometry}
\usepackage{pst-optic,graphicx}
\begin{document}
\noindent
\resizebox{\textwidth}{!}{%
    \begin{pspicture}[showgrid](-7.5,-5)(8,4)%
        \rput(0,0){\lens[lensScale=1.5,yBottom=-5,yTop=5,XO=-4,focus=1.5,OA=-2.5,AB=2,
            lensGlass=false, lensWidth=0.05,xRight=8.5]}%
        \Transform
        \rput(0,0){\lens[lensScale=1.5,yBottom=-5,yTop=5,XO=3.5,focus=2,lensTwo=true,
            lensGlass=false,lensWidth=0.05,xRight=8.5]}%
    \end{pspicture}}
\end{document}

enter image description here

In the end you can set showgrid=false to remove the grid.

7
  • Thank you! I have an additional question: on the right of the picture we can see that the rays are cut before the place where they cross. I tried to increase the size of the pspicture and even there the rays don't cross. What do I miss ?
    – Eric Leroy
    Jan 19, 2023 at 11:44
  • 1
    For the second lens use \lens[..., xLeft=-8,xRight=8]
    – user187802
    Jan 19, 2023 at 13:10
  • now I have the superposition of the AB object of the second lens with the A'B' image of the first lens.
    – Eric Leroy
    Jan 22, 2023 at 9:34
  • I read the documentation of pst-optic but I didn't found the syntax for all the options used here. Do you know if there is a more complete documentation or a website ?
    – Eric Leroy
    Jan 22, 2023 at 16:00
  • page 4 in the tabular
    – user187802
    Jan 23, 2023 at 10:13

You must log in to answer this question.

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