6

this is my first time that i use latex but im trying to put some pngs and eps image files but i get the error "Error: Not in outer par mode. " please help.

\documentclass[journal]{IEEEtran}
\usepackage{graphicx}

\begin{document}

\title{Bare Demo of IEEEtran.cls for Journals}

\author{Michael~Shell,~\IEEEmembership{Member,~IEEE,}
       John~Doe,~\IEEEmembership{Fellow,~OSA,}
      and~Jane~Doe,~\IEEEmembership{Life~Fellow,~IEEE}% <-this % stops a space
\thanks{M. Shell is with the Department of Electrical and Computer Engineering, Georgia Institute of Technology, Atlanta, GA, 30332 USA e-mail: (see http://www.michaelshell.org/contact.html).}% <-this % stops a >space
\thanks{J. Doe and J. Doe are with Anonymous University.}% <-this % stops a space
\thanks{Manuscript received April 19, 2005; revised December 27, 2012.}}

\markboth{Journal of \LaTeX\ Class Files,~Vol.~11, No.~4, December~2012}%
{Shell \MakeLowercase{\textit{et al.}}: Bare Demo of IEEEtran.cls for Journals}


\maketitle

\begin{abstract}
The abstract goes here.
\end{abstract}

\begin{IEEEkeywords}
IEEEtran, journal, \LaTeX, paper, template.
\end{IEEEkeywords}

\IEEEpeerreviewmaketitle

\section{Actividades}
Se lanzo un dado equilibrado de seis caras un numero suficiente de veces hasta hasta completar 120 series. Una serie consiste en un numero de lanzamientos que terminaba cuando aparecia el primer exito. El exito consistia en conseguir un multiplo de 3. Acontinuacion se procedio a registrar los datos sus frecuencias relativas y compararlas >con el modelo matematico.

\section{Experimentos}

\begin{table}
\begin{tabular}{|c|c|c|}
\hline
($i$)&($f_i$)&($P_i$)\\
\hline
1&0.317&0.333\\
2&0.292&0.222\\
3&0.150&0.148\\
4&0.058&0.099\\
5&0.058&0.066\\
6&0.033&0.044\\
7&0.058&0.029\\
8&0.017&0.020\\
9&0.008&0.013\\
10&0.000&0.009\\
11&0.008&0.006\\
\hline
\end{tabular}


\begin{figure}
\centering
        \includegraphics[widht=\textwidht]{C:/Users/Tzukasa/Pictures/grafico.png}
\label{fig:grafico}
\end{figure}


\begin{figure}
\includegraphics[width=0.90\textwidth]{barra2.eps}
\caption{Frecuencias empiricas y teoricas para el numero de lanzamientos de un dado necesarios para obtener un multiplo de 2}
\label{barra2}
\end{figure}

\caption{Frecuencuas relativas ($f_i$) y probabilidades te\'oricas ($P_i$) para el numero de intetos necesarios ($i$) para obtener el primer m\'ultiplo de 3 al lanzar un dado.}
\label{tablaExp1}
\end{table}

\IEEEPARstart{T}{his} demo file is intended to serve as a ``starter file''
for IEEE journal papers produced under \LaTeX\ using
IEEEtran.cls version 1.8 and later.

I wish you the best of success.

\hfill mds

\hfill December 27, 2012

\subsection{Subsection Heading Here}
Subsection text here.

\subsubsection{Subsubsection Heading Here}
Subsubsection text here.


\section{Conclusion}
The conclusion goes here.


\appendices
\section{Proof of the First Zonklar Equation}
Appendix one text goes here.

\section{}
Appendix two text goes here.


\section*{Acknowledgment}


The authors would like to thank...

\ifCLASSOPTIONcaptionsoff
 \newpage
\fi


\begin{thebibliography}{1}

\bibitem{IEEEhowto:kopka}
H.~Kopka and P.~W. Daly, \emph{A Guide to \LaTeX}, 3rd~ed.\hskip 1em plus
  0.5em minus 0.4em\relax Harlow, England: Addison-Wesley, 1999.

\bibitem{Esparza2013}
A. Esparza, \emph{A Guide to \LaTeX}, 3rd~ed \hskip 1em plus 0.5em minus 0.4em\realx Harlow England: Addison-Wesley, 1999.

\end{thebibliography}


\begin{IEEEbiography}{Michael Shell}
Biography text here.
\end{IEEEbiography}

\begin{IEEEbiographynophoto}{John Doe}
Biography text here.
\end{IEEEbiographynophoto}

\begin{IEEEbiographynophoto}{Jane Doe}
Biography text here.
\end{IEEEbiographynophoto}

\end{document}
  • If you select your code and click on the button {} at the top menu it marks it as a code as I've did it above. Or you can manually enter four whitespace characters to mark it. – percusse Sep 8 '14 at 18:10
  • 2
    the error is being reported because you can't nest one float inside another, and you appear to be trying here to include two figures inside a (floating) table. if they are meant to be a unit, then omit the figure wrappers, and just include the \includegraphics commands, using a separate package to add the captions. there may still be some confusion with the final caption, but i haven't time to experiment. – barbara beeton Sep 8 '14 at 18:21
  • 1
    Also widht=\textwidht will probably confuse \includegraphics. – Thruston Sep 8 '14 at 18:22
  • 1
    @Thruston: Probably? ;-) I would say, it will definitely confuse \includegraphics ;-) – user31729 Sep 8 '14 at 19:25
5

the error is being reported because you can't nest one float inside another, and you appear to be trying here to include two figures inside a (floating) table.

if they are meant to be a unit, then omit the figure wrappers, and just include the \includegraphics commands, using a separate package to add the captions. the package caption provides the command \captionof to handle such situations.

the first figure, with the \label{fig:grafico}, will not be properly referenceable, since there is no caption that the label can be attached to.

1

Several things appear to gone amiss when the existing template was edited. The immediate cause of the error you're getting is that the following three instructions:

\caption{Frecuencuas relativas ($f_i$) y probabilidades te\'oricas ($P_i$) para el numero de intetos necesarios ($i$) para obtener el primer m\'ultiplo de 3 al lanzar un dado.}
\label{tablaExp1}
\end{table}

appear to have gotten separated from the rest of the table environment. You should move these lines to immediately after the line that contains \end{tabular}.

There are several other, typo-kind errors that need to be fixed. E.g., \realx -> \relax, and widht=\textwidht -> width=\textwidth.

Even with these modifications, the document won't look right, primarily because the graphics in both figure environments are much too wide. Change \textwidth to \columnwidth in both figures and see if the resulting look is what you want.

Here's a version of your code that compiles and fixes the width issues of both figure environments:

\documentclass[journal]{IEEEtran}
\usepackage[demo]{graphicx} % omit 'demo' option in real document
\usepackage[spanish]{babel}
\usepackage[T1]{fontenc}

%% The following three directives are optional
\usepackage{caption}
\captionsetup[figure]{font=footnotesize,
                      labelsep=period}
\captionsetup[table]{font={footnotesize,sc},
                     labelsep=newline,
                     justification=centering}
\begin{document}

\title{Bare Demo of IEEEtran.cls for Journals}

\author{Michael~Shell,~\IEEEmembership{Member,~IEEE,}
       John~Doe,~\IEEEmembership{Fellow,~OSA,}
      and~Jane~Doe,~\IEEEmembership{Life~Fellow,~IEEE}% <-this % stops a space
\thanks{M. Shell is with the Department of Electrical and Computer Engineering, Georgia Institute of Technology, Atlanta, GA, 30332 USA e-mail: (see http://www.michaelshell.org/contact.html).}% <-this % stops a >space
\thanks{J. Doe and J. Doe are with Anonymous University.}% <-this % stops a space
\thanks{Manuscript received April 19, 2005; revised December 27, 2012.}}

\markboth{Journal of \LaTeX\ Class Files,~Vol.~11, No.~4, December~2012}%
{Shell \MakeLowercase{\textit{et al.}}: Bare Demo of IEEEtran.cls for Journals}


\maketitle

\begin{abstract}
The abstract goes here.
\end{abstract}

\begin{IEEEkeywords}
IEEEtran, journal, \LaTeX, paper, template.
\end{IEEEkeywords}

\IEEEpeerreviewmaketitle

\section{Actividades}
Se lanzo un dado equilibrado de seis caras un numero suficiente de veces hasta hasta completar 120 series. Una serie consiste en un numero de lanzamientos que terminaba cuando aparecia el primer exito. El exito consistia en conseguir un multiplo de 3. Acontinuacion se procedio a registrar los datos sus frecuencias relativas y compararlas >con el modelo matematico.

\section{Experimentos}

\begin{table}[h!]
\centering
\begin{tabular}{|c|c|c|}
\hline
($i$)&($f_i$)&($P_i$)\\
\hline
1&0.317&0.333\\
2&0.292&0.222\\
3&0.150&0.148\\
4&0.058&0.099\\
5&0.058&0.066\\
6&0.033&0.044\\
7&0.058&0.029\\
8&0.017&0.020\\
9&0.008&0.013\\
10&0.000&0.009\\
11&0.008&0.006\\
\hline
\end{tabular}
\caption{Frecuencuas relativas ($f_i$) y probabilidades te\'oricas ($P_i$) para el numero de intetos necesarios ($i$) para obtener el primer m\'ultiplo de 3 al lanzar un dado.}
\label{tablaExp1}
\end{table}


\begin{figure}[h!]
%%%\centering
\includegraphics[width=\columnwidth]{C:/Users/Tzukasa/Pictures/grafico.png}
\label{fig:grafico}
\end{figure}


\begin{figure}[ht!]
\includegraphics[width=\columnwidth]{barra2.eps}
\caption{Frecuencias empiricas y teoricas para el numero de lanzamientos de un dado necesarios para obtener un multiplo de 2}
\label{barra2}
\end{figure}


\IEEEPARstart{T}{his} demo file is intended to serve as a ``starter file''
for IEEE journal papers produced under \LaTeX\ using
IEEEtran.cls version 1.8 and later.

I wish you the best of success.

\hfill mds

\hfill December 27, 2012

\subsection{Subsection Heading Here}
Subsection text here.

\subsubsection{Subsubsection Heading Here}
Subsubsection text here.


\section{Conclusion}
The conclusion goes here.


\appendices
\section{Proof of the First Zonklar Equation}
Appendix one text goes here.

\section{}
Appendix two text goes here.


\section*{Acknowledgment}


The authors would like to thank...

\ifCLASSOPTIONcaptionsoff
 \newpage
\fi


\begin{thebibliography}{1}

\bibitem{IEEEhowto:kopka}
H.~Kopka and P.~W. Daly, \emph{A Guide to \LaTeX}, 3rd~ed.\hskip 1em plus 0.5em minus 0.4em\relax Harlow, England: Addison-Wesley, 1999.

\bibitem{Esparza2013}
A. Esparza, \emph{A Guide to \LaTeX}, 3rd~ed \hskip 1em plus 0.5em minus 0.4em\relax Harlow England: Addison-Wesley, 1999.

\end{thebibliography}

\begin{IEEEbiography}{Michael Shell}
Biography text here.
\end{IEEEbiography}

\begin{IEEEbiographynophoto}{John Doe}
Biography text here.
\end{IEEEbiographynophoto}

\begin{IEEEbiographynophoto}{Jane Doe}
Biography text here.
\end{IEEEbiographynophoto}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.