Hyperlink only Section Number in Table of ContentsDisable hyperlinks in minitoc while the hyperlinks are...

Stopping power of mountain vs road bike

Can one be a co-translator of a book, if he does not know the language that the book is translated into?

What killed these X2 caps?

How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?

Why is Collection not simply treated as Collection<?>

Alternative to sending password over mail?

Does a druid starting with a bow start with no arrows?

Why doesn't H₄O²⁺ exist?

Facing a paradox: Earnshaw's theorem in one dimension

I Accidentally Deleted a Stock Terminal Theme

Is "remove commented out code" correct English?

Did Shadowfax go to Valinor?

AES: Why is it a good practice to use only the first 16bytes of a hash for encryption?

Why are electrically insulating heatsinks so rare? Is it just cost?

CEO ridiculed me with gay jokes and grabbed me and wouldn't let go - now getting pushed out of company

Should I tell management that I intend to leave due to bad software development practices?

What is the word for reserving something for yourself before others do?

How to prevent "they're falling in love" trope

Is it possible to create light that imparts a greater proportion of its energy as momentum rather than heat?

What's the difference between 'rename' and 'mv'?

Will google still index a page if I use a $_SESSION variable?

In a spin, are both wings stalled?

How could indestructible materials be used in power generation?

Would Slavery Reparations be considered Bills of Attainder and hence Illegal?



Hyperlink only Section Number in Table of Contents


Disable hyperlinks in minitoc while the hyperlinks are enabled in ToCWrong page number in table of contentsIndex in table of contents without page numberHide section number but keep in table of contentsPage number resets on Table of ContentsText next to page number in table of contentsTable of Contents link to first section does not work correctlyHelp! Table of Contents - odd behaviorModifying Table of contents (TOC)Actual page number and Contents page number do not matchChange section numbering for appendix













1















I'm trying to get my table of contents to hyperlink only the section numbering and the page number, like this:



Table of contents example



But I've only managed to get the page number to link with



 linktocpage = true


can anyone help with getting the section numbering (but not the titles) hyperlinked as well? Thanks.










share|improve this question























  • Part of the solution is given by tex.stackexchange.com/questions/145601/…

    – John Kormylo
    Sep 12 '15 at 22:53
















1















I'm trying to get my table of contents to hyperlink only the section numbering and the page number, like this:



Table of contents example



But I've only managed to get the page number to link with



 linktocpage = true


can anyone help with getting the section numbering (but not the titles) hyperlinked as well? Thanks.










share|improve this question























  • Part of the solution is given by tex.stackexchange.com/questions/145601/…

    – John Kormylo
    Sep 12 '15 at 22:53














1












1








1








I'm trying to get my table of contents to hyperlink only the section numbering and the page number, like this:



Table of contents example



But I've only managed to get the page number to link with



 linktocpage = true


can anyone help with getting the section numbering (but not the titles) hyperlinked as well? Thanks.










share|improve this question














I'm trying to get my table of contents to hyperlink only the section numbering and the page number, like this:



Table of contents example



But I've only managed to get the page number to link with



 linktocpage = true


can anyone help with getting the section numbering (but not the titles) hyperlinked as well? Thanks.







table-of-contents






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 12 '15 at 21:28









James McMillanJames McMillan

755




755













  • Part of the solution is given by tex.stackexchange.com/questions/145601/…

    – John Kormylo
    Sep 12 '15 at 22:53



















  • Part of the solution is given by tex.stackexchange.com/questions/145601/…

    – John Kormylo
    Sep 12 '15 at 22:53

















Part of the solution is given by tex.stackexchange.com/questions/145601/…

– John Kormylo
Sep 12 '15 at 22:53





Part of the solution is given by tex.stackexchange.com/questions/145601/…

– John Kormylo
Sep 12 '15 at 22:53










2 Answers
2






active

oldest

votes


















4














I couldn't figure out how to treat sections different than chapters, even though argument #1 contains either "chapter" or "section" (or
"part" or ...). String compares just weren't working. Let me know if you want the page numbers to be linked as well.



documentclass{book}

letstdnumberlinenumberline
letstdcontentslinecontentsline
usepackage{hyperref}

begin{document}
renewcommand{contentsline}[4]%
{bgroup
edefanchorname{#4}
defnumberline#1{stdnumberline{hyperlink{anchorname}{#1}}}
stdcontentsline{#1}{#2}{#3}
egroup}

tableofcontents

chapter{One}

section{First section}

section{Second section}

end{document}





share|improve this answer

































    0














    Set up hyperref:



    usepackage{hyperref}
    hypersetup{linktoc = all}


    Formulate every section, subsection, etc. to be included in the TOC as



    section[textcolor{black}{NAME}]{NAME}


    To color your text this way you will need



    usepackage{xcolor}


    The text in the TOC will be visually indistinguishable from ordinary text, but will remain part of the link i.e. clickable. This is an utterly ridiculous hack as the option should be, but is not included in hyperref e.g.



    hypersetup{linktoc = numpage}


    Dots (if included in the TOC) aren't part of the link in any case, with no obvious customization available. Hyperref has room for improvement.






    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%2f267274%2fhyperlink-only-section-number-in-table-of-contents%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









      4














      I couldn't figure out how to treat sections different than chapters, even though argument #1 contains either "chapter" or "section" (or
      "part" or ...). String compares just weren't working. Let me know if you want the page numbers to be linked as well.



      documentclass{book}

      letstdnumberlinenumberline
      letstdcontentslinecontentsline
      usepackage{hyperref}

      begin{document}
      renewcommand{contentsline}[4]%
      {bgroup
      edefanchorname{#4}
      defnumberline#1{stdnumberline{hyperlink{anchorname}{#1}}}
      stdcontentsline{#1}{#2}{#3}
      egroup}

      tableofcontents

      chapter{One}

      section{First section}

      section{Second section}

      end{document}





      share|improve this answer






























        4














        I couldn't figure out how to treat sections different than chapters, even though argument #1 contains either "chapter" or "section" (or
        "part" or ...). String compares just weren't working. Let me know if you want the page numbers to be linked as well.



        documentclass{book}

        letstdnumberlinenumberline
        letstdcontentslinecontentsline
        usepackage{hyperref}

        begin{document}
        renewcommand{contentsline}[4]%
        {bgroup
        edefanchorname{#4}
        defnumberline#1{stdnumberline{hyperlink{anchorname}{#1}}}
        stdcontentsline{#1}{#2}{#3}
        egroup}

        tableofcontents

        chapter{One}

        section{First section}

        section{Second section}

        end{document}





        share|improve this answer




























          4












          4








          4







          I couldn't figure out how to treat sections different than chapters, even though argument #1 contains either "chapter" or "section" (or
          "part" or ...). String compares just weren't working. Let me know if you want the page numbers to be linked as well.



          documentclass{book}

          letstdnumberlinenumberline
          letstdcontentslinecontentsline
          usepackage{hyperref}

          begin{document}
          renewcommand{contentsline}[4]%
          {bgroup
          edefanchorname{#4}
          defnumberline#1{stdnumberline{hyperlink{anchorname}{#1}}}
          stdcontentsline{#1}{#2}{#3}
          egroup}

          tableofcontents

          chapter{One}

          section{First section}

          section{Second section}

          end{document}





          share|improve this answer















          I couldn't figure out how to treat sections different than chapters, even though argument #1 contains either "chapter" or "section" (or
          "part" or ...). String compares just weren't working. Let me know if you want the page numbers to be linked as well.



          documentclass{book}

          letstdnumberlinenumberline
          letstdcontentslinecontentsline
          usepackage{hyperref}

          begin{document}
          renewcommand{contentsline}[4]%
          {bgroup
          edefanchorname{#4}
          defnumberline#1{stdnumberline{hyperlink{anchorname}{#1}}}
          stdcontentsline{#1}{#2}{#3}
          egroup}

          tableofcontents

          chapter{One}

          section{First section}

          section{Second section}

          end{document}






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Sep 13 '15 at 0:36

























          answered Sep 13 '15 at 0:30









          John KormyloJohn Kormylo

          46.5k22672




          46.5k22672























              0














              Set up hyperref:



              usepackage{hyperref}
              hypersetup{linktoc = all}


              Formulate every section, subsection, etc. to be included in the TOC as



              section[textcolor{black}{NAME}]{NAME}


              To color your text this way you will need



              usepackage{xcolor}


              The text in the TOC will be visually indistinguishable from ordinary text, but will remain part of the link i.e. clickable. This is an utterly ridiculous hack as the option should be, but is not included in hyperref e.g.



              hypersetup{linktoc = numpage}


              Dots (if included in the TOC) aren't part of the link in any case, with no obvious customization available. Hyperref has room for improvement.






              share|improve this answer






























                0














                Set up hyperref:



                usepackage{hyperref}
                hypersetup{linktoc = all}


                Formulate every section, subsection, etc. to be included in the TOC as



                section[textcolor{black}{NAME}]{NAME}


                To color your text this way you will need



                usepackage{xcolor}


                The text in the TOC will be visually indistinguishable from ordinary text, but will remain part of the link i.e. clickable. This is an utterly ridiculous hack as the option should be, but is not included in hyperref e.g.



                hypersetup{linktoc = numpage}


                Dots (if included in the TOC) aren't part of the link in any case, with no obvious customization available. Hyperref has room for improvement.






                share|improve this answer




























                  0












                  0








                  0







                  Set up hyperref:



                  usepackage{hyperref}
                  hypersetup{linktoc = all}


                  Formulate every section, subsection, etc. to be included in the TOC as



                  section[textcolor{black}{NAME}]{NAME}


                  To color your text this way you will need



                  usepackage{xcolor}


                  The text in the TOC will be visually indistinguishable from ordinary text, but will remain part of the link i.e. clickable. This is an utterly ridiculous hack as the option should be, but is not included in hyperref e.g.



                  hypersetup{linktoc = numpage}


                  Dots (if included in the TOC) aren't part of the link in any case, with no obvious customization available. Hyperref has room for improvement.






                  share|improve this answer















                  Set up hyperref:



                  usepackage{hyperref}
                  hypersetup{linktoc = all}


                  Formulate every section, subsection, etc. to be included in the TOC as



                  section[textcolor{black}{NAME}]{NAME}


                  To color your text this way you will need



                  usepackage{xcolor}


                  The text in the TOC will be visually indistinguishable from ordinary text, but will remain part of the link i.e. clickable. This is an utterly ridiculous hack as the option should be, but is not included in hyperref e.g.



                  hypersetup{linktoc = numpage}


                  Dots (if included in the TOC) aren't part of the link in any case, with no obvious customization available. Hyperref has room for improvement.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jul 23 '17 at 20:48

























                  answered Jul 23 '17 at 20:41









                  user139780user139780

                  12




                  12






























                      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%2f267274%2fhyperlink-only-section-number-in-table-of-contents%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

                      Paper upload error, “Upload failed: The top margin is 0.715 in on page 3, which is below the required...

                      Emraan Hashmi Filmografia | Linki zewnętrzne | Menu nawigacyjneGulshan GroverGulshan...

                      How can I write this formula?newline and italics added with leqWhy does widehat behave differently if I...