Monday, November 19, 2012

How to use underscore in Bibtex



Suppose we have two files: the main file name is main.tex and xbib.bibtex file.

The main.tex file contains:

\documentclass[11pt]{article}

\begin{document}

The common properties include\cite{internet1}.

\bibliography{xbib}{}

\bibliographystyle{plain}

\end{document}

The xbib.bibtex file contains:

@MISC{internet1,

  howpublished = {\url{http://www.cse.iitm.ac.in/~sdas/courses/CV_DIP/PDF/lect-Segmen.pdf}},

}

Then it will create a problem like:

! Missing $ inserted.     $

The solution is to add the red colored line in main.tex file as follows:

\documentclass[11pt]{article}

\usepackage{underscore}

\begin{document}

The common properties include\cite {internet1}.

\bibliography{xbib}{}

\bibliographystyle{plain}

\end{document}

The xbib.bibtex file should add the red colored portion:

@MISC{internet1,

  howpublished = {\url{http://www.cse.iitm.ac.in/~sdas/courses/CV\textunderscore_DIP/PDF/lect-Segmen.pdf}},

}

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}

! Undefined control sequence. ......... in latex





look at the following piece of code:

\begin{figure*}

\centerline{

\mbox{\includegraphics{Images\original.eps}}

\mbox{\includegraphics{Images\original.eps}}

}

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

\label{overView}

\end{figure*}

Here  Images is the folder exists in the same directory of the main file with tex extension.

will create Undefined control sequence. Images\original.eps

the problem is here control sequence '\'  is invalid for a sequence of path of image. it should be replaced by  '/' .

so the corrected code is:

\begin{figure*}

\centerline{

\mbox{\includegraphics{Images/original.eps}}

\mbox{\includegraphics{Images/original.eps}}

}

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

\label{overView}

\end{figure*}