Graphics, Figures & TablesProblem with reading image name in LaTeX

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ciema7
Posts: 22
Joined: Sat Nov 10, 2018 2:31 am

Problem with reading image name in LaTeX

Post by ciema7 »

Hello Friends,

I have really simple question. Can You advise me why I cannot type to this code (which insert picture) full name or any numbers in the file name and I can only insert the one letter to provide inserting picture? I mean when I name my picture for example "graphics" or "g1" it won't work, but when I insert "g" as a name it will ! Is there any solution or do i have to name each of my pictures as "a", "b", "c", "d".... etc ? Here is my code:

Code: Select all

\begin{figure}[ht]
	\centering
	\includegraphics[width=12cm, height=8cm]graphics
	\caption{This is the picture description}
	\label{fig:graphics}
\end{figure}
Thank You in advance for help.
Last edited by Stefan Kottwitz on Sat Nov 17, 2018 12:58 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.

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

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Problem with reading image name in LaTeX

Post by Stefan Kottwitz »

Hi,

the image name is an argument (parameter) for the \includegraphics command. Such mandatory arguments have to be in curly braces. So this would work:

Code: Select all

\includegraphics[width=12cm, height=8cm]{graphics}
Stefan
LaTeX.org admin
ciema7
Posts: 22
Joined: Sat Nov 10, 2018 2:31 am

Problem with reading image name in LaTeX

Post by ciema7 »

Stefan Kottwitz wrote:Hi,

the image name is an argument (parameter) for the \includegraphics command. Such mandatory arguments have to be in curly braces. So this would work:

Code: Select all

\includegraphics[width=12cm, height=8cm]{graphics}
Stefan
Of course. Thank You very much :)
Post Reply