Graphics, Figures & TablesProblems including .ps figures in a .tex file

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Ultragabu
Posts: 4
Joined: Fri Apr 24, 2015 4:27 pm

Problems including .ps figures in a .tex file

Post by Ultragabu »

Hi. I'm having trouble including a .ps picture in my file. My code is

Code: Select all

\newpage
\begin{figure}[c]
\hspace{-1.5cm}
\includegraphics[scale=0.9]{sz.ps}
\end{figure}
And this picture is included just fine (I use latex -> dvips -> ps2pdf), but when I try to include a diferent .ps file, the compilation is carried out without problems but the page where the picture is supposed to be in is a blank.

I can visualise both pictures with irfanview so I know they're ok, so what could be the problem? Could it be the .ps file size?

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Problems including .ps figures in a .tex file

Post by Johannes_B »

Hi and welcome,

the placement option c for LaTeX is not defined by default. It is possible that you have a package defining it, i am not aware of one though.

Try including the picture in a blank document, does it work? If not, can you upload the log-file to the forum server for review?
If it works, then there might be some monkey business in your real document. But let's check the first things first.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Ultragabu
Posts: 4
Joined: Fri Apr 24, 2015 4:27 pm

Problems including .ps figures in a .tex file

Post by Ultragabu »

I included the pic in a .tex file without anything but the picture. It compiles without error but the result is a blank page.


This is my code:

Code: Select all

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[10pt,letterpaper]{article}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%% PACKAGES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{geometry}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{rotating}
\usepackage{cite}
\usepackage{color}
\usepackage{fancybox}
\usepackage{pstricks}
\usepackage{pst-plot}
\usepackage{pstricks-add}
\usepackage{epsf}

\begin{document}

\newpage
\begin{figure}[]
\hspace{-1.5cm}
\includegraphics[scale=0.9]{AnaFig1.ps}
\end{figure}

\end{document}
The log and the picture I'm trying to include are attached to the post.
Attachments
test.log
the log
(18.85 KiB) Downloaded 453 times
AnaFig1.ps
the picture I'm trying to include
(392.26 KiB) Downloaded 445 times
Last edited by Stefan Kottwitz on Fri Apr 24, 2015 5:33 pm, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

Problems including .ps figures in a .tex file

Post by Stefan Kottwitz »

Welcome to the forum!

The picture was created using (La)TeX and PSTricks. So you could include the (La)TeX source instead of the PS file.

Or, convert the file using the epstopdf script, and use it with pdfLaTeX. Possibly epstopdf is already installed on your machine, try that command at the command line, i.e. in a terminal window.

Such pictures can also be created using TikZ.

Stefan
LaTeX.org admin
Ultragabu
Posts: 4
Joined: Fri Apr 24, 2015 4:27 pm

Re: Problems including .ps figures in a .tex file

Post by Ultragabu »

I have included the pdf version of that .ps picture and it works with pdflatex... but do you have any clue why some .ps picture would be loaded and others don't when I use (latex -> dvips -> ps2pdf) to compile my code?

Once the picture was already made does it matter whether it was created with pstrick or something else?

Thank you.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

Re: Problems including .ps figures in a .tex file

Post by Stefan Kottwitz »

Perhaps attach the .ps and .pdf output for investigating.

Stefan
LaTeX.org admin
Post Reply