Graphics, Figures & TablesLines not drawn when formatting to PDF, works to PS

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Aski
Posts: 6
Joined: Wed Dec 03, 2008 3:29 pm

Lines not drawn when formatting to PDF, works to PS

Post by Aski »

I have trouble when formatting my LaTeX document to PDF. Non-horizontal and non-vertical lines are not drawn. But, strangely it works when formatting to PS.

I have a full installation of MiKTeX 2.9 and I use TeXnicCenter 1.0

In the preamble the following is defined:

Code: Select all

\usepackage{graphicx}
\usepackage{eepic}
\usepackage{epic}
And the following is an example of where I get the problem:

Code: Select all

      \begin{figure}[htb]
        \centering
        \setlength{\unitlength}{1cm}
        \begin{picture}(2,2)
          %triangel
          \put(0,0){\line(1,0){2}}
          \put(0,0){\line(1,1){1}}
          \put(2,0){\line(-1,1){1}}
        \end{picture}
        \caption{Triangel}
        \label{fig:Triangel}
      \end{figure}
Only the horizontal line is drawn when formatting LaTeX to PDF.

What I see in the log is that it says "Non-PDF special ignored".

Anyone who knows what can be wrong? I need to present the document in PDF.
Last edited by Aski on Tue Mar 22, 2011 12:57 pm, edited 1 time in total.

Recommended reading 2024:

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

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

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Lines not drawn when formatting to PDF, works to PS

Post by localghost »

Please always provide a minimal example that is compilable as provided. The warning you mentioned seems not to come from the packages you listed. Supplemented to a full example your code compiles smoothly with the desired result. By the way, there are much more sophisticated graphics package like pgf/tikZ or PSTricks which are not so limited like the ones you use.


Thorsten
Aski
Posts: 6
Joined: Wed Dec 03, 2008 3:29 pm

Lines not drawn when formatting to PDF, works to PS

Post by Aski »

Ok, sorry, hope this is the minimum information you need to help me. Sorry for not being able to make the indentation of lines as I do in my original file.

Code: Select all

\documentclass[11pt]{report}
\usepackage[a4paper]{geometry}
\usepackage{graphicx}
\usepackage{eepic}
\usepackage{epic}
\begin{document}
   \begin{figure}[htb]
     \centering
     \setlength{\unitlength}{1cm}
     \begin{picture}(2,2)
       \put(0,0){\line(1,0){2}}
       \put(0,0){\line(1,1){1}}
       \put(2,0){\line(-1,1){1}}
     \end{picture}
   \end{figure}
\end{document}
I didn't know about the other packages you recommended. Will check them and see if they will work better for me. Thanks for that advice. Cheers, Anna
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Lines not drawn when formatting to PDF, works to PS

Post by localghost »

The button for the »Code« environment that I mentioned in my last reply can't be missed since it's placed right on top of the input window when composing a post. It would be very kind if you use it now and in the future so that further reminders will not be necessary.

The packages epic and eepic are the culprits. That doesn't surprise since they have to be considered outdated. I already mentioned some very good packages for such drawings. If you insist on drawing figures in this primitive way, you should try the pict2e package instead and drop the other ones.
User avatar
shadgrind
Posts: 140
Joined: Thu Jul 16, 2009 12:39 am

Re: Lines not drawn when formatting to PDF, works to PS

Post by shadgrind »

Are you creating the PDF with pdflatex? Because the eepic package is not completely compatible with pdflatex; some commands won't work properly. This is likely what is causing your problem. However, you could create the PDF by using ps2pdf on the PS file generated by latex->dvips. Doing that on the example you gave created a PDF with the full triangle, just as in the PS file.
System: TeX Live 2012, Fedora 18 x86_64, GNU Emacs 24.2
Aski
Posts: 6
Joined: Wed Dec 03, 2008 3:29 pm

Re: Lines not drawn when formatting to PDF, works to PS

Post by Aski »

Shadgrind, thank you for the tip, and the explanation of eepic not being completely compatile with pdflatex. I now format the document to pdf via ps and I think it made the trick.

Moderator, I also want to thank you for your kind help. I will definitely use PSTricks or PGF/TikZ, or both, in the future, and leave epic and eepic. But for my "problem" document today, which I started in 2006 and haven't worked on since 2008, I have like 50 illustrations and I feel that it is too much effort to change them and prefer to keep them as is.

I have also, with a better internet connection than at home (300kbit/s if I'm lucky), fetched among others the board rules to my computer to avoid beginner's errors in future communication in this community. And I still consider myself a beginner here, eventhough it was a long time since I joined.

And now I suppose I have wasted your time enough in this issue. So, thank you and I'm closing this discussion since my troubles seem to have been solved. :D
Post Reply