Menu
Blog moved to https://alihazrat.medium.com
The cross reference and hyperlink generation in LaTeX is a sensitive feature to the use of underscore. (<_>).
Example 1: \url generates an hyperlink to a webpage and includes the webpage. However, if the url contains an underscore, LaTeX may fail to generate a correct link and may not point to the desired webpage. For example, if the url is www.example.com/page_one. and a user tries to generate the hyperlink by writing the following code; \url{www.example.com/page_one} This may not generate a correct hyperlink. How to solve this problem. The solution is pretty simple. Just type the following instead. \url{www.example.com/page\_one} The only addition is a backslash (\), just before the underscore (_). Example 2: Similarly, if a user refers to a figure/graphics included in a document, and the label contains an underscore, the hyperlink will not be generated and the output PDF document will ??. For example, This has been shown in Figure \ref{example_two} The figure has been included as shown below. \begin{figure} \includegraphics{example.png} \caption{This is an example caption} \label{example_two} \end{figure}. The simple solution to this problem is, remove the underscore (_) from the label name. So, rename the label as \label{exampletwo}. Comments are welcomed.
24 Comments
LaTeX Errors displayed in log file:
I found no \bibdata command---while reading file paperbyali.aux I found no \bibstyle command---while reading file paperbyali.aux In a recent submission of my LaTeX source file for a conference, I faced the above errors. This type of error occurs when a user uses BibTex for bibliography. However, I was not using BibTex for bibliography. I put all the references into the main .tex file, and generated the bibliography by using \begin{thebibliography} and \end{thebibliography} which is simply an alternative to .bibTeX for generating bibliography in LaTeX. I compiled my file and generated output successfully. But, as soon as I uploaded it on to the server (easychair.org), Mr. LaTeX would give me the same error. I found no \bibdata command---while reading file paperbyali.aux I found no \bibstyle command---while reading file paperbyali.aux There are two approaches to solve the above problem. First one, I may have gone for generating bibliography using the BibTeX. This would have meant writing up all the references (almost 30 plus in my case) in the BibTeX format, which may be time consuming if you are running short on time. So, I followed the second approach. The server expected the file to contain .bib files, and call to the .bib file. I generated an empty foo.bib file, and made a call to it in the main .tex file, as done in the usual way. However, rather than using \bibliography{foo.bib} for calling the .bib file, I used \nobibliography{foo.bib}. Thus, the bibliography was generated from the references specified in the main .tex file and I got rid of the errors by the server, as now, there was a call to .bib file, which the server was expecting. |
Hazrat Ali
Hazrat Ali is Assistant Professor at Department of Electrical Engineering, COMSATS University Islamabad, Abbottabad Campus, Abbottabad Pakistan. Archives
October 2020
Categories |