On 03/31/2017 03:48 PM, Steve Litt wrote:
On Thu, 30 Mar 2017 16:25:18 -0400
"Paul A. Rubin" <parubi...@gmail.com> wrote:

On 03/30/2017 03:45 PM, Steve Litt wrote:
Hi all,

Including one hyperlink in my document removes the color for all my
URLs. What I really want is my hyperlinks colored the same as my
URLs (currently red), but I definitely don't want my URLs colorless.

Does anyone know how to apply hyperlinks without screwing up URL
colors?

RELEVANT FACTS:

Linux, 64 bit Void distro

LyX version 2.2.2

Document class based on document class "book".

\usepackage{soul}

\usepackage[bookmarks,
plainpages=false,pdfpagelabels,colorlinks=true,bookmarksnumbered=true]{hyperref}

\usepackage{color}

I made a small test document (attached) using the standard book
class.
Paul, it turns around that, for some reason, when I put:

\usepackage[bookmarks,
unicode=true,plainpages=false,pdfpagelabels,colorlinks=true,bookmarksnumbered=true]{hyperref}

LyX ignored the arguments. But, when I put:

bookmarks,
unicode=true,plainpages=false,pdfpagelabels,colorlinks=true,bookmarksnumbered=true

in the Custom field in the document settings document class dialog box,
coloration comes back.

So that material must be repeated twice, once in that field, and once
in the layout file.

ACTUALLY, I lied. It turns out that if I have:

\usepackage{hyperref} in the layout and the arguments in the field, it
still works.

OH WAIT, I lied some more. It turns out I don't even have to put in the
layout file:

\usepackage{hyperref}

LyX somehow just knows that.

Whatever this is all about, it's in need of some serious documentation.

But, the good news is, I can go about my business using both URLs and
hyperlinks.

Thanks,

SteveT

Steve Litt
March 2017 featured book: Troubleshooting: Why Bother?
http://www.troubleshooters.com/twb
LyX loads certain LaTeX packages automagically when it sees some features of the document that it knows will need said packages. I'm pretty sure hyperref is in that category (see a hyperlink, load the package). What I believe happens then is that if the user tries to load the package manually in the preamble, LaTeX sees two \usepackage statements for the same package and pays attention to only one of them (the first, I think). I think the automatic load precedes user specifications in the preamble, so the user's options get lost. Seems to me I've seen a trick suggested in some cases where the user indicates that some module or something provides the disputed package, to prevent LyX from adding the automatic load command. (Note all the qualifiers in the previous paragraph: I'm not at all sure about this.)

As the Bard said, though, all's well that ends well.

Paul

Reply via email to