LaTeX forum ⇒ Graphics, Figures & Tablesfigure not appearing in pdf

Information and discussion about graphics, figures & tables in LaTeX documents.
amnakhan786
Posts: 1
Joined: Thu Jan 17, 2013 5:31 pm

figure not appearing in pdf

Postby amnakhan786 » Thu Jan 17, 2013 5:38 pm

hi,
i am trying to include .eps figure in latex and hen convert it to pdf. I am a beginner and i read some info about adding figure but couldnt clearly get how to do it. I found this code online which is trying to include figure into latex but when i run this code this doesnot work(the figures doesnot appear) i dont understand where i should enter the name of figure, where i enter the path, or for this code i kept the figure in the same folder but no results.
  1. \documentclass[12pt]{article}
  2. \usepackage{epsf}
  3. \listfiles
  4.  
  5. \title{\bf How to include epsf files}
  6. \author{Gianfranco Ciardo}
  7.  
  8. \setlength{\oddsidemargin}{-0.25in}
  9. \setlength{\topmargin}{-0.5in}
  10. \setlength{\headheight}{0cm}
  11. \setlength{\headsep}{0cm}
  12. \setlength{\textheight}{10in}
  13. \setlength{\textwidth}{7in}
  14. \setlength{\topskip}{0cm}
  15. \renewcommand{\baselinestretch}{1.1}
  16. \renewcommand{\arraystretch}{1.2}
  17. \renewcommand{\dbltopfraction}{0.9}
  18. \renewcommand{\topfraction}{0.9}
  19. \renewcommand{\bottomfraction}{0.9}
  20. \renewcommand{\dblfloatpagefraction}{0.99}
  21. \renewcommand{\floatpagefraction}{0.99}
  22. \renewcommand{\textfraction}{0.01}
  23.  
  24. % epsf figures (inline or centered)
  25. \newcommand{\INLINEFIG}[1]{\epsfclipoff\epsffile{Figure.eps}}
  26. \newcommand{\FIG}[1]{\begin{center}
  27. \mbox{\epsfclipoff\epsffile{Figure.eps}}
  28. \end{center}}
  29. \def\epsfsize#1#2{1.0#1} % change 1.0 to any zoom factor you want
  30.  
  31. \pagestyle{empty}
  32.  
  33. \date{}
  34.  
  35. \begin{document}
  36.  
  37. \maketitle
  38.  
  39. \thispagestyle{empty}
  40.  
  41. First, you need to generate an ``eps'' (encapsulated postscript) file using
  42. one of the tools available to you.
  43. Then you can include it in a latex file.
  44. To se how, examine the source file for this page.
  45.  
  46. This is an example of an inline figure, \INLINEFIG{Figure}, while
  47. this is an example of the same figure centered in a space by itself:
  48. \FIG{Figure}
  49.  
  50. You can scale the figure as you want:
  51. for example, this is the same figure, just twice as large:
  52. {\def\epsfsize#1#2{2.0#1}\FIG{Figure}}
  53. or one fourth as large:
  54. {\def\epsfsize#1#2{0.25#1}\FIG{Figure}}
  55.  
  56. In multipage documents, it is usually more appropriate to include pictures
  57. only in the ``figure'' environment, as done in Fig.~\ref{FIG:myfig}.
  58.  
  59. \begin{figure}
  60. \FIG{Figure.eps}
  61. \caption{An example of floating figure.}
  62. \label{FIG:myfig}
  63. \end{figure}
  64.  
  65. \end{document}


url of the page where i found this code is: http://www.cs.ucr.edu/~ciardo/teaching/CS246/CS246.html

any help is appreciated.

Tags:

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

Postby localghost » Thu Jan 17, 2013 5:57 pm

amnakhan786 wrote:[…] url of the page where i found this code is: http://www.cs.ucr.edu/~ciardo/teaching/CS246/CS246.html […]

Forget this code completely, and fast. It is complete kludge. The epsf package is obsolete for a very long time. Have a look at the graphicx package. And page dimensions are set with geometry, not the way this code does it. One golden rule when using LaTeX:
If you don't know what code does, don't use it!

There are some more concerns which could be explained here. But just to forget it is much better.


Best regards and welcome to the board
Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

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

Postby Stefan Kottwitz » Fri Jan 18, 2013 1:20 am

I agree with Thorsten. You had no luck in choosing the example code. It would take some time to explain why most of the code is not recommendable today with modern LaTeX.

I suggest, read a good LaTeX introduction or tutorial, before you work with a template which you cannot evaluate. This can help: LaTeX Resources for Beginners.

If you still want to start with a template, have a look at www.latextemplates.com.

If you have questions, let us know.

Stefan
LaTeX.org admin


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 2 guests