Formatting phonenumbers with phonenumber-package and macros as argument (expand-problem)

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











up vote
1
down vote

favorite












I try to use the phonenumbers-package to format phonenumbers. As argument I want to use a macro (in the actual document the macro will be defined with pgfkeys!)



What I tried so far:



documentclassarticle

usepackage[ngerman]babel
usepackage[area-code-sep=hyphen, country=DE]phonenumbers

begindocument
deftel01601234567

noindent
phonenumber01601234567\ % Correct!
phonenumbertel\ % No Output
expandafterphonenumbertel\ % No Output
expandafterphonenumbertel\ % Unformatted
expandafterphonenumberbgrouptelegroup\ % Unformatted
expandafterphonenumberexpandafterbgrouptelegroup\ % Unformatted
enddocument


I don't understand, how I can expand my tel-macro before using it as an argument.



Thanks in advance!










share|improve this question

























    up vote
    1
    down vote

    favorite












    I try to use the phonenumbers-package to format phonenumbers. As argument I want to use a macro (in the actual document the macro will be defined with pgfkeys!)



    What I tried so far:



    documentclassarticle

    usepackage[ngerman]babel
    usepackage[area-code-sep=hyphen, country=DE]phonenumbers

    begindocument
    deftel01601234567

    noindent
    phonenumber01601234567\ % Correct!
    phonenumbertel\ % No Output
    expandafterphonenumbertel\ % No Output
    expandafterphonenumbertel\ % Unformatted
    expandafterphonenumberbgrouptelegroup\ % Unformatted
    expandafterphonenumberexpandafterbgrouptelegroup\ % Unformatted
    enddocument


    I don't understand, how I can expand my tel-macro before using it as an argument.



    Thanks in advance!










    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I try to use the phonenumbers-package to format phonenumbers. As argument I want to use a macro (in the actual document the macro will be defined with pgfkeys!)



      What I tried so far:



      documentclassarticle

      usepackage[ngerman]babel
      usepackage[area-code-sep=hyphen, country=DE]phonenumbers

      begindocument
      deftel01601234567

      noindent
      phonenumber01601234567\ % Correct!
      phonenumbertel\ % No Output
      expandafterphonenumbertel\ % No Output
      expandafterphonenumbertel\ % Unformatted
      expandafterphonenumberbgrouptelegroup\ % Unformatted
      expandafterphonenumberexpandafterbgrouptelegroup\ % Unformatted
      enddocument


      I don't understand, how I can expand my tel-macro before using it as an argument.



      Thanks in advance!










      share|improve this question













      I try to use the phonenumbers-package to format phonenumbers. As argument I want to use a macro (in the actual document the macro will be defined with pgfkeys!)



      What I tried so far:



      documentclassarticle

      usepackage[ngerman]babel
      usepackage[area-code-sep=hyphen, country=DE]phonenumbers

      begindocument
      deftel01601234567

      noindent
      phonenumber01601234567\ % Correct!
      phonenumbertel\ % No Output
      expandafterphonenumbertel\ % No Output
      expandafterphonenumbertel\ % Unformatted
      expandafterphonenumberbgrouptelegroup\ % Unformatted
      expandafterphonenumberexpandafterbgrouptelegroup\ % Unformatted
      enddocument


      I don't understand, how I can expand my tel-macro before using it as an argument.



      Thanks in advance!







      macros expansion arguments






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 1 hour ago









      Wulle

      15016




      15016




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          expandafterphonenumberexpandaftertel


          works in the example. You need the first expandafter to 'jump over' phonenumber and the second expandafter to 'jump over' the {, so that tel is expanded before phonenumber and you end up with phonenumber01601234567.



          and bgroup and and egroup are not equivalent as argument delimiters. That's why expandafterphonenumberexpandafterbgrouptelegroup did not work correctly. You can see what happens when you use bgroup/egroup instead of / in



          documentclassarticle
          usepackage[T1]fontenc
          usepackage[utf8]inputenc

          deffoo#1-detokenize#1-

          begindocument
          fooDEF

          foobgroup ABCegroup
          enddocument


          The first line works as expected and shows "-DEF-", but the second line throws an error about too many s and shows "-bgroup-ABC", this demonstrates that foo assumes bgroup is its argument and not the entire string ABC.






          share|improve this answer




















          • Thanks for the solution and for the explanation!
            – Wulle
            7 mins ago










          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%2f457215%2fformatting-phonenumbers-with-phonenumber-package-and-macros-as-argument-expand%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










          expandafterphonenumberexpandaftertel


          works in the example. You need the first expandafter to 'jump over' phonenumber and the second expandafter to 'jump over' the {, so that tel is expanded before phonenumber and you end up with phonenumber01601234567.



          and bgroup and and egroup are not equivalent as argument delimiters. That's why expandafterphonenumberexpandafterbgrouptelegroup did not work correctly. You can see what happens when you use bgroup/egroup instead of / in



          documentclassarticle
          usepackage[T1]fontenc
          usepackage[utf8]inputenc

          deffoo#1-detokenize#1-

          begindocument
          fooDEF

          foobgroup ABCegroup
          enddocument


          The first line works as expected and shows "-DEF-", but the second line throws an error about too many s and shows "-bgroup-ABC", this demonstrates that foo assumes bgroup is its argument and not the entire string ABC.






          share|improve this answer




















          • Thanks for the solution and for the explanation!
            – Wulle
            7 mins ago














          up vote
          3
          down vote



          accepted










          expandafterphonenumberexpandaftertel


          works in the example. You need the first expandafter to 'jump over' phonenumber and the second expandafter to 'jump over' the {, so that tel is expanded before phonenumber and you end up with phonenumber01601234567.



          and bgroup and and egroup are not equivalent as argument delimiters. That's why expandafterphonenumberexpandafterbgrouptelegroup did not work correctly. You can see what happens when you use bgroup/egroup instead of / in



          documentclassarticle
          usepackage[T1]fontenc
          usepackage[utf8]inputenc

          deffoo#1-detokenize#1-

          begindocument
          fooDEF

          foobgroup ABCegroup
          enddocument


          The first line works as expected and shows "-DEF-", but the second line throws an error about too many s and shows "-bgroup-ABC", this demonstrates that foo assumes bgroup is its argument and not the entire string ABC.






          share|improve this answer




















          • Thanks for the solution and for the explanation!
            – Wulle
            7 mins ago












          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          expandafterphonenumberexpandaftertel


          works in the example. You need the first expandafter to 'jump over' phonenumber and the second expandafter to 'jump over' the {, so that tel is expanded before phonenumber and you end up with phonenumber01601234567.



          and bgroup and and egroup are not equivalent as argument delimiters. That's why expandafterphonenumberexpandafterbgrouptelegroup did not work correctly. You can see what happens when you use bgroup/egroup instead of / in



          documentclassarticle
          usepackage[T1]fontenc
          usepackage[utf8]inputenc

          deffoo#1-detokenize#1-

          begindocument
          fooDEF

          foobgroup ABCegroup
          enddocument


          The first line works as expected and shows "-DEF-", but the second line throws an error about too many s and shows "-bgroup-ABC", this demonstrates that foo assumes bgroup is its argument and not the entire string ABC.






          share|improve this answer












          expandafterphonenumberexpandaftertel


          works in the example. You need the first expandafter to 'jump over' phonenumber and the second expandafter to 'jump over' the {, so that tel is expanded before phonenumber and you end up with phonenumber01601234567.



          and bgroup and and egroup are not equivalent as argument delimiters. That's why expandafterphonenumberexpandafterbgrouptelegroup did not work correctly. You can see what happens when you use bgroup/egroup instead of / in



          documentclassarticle
          usepackage[T1]fontenc
          usepackage[utf8]inputenc

          deffoo#1-detokenize#1-

          begindocument
          fooDEF

          foobgroup ABCegroup
          enddocument


          The first line works as expected and shows "-DEF-", but the second line throws an error about too many s and shows "-bgroup-ABC", this demonstrates that foo assumes bgroup is its argument and not the entire string ABC.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 51 mins ago









          moewe

          80.2k7100306




          80.2k7100306











          • Thanks for the solution and for the explanation!
            – Wulle
            7 mins ago
















          • Thanks for the solution and for the explanation!
            – Wulle
            7 mins ago















          Thanks for the solution and for the explanation!
          – Wulle
          7 mins ago




          Thanks for the solution and for the explanation!
          – Wulle
          7 mins ago

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f457215%2fformatting-phonenumbers-with-phonenumber-package-and-macros-as-argument-expand%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          List of Gilmore Girls characters

          Confectionery