GeneralNeed urgent help!: how to remove filename when including gra

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
banchongsan
Posts: 4
Joined: Sun Apr 29, 2007 10:46 am

Need urgent help!: how to remove filename when including gra

Post by banchongsan »

Hi. I am a beginner of Latex. I have a simple question yet very urgent. Now I am trying to include a jpeg graphic using texniccenter. The enviroment is \usepackage{graphicx}. I use the following command:

\begin{figure}[h]
\centering
\includegraphics[width=1.00\textwidth]{C:/Program Files/texpic/1.jpg}
\end{figure}

The problem is: when the .tex file is converted to PDF, 'Files/texpic/1.jpg' appears above the graphic in my PDF file. How can I remove this???

I would appreciate your quick reply as I have to submit my work soon.

Thank you

Boong

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

Re: Need urgent help!: how to remove filename when including gra

Post by localghost »

No blank spaces in the graphics path! Place the graphics files in a subdirectory of your source code (e. g. "gfx").

The next time you should avoid vocabulary like "urgent", because that is completely futile regarding the problem.
banchongsan
Posts: 4
Joined: Sun Apr 29, 2007 10:46 am

Re: Need urgent help!: how to remove filename when including gra

Post by banchongsan »

Thans for your advise, localghost. But I still don't understand what you mean by "Place the graphics files in a subdirectory of your source code (e. g. "gfx")". Can you explain me once again?

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

Need urgent help!: how to remove filename when including gra

Post by localghost »

Normally, you have a directory for your project (a thesis or something else), because (pdf)latex generates some more files than only the output. This may serve as an example.

Code: Select all

D:\Projects\Thesis
D:\Projects\Thesis\gfx
In the first directory you put the source (.tex) files of the document you are writing. (pdf)latex will generate some important auxiliary files (.aux, .log, …). The second directory (subdirectory of the first one) is the place where you put your graphics files. Taking your example, the code for including a graphics file is the following.

Code: Select all

\begin{figure}[!ht]
  \centering
  \includegraphics[width=\textwidth]{gfx/1}
  \caption{Picture No. 1}\label{fig:picno1}
\end{figure}
You can omit the ending of the file, because pdflatex will find the right file on its own. With this there will be no more path strings in your output. And you have all your files related to a project together in one directory.
Last edited by localghost on Sun Apr 29, 2007 2:05 pm, edited 1 time in total.
banchongsan
Posts: 4
Joined: Sun Apr 29, 2007 10:46 am

Re: Need urgent help!: how to remove filename when including gra

Post by banchongsan »

Thanks a lot! I will try!

By the way I am now in Germany too. i live in Freiburg.

Schoene Sonntag
banchongsan
Posts: 4
Joined: Sun Apr 29, 2007 10:46 am

Re: Need urgent help!: how to remove filename when including gra

Post by banchongsan »

I already tried and it works!

Danke schoen.
Post Reply