插入数字 错误:未处于外层模式

插入数字 错误:未处于外层模式

这是我第一次使用乳胶,但我试图放入一些 png 和 eps 图像文件,但出现错误“错误:不在外部模式。”请帮忙。

\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}

答案1

报告错误的原因是您不能将一个浮点数嵌套在另一个浮点数中,而您似乎正试图在一个(浮动)表格中包含两个数字。

如果它们是一个单元,则省略图形包装器,只包含命令\includegraphics,使用单独的包来添加标题。该包提供了处理这种情况的caption命令。\captionof

第一个图带有 ,\label{fig:grafico}无法正确引用,因为没有可以附加标签的标题。

答案2

编辑现有模板时似乎出现了一些问题。您收到的错误的直接原因是以下三条指令:

\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}

似乎已经与table环境的其余部分分离。您应该将这些行移至包含 的行之后\end{tabular}

还有其他几个拼写错误需要修复。例如\realx->\relaxwidht=\textwidht-> width=\textwidth

即使进行了这些修改,文档看起来仍然不正确,主要是因为两个figure环境中的图形都太宽了。将两个图中的更改\textwidth\columnwidth,看看最终的外观是否符合您的要求。

这是编译并修复两种环境的宽度问题的代码版本figure

\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}

相关内容