[Tex/LaTex] how to deal with Long URL in LaTeX

line-breakingurls

I am a green hand in LaTeX. I sought online and found a lot of posts about the question I asked. However, I cannot follow their instructions. Could anyone give me a hand ? (OS is ubuntu 12.04.)

The example code are as follows:

\url{http://www.coreavc.com/index.php?option=com_content&task=view&id=27&Itemid=1com/index.php?option=com_content&task=view&id=27&Itemid=1}

what is the LaTeX code which can wrap this long URL?

The latex code I have is:
enter image description here
enter image description here

The result is like this. For URLs, they do not wrap automatically but go out of the page.
enter image description here

Best Answer

Another approach: Split the linked URL and the link text with \href:

\documentclass{scrartcl} 
\usepackage{hyperref}
\begin{document}

Only Domain:
\href{http://www.coreavc.com/index.php?option=com_content&task=view&id=27&Itemid=1com/index.php?option=com_content&task=view&id=27&Itemid=1}{http://www.coreavc.com}

Domain with description:
\href{http://www.coreavc.com/index.php?option=com_content&task=view&id=27&Itemid=1com/index.php?option=com_content&task=view&id=27&Itemid=1}{http://www.coreavc.com Subpage I want}

Domain with description:
\href{http://www.coreavc.com/index.php?option=com_content&task=view&id=27&Itemid=1com/index.php?option=com_content&task=view&id=27&Itemid=1}{http://www.coreavc.com Start $\to$ Menu 1 $\to$ Menu2}

\end{document}

Text with marked links

Remark for the 3rd version (navigation path): There you can describe how you can find the page via web navigation (or menu pathes). This may also help a reader, if the link will break in future - unless the webpage is reorganized completely.

There are also packages to print menus, e.g. menukeys