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

Clash 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!
macros expansion arguments
add a comment |Â
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!
macros expansion arguments
add a comment |Â
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!
macros expansion arguments
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
macros expansion arguments
asked 1 hour ago
Wulle
15016
15016
add a comment |Â
add a comment |Â
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.
Thanks for the solution and for the explanation!
â Wulle
7 mins ago
add a comment |Â
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.
Thanks for the solution and for the explanation!
â Wulle
7 mins ago
add a comment |Â
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.
Thanks for the solution and for the explanation!
â Wulle
7 mins ago
add a comment |Â
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.
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.
answered 51 mins ago
moewe
80.2k7100306
80.2k7100306
Thanks for the solution and for the explanation!
â Wulle
7 mins ago
add a comment |Â
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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
