Re: Including a hyperlink removes coloring from my URLs

2017-04-06 Thread Jacob Bishop
On Thu, Mar 30, 2017 at 4:41 PM, Steve Litt 
wrote:

> On Thu, 30 Mar 2017 16:25:18 -0400
> "Paul A. Rubin"  wrote:
>
> > On 03/30/2017 03:45 PM, Steve Litt wrote:
>
> [snip Steve's symptom description]
>
> > I made a small test document (attached) using the standard book
> > class. When I added the hyperlink to the document, I got an error
> > message about an option class between two packages (that was not
> > there when the document had URLs but not hyperlinks).


Following Paul's lead, I made a small test document, but since I like to
use options that are provided through the LyX interface whenever possible,
I did everything through the "PDF Properties" dialogue under
document>settings to enable the options that Steve indicated. This way, I
wasn't putting anything into the document class options field, and the only
thing I had to put in the preamble was except \usepackage{soul}. (oh, and I
put pdfpagelabels in the "Additional Options" box under the "PDF
Properties" section of document settings).

Interestingly, I didn't get an error at all when compiling.

It had
> > something to do with one package loading with the option unicode=true
> > while some earlier package is apparently a unicode denier.
>

Looking at the CTAN page for soul (http://ctan.org/pkg/soul), I would guess
that this is the "unicode denier." The documentation points to another
package, soulutf8 (http://ctan.org/pkg/soulutf8) to use if you want unicode
support. My sample document didn't have any unicode in it so maybe that's
why the problem isn't triggered.


> > Following the suggestion in the error message, I moved the unicode
> > option and all the options for hyperref to the document class options
> > field, and that fixed things ... sort of. The URLs and the hyperlink
> > are all colored now, but the color is purple (or purplish), which
> > would not be my first (second, third, ...) choice. Presumably there's
> > a place to specify an option to some package to use red, blue, ...
>

Based on the way I set things up, in the "Additional Options" box of the
"PDF Properties" tab, putting urlcolor=red does the trick. (see
https://www.tug.org/applications/hyperref/manual.html#x1-90003.5 ).

See attached.

Jacob


url_hyperlink_colors.lyx
Description: application/lyx


Re: Including a hyperlink removes coloring from my URLs

2017-03-31 Thread Paul A. Rubin

On 03/31/2017 03:48 PM, Steve Litt wrote:

On Thu, 30 Mar 2017 16:25:18 -0400
"Paul A. Rubin"  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



Re: Including a hyperlink removes coloring from my URLs

2017-03-31 Thread Steve Litt
On Thu, 30 Mar 2017 16:25:18 -0400
"Paul A. Rubin"  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


Re: Including a hyperlink removes coloring from my URLs

2017-03-30 Thread Steve Litt
On Thu, 30 Mar 2017 16:25:18 -0400
"Paul A. Rubin"  wrote:

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

[snip Steve's symptom description]

> I made a small test document (attached) using the standard book
> class. When I added the hyperlink to the document, I got an error
> message about an option class between two packages (that was not
> there when the document had URLs but not hyperlinks). It had
> something to do with one package loading with the option unicode=true
> while some earlier package is apparently a unicode denier.
> 
> Following the suggestion in the error message, I moved the unicode 
> option and all the options for hyperref to the document class options 
> field, and that fixed things ... sort of. The URLs and the hyperlink
> are all colored now, but the color is purple (or purplish), which
> would not be my first (second, third, ...) choice. Presumably there's
> a place to specify an option to some package to use red, blue, ...
> 
> Paul

VERY nice, Paul. You just trapped the problem.

It turns out adding unicode=true to mine didn't work, but with yours
working perfectly, I can now keep carving down mine until I get it to
work like yours. I'll be using your minimal case as an example in my
troubleshooting classes: You really sectioned it down.

Thanks,

SteveT

Steve Litt
March 2017 featured book: Troubleshooting: Why Bother?
http://www.troubleshooters.com/twb


Re: Including a hyperlink removes coloring from my URLs

2017-03-30 Thread Paul A. Rubin

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. 
When I added the hyperlink to the document, I got an error message about 
an option class between two packages (that was not there when the 
document had URLs but not hyperlinks). It had something to do with one 
package loading with the option unicode=true while some earlier package 
is apparently a unicode denier.


Following the suggestion in the error message, I moved the unicode 
option and all the options for hyperref to the document class options 
field, and that fixed things ... sort of. The URLs and the hyperlink are 
all colored now, but the color is purple (or purplish), which would not 
be my first (second, third, ...) choice. Presumably there's a place to 
specify an option to some package to use red, blue, ...


Paul



url_hyperlink.lyx
Description: application/lyx