gb4e: Pull out only subexample label

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












Is there a way to pull out just the subexample number for a reference when using gb4e? Sometimes I'd like to do something like "In the (a) example(s)...," without having the number. It feels like this should be possible, but I can't seem to find how anywhere.



MWE:



documentclassarticle
usepackagegb4e

begindocument
Blah blah blah...

Here are some examples...
beginexe
ex beginxlist
exThis is an example.labelsub1
ex[*]This example an is.labelsub2
endxlist
endexe

As with the previous cases, we see here that the refsub1 example is grammatical, while the refsub2 example is not.

enddocument


The goal would be to replace refsub1 and refsub2 with commands that will just pull out the (a) and (b) parts, without including the preceding number.










share|improve this question



























    up vote
    1
    down vote

    favorite












    Is there a way to pull out just the subexample number for a reference when using gb4e? Sometimes I'd like to do something like "In the (a) example(s)...," without having the number. It feels like this should be possible, but I can't seem to find how anywhere.



    MWE:



    documentclassarticle
    usepackagegb4e

    begindocument
    Blah blah blah...

    Here are some examples...
    beginexe
    ex beginxlist
    exThis is an example.labelsub1
    ex[*]This example an is.labelsub2
    endxlist
    endexe

    As with the previous cases, we see here that the refsub1 example is grammatical, while the refsub2 example is not.

    enddocument


    The goal would be to replace refsub1 and refsub2 with commands that will just pull out the (a) and (b) parts, without including the preceding number.










    share|improve this question

























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      Is there a way to pull out just the subexample number for a reference when using gb4e? Sometimes I'd like to do something like "In the (a) example(s)...," without having the number. It feels like this should be possible, but I can't seem to find how anywhere.



      MWE:



      documentclassarticle
      usepackagegb4e

      begindocument
      Blah blah blah...

      Here are some examples...
      beginexe
      ex beginxlist
      exThis is an example.labelsub1
      ex[*]This example an is.labelsub2
      endxlist
      endexe

      As with the previous cases, we see here that the refsub1 example is grammatical, while the refsub2 example is not.

      enddocument


      The goal would be to replace refsub1 and refsub2 with commands that will just pull out the (a) and (b) parts, without including the preceding number.










      share|improve this question















      Is there a way to pull out just the subexample number for a reference when using gb4e? Sometimes I'd like to do something like "In the (a) example(s)...," without having the number. It feels like this should be possible, but I can't seem to find how anywhere.



      MWE:



      documentclassarticle
      usepackagegb4e

      begindocument
      Blah blah blah...

      Here are some examples...
      beginexe
      ex beginxlist
      exThis is an example.labelsub1
      ex[*]This example an is.labelsub2
      endxlist
      endexe

      As with the previous cases, we see here that the refsub1 example is grammatical, while the refsub2 example is not.

      enddocument


      The goal would be to replace refsub1 and refsub2 with commands that will just pull out the (a) and (b) parts, without including the preceding number.







      cross-referencing linguistics gb4e






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 hours ago









      Alan Munn

      155k27414687




      155k27414687










      asked 4 hours ago









      Jigsaw

      743




      743




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          You can do this with the refcount and xstring packages:



          documentclassarticle
          usepackagerefcount
          usepackagexstring
          newcommandsubref[1]StrRightgetrefnumber#11
          usepackagegb4e

          begindocument
          beginexe
          exlabeltop
          beginxlist
          ex Example labelsub
          ex Example labelsub2
          endxlist
          endexe

          In the (subrefsub2) examples. In the (subrefsub) examples.
          enddocument


          output of code






          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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            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%2f451820%2fgb4e-pull-out-only-subexample-label%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote



            accepted










            You can do this with the refcount and xstring packages:



            documentclassarticle
            usepackagerefcount
            usepackagexstring
            newcommandsubref[1]StrRightgetrefnumber#11
            usepackagegb4e

            begindocument
            beginexe
            exlabeltop
            beginxlist
            ex Example labelsub
            ex Example labelsub2
            endxlist
            endexe

            In the (subrefsub2) examples. In the (subrefsub) examples.
            enddocument


            output of code






            share|improve this answer
























              up vote
              3
              down vote



              accepted










              You can do this with the refcount and xstring packages:



              documentclassarticle
              usepackagerefcount
              usepackagexstring
              newcommandsubref[1]StrRightgetrefnumber#11
              usepackagegb4e

              begindocument
              beginexe
              exlabeltop
              beginxlist
              ex Example labelsub
              ex Example labelsub2
              endxlist
              endexe

              In the (subrefsub2) examples. In the (subrefsub) examples.
              enddocument


              output of code






              share|improve this answer






















                up vote
                3
                down vote



                accepted







                up vote
                3
                down vote



                accepted






                You can do this with the refcount and xstring packages:



                documentclassarticle
                usepackagerefcount
                usepackagexstring
                newcommandsubref[1]StrRightgetrefnumber#11
                usepackagegb4e

                begindocument
                beginexe
                exlabeltop
                beginxlist
                ex Example labelsub
                ex Example labelsub2
                endxlist
                endexe

                In the (subrefsub2) examples. In the (subrefsub) examples.
                enddocument


                output of code






                share|improve this answer












                You can do this with the refcount and xstring packages:



                documentclassarticle
                usepackagerefcount
                usepackagexstring
                newcommandsubref[1]StrRightgetrefnumber#11
                usepackagegb4e

                begindocument
                beginexe
                exlabeltop
                beginxlist
                ex Example labelsub
                ex Example labelsub2
                endxlist
                endexe

                In the (subrefsub2) examples. In the (subrefsub) examples.
                enddocument


                output of code







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 3 hours ago









                Alan Munn

                155k27414687




                155k27414687



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f451820%2fgb4e-pull-out-only-subexample-label%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    Long meetings (6-7 hours a day): Being “babysat” by supervisor

                    Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                    Confectionery