Use of linkcolor option in hyperref












0















This question is posted as a requested follow-on from options for appearance of links in hyperref , to clear up some odd behaviour in hyperref.



In the snippet below, the two usepackage commands both work, but 'linkcolor=.' throws an error when combined with colorlinks=true (error text shown at end of post).



documentclass{article}

usepackage[colorlinks=true,linkcolor=]{hyperref}
%usepackage[linkcolor=.]{hyperref}

begin{document}

See Figure~ref{fig}

begin{figure}
caption{This is an empty figure label{fig}}
end{figure}
end{document}


If I use the line



usepackage[colorlinks=true,linkcolor=.]{hyperref}


(note the dot), I get error text:



! LaTeX Error: Undefined color `.'



and the error comes immediately after the closing brace of ref{}



The effect I wanted to achieve was to remove boxes around links and leave all links text color except actual URLs, so when I used this command I also had urlcolor=blue in the options, but that was not needed to reproduce the error. But the following line did work, in that all links but URLs were invisible:



usepackage[colorlinks=true,urlcolor=blue,linkcolor=]{hyperref}


Using MiKTeX-pdfTeX 2.9.6959 (1.40.20) (MiKTeX 2.9.6960) on Windows 10










share|improve this question


















  • 1





    Add usepackage{xcolor}.

    – Ulrike Fischer
    2 hours ago











  • Of course you get an error with linkcolor=. as this is setting the colour to ., which is a non-existent colour. SImialrly, with linkcolor= you are remving all colour so the lins are invisible. Doesn't usepackage[colorlinks=true,linkcolor=black]{hyperref} give what you want?

    – Andrew
    2 hours ago













  • Thank you for your advice to add xcolor. Perhaps hyperref should be loading it? I did not want to assume text was black. linkcolor=. is supposed to match the current text colour. See the discussion linked in the question for context. linkcolor=. works under some circumstances. The dot on its own is not necessarily an error.

    – Dr Darren
    2 hours ago
















0















This question is posted as a requested follow-on from options for appearance of links in hyperref , to clear up some odd behaviour in hyperref.



In the snippet below, the two usepackage commands both work, but 'linkcolor=.' throws an error when combined with colorlinks=true (error text shown at end of post).



documentclass{article}

usepackage[colorlinks=true,linkcolor=]{hyperref}
%usepackage[linkcolor=.]{hyperref}

begin{document}

See Figure~ref{fig}

begin{figure}
caption{This is an empty figure label{fig}}
end{figure}
end{document}


If I use the line



usepackage[colorlinks=true,linkcolor=.]{hyperref}


(note the dot), I get error text:



! LaTeX Error: Undefined color `.'



and the error comes immediately after the closing brace of ref{}



The effect I wanted to achieve was to remove boxes around links and leave all links text color except actual URLs, so when I used this command I also had urlcolor=blue in the options, but that was not needed to reproduce the error. But the following line did work, in that all links but URLs were invisible:



usepackage[colorlinks=true,urlcolor=blue,linkcolor=]{hyperref}


Using MiKTeX-pdfTeX 2.9.6959 (1.40.20) (MiKTeX 2.9.6960) on Windows 10










share|improve this question


















  • 1





    Add usepackage{xcolor}.

    – Ulrike Fischer
    2 hours ago











  • Of course you get an error with linkcolor=. as this is setting the colour to ., which is a non-existent colour. SImialrly, with linkcolor= you are remving all colour so the lins are invisible. Doesn't usepackage[colorlinks=true,linkcolor=black]{hyperref} give what you want?

    – Andrew
    2 hours ago













  • Thank you for your advice to add xcolor. Perhaps hyperref should be loading it? I did not want to assume text was black. linkcolor=. is supposed to match the current text colour. See the discussion linked in the question for context. linkcolor=. works under some circumstances. The dot on its own is not necessarily an error.

    – Dr Darren
    2 hours ago














0












0








0








This question is posted as a requested follow-on from options for appearance of links in hyperref , to clear up some odd behaviour in hyperref.



In the snippet below, the two usepackage commands both work, but 'linkcolor=.' throws an error when combined with colorlinks=true (error text shown at end of post).



documentclass{article}

usepackage[colorlinks=true,linkcolor=]{hyperref}
%usepackage[linkcolor=.]{hyperref}

