tags:

views:

162

answers:

3

I just created a LaTeX document and compile it to a PDF using pdftex. Every time I make a reference using the \ref command, the reference is put on a new line. Why does this happen and how do I prevent this?

+1  A: 

Are you by any chance using \\ in URLs instead of //? \\ is used as a linebreak in TeX.

Try to localize the problem: create a new file which initializes hyperref the same way, uses no other packages, and has some text and a reference. Check if references still start on new lines. If they do, you can show it here (and on LaTeX forums); if not, add more of your report's preamble until you get a file which exhibits the problem.

Alexey Romanov
Oops, I'm really sorry. I meant ref instead of href. I'm sorry for the mistake.
Bram
+1  A: 

Can you prepare a minimum example demonstrating your problem?

I've tried with:

\documentclass{report}
\usepackage[pdftex,breaklinks=true,bookmarks=true,bookmarksopen= true,pdfpagemode=UseNone,plainpages=false,pdfpagelabels,pdfstartview=FitH,olorlinks=true,citecolor=blue]{hyperref}
\begin{document}
Test \url{http://test.com} \ref{http://someother.com}.
\end{document}

And the whole output is a single line in PDF.

BTW \ref is used to produce internal document links (like in "As described in chapter \ref{chapter:second}...").

Grzegorz Oledzki
A: 

It was my own fault, I used \par for the paragraph sign instead of \P. This is one of my first LaTeX documents, so I overlooked it. Thanks for the quick responses/answers though.

Bram