babel conflicts with, I think, refcount

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











up vote
3
down vote

favorite












The following code is continued from this post and this one. The following code compiles ok without babel but not with it. See the console output below. Is there a way resolve this issue?



documentclassarticle
usepackageafterpage
usepackage[french]babel % no error if uncommented
usepackagemwe
usepackagerefcount
usepackagetocloft
usepackagexparse
usepackagexwatermark % ruled out

newlistofenclenclList of enclosed items

NewDocumentCommand
addencl
m

refstepcounterencl
addcontentslineenclencltheencl. #1


NewDocumentCommand
getencl
m

Esmall NCL # getrefnumber#1


begindocument
newwatermark*[page=getpagerefnumberencl:bar]Bar
newwatermark*[page=getpagerefnumberencl:foo]Foo

listofencl

%verb|getrefnumberencl:foo|:getrefnumberencl:foo
%verb|getpagerefnumberencl:foo|:getpagerefnumberencl:foo

getenclencl:bar~is~on~page~getpagerefnumberencl:bar

getenclencl:foo~is~on~page~getpagerefnumberencl:foo

newpage

%refstepcounterencl
addenclBarlabelencl:bar
includegraphics[width=linewidth]example-image-a

newpage

addenclFoolabelencl:foo
includegraphics[width=linewidth]example-image-b

%newwatermark*


enddocument


Console output:




ERROR: Missing endcsname inserted.



--- TeX said ---
unskip l.36 getenclencl:bar
~is~on~page~getpagerefnumberencl:bar
--- HELP --- From the .log file...



The control sequence marked should not appear
between csname and endcsname.











share|improve this question

























    up vote
    3
    down vote

    favorite












    The following code is continued from this post and this one. The following code compiles ok without babel but not with it. See the console output below. Is there a way resolve this issue?



    documentclassarticle
    usepackageafterpage
    usepackage[french]babel % no error if uncommented
    usepackagemwe
    usepackagerefcount
    usepackagetocloft
    usepackagexparse
    usepackagexwatermark % ruled out

    newlistofenclenclList of enclosed items

    NewDocumentCommand
    addencl
    m

    refstepcounterencl
    addcontentslineenclencltheencl. #1


    NewDocumentCommand
    getencl
    m

    Esmall NCL # getrefnumber#1


    begindocument
    newwatermark*[page=getpagerefnumberencl:bar]Bar
    newwatermark*[page=getpagerefnumberencl:foo]Foo

    listofencl

    %verb|getrefnumberencl:foo|:getrefnumberencl:foo
    %verb|getpagerefnumberencl:foo|:getpagerefnumberencl:foo

    getenclencl:bar~is~on~page~getpagerefnumberencl:bar

    getenclencl:foo~is~on~page~getpagerefnumberencl:foo

    newpage

    %refstepcounterencl
    addenclBarlabelencl:bar
    includegraphics[width=linewidth]example-image-a

    newpage

    addenclFoolabelencl:foo
    includegraphics[width=linewidth]example-image-b

    %newwatermark*


    enddocument


    Console output:




    ERROR: Missing endcsname inserted.



    --- TeX said ---
    unskip l.36 getenclencl:bar
    ~is~on~page~getpagerefnumberencl:bar
    --- HELP --- From the .log file...



    The control sequence marked should not appear
    between csname and endcsname.











    share|improve this question























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      The following code is continued from this post and this one. The following code compiles ok without babel but not with it. See the console output below. Is there a way resolve this issue?



      documentclassarticle
      usepackageafterpage
      usepackage[french]babel % no error if uncommented
      usepackagemwe
      usepackagerefcount
      usepackagetocloft
      usepackagexparse
      usepackagexwatermark % ruled out

      newlistofenclenclList of enclosed items

      NewDocumentCommand
      addencl
      m

      refstepcounterencl
      addcontentslineenclencltheencl. #1


      NewDocumentCommand
      getencl
      m

      Esmall NCL # getrefnumber#1


      begindocument
      newwatermark*[page=getpagerefnumberencl:bar]Bar
      newwatermark*[page=getpagerefnumberencl:foo]Foo

      listofencl

      %verb|getrefnumberencl:foo|:getrefnumberencl:foo
      %verb|getpagerefnumberencl:foo|:getpagerefnumberencl:foo

      getenclencl:bar~is~on~page~getpagerefnumberencl:bar

      getenclencl:foo~is~on~page~getpagerefnumberencl:foo

      newpage

      %refstepcounterencl
      addenclBarlabelencl:bar
      includegraphics[width=linewidth]example-image-a

      newpage

      addenclFoolabelencl:foo
      includegraphics[width=linewidth]example-image-b

      %newwatermark*


      enddocument


      Console output:




      ERROR: Missing endcsname inserted.



      --- TeX said ---
      unskip l.36 getenclencl:bar
      ~is~on~page~getpagerefnumberencl:bar
      --- HELP --- From the .log file...



      The control sequence marked should not appear
      between csname and endcsname.











      share|improve this question













      The following code is continued from this post and this one. The following code compiles ok without babel but not with it. See the console output below. Is there a way resolve this issue?



      documentclassarticle
      usepackageafterpage
      usepackage[french]babel % no error if uncommented
      usepackagemwe
      usepackagerefcount
      usepackagetocloft
      usepackagexparse
      usepackagexwatermark % ruled out

      newlistofenclenclList of enclosed items

      NewDocumentCommand
      addencl
      m

      refstepcounterencl
      addcontentslineenclencltheencl. #1


      NewDocumentCommand
      getencl
      m

      Esmall NCL # getrefnumber#1


      begindocument
      newwatermark*[page=getpagerefnumberencl:bar]Bar
      newwatermark*[page=getpagerefnumberencl:foo]Foo

      listofencl

      %verb|getrefnumberencl:foo|:getrefnumberencl:foo
      %verb|getpagerefnumberencl:foo|:getpagerefnumberencl:foo

      getenclencl:bar~is~on~page~getpagerefnumberencl:bar

      getenclencl:foo~is~on~page~getpagerefnumberencl:foo

      newpage

      %refstepcounterencl
      addenclBarlabelencl:bar
      includegraphics[width=linewidth]example-image-a

      newpage

      addenclFoolabelencl:foo
      includegraphics[width=linewidth]example-image-b

      %newwatermark*


      enddocument


      Console output:




      ERROR: Missing endcsname inserted.



      --- TeX said ---
      unskip l.36 getenclencl:bar
      ~is~on~page~getpagerefnumberencl:bar
      --- HELP --- From the .log file...



      The control sequence marked should not appear
      between csname and endcsname.








      babel refcount






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 hours ago









      Erwann

      1357




      1357




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote













          It will work if you use string: in place of : at a number of locations.



          documentclassarticle
          usepackageafterpage
          usepackage[french]babel % no error if uncommented
          usepackagemwe
          usepackagerefcount
          usepackagetocloft
          usepackagexparse
          usepackagexwatermark % ruled out

          newlistofenclenclList of enclosed items

          NewDocumentCommand
          addencl
          m

          refstepcounterencl
          addcontentslineenclencltheencl. #1


          NewDocumentCommand
          getencl
          m

          Esmall NCL # getrefnumber#1


          begindocument
          newwatermark*[page=getpagerefnumberenclstring:bar]Bar
          newwatermark*[page=getpagerefnumberenclstring:foo]Foo

          listofencl

          %verb|getrefnumberencl:foo|:getrefnumberencl:foo
          %verb|getpagerefnumberencl:foo|:getpagerefnumberencl:foo

          getenclenclstring:bar~is~on~page~getpagerefnumberenclstring:bar

          getenclenclstring:foo~is~on~page~getpagerefnumberenclstring:foo

          newpage

          %refstepcounterencl
          addenclBarlabelencl:bar
          includegraphics[width=linewidth]example-image-a

          newpage

          addenclFoolabelencl:foo
          includegraphics[width=linewidth]example-image-b

          %newwatermark*


          enddocument


          Output:



          enter image description here



          Note: I initially added detokenize to the document commands defined, but there remained a problem with getpagerefnumber.






          share|improve this answer



























            up vote
            2
            down vote













            When babel-french is active, the colon has a special meaning: “remove a possible space, add a nonbreaking space and print the colon”.



            Indeed, you get



            ! Missing endcsname inserted.
            <to be read again>
            unskip


            LaTeX makes provision so that ref or pageref take care of babel shorthands such as :, ? and ! for French and " for German. This cannot be done with getrefnumber or getpagerefnumber, because the protection needs assignments, in this case setting a switch so that the colon shorthand, for instance, produces a standard colon.



            The refcount commands want and need to be fully expandable and so no assignment can take place during their job: expandability is the feature for which refcount was born.



            In general, I recommend avoiding babel shorthands in labels.



            For your specific problem, where you use no macros in the argument to get(page)refnumber, you can use detokenize:



            documentclassarticle
            usepackage[french]babel % no error if uncommented
            usepackagerefcount
            usepackagetocloft
            usepackagexparse
            usepackagexwatermark % ruled out

            newlistofenclenclList of enclosed items

            NewDocumentCommandaddencl m
            %
            refstepcounterencl%
            addcontentslineenclencltheencl. #1%


            NewDocumentCommandgetencl m
            %
            Esmall NCL # getrefnumberdetokenize#1%


            newcommandbgetpagerefnumber[1]getpagerefnumberdetokenize#1

            begindocument

            newwatermark*[page=bgetpagerefnumberencl:bar]Bar
            newwatermark*[page=bgetpagerefnumberencl:foo]Foo

            listofencl

            getenclencl:bar~is~on~page~bgetpagerefnumberencl:bar

            getenclencl:foo~is~on~page~bgetpagerefnumberencl:foo

            newpage

            %refstepcounterencl
            addenclBarlabelencl:bar
            includegraphics[width=linewidth]example-image-a

            newpage

            addenclFoolabelencl:foo
            includegraphics[width=linewidth]example-image-b

            %newwatermark*


            enddocument


            But it's much simpler using encl-foo.






            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%2f450771%2fbabel-conflicts-with-i-think-refcount%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              2
              down vote













              It will work if you use string: in place of : at a number of locations.



              documentclassarticle
              usepackageafterpage
              usepackage[french]babel % no error if uncommented
              usepackagemwe
              usepackagerefcount
              usepackagetocloft
              usepackagexparse
              usepackagexwatermark % ruled out

              newlistofenclenclList of enclosed items

              NewDocumentCommand
              addencl
              m

              refstepcounterencl
              addcontentslineenclencltheencl. #1


              NewDocumentCommand
              getencl
              m

              Esmall NCL # getrefnumber#1


              begindocument
              newwatermark*[page=getpagerefnumberenclstring:bar]Bar
              newwatermark*[page=getpagerefnumberenclstring:foo]Foo

              listofencl

              %verb|getrefnumberencl:foo|:getrefnumberencl:foo
              %verb|getpagerefnumberencl:foo|:getpagerefnumberencl:foo

              getenclenclstring:bar~is~on~page~getpagerefnumberenclstring:bar

              getenclenclstring:foo~is~on~page~getpagerefnumberenclstring:foo

              newpage

              %refstepcounterencl
              addenclBarlabelencl:bar
              includegraphics[width=linewidth]example-image-a

              newpage

              addenclFoolabelencl:foo
              includegraphics[width=linewidth]example-image-b

              %newwatermark*


              enddocument


              Output:



              enter image description here



              Note: I initially added detokenize to the document commands defined, but there remained a problem with getpagerefnumber.






              share|improve this answer
























                up vote
                2
                down vote













                It will work if you use string: in place of : at a number of locations.



                documentclassarticle
                usepackageafterpage
                usepackage[french]babel % no error if uncommented
                usepackagemwe
                usepackagerefcount
                usepackagetocloft
                usepackagexparse
                usepackagexwatermark % ruled out

                newlistofenclenclList of enclosed items

                NewDocumentCommand
                addencl
                m

                refstepcounterencl
                addcontentslineenclencltheencl. #1


                NewDocumentCommand
                getencl
                m

                Esmall NCL # getrefnumber#1


                begindocument
                newwatermark*[page=getpagerefnumberenclstring:bar]Bar
                newwatermark*[page=getpagerefnumberenclstring:foo]Foo

                listofencl

                %verb|getrefnumberencl:foo|:getrefnumberencl:foo
                %verb|getpagerefnumberencl:foo|:getpagerefnumberencl:foo

                getenclenclstring:bar~is~on~page~getpagerefnumberenclstring:bar

                getenclenclstring:foo~is~on~page~getpagerefnumberenclstring:foo

                newpage

                %refstepcounterencl
                addenclBarlabelencl:bar
                includegraphics[width=linewidth]example-image-a

                newpage

                addenclFoolabelencl:foo
                includegraphics[width=linewidth]example-image-b

                %newwatermark*


                enddocument


                Output:



                enter image description here



                Note: I initially added detokenize to the document commands defined, but there remained a problem with getpagerefnumber.






                share|improve this answer






















                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  It will work if you use string: in place of : at a number of locations.



                  documentclassarticle
                  usepackageafterpage
                  usepackage[french]babel % no error if uncommented
                  usepackagemwe
                  usepackagerefcount
                  usepackagetocloft
                  usepackagexparse
                  usepackagexwatermark % ruled out

                  newlistofenclenclList of enclosed items

                  NewDocumentCommand
                  addencl
                  m

                  refstepcounterencl
                  addcontentslineenclencltheencl. #1


                  NewDocumentCommand
                  getencl
                  m

                  Esmall NCL # getrefnumber#1


                  begindocument
                  newwatermark*[page=getpagerefnumberenclstring:bar]Bar
                  newwatermark*[page=getpagerefnumberenclstring:foo]Foo

                  listofencl

                  %verb|getrefnumberencl:foo|:getrefnumberencl:foo
                  %verb|getpagerefnumberencl:foo|:getpagerefnumberencl:foo

                  getenclenclstring:bar~is~on~page~getpagerefnumberenclstring:bar

                  getenclenclstring:foo~is~on~page~getpagerefnumberenclstring:foo

                  newpage

                  %refstepcounterencl
                  addenclBarlabelencl:bar
                  includegraphics[width=linewidth]example-image-a

                  newpage

                  addenclFoolabelencl:foo
                  includegraphics[width=linewidth]example-image-b

                  %newwatermark*


                  enddocument


                  Output:



                  enter image description here



                  Note: I initially added detokenize to the document commands defined, but there remained a problem with getpagerefnumber.






                  share|improve this answer












                  It will work if you use string: in place of : at a number of locations.



                  documentclassarticle
                  usepackageafterpage
                  usepackage[french]babel % no error if uncommented
                  usepackagemwe
                  usepackagerefcount
                  usepackagetocloft
                  usepackagexparse
                  usepackagexwatermark % ruled out

                  newlistofenclenclList of enclosed items

                  NewDocumentCommand
                  addencl
                  m

                  refstepcounterencl
                  addcontentslineenclencltheencl. #1


                  NewDocumentCommand
                  getencl
                  m

                  Esmall NCL # getrefnumber#1


                  begindocument
                  newwatermark*[page=getpagerefnumberenclstring:bar]Bar
                  newwatermark*[page=getpagerefnumberenclstring:foo]Foo

                  listofencl

                  %verb|getrefnumberencl:foo|:getrefnumberencl:foo
                  %verb|getpagerefnumberencl:foo|:getpagerefnumberencl:foo

                  getenclenclstring:bar~is~on~page~getpagerefnumberenclstring:bar

                  getenclenclstring:foo~is~on~page~getpagerefnumberenclstring:foo

                  newpage

                  %refstepcounterencl
                  addenclBarlabelencl:bar
                  includegraphics[width=linewidth]example-image-a

                  newpage

                  addenclFoolabelencl:foo
                  includegraphics[width=linewidth]example-image-b

                  %newwatermark*


                  enddocument


                  Output:



                  enter image description here



                  Note: I initially added detokenize to the document commands defined, but there remained a problem with getpagerefnumber.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 2 hours ago









                  jfbu

                  41.5k61134




                  41.5k61134




















                      up vote
                      2
                      down vote













                      When babel-french is active, the colon has a special meaning: “remove a possible space, add a nonbreaking space and print the colon”.



                      Indeed, you get



                      ! Missing endcsname inserted.
                      <to be read again>
                      unskip


                      LaTeX makes provision so that ref or pageref take care of babel shorthands such as :, ? and ! for French and " for German. This cannot be done with getrefnumber or getpagerefnumber, because the protection needs assignments, in this case setting a switch so that the colon shorthand, for instance, produces a standard colon.



                      The refcount commands want and need to be fully expandable and so no assignment can take place during their job: expandability is the feature for which refcount was born.



                      In general, I recommend avoiding babel shorthands in labels.



                      For your specific problem, where you use no macros in the argument to get(page)refnumber, you can use detokenize:



                      documentclassarticle
                      usepackage[french]babel % no error if uncommented
                      usepackagerefcount
                      usepackagetocloft
                      usepackagexparse
                      usepackagexwatermark % ruled out

                      newlistofenclenclList of enclosed items

                      NewDocumentCommandaddencl m
                      %
                      refstepcounterencl%
                      addcontentslineenclencltheencl. #1%


                      NewDocumentCommandgetencl m
                      %
                      Esmall NCL # getrefnumberdetokenize#1%


                      newcommandbgetpagerefnumber[1]getpagerefnumberdetokenize#1

                      begindocument

                      newwatermark*[page=bgetpagerefnumberencl:bar]Bar
                      newwatermark*[page=bgetpagerefnumberencl:foo]Foo

                      listofencl

                      getenclencl:bar~is~on~page~bgetpagerefnumberencl:bar

                      getenclencl:foo~is~on~page~bgetpagerefnumberencl:foo

                      newpage

                      %refstepcounterencl
                      addenclBarlabelencl:bar
                      includegraphics[width=linewidth]example-image-a

                      newpage

                      addenclFoolabelencl:foo
                      includegraphics[width=linewidth]example-image-b

                      %newwatermark*


                      enddocument


                      But it's much simpler using encl-foo.






                      share|improve this answer
























                        up vote
                        2
                        down vote













                        When babel-french is active, the colon has a special meaning: “remove a possible space, add a nonbreaking space and print the colon”.



                        Indeed, you get



                        ! Missing endcsname inserted.
                        <to be read again>
                        unskip


                        LaTeX makes provision so that ref or pageref take care of babel shorthands such as :, ? and ! for French and " for German. This cannot be done with getrefnumber or getpagerefnumber, because the protection needs assignments, in this case setting a switch so that the colon shorthand, for instance, produces a standard colon.



                        The refcount commands want and need to be fully expandable and so no assignment can take place during their job: expandability is the feature for which refcount was born.



                        In general, I recommend avoiding babel shorthands in labels.



                        For your specific problem, where you use no macros in the argument to get(page)refnumber, you can use detokenize:



                        documentclassarticle
                        usepackage[french]babel % no error if uncommented
                        usepackagerefcount
                        usepackagetocloft
                        usepackagexparse
                        usepackagexwatermark % ruled out

                        newlistofenclenclList of enclosed items

                        NewDocumentCommandaddencl m
                        %
                        refstepcounterencl%
                        addcontentslineenclencltheencl. #1%


                        NewDocumentCommandgetencl m
                        %
                        Esmall NCL # getrefnumberdetokenize#1%


                        newcommandbgetpagerefnumber[1]getpagerefnumberdetokenize#1

                        begindocument

                        newwatermark*[page=bgetpagerefnumberencl:bar]Bar
                        newwatermark*[page=bgetpagerefnumberencl:foo]Foo

                        listofencl

                        getenclencl:bar~is~on~page~bgetpagerefnumberencl:bar

                        getenclencl:foo~is~on~page~bgetpagerefnumberencl:foo

                        newpage

                        %refstepcounterencl
                        addenclBarlabelencl:bar
                        includegraphics[width=linewidth]example-image-a

                        newpage

                        addenclFoolabelencl:foo
                        includegraphics[width=linewidth]example-image-b

                        %newwatermark*


                        enddocument


                        But it's much simpler using encl-foo.






                        share|improve this answer






















                          up vote
                          2
                          down vote










                          up vote
                          2
                          down vote









                          When babel-french is active, the colon has a special meaning: “remove a possible space, add a nonbreaking space and print the colon”.



                          Indeed, you get



                          ! Missing endcsname inserted.
                          <to be read again>
                          unskip


                          LaTeX makes provision so that ref or pageref take care of babel shorthands such as :, ? and ! for French and " for German. This cannot be done with getrefnumber or getpagerefnumber, because the protection needs assignments, in this case setting a switch so that the colon shorthand, for instance, produces a standard colon.



                          The refcount commands want and need to be fully expandable and so no assignment can take place during their job: expandability is the feature for which refcount was born.



                          In general, I recommend avoiding babel shorthands in labels.



                          For your specific problem, where you use no macros in the argument to get(page)refnumber, you can use detokenize:



                          documentclassarticle
                          usepackage[french]babel % no error if uncommented
                          usepackagerefcount
                          usepackagetocloft
                          usepackagexparse
                          usepackagexwatermark % ruled out

                          newlistofenclenclList of enclosed items

                          NewDocumentCommandaddencl m
                          %
                          refstepcounterencl%
                          addcontentslineenclencltheencl. #1%


                          NewDocumentCommandgetencl m
                          %
                          Esmall NCL # getrefnumberdetokenize#1%


                          newcommandbgetpagerefnumber[1]getpagerefnumberdetokenize#1

                          begindocument

                          newwatermark*[page=bgetpagerefnumberencl:bar]Bar
                          newwatermark*[page=bgetpagerefnumberencl:foo]Foo

                          listofencl

                          getenclencl:bar~is~on~page~bgetpagerefnumberencl:bar

                          getenclencl:foo~is~on~page~bgetpagerefnumberencl:foo

                          newpage

                          %refstepcounterencl
                          addenclBarlabelencl:bar
                          includegraphics[width=linewidth]example-image-a

                          newpage

                          addenclFoolabelencl:foo
                          includegraphics[width=linewidth]example-image-b

                          %newwatermark*


                          enddocument


                          But it's much simpler using encl-foo.






                          share|improve this answer












                          When babel-french is active, the colon has a special meaning: “remove a possible space, add a nonbreaking space and print the colon”.



                          Indeed, you get



                          ! Missing endcsname inserted.
                          <to be read again>
                          unskip


                          LaTeX makes provision so that ref or pageref take care of babel shorthands such as :, ? and ! for French and " for German. This cannot be done with getrefnumber or getpagerefnumber, because the protection needs assignments, in this case setting a switch so that the colon shorthand, for instance, produces a standard colon.



                          The refcount commands want and need to be fully expandable and so no assignment can take place during their job: expandability is the feature for which refcount was born.



                          In general, I recommend avoiding babel shorthands in labels.



                          For your specific problem, where you use no macros in the argument to get(page)refnumber, you can use detokenize:



                          documentclassarticle
                          usepackage[french]babel % no error if uncommented
                          usepackagerefcount
                          usepackagetocloft
                          usepackagexparse
                          usepackagexwatermark % ruled out

                          newlistofenclenclList of enclosed items

                          NewDocumentCommandaddencl m
                          %
                          refstepcounterencl%
                          addcontentslineenclencltheencl. #1%


                          NewDocumentCommandgetencl m
                          %
                          Esmall NCL # getrefnumberdetokenize#1%


                          newcommandbgetpagerefnumber[1]getpagerefnumberdetokenize#1

                          begindocument

                          newwatermark*[page=bgetpagerefnumberencl:bar]Bar
                          newwatermark*[page=bgetpagerefnumberencl:foo]Foo

                          listofencl

                          getenclencl:bar~is~on~page~bgetpagerefnumberencl:bar

                          getenclencl:foo~is~on~page~bgetpagerefnumberencl:foo

                          newpage

                          %refstepcounterencl
                          addenclBarlabelencl:bar
                          includegraphics[width=linewidth]example-image-a

                          newpage

                          addenclFoolabelencl:foo
                          includegraphics[width=linewidth]example-image-b

                          %newwatermark*


                          enddocument


                          But it's much simpler using encl-foo.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 1 hour ago









                          egreg

                          682k8318123060




                          682k8318123060



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f450771%2fbabel-conflicts-with-i-think-refcount%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