begin{document}

See Figure~ref{fig}

begin{figure}
caption{This is an empty figure label{fig}}
end{figure}
end{document}


If I use the line



usepackage[colorlinks=true,linkcolor=.]{hyperref}


(note the dot), I get error text:



! LaTeX Error: Undefined color `.'



and the error comes immediately after the closing brace of ref{}



The effect I wanted to achieve was to remove boxes around links and leave all links text color except actual URLs, so when I used this command I also had urlcolor=blue in the options, but that was not needed to reproduce the error. But the following line did work, in that all links but URLs were invisible:



usepackage[colorlinks=true,urlcolor=blue,linkcolor=]{hyperref}


Using MiKTeX-pdfTeX 2.9.6959 (1.40.20) (MiKTeX 2.9.6960) on Windows 10










share|improve this question














This question is posted as a requested follow-on from options for appearance of links in hyperref , to clear up some odd behaviour in hyperref.



In the snippet below, the two usepackage commands both work, but 'linkcolor=.' throws an error when combined with colorlinks=true (error text shown at end of post).



documentclass{article}

usepackage[colorlinks=true,linkcolor=]{hyperref}
%usepackage[linkcolor=.]{hyperref}

begin{document}

See Figure~ref{fig}

begin{figure}
caption{This is an empty figure label{fig}}
end{figure}
end{document}


If I use the line



usepackage[colorlinks=true,linkcolor=.]{hyperref}


(note the dot), I get error text:



! LaTeX Error: Undefined color `.'



and the error comes immediately after the closing brace of ref{}



The effect I wanted to achieve was to remove boxes around links and leave all links text color except actual URLs, so when I used this command I also had urlcolor=blue in the options, but that was not needed to reproduce the error. But the following line did work, in that all links but URLs were invisible:



usepackage[colorlinks=true,urlcolor=blue,linkcolor=]{hyperref}


Using MiKTeX-pdfTeX 2.9.6959 (1.40.20) (MiKTeX 2.9.6960) on Windows 10







hyperref






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 hours ago









Dr DarrenDr Darren

192




192








  • 1





    Add usepackage{xcolor}.

    – Ulrike Fischer
    2 hours ago











  • Of course you get an error with linkcolor=. as this is setting the colour to ., which is a non-existent colour. SImialrly, with linkcolor= you are remving all colour so the lins are invisible. Doesn't usepackage[colorlinks=true,linkcolor=black]{hyperref} give what you want?

    – Andrew
    2 hours ago













  • Thank you for your advice to add xcolor. Perhaps hyperref should be loading it? I did not want to assume text was black. linkcolor=. is supposed to match the current text colour. See the discussion linked in the question for context. linkcolor=. works under some circumstances. The dot on its own is not necessarily an error.

    – Dr Darren
    2 hours ago














  • 1





    Add usepackage{xcolor}.

    – Ulrike Fischer
    2 hours ago











  • Of course you get an error with linkcolor=. as this is setting the colour to ., which is a non-existent colour. SImialrly, with linkcolor= you are remving all colour so the lins are invisible. Doesn't usepackage[colorlinks=true,linkcolor=black]{hyperref} give what you want?

    – Andrew
    2 hours ago













  • Thank you for your advice to add xcolor. Perhaps hyperref should be loading it? I did not want to assume text was black. linkcolor=. is supposed to match the current text colour. See the discussion linked in the question for context. linkcolor=. works under some circumstances. The dot on its own is not necessarily an error.

    – Dr Darren
    2 hours ago








1




1





Add usepackage{xcolor}.

– Ulrike Fischer
2 hours ago





Add usepackage{xcolor}.

– Ulrike Fischer
2 hours ago













Of course you get an error with linkcolor=. as this is setting the colour to ., which is a non-existent colour. SImialrly, with linkcolor= you are remving all colour so the lins are invisible. Doesn't usepackage[colorlinks=true,linkcolor=black]{hyperref} give what you want?

– Andrew
2 hours ago







Of course you get an error with linkcolor=. as this is setting the colour to ., which is a non-existent colour. SImialrly, with linkcolor= you are remving all colour so the lins are invisible. Doesn't usepackage[colorlinks=true,linkcolor=black]{hyperref} give what you want?

– Andrew
2 hours ago















Thank you for your advice to add xcolor. Perhaps hyperref should be loading it? I did not want to assume text was black. linkcolor=. is supposed to match the current text colour. See the discussion linked in the question for context. linkcolor=. works under some circumstances. The dot on its own is not necessarily an error.

– Dr Darren
2 hours ago





Thank you for your advice to add xcolor. Perhaps hyperref should be loading it? I did not want to assume text was black. linkcolor=. is supposed to match the current text colour. See the discussion linked in the question for context. linkcolor=. works under some circumstances. The dot on its own is not necessarily an error.

– Dr Darren
2 hours ago










2 Answers
2






active

oldest

votes


















3














linkcolor=. causes hyperref to issue color{.}



which produces



LaTeX Error: Undefined color `.'


as there is no colour of that name using the standard color package as loaded by hyperref.



You are possibly thinking of the xcolor package syntax wher . means the current color



usepackage{xcolor}
usepackage[colorlinks=true,linkcolor=.]{hyperref}


works, although specifying coloured links this way seems slightly strange choice rather than just specifying the link border to have width 0.






share|improve this answer
























  • Strange to you. Seemed reasonable to me, with my lack of experience. I didn't want a border, so saying 'colour it instead' and then making the colour like the text seemed reasonable to me.

    – Dr Darren
    2 hours ago






  • 1





    @DrDarren there is some cost to adding a colour, the resulting pdf will have code to push a colour on to the stack and restore it, just using the current colour, conversely a pdf link always has a border attribute so setting its width to 0 (pdfborder= 0 0 0) is a far more direct and lightweight way of specifyng this

    – David Carlisle
    1 hour ago



















0














To sum up, as noted above, adding



usepackage{xcolor}



fixes the problem with using the dot in the hyperref options. There are other ways of getting the result I wanted that also do not throw errors; thanks to other posters.



Perhaps hyperref should load xcolor instead of color?






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477785%2fuse-of-linkcolor-option-in-hyperref%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    linkcolor=. causes hyperref to issue color{.}



    which produces



    LaTeX Error: Undefined color `.'


    as there is no colour of that name using the standard color package as loaded by hyperref.



    You are possibly thinking of the xcolor package syntax wher . means the current color



    usepackage{xcolor}
    usepackage[colorlinks=true,linkcolor=.]{hyperref}


    works, although specifying coloured links this way seems slightly strange choice rather than just specifying the link border to have width 0.






    share|improve this answer
























    • Strange to you. Seemed reasonable to me, with my lack of experience. I didn't want a border, so saying 'colour it instead' and then making the colour like the text seemed reasonable to me.

      – Dr Darren
      2 hours ago






    • 1





      @DrDarren there is some cost to adding a colour, the resulting pdf will have code to push a colour on to the stack and restore it, just using the current colour, conversely a pdf link always has a border attribute so setting its width to 0 (pdfborder= 0 0 0) is a far more direct and lightweight way of specifyng this

      – David Carlisle
      1 hour ago
















    3














    linkcolor=. causes hyperref to issue color{.}



    which produces



    LaTeX Error: Undefined color `.'


    as there is no colour of that name using the standard color package as loaded by hyperref.



    You are possibly thinking of the xcolor package syntax wher . means the current color



    usepackage{xcolor}
    usepackage[colorlinks=true,linkcolor=.]{hyperref}


    works, although specifying coloured links this way seems slightly strange choice rather than just specifying the link border to have width 0.






    share|improve this answer
























    • Strange to you. Seemed reasonable to me, with my lack of experience. I didn't want a border, so saying 'colour it instead' and then making the colour like the text seemed reasonable to me.

      – Dr Darren
      2 hours ago






    • 1





      @DrDarren there is some cost to adding a colour, the resulting pdf will have code to push a colour on to the stack and restore it, just using the current colour, conversely a pdf link always has a border attribute so setting its width to 0 (pdfborder= 0 0 0) is a far more direct and lightweight way of specifyng this

      – David Carlisle
      1 hour ago














    3












    3








    3







    linkcolor=. causes hyperref to issue color{.}



    which produces



    LaTeX Error: Undefined color `.'


    as there is no colour of that name using the standard color package as loaded by hyperref.



    You are possibly thinking of the xcolor package syntax wher . means the current color



    usepackage{xcolor}
    usepackage[colorlinks=true,linkcolor=.]{hyperref}


    works, although specifying coloured links this way seems slightly strange choice rather than just specifying the link border to have width 0.






    share|improve this answer













    linkcolor=. causes hyperref to issue color{.}



    which produces



    LaTeX Error: Undefined color `.'


    as there is no colour of that name using the standard color package as loaded by hyperref.



    You are possibly thinking of the xcolor package syntax wher . means the current color



    usepackage{xcolor}
    usepackage[colorlinks=true,linkcolor=.]{hyperref}


    works, although specifying coloured links this way seems slightly strange choice rather than just specifying the link border to have width 0.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 2 hours ago









    David CarlisleDavid Carlisle

    493k4111371885




    493k4111371885













    • Strange to you. Seemed reasonable to me, with my lack of experience. I didn't want a border, so saying 'colour it instead' and then making the colour like the text seemed reasonable to me.

      – Dr Darren
      2 hours ago






    • 1





      @DrDarren there is some cost to adding a colour, the resulting pdf will have code to push a colour on to the stack and restore it, just using the current colour, conversely a pdf link always has a border attribute so setting its width to 0 (pdfborder= 0 0 0) is a far more direct and lightweight way of specifyng this

      – David Carlisle
      1 hour ago



















    • Strange to you. Seemed reasonable to me, with my lack of experience. I didn't want a border, so saying 'colour it instead' and then making the colour like the text seemed reasonable to me.

      – Dr Darren
      2 hours ago






    • 1





      @DrDarren there is some cost to adding a colour, the resulting pdf will have code to push a colour on to the stack and restore it, just using the current colour, conversely a pdf link always has a border attribute so setting its width to 0 (pdfborder= 0 0 0) is a far more direct and lightweight way of specifyng this

      – David Carlisle
      1 hour ago

















    Strange to you. Seemed reasonable to me, with my lack of experience. I didn't want a border, so saying 'colour it instead' and then making the colour like the text seemed reasonable to me.

    – Dr Darren
    2 hours ago





    Strange to you. Seemed reasonable to me, with my lack of experience. I didn't want a border, so saying 'colour it instead' and then making the colour like the text seemed reasonable to me.

    – Dr Darren
    2 hours ago




    1




    1





    @DrDarren there is some cost to adding a colour, the resulting pdf will have code to push a colour on to the stack and restore it, just using the current colour, conversely a pdf link always has a border attribute so setting its width to 0 (pdfborder= 0 0 0) is a far more direct and lightweight way of specifyng this

    – David Carlisle
    1 hour ago





    @DrDarren there is some cost to adding a colour, the resulting pdf will have code to push a colour on to the stack and restore it, just using the current colour, conversely a pdf link always has a border attribute so setting its width to 0 (pdfborder= 0 0 0) is a far more direct and lightweight way of specifyng this

    – David Carlisle
    1 hour ago











    0














    To sum up, as noted above, adding



    usepackage{xcolor}



    fixes the problem with using the dot in the hyperref options. There are other ways of getting the result I wanted that also do not throw errors; thanks to other posters.



    Perhaps hyperref should load xcolor instead of color?






    share|improve this answer




























      0














      To sum up, as noted above, adding



      usepackage{xcolor}



      fixes the problem with using the dot in the hyperref options. There are other ways of getting the result I wanted that also do not throw errors; thanks to other posters.



      Perhaps hyperref should load xcolor instead of color?






      share|improve this answer


























        0












        0








        0







        To sum up, as noted above, adding



        usepackage{xcolor}



        fixes the problem with using the dot in the hyperref options. There are other ways of getting the result I wanted that also do not throw errors; thanks to other posters.



        Perhaps hyperref should load xcolor instead of color?






        share|improve this answer













        To sum up, as noted above, adding



        usepackage{xcolor}



        fixes the problem with using the dot in the hyperref options. There are other ways of getting the result I wanted that also do not throw errors; thanks to other posters.



        Perhaps hyperref should load xcolor instead of color?







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 1 hour ago









        Dr DarrenDr Darren

        192




        192






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477785%2fuse-of-linkcolor-option-in-hyperref%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Lallio

            Futebolista

            Jornalista