Monday, November 19, 2012

Missing number, treated as zero. \discretionary problem in latex


If u have a .tex file file like this:

\documentclass[11pt]{article}

\usepackage{graphicx}

\usepackage{underscore}

\begin{document}

\begin{figure*}

\centerline{

\mbox{\includegraphics[width=3.00in]{ImageName1_0.eps}}

\mbox{\includegraphics[width=3.00in]{ImageName1_0.eps}}

}

\caption{Replace text here with your desired caption.}

\label{overView}

\end{figure*}

\end{document}

this file will create a problem 'Missing number, treated as zero.     \discretionary  in latex'

cause: having underscore in the  ImageName1_0. while using \usepackage{underscore} package this creates the problem. so if we use \usepackage{underscore}in the preamble  then we should avoid underscore in the image name as follows. if we don't use \usepackage{underscore} then it will not create error.

solution: green colored text.

\documentclass[11pt]{article}

\usepackage{graphicx}

\usepackage{underscore}

\begin{document}

\begin{figure*}

\centerline{

\mbox{\includegraphics[width=3.00in]{ImageName.eps}}

\mbox{\includegraphics[width=3.00in]{ImageName.eps}}

}

\caption{Replace text here with your desired caption.}

\label{overView}

\end{figure*}

\end{document}

No comments:

Post a Comment