I have a template for my project and I don't know very much about LaTeX. It puts that for putting an image is:
\begin{figure}
\centering
% dummy figure replacement
\begin{tabular}{@{}c@{}}
\rule{.5\textwidth}{.5\textwidth} \\
\end{tabular}
\caption{\label{fig:example}A figure}
\end{figure}
but I think that in this text is missing a command to insert the image like this: \includegraphics[width=0.7\textwidth]{mifigure}
but if I put that, it does´t work.
also if I put \includegraphics
without width=0.7\textwidth
, the image appear too big to the side of the document.
(my image is inside a folder and it is .png
)
Now I have another problem related to this.
In main.tex
\documentclass{MScthesisITEM}
\DeclareGraphicsExtensions{.pdf,.jpg,.png}
\graphicspath{{./figs/}}
In example chapter4.tex
\begin{figure}
\centering
% dummy figure replacement
\begin{tabular}{@{}c@{}}
\rule{.5\textwidth}{.5\textwidth} \\
\end{tabular}
\caption{\label{fig:example}A figure}
\end{figure}
This shows a black image in the center of the document.
In my chapter.tex
\begin{figure}
\centering
% dummy figure replacement
\begin{tabular}{@{}c@{}}
\rule{.5\textwidth}{.5\textwidth} \\
\includegraphics[width=.5\linewidth]{circuitpacket}
\end{tabular}
\caption{ Explanation...}
\label{fig:comparison_circuit}
\end{figure}
I obtained the black image and my image after the black image. How can I erase the black image?
documentclass
and additional packages you're using... because the result depend on these things... Make sure you've included the packagegraphicx
. Second, I'm not sure it is customary to insert the\label
on the\caption
argument (although it depends on theclass
you're using. Third, there's an option (intead ofwidth
, you can use\includegraphics[scale=.2]{myfigure}
\rule{<width>}{<height>}
creates a black box, so the line `\rule{.5\textwidth}{.5\textwidth} \` adds a square black box.easyfig
package.