3

LyX 2.1.2, Linux Ubuntu/Linux Mint package version refuses to print (Export: PDF (XeTex)) URL's (internet addresses) containing the pound sign # to .pdf IN FOOTNOTES, whereas it prints such addresses to .pdf in the main text without problem. Here is the offending URL:

http://www.livius.org/cg-cm/chronicles/abc1/abc1_col_ii.html#column_ii

A similar URL without the # has no problem appearing in .pdf footnotes:

http://www.livius.org/cg-cm/chronicles/abc1/abc1_col_i.html

My document setup is Book (standard class); Module is Biblatex-citation-styles; Bibliography is Citation style - default; Bibliography style = default style = plain. Bibliography generation: processor = Biber

2 Answers 2

2

Define with \urldef a command for the problematic url:

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\urldef\mydangerousurl\url{http://www.livius.org/cg-cm/chronicles/abc1/abc1_col_ii.html#column_ii}
abc\footnote{\mydangerousurl}
\end{document}
1
  • Thanks for sending me on the right path. I found another article which led me closer to the final solution, which works: Commented Nov 26, 2014 at 19:33
2

Thanks Ulrike for sending me on the right path. I found another article which led me closer to the final solution, but which also did not work, but with a little fiddling I finally got it to work as follows: First I added to my LyX document (Book) preamble, at the end of my earlier existing LyX preamble the following two lines of code:

\usepackage{url}

\urldef\mydangerousurl\url{http://www.livius.org/cg-cm/chronicle /abc1/abc1_col_ii.html#column_ii}

Note that the URL above itself, between brackets {} is too long to fit on one line. Next I had to change my earlier attempted footnote, by snipping out the LyX Insert URL command along with the URL inside of it, and replacing all of that by "Insert Tex Code" LyX command, into whose window I pasted the following line:

\mydangerousurl{}

This procedure eliminates use of the LyX "Insert URL" command which had not worked.

Note that my footnote was long and complex, including reference to my bibliography, so my procedure above describes the modification of my long footnote.

This worked for me. Thanks.

PS for including multiple urls: Note that urldef is fussy - it accepts as definitions for URLs only alphabetic characters in any combination or length, upper and lower case. I tried to add numbers at the end, such as mydangerousurl1, and LyX would not output to PDF. However any combination of alphabetic letters works. Try appending A,B,C, etc, to distinguish your URLs or Roman numerals.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .