ref should use enumerate label name












55















I have done this:



begin{enumerate}
renewcommand{labelenumi}{textbf{S.theenumi}}
item a
item label{l} b
item c. goto ref{l}
end{enumerate}


The ref just uses the enumerate number. But I want it to be the full enumerate label.



I also could just type S.ref{l} but that has the two disadvantages that




  1. if I update the enumerate label, I also have to update this reference,

  2. together with hyperref, this doesn't look so nice.


How would be a clean/nice way to solve this?










share|improve this question





























    55















    I have done this:



    begin{enumerate}
    renewcommand{labelenumi}{textbf{S.theenumi}}
    item a
    item label{l} b
    item c. goto ref{l}
    end{enumerate}


    The ref just uses the enumerate number. But I want it to be the full enumerate label.



    I also could just type S.ref{l} but that has the two disadvantages that




    1. if I update the enumerate label, I also have to update this reference,

    2. together with hyperref, this doesn't look so nice.


    How would be a clean/nice way to solve this?










    share|improve this question



























      55












      55








      55


      12






      I have done this:



      begin{enumerate}
      renewcommand{labelenumi}{textbf{S.theenumi}}
      item a
      item label{l} b
      item c. goto ref{l}
      end{enumerate}


      The ref just uses the enumerate number. But I want it to be the full enumerate label.



      I also could just type S.ref{l} but that has the two disadvantages that




      1. if I update the enumerate label, I also have to update this reference,

      2. together with hyperref, this doesn't look so nice.


      How would be a clean/nice way to solve this?










      share|improve this question
















      I have done this:



      begin{enumerate}
      renewcommand{labelenumi}{textbf{S.theenumi}}
      item a
      item label{l} b
      item c. goto ref{l}
      end{enumerate}


      The ref just uses the enumerate number. But I want it to be the full enumerate label.



      I also could just type S.ref{l} but that has the two disadvantages that




      1. if I update the enumerate label, I also have to update this reference,

      2. together with hyperref, this doesn't look so nice.


      How would be a clean/nice way to solve this?







      hyperref cross-referencing enumerate






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 6 '12 at 0:30









      Werner

      442k679741669




      442k679741669










      asked Jun 6 '12 at 0:11









      AlbertAlbert

      1,01631524




      1,01631524






















          2 Answers
          2






          active

          oldest

          votes


















          73














          You can use the enumitem package:



          documentclass{article}
          usepackage{enumitem}

          begin{document}

          begin{enumerate}[label=textbf{S.arabic*}]
          item a
          item label{l} b
          item c. goto ref{l}
          end{enumerate}

          end{document}


          enter image description here



          or



          begin{enumerate}[label=textbf{S.arabic*},ref=S.arabic*]
          item a
          item label{l} b
          item c. goto ref{l}
          end{enumerate}


          if you don't want the reference to be boldfaced.






          share|improve this answer
























          • This is nice. I would like to add that it does not work together with usepackage{paralist} ... if you need to use that package.

            – peschü
            Mar 12 '17 at 20:19



















          18














          For your attempt properly work, you need redefine the counter representation (theenumi) as well as the label associated with it (labelenumi). This separates the formatting from the counter when you're using ref:



          enter image description here



          documentclass{article}
          begin{document}
          begin{enumerate}
          renewcommand{labelenumi}{textbf{theenumi}}
          renewcommand{theenumi}{S.arabic{enumi}}
          item a
          makeatletter
          show@currentlabel
          makeatother
          item label{l} b
          item c. goto ref{l}
          end{enumerate}
          end{document}


          This also works nicely with hyperref. However, in general, it is much easier to use enumitem since it can be used in a global or localized setting using a key-value approach; very convenient.






          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%2f58713%2fref-should-use-enumerate-label-name%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









            73














            You can use the enumitem package:



            documentclass{article}
            usepackage{enumitem}

            begin{document}

            begin{enumerate}[label=textbf{S.arabic*}]
            item a
            item label{l} b
            item c. goto ref{l}
            end{enumerate}

            end{document}


            enter image description here



            or



            begin{enumerate}[label=textbf{S.arabic*},ref=S.arabic*]
            item a
            item label{l} b
            item c. goto ref{l}
            end{enumerate}


            if you don't want the reference to be boldfaced.






            share|improve this answer
























            • This is nice. I would like to add that it does not work together with usepackage{paralist} ... if you need to use that package.

              – peschü
              Mar 12 '17 at 20:19
















            73














            You can use the enumitem package:



            documentclass{article}
            usepackage{enumitem}

            begin{document}

            begin{enumerate}[label=textbf{S.arabic*}]
            item a
            item label{l} b
            item c. goto ref{l}
            end{enumerate}

            end{document}


            enter image description here



            or



            begin{enumerate}[label=textbf{S.arabic*},ref=S.arabic*]
            item a
            item label{l} b
            item c. goto ref{l}
            end{enumerate}


            if you don't want the reference to be boldfaced.






            share|improve this answer
























            • This is nice. I would like to add that it does not work together with usepackage{paralist} ... if you need to use that package.

              – peschü
              Mar 12 '17 at 20:19














            73












            73








            73







            You can use the enumitem package:



            documentclass{article}
            usepackage{enumitem}

            begin{document}

            begin{enumerate}[label=textbf{S.arabic*}]
            item a
            item label{l} b
            item c. goto ref{l}
            end{enumerate}

            end{document}


            enter image description here



            or



            begin{enumerate}[label=textbf{S.arabic*},ref=S.arabic*]
            item a
            item label{l} b
            item c. goto ref{l}
            end{enumerate}


            if you don't want the reference to be boldfaced.






            share|improve this answer













            You can use the enumitem package:



            documentclass{article}
            usepackage{enumitem}

            begin{document}

            begin{enumerate}[label=textbf{S.arabic*}]
            item a
            item label{l} b
            item c. goto ref{l}
            end{enumerate}

            end{document}


            enter image description here



            or



            begin{enumerate}[label=textbf{S.arabic*},ref=S.arabic*]
            item a
            item label{l} b
            item c. goto ref{l}
            end{enumerate}


            if you don't want the reference to be boldfaced.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jun 6 '12 at 0:13









            Gonzalo MedinaGonzalo Medina

            398k4113021571




            398k4113021571













            • This is nice. I would like to add that it does not work together with usepackage{paralist} ... if you need to use that package.

              – peschü
              Mar 12 '17 at 20:19



















            • This is nice. I would like to add that it does not work together with usepackage{paralist} ... if you need to use that package.

              – peschü
              Mar 12 '17 at 20:19

















            This is nice. I would like to add that it does not work together with usepackage{paralist} ... if you need to use that package.

            – peschü
            Mar 12 '17 at 20:19





            This is nice. I would like to add that it does not work together with usepackage{paralist} ... if you need to use that package.

            – peschü
            Mar 12 '17 at 20:19











            18














            For your attempt properly work, you need redefine the counter representation (theenumi) as well as the label associated with it (labelenumi). This separates the formatting from the counter when you're using ref:



            enter image description here



            documentclass{article}
            begin{document}
            begin{enumerate}
            renewcommand{labelenumi}{textbf{theenumi}}
            renewcommand{theenumi}{S.arabic{enumi}}
            item a
            makeatletter
            show@currentlabel
            makeatother
            item label{l} b
            item c. goto ref{l}
            end{enumerate}
            end{document}


            This also works nicely with hyperref. However, in general, it is much easier to use enumitem since it can be used in a global or localized setting using a key-value approach; very convenient.






            share|improve this answer




























              18














              For your attempt properly work, you need redefine the counter representation (theenumi) as well as the label associated with it (labelenumi). This separates the formatting from the counter when you're using ref:



              enter image description here



              documentclass{article}
              begin{document}
              begin{enumerate}
              renewcommand{labelenumi}{textbf{theenumi}}
              renewcommand{theenumi}{S.arabic{enumi}}
              item a
              makeatletter
              show@currentlabel
              makeatother
              item label{l} b
              item c. goto ref{l}
              end{enumerate}
              end{document}


              This also works nicely with hyperref. However, in general, it is much easier to use enumitem since it can be used in a global or localized setting using a key-value approach; very convenient.






              share|improve this answer


























                18












                18








                18







                For your attempt properly work, you need redefine the counter representation (theenumi) as well as the label associated with it (labelenumi). This separates the formatting from the counter when you're using ref:



                enter image description here



                documentclass{article}
                begin{document}
                begin{enumerate}
                renewcommand{labelenumi}{textbf{theenumi}}
                renewcommand{theenumi}{S.arabic{enumi}}
                item a
                makeatletter
                show@currentlabel
                makeatother
                item label{l} b
                item c. goto ref{l}
                end{enumerate}
                end{document}


                This also works nicely with hyperref. However, in general, it is much easier to use enumitem since it can be used in a global or localized setting using a key-value approach; very convenient.






                share|improve this answer













                For your attempt properly work, you need redefine the counter representation (theenumi) as well as the label associated with it (labelenumi). This separates the formatting from the counter when you're using ref:



                enter image description here



                documentclass{article}
                begin{document}
                begin{enumerate}
                renewcommand{labelenumi}{textbf{theenumi}}
                renewcommand{theenumi}{S.arabic{enumi}}
                item a
                makeatletter
                show@currentlabel
                makeatother
                item label{l} b
                item c. goto ref{l}
                end{enumerate}
                end{document}


                This also works nicely with hyperref. However, in general, it is much easier to use enumitem since it can be used in a global or localized setting using a key-value approach; very convenient.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jun 6 '12 at 0:27









                WernerWerner

                442k679741669




                442k679741669






























                    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%2f58713%2fref-should-use-enumerate-label-name%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

                    How to send String Array data to Server using php in android

                    Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

                    Is anime1.com a legal site for watching anime?