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

Post by Fibonacci »

I have the following code:

Code: Select all

\documentclass{article}
\usepackage[landscape]{geometry}
\usepackage{pstricks}
\begin{document}
\hspace{6.5in}\begin{pspicture}(1in,1in)\pscircle(0,0){1}
\end{pspicture}
\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?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

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

PSTricks cuts figures in landscape mode

Post by Sundial »

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 7557 times
Last edited by cgnieder on Mon Jul 06, 2015 11:59 pm, edited 1 time in total.
Fibonacci
Posts: 37
Joined: Tue Jan 25, 2011 1:16 am

PSTricks cuts figures in landscape mode

Post by Fibonacci »

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

PSTricks cuts figures in landscape mode

Post by Sundial »

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 7557 times
Last edited by cgnieder on Tue Jul 07, 2015 12:00 am, edited 1 time in total.
Fibonacci
Posts: 37
Joined: Tue Jan 25, 2011 1:16 am

PSTricks cuts figures in landscape mode

Post by Fibonacci »

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: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Re: PSTricks cuts figures in landscape mode

Post by Stefan Kottwitz »

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
LaTeX.org admin
Sundial
Posts: 57
Joined: Thu Apr 19, 2012 7:28 pm

PSTricks cuts figures in landscape mode

Post by Sundial »

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: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Re: PSTricks cuts figures in landscape mode

Post by Stefan Kottwitz »

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
LaTeX.org admin
Sundial
Posts: 57
Joined: Thu Apr 19, 2012 7:28 pm

PSTricks cuts figures in landscape mode

Post by Sundial »

My code is simply shown below:

Code: Select all

\documentclass{article}
\usepackage[landscape]{geometry}
\usepackage{pstricks}
\begin{document}
\hspace{4in} 
\begin{pspicture}(1in,1in)\pscircle(0,0){1}
\end{pspicture}
\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

PSTricks cuts figures in landscape mode

Post by Fibonacci »

Try this, then:

Code: Select all

\documentclass{article}
\usepackage[landscape]{geometry}
\usepackage{pstricks}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus blandit in magna id sagittis. Pellentesque
\begin{pspicture}(1in,1in)\pscircle(0,0){1}
\end{pspicture}
\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.
Post Reply