Graphics, Figures & TablesProblem with underscore in an image file location

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
User avatar
jlbfunes
Posts: 10
Joined: Wed May 21, 2008 10:35 pm

Problem with underscore in an image file location

Post by jlbfunes »

Hi there,
I want to include an image in my document. This image (Log_Data1.png) is in a folder named IP_SR, so my instruction for including the file is as follows,

Code: Select all

\begin{figure}[!htp]
  \begin{center}
    \subfigure[CL]{\label{mt11} \includegraphics[scale=\szt]{STS/CL/Log_Dat1.png}}
    \subfigure[IP_SR]{\label{mt12} \includegraphics[scale=\szt]{STS/IP_SR/Log_Dat1.png}}
    \subfigure[LP_SR]{\label{mt21} \includegraphics[scale=\szt]{STS/LP_SR/Log_Dat1.png}}\\
    \subfigure[QP_SR]{\label{mt22} \includegraphics[scale=\szt]{STS/QP_SR/Log_Dat1.png}}
  \end{center}
  \caption{Curves for Network }
  \label{im}
\end{figure}
LaTeX (pdf-latex) is finding problematic to interpret the underscore in the address. Could you please suggest a workaround for this issue?

Thank you, guys.
I use TeXnicCenter 1 Beta 7.01. MikTeX 2.7 on Windows Vista Home Edition (I will be switching to Linux soon, I swear).

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
jlbfunes
Posts: 10
Joined: Wed May 21, 2008 10:35 pm

Re: Problem with underscore in an image file location

Post by jlbfunes »

Found the problem by myself. Please disregard this post. The problem was in the caption of the subfigures. I just changed the "_" to "\_" and it worked correctly.

Thank you.
I use TeXnicCenter 1 Beta 7.01. MikTeX 2.7 on Windows Vista Home Edition (I will be switching to Linux soon, I swear).
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Problem with underscore in an image file location

Post by localghost »

Generally it is not recommendable to use the underscore neither in labels nor in the name and the path of a graphics file. It is reserved for subscripts in math mode. For the files issue there is the grffile package from the oberdiek bundle.

Obviously you are using the subfigure package. It is obsolete [1]. Replace it by another package and use the provided structures.

[1] View topic: Obsolete packages and document classes - Avoid usage!


Best regards
Thorsten
Post Reply