General ⇒ Errors in Inserting .eps files
-
- Posts: 3
- Joined: Mon Jan 14, 2008 4:58 am
Errors in Inserting .eps files
Within the LaTeX code itself, here is what I am entering and the subsequent error:
\documentclass{article}
\usepackage{graphicx}
\usepackage{epsfig}
\begin{document}
\begin{figure}
\includegraphics{SemiconductorConductivity.eps}
%Yes, I made sure to put that file in the same directory as the .tex file
\end{figure}
\end{document}
It gives me a blank area in the document where the picture should be. TeXnicCenter is giving me the following error:
! LaTeX Error: Unknown Graphics Extension: .eps
Does anyone know why it is not working, and how to fix it so that I can include graphs and such in my reports? Thanks
-----------------
Edit: I sorta got it by changing \usepackage{graphicx} to \usepackage[pdftex]{graphicx} and then just changing the filename to .jpg instead of .eps. I suppose this works now, but it loads the image on another page, not in the location where I need it. Is it possible through this method to shrink down the image and place it at a specific location on the page, and if so, how?
Right now this how my code is working:
\section{Calculations}
\subsection{Magnetic Field}
We will demonstrate how to calculate the magnetic field based on the available data. The magnetic field is calculated using the equation:
\begin{eqnarray}
\vec{B} & = & \mu_0 {\left(\frac{4}{5}\right)}^{3/2} {nI \over d}
\end{eqnarray}
where n is the number of turns around the coil and d is the distance between the coils. For this experiment, n = 130 and d = 15 cm.
\begin{eqnarray}
\vec{B} & = & 4\pi \cdot{10^{-7} T m/A} {\left(\frac{4}{5}\right)}^{3/2} {{\left(130 \right)}{\left(1.102 A\right)} \over 15cm} \nonumber \\
& = & 8.588*10^{-4} T \nonumber
\end{eqnarray}
\subsection{Velocity in terms of e and m}
\subsection{Compute the e/m ratio}
We will now demonstrate how to calculate the ratio of electron charge to electron mass:
%This is the location in the document where the picture is showing up
\begin{eqnarray}
{m \frac{v^2}{r}} = {evB}
\end{eqnarray}
Since $v = \sqrt{{2eV}\over m}$
\begin{eqnarray}
m \frac{\left(\sqrt{{2eV}\over m}\right)^2}{r} & = & {e \cdot B \cdot \sqrt{{2eV}\over m}} \nonumber \\
\frac{e}{m} & = & {{2 \cdot V} \over {B^2 \cdot r^2}}
\end{eqnarray}
\subsection{Average e/m ratio}
\begin{figure}
\begin{center}
\includegraphics{SemiconductorConductivity2.jpg}
\caption{Conductivity of a Semiconductor Material}
\end{center}
\end{figure}
%This is where I actually want the picture to show.
\subsection{Electron Velocity}
The velocity of the electron can be calculated as such:
\subsection{Error Analysis}
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
Errors in Inserting .eps files
When using the table or figure environments, the tables or figures will be treated as floating objects; which means that they can float through your docuement until LaTeX finds the right place for them; if you want to "force" LaTeX to place a floating object where you want, use something like the following: (read l2tabu (link below) to see the reasons for using \centering instead of \begin{center}...\end{center})
Code: Select all
\begin{figure}[!ht]
\centering
\includegraphics[width=4cm]{your_image.eps}
\end{figure}
If you use .eps images then you can produce a .dvi or a .ps final document.
The eqnarray environment sholdn't be used anymore (the reasons can be found in l2tabu). Use align or some of the other environments provided by the amsmath package.
-
- Posts: 3
- Joined: Mon Jan 14, 2008 4:58 am