LaTeX forum ⇒ Graphics, Figures & TablesPSTricks cuts figures in landscape mode

Information and discussion about graphics, figures & tables in LaTeX documents.
Fibonacci
Posts: 37
Joined: Tue Jan 25, 2011 1:16 am

PSTricks cuts figures in landscape mode

Postby Fibonacci » Sun Jul 05, 2015 7:22 pm

I have the following code:
  1. \documentclass{article}
  2. \usepackage[landscape]{geometry}
  3. \usepackage{pstricks}
  4. \begin{document}
  5. \hspace{6.5in}\begin{pspicture}(1in,1in)\pscircle(0,0){1}
  6. \end{pspicture}
  7. \end{document}


If I compile it with XeLaTeX under GNU/Linux, or paste that in Overleaf, the circle will not appear complete.

Certain TeX installations on Windows don't seem to have that problem, though.

What's happening and how do I prevent it?

Tags:

Sundial
Posts: 57
Joined: Thu Apr 19, 2012 7:28 pm

Postby Sundial » Sun Jul 05, 2015 8:04 pm

Hi.
Your drawback is caused by the horizontal space settled too high; by changing its figure into, i.e. 5.5 inches, the whole circle appears properly, as shown below. Cheers

01.png
01.png (55.67 KiB) Viewed 2726 times
Last edited by cgnieder on Mon Jul 06, 2015 11:59 pm, edited 1 time in total.
Reason: scaled image down so it doesn't destroy forum view

Fibonacci
Posts: 37
Joined: Tue Jan 25, 2011 1:16 am

Postby Fibonacci » Sun Jul 05, 2015 8:07 pm

Sundial wrote:Hi.
Your drawback is caused by the horizontal space settled too high; by changing its figure into, i.e. 5.5 inches, the whole circle appears properly, as shown below. Cheers


No it's not. Compiling the code without modifications with pslatex makes the whole circle appear properly.

Sundial
Posts: 57
Joined: Thu Apr 19, 2012 7:28 pm

Postby Sundial » Sun Jul 05, 2015 8:30 pm

Please, look at what happens (Overleaf compiler) with spacer 6.5in: the cutoff of your circle. Any comparison should be carried out with the same compiler, mine is Overleaf,as said.

02.png
02.png (61.43 KiB) Viewed 2726 times
Last edited by cgnieder on Tue Jul 07, 2015 12:00 am, edited 1 time in total.
Reason: scaled image down so it doesn't destroy forum view

Fibonacci
Posts: 37
Joined: Tue Jan 25, 2011 1:16 am

Postby Fibonacci » Sun Jul 05, 2015 8:49 pm

Sundial wrote:Please, look at what happens (Overleaf compiler) with spacer 6.5in: the cutoff of your circle. Any comparison should be carried out with the same compiler, mine is Overleaf,as said.


And that is exactly the problem I am asking how to prevent – the fact that Overleaf and XeLaTeX cut off pictures at an arbitrary spot before the end of the page.

Of course it is (also) caused by using PSTricks, but “stop using PSTricks” would not count as a solution, would it?

User avatar
Stefan Kottwitz
Site Admin
Posts: 9388
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Jul 06, 2015 5:04 pm

Hi Sundial,

can you please post code as text (marked as code via the "Code" button)?

Then we can copy & paste, and even better: by just one click we can open it directly in OverLeaf: there's automatically a link above the code box then.

In that case you could remove the images above, as it's slowing down loading on my slow internet connection, but even more, they are too huge for the web site layout.

Thanks!

Stefan
Site admin

Sundial
Posts: 57
Joined: Thu Apr 19, 2012 7:28 pm

Postby Sundial » Mon Jul 06, 2015 8:06 pm

Hi Stefan,
I beg your pardon for my posted screenshots so wide! They come directly from the opening post code by pushing on 'Open in WriteLatex' bar. That allowed me to better specify my thought, based on the use of \hspace command. Please, erase them if you believe they are disturbing so much. Cheers

User avatar
Stefan Kottwitz
Site Admin
Posts: 9388
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Jul 06, 2015 9:00 pm

I did not notice the code in the opening post, just sah huge screenshots and though it was your code :-o

Screenshots are great, I often post them as addition, makes it easier for all readers. I just cut or resize so it's not too large,

Stefan
Site admin

Sundial
Posts: 57
Joined: Thu Apr 19, 2012 7:28 pm

Postby Sundial » Mon Jul 06, 2015 11:19 pm

My code is simply shown below:
  1. \documentclass{article}
  2. \usepackage[landscape]{geometry}
  3. \usepackage{pstricks}
  4. \begin{document}
  5. \hspace{4in}
  6. \begin{pspicture}(1in,1in)\pscircle(0,0){1}
  7. \end{pspicture}
  8. \end{document}

What does this mean? Different compilers sometimes have different behaviours on dealing with spacer (\hspace), so to overcome any mismatch the shortest way is to modify its width, from 6.5in to i.e. 4in. Cheers

Fibonacci
Posts: 37
Joined: Tue Jan 25, 2011 1:16 am

Postby Fibonacci » Tue Jul 07, 2015 11:40 pm

Try this, then:
  1. \documentclass{article}
  2. \usepackage[landscape]{geometry}
  3. \usepackage{pstricks}
  4. \begin{document}
  5. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus blandit in magna id sagittis. Pellentesque
  6. \begin{pspicture}(1in,1in)\pscircle(0,0){1}
  7. \end{pspicture}
  8. \end{document}

If you open it on Overleaf, or compile it with XeLaTeX, you'll see that the picture is still cut short, and the problem is not with \hspace (since there is no \hspace in this code). Surely the “shortest way” to get a full circle is cutting the text short, but hopefully it's obvious now that this is not an acceptable solution.


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 4 guests