I have a figure name "L=10_W=8.00.eps", I put it in the \figure environment by  \includegraphics{L=10_W=8.00.eps}   compile it with xelatex, but get error:     File ended prematurely  After I renamed it to "L=10_W=8.eps", the error goes away.
35718
\includegraphics cannot handle filenames that contain more than the one dot, separating the filename from the extension. Apparently it uses everything after the first dot as extension and then, of course, complains about an unknown graphics extension.  This is annoying as I very often have filenames that contain parameter values, e.g. plot_a0.4_b0.6.pdf.  Is there a way to teach LaTeX to interpret only the string behind the last dot as extension?
1605
How to influence the position of float environments like figure and table in LaTeX?   This is a general question and should collect useful answers for all users. I hope we can use this as a reference
100146
Possible Duplicate:          I'm having a problem with referencing figures in LaTeX. I have the following text:  \begin{figure}[H] \center \label{fig:enn1015} \includegraphics[scale=0.40]{imagens/outputs/ENN_10_15.eps} \caption{ENN unbalanced 10\%} \end{figure}  The figure \ref{fig:enn1015} (...)   For some reason, the figure caption is:  Figure 3.5 Enn unbalanced 10%   But the text is:  The figure 3.2.1 (...)   Instead of:  The figure 3.5   It is printing the chapter.section.subsection the figure is in, and not the figure. Can anybody help me?
30586
I am using MikTex 2.9 and TeXstudio for my TeX preparation. I would like to set the path to my figures folder, which contains all the figures, plots etc. required for my work.   I used \graphicspath to set the directory, but it gives me an error message:  \documentclass[12pt]{article}  \usepackage{graphicx}  \graphicspath{D:/LATEX/Reports@IIT/figures}  \begin{document} \includegraphics[width=4.5cm,height=4cm,angle=0]{logo.jpg}  \end{document}      Error: Package pdftex.def Error: File `logo.jpg' not found   However, when I prepend the filenames of the images with the same path in the \includegraphics command, it works just fine:  \documentclass[12pt]{article}  \usepackage{graphicx}  \begin{document}  \includegraphics[width=4.5cm,height=4cm,angle=0]{D:/LATEX/Reports@IIT/figures/logo.jpg}  \end{document}   Why is \graphicspath not setting the path?
22340
I mess up with things when I try to use the figure-thing: the picture is not appearing with the correct alignment (apparently because I forget the float package). Now I want to use only the graphicx package with \includegraphics. How can I center the \includegraphics without figure?  Not working or doing centering to the document afterwards.  \includegraphics[width=0.5 \textwidth]{./Pictures/r.png}{\centering} \includegraphics[width=0.5 \textwidth]{./Pictures/r.png}\centering
41221
Everything works perfectly except until the error below. I'm slightly new at LaTeX and perhaps I'm missing a package, but I already have the graphicx package. Any help will be greatly appreciated!  ! LaTeX Error: Unknown graphics extension: .eps.  See the LaTeX manual or LaTeX Companion for explanation. Type  H &lt;return&gt;  for immediate help.  ...                                                l.24 \includegraphics[width=2.6in]{02_1.eps}  ?
108660
(my first question here) I'm using xelatex to compile this code:  \documentclass{book} \usepackage{fontspec}  \begin{document}  %This is a Greek text ``Ελλάδα'' text  \end{document}   and receive this error :  ("C:\Program Files\MiKTeX 2.9\tex\latex\fontspec\fontspec.cfg") ! Undefined control sequence. &lt;argument&gt; \LaTeX3 error:                             Erroneous variable \c__fontspec_shape_n_n_tl used! l.3806 \emfontdeclare{ \emshape, \eminnershape }   My aim is to make LaTeX compile greek letters properly in my pdf, but that's a different issue.
112330
I'm wondering how to give subnumberings like "2a" and "2b" for separate floats.  I know both the subfigure and subcaption packages do the subnumbering but they demand the subfigures be in a single figure environment.  For example, I'd be happy if I could find an environment subfigures like this:  \begin{subfigures} \begin{figure}   A figure comes here.   \caption{\label{first}Caption text.} %--&gt; Fig.1a \end{figure} \begin{figure}   Another figure.   \caption{\label{second}Caption text.} %--&gt; Fig.1b \end{figure} \end{subfigures}   It's basically the same as AMS LaTeX's subequations environment.  The reason why I want to do this is that I can't decide how I should group my figures until much later in my writing process.  If I had an environment like the above, all I would have to do is to cut&amp;paste figure environments or delete or add subfigures environments in order to reorganize my figures.  Since what I want is very similar to the subequations environment, I guess I can make my own subfigures environment after enough hacking, but I'm not much versed in TeX coding and am wondering if there is already a solution available.  Thanks for your help.  Ryo  Edit: Thank you all for your responses.  Mico asks: &lsquo;Should the individual figure environments within a (still to be designed) subfigures environment be allowed to "float" and possibly end up on different pages . . . ?&rsquo; &mdash; Yes.  I just want separate floats to be numbered in the way I want and that's all.  Of course, if there be an option that controls the placement of the grouped figures, that would be a nice addition.
76947
I have this figure in Excel that I want to replicate in LaTeX.    So far, I have these.    Can anyone help me to get as close as possible to the first figure please? Also, I want to add a legend to the error bars to let the reader know its magnitude.  My MWE:  \documentclass[11pt,paper=a4,BCOR=15mm,bibliography=totoc,DIV=9,final,headings=optiontohead, listof=chaptergapsmall,listof=totoc,numbers=noenddot,openright,parskip=half,titlepage,twoside,]{scrreprt} \usepackage[ngerman,english,]{babel}  \usepackage[onehalfspacing]{setspace}        \usepackage{graphicx} \usepackage{tikz,pgfplots} \usetikzlibrary{intersections, calc} \usepgfplotslibrary{units}   \begin{document}  \begin{figure}[h!] \centering \begin{tikzpicture} [scale=1.23] \begin{axis}[       ybar,         bar width=7pt,         xtick={1,...,9},     ylabel= y values,     xlabel=y values,     enlargelimits=0.05,     ybar interval=0.7,     %       x unit=-,     %       y unit=\si{\frac{kg}{h}},      ]    \addplot     coordinates {(1,4473.317111) (2,7394.47646) (3,6886.499957)      (4,9836.193336) (5,8098.401475) (6,8308.855452) (7,9983.205801)      (8,7617.506648) (9,9617.462814)}; \addplot+[error bars/.cd, y dir=both,y explicit]     coordinates {(1,4342.7395) +- (0,0.05)                 (2,7381.3423) +- (0,0.05)                 (3,6837.375) +- (0,0.05)                 (4,9964.5747) +- (0,0.05)                 (5,7624.083) +- (0,0.05)                 (6,7843.0192) +- (0,0.05)                 (7,9665.1374) +- (0,0.05)                 (8,7266.0779) +- (0,0.05)                 (9,9393.7355) +- (0,0.05)                 }; \legend{x data,y values} \end{axis} \end{tikzpicture} \caption{Figure Caption} \label{fig:plot1} \end{figure}  \end{document}
80472
I recently updated MikTex and it seems Xelatex is not able to place figures correctly anymore. Before updating all figures were shown correctly. I work with Texworks and Miktex 2.9  Here it is the code that I run:  \documentclass[10pt,a4paper]{report} \usepackage{graphicx} \graphicspath{{method1/}{method2/}{dpfig/}}  \begin{document}  \begin{figure}[!htbp] \centering \begin{tabular}{cc} \includegraphics[trim=6cm 2.5cm 6cm 2.5cm,clip=true,width=0.33\textwidth]{figure1.eps}&amp; \includegraphics[trim=6cm 2.5cm 6cm 2.5cm,clip=true,width=0.33\textwidth]{figure2.eps}\\ \end{tabular} \caption{Two figures} \end{figure} \end{document} \end{figure}   With this code, figures are correctly trimmed and the relative position between figure 1 and figure 2 is maintained. However, the position in the document is wrong: figure are placed upper and more right than expected (as the bottom-left corner of the table was placed in the middle of the page). The unusual thing is that this does not happen in draft mode and picture are shown centered as it would be.  I usually compile with Xelatex, Makeindex and Bibtex.  I hope to have been clear.. bye!  EDIT: Sorry, I forgot to add the images I prepared from the file that run that script:
94245
I'm a beginning latex user. I have some programming code in my document which I format using the lstlisting environment from the package listings.  However this still allows the code segments to be split into two pieces when placed near the end of a page.  To fix this I also use a figure environment for code. This causes an often recurring pattern:  \begin{figure}[H] \begin{lstlisting} ..code.. \end{lstlisting} \end{figure}   How can I define a new environment for this pattern? I tried:  \newenvironment{mylisting} { \begin{figure}[H] \begin{lstlisting} } { \end{lstlisting} \end{figure} }   However using this environment gave errors all over.
7661
Have anyone an idea how i can use \IfFileExist{}{}{} for file names with spaces?  f.e. didn't work  \newcommand{\runI}{D:/Test/run1 - T2} \newcommand\IG[2][]{\IfFileExists{#2}{\includegraphics[#1]{#2}}{\fbox{File #2 doesn't exist}}}  \begin{figure}[htbp] \centering \IG[trim = 40mm 10mm 40mm 2mm,clip = true, width=0.4\textwidth]{\runI/LatexTestFig2.png} \caption{run 1} \label{overflow} \end{figure}   f.e. work  \newcommand{\runII}{D:/Test/run1-T2-Kopie} \newcommand\IG[2][]{\IfFileExists{#2}{\includegraphics[#1]{#2}}{\fbox{File #2 doesn't exist}}}  \begin{figure}[htbp] \centering \IG[trim = 40mm 10mm 40mm 2mm,clip = true, width=0.4\textwidth]{\runII/LatexTestFig2.png} \caption{run 1} \label{overflow} \end{figure}   what can I do? THX
19033
If I just try to set the figure's size to 0.9\textwidth my figure will just end up on the right column, sized to be two-columns wide.  Has anyone done this before?
118393
I'm trying to insert a figure into my LaTeX file using the following syntax:  \begin{figure}   \centering   \includegraphics [width=3in]{fig1.png}   \caption{Calculation of shortest path betweenness}   \label{Fig.3:Shortest path betweenness} \end{figure}   It worked for me before but this time I'm getting the following error:   LaTeX Error: \begin{figure} on input line xxx ended by \end{document}   Also, hovering over the red cross symbol indicating error in Eclipse, I see this message    paragraph ended before Gin@iii was completed.   It's obvious that I have the \end{figure} to end my \begin{figure} so I don't understand how I still get that error.  Can someone please tell me what the problem is?  Edit: Add more details for debugging. The problem went away if I remove '[width=3in]'. Here is the detail error:  pdflatex&gt; Runaway argument? pdflatex&gt; width=3in]{fig1.png} \caption {Caption} \label {Fig.1}  pdflatex&gt; ! Paragraph ended before \Gin@iii was complete. pdflatex&gt; &lt;to be read again&gt;  pdflatex&gt;                    \par  pdflatex&gt; l.40  pdflatex&gt;        pdflatex&gt;  pdflatex&gt; Underfull \vbox (badness 10000) has occurred while \output is active pdflatex&gt; (./document.bbl pdflatex&gt;  pdflatex&gt; Package natbib Warning: Empty `thebibliography' environment on input line 3.   Added sample code:  \documentclass[10pt,psfig,letterpaper,twocolumn]{article} \usepackage{geometry} \usepackage{graphics} \usepackage{setspace} \usepackage{natbib} \usepackage{verbatim} \usepackage[scaled=0.9]{helvet} \singlespacing \paperwidth 8.5in \paperheight 11in \oddsidemargin 0in \headsep 1.3cm  \geometry{left=0.75in,top=0.75in,right=0.75in,bottom=1in} \textwidth 7in  \textheight 9.25in \columnsep 0.4in \footskip 0in  \renewcommand{\bibname}{REFERENCE} \pagestyle{empty}  \begin{document} \bibliographystyle{acm}   \title{\fontfamily{phv}\selectfont{\huge{\bfseries{Title here}}}} \author{ {\fontfamily{ptm}\selectfont{\large{\bfseries{author name}}}}\thanks{contact info }}  \maketitle \thispagestyle{empty}  \section*{\fontfamily{phv}\selectfont{\normalsize{\bfseries{Section name}}}}  \begin{figure} \centering \includegraphics[width=3in]{fig1.png} \caption{Caption} \label{Fig.1} \end{figure}  \pagebreak[4] \vspace*{5.52in} \bibliography{ref} \end{document}
92598
I'm trying to include a png figure and it works when I see it in dvi, but the ps comes in black and white.  If I compile directly to pdf there is no problem. However I'm using psTricks for a different figure, so I need to use ps first.  Any suggestions?
464
I want to import graphics into my main input file using the macro \includegraphics. It does not work if the filename contains spaces.   also discusses this subject, but there is no solution there.  My compilation routine is latex->dvips->ps2pdf (because of PSTricks).
43516
I which to have a wrapped figure in a custom float environment: the caption should be on top and carry the name "Infographic". Unfortunately I don't know how to do this.   This is what I came up with  \documentclass{article}  \usepackage{float} \usepackage{wrapfig}  \floatstyle{plain} \newfloat{infographic}{H}{info} \floatname{infographic}{Infographic}  \begin{document}  \begin{wrapfigure}{r}{.4\textwidth} \begin{infographic} \centering \includegraphics[width=.4\textwidth]{test} \end{infographic} \end{wrapfigure}  \end{document}   but the newfloat completely messes up the wrapfigure.