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
|
Hazrat Ali
Hazrat Ali is Assistant Professor at Department of Electrical Engineering, COMSATS University Islamabad, Abbottabad Campus, Abbottabad Pakistan. Archives
October 2020
Categories |