Hi everyone,
I'm having issues with URLs using the "#" symbol, even though I'm using the url package and have surrounded all URLs with url={\url{...}}. I get an error message when compiling the PDF. This is using LyX 2.0 and BibTeX.
Hi Clemens,
thank you very much for your reply. Sorry if I wasn't clear. I thought the problem was pretty obvious and you indeed guessed correctly. Also I thought providing the troubleshooting URL, the error message and the problem would be enough.
I have tried to produce an MWE now so I would be extremely grateful if you could have a look at it. The solution you gave me means that I would have to put all my bibliography entries, or at least the ones that have URLs with a #-symbol, at the beginning of my document. Correct? I would much prefer a solution that would let me deal with this problem in the *.bib, if there is one.
As you can see from the MWE, I am using the APSR output style and the Natbib package. And yes, I would like the URL to appear in the bibliography. It works for all entries except the ones using "#". Interestingly, it works for "_" without escaping.
One of the troubleshooting Bibtex entries looks as follows:
Do you think the problem might be with the output style? But I've tried different ones - to no avail.
I hope this follow-up now meets your quality standards, so that I may in the future continue to bug this expert forum with my lowly and poorly explained problems (I actually thought that this was what the forum was for. Silly me).
I'm sorry if I offended you. Indeed it wasn't clear where the problem was in your first post. That's not a question of quality standards. It's rather a question of knowing where to start to look, which is far more easy and in most cases only possible, if a MWE is provided. I sincerely hope that this forum is not intended to be an expert forum! I wouldn't call myself an expert at all.
To the problem: in this case the style apsr was a important information, as it turns out. It uses a command \harvardurl which obviously places the url into a \textit command.
So the error was actually this one:
Your solution works at first sight, but it messes with the font. Italic and non-italic are reversed in the bibliography (i.e. what is supposed to be non-italic becomes italicised and vice versa). I have no idea why this is though. Maybe there are packages that are conflicting?
Strangely enough my solution didn't work for me anymore, as I tested it again a few minutes ago... However, this should work (as long as you don't use the hyperref package):
The problem wasn't a conflicting package. You may know that \itshape sets everything in italics, that follows after it until you change it back with \upshape or \normalfont or into another shape. One way to prevent this is to make the changes local, i.e. inside {}. I forgot to do that in the previous suggestion