Protected expansion in expl3
I am trying to understand whether there is a proper expl3 way to achieve the same result as the latex2e protected@edef
, that is expanding a token list while respecting the protect
mechanism of latex2e.
Using expl3 functions with an "x" type argument (e.g. tl_gset:Nx
) seems to expand everything ignoring the latex2e protection mechanism.
I seem to be able to achieve the desired goal by manually replicating the mechanisms applied by protected@edef
, that is by doing a tl_set:Nn protect { noexpandprotectnoexpand }
right before the "x" expansion (e.g., before the tl_gset:Nx
), but I wonder if this is the preferred method or if there are more elegant alternatives.
expl3
add a comment |
I am trying to understand whether there is a proper expl3 way to achieve the same result as the latex2e protected@edef
, that is expanding a token list while respecting the protect
mechanism of latex2e.
Using expl3 functions with an "x" type argument (e.g. tl_gset:Nx
) seems to expand everything ignoring the latex2e protection mechanism.
I seem to be able to achieve the desired goal by manually replicating the mechanisms applied by protected@edef
, that is by doing a tl_set:Nn protect { noexpandprotectnoexpand }
right before the "x" expansion (e.g., before the tl_gset:Nx
), but I wonder if this is the preferred method or if there are more elegant alternatives.
expl3
add a comment |
I am trying to understand whether there is a proper expl3 way to achieve the same result as the latex2e protected@edef
, that is expanding a token list while respecting the protect
mechanism of latex2e.
Using expl3 functions with an "x" type argument (e.g. tl_gset:Nx
) seems to expand everything ignoring the latex2e protection mechanism.
I seem to be able to achieve the desired goal by manually replicating the mechanisms applied by protected@edef
, that is by doing a tl_set:Nn protect { noexpandprotectnoexpand }
right before the "x" expansion (e.g., before the tl_gset:Nx
), but I wonder if this is the preferred method or if there are more elegant alternatives.
expl3
I am trying to understand whether there is a proper expl3 way to achieve the same result as the latex2e protected@edef
, that is expanding a token list while respecting the protect
mechanism of latex2e.
Using expl3 functions with an "x" type argument (e.g. tl_gset:Nx
) seems to expand everything ignoring the latex2e protection mechanism.
I seem to be able to achieve the desired goal by manually replicating the mechanisms applied by protected@edef
, that is by doing a tl_set:Nn protect { noexpandprotectnoexpand }
right before the "x" expansion (e.g., before the tl_gset:Nx
), but I wonder if this is the preferred method or if there are more elegant alternatives.
expl3
expl3
asked 54 mins ago
Callegar
811
811
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
There is no equivalent of protected@edef
in expl3
as 'native' expl3
material is either fully expandable or engine-protected. As such, if you do need to take mixed LaTeX2e input and use it in expl3
, you'll need to stick to the LaTeX2e mechanism
protected@edef l_tmpa_tl { <stuff> }
There is at
missing, this is probably a mistake? (I'm not sure sinceexpl3
still looks like alien wizardry to me most of the time...)
– Marijn
10 mins ago
add a comment |
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
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f467329%2fprotected-expansion-in-expl3%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There is no equivalent of protected@edef
in expl3
as 'native' expl3
material is either fully expandable or engine-protected. As such, if you do need to take mixed LaTeX2e input and use it in expl3
, you'll need to stick to the LaTeX2e mechanism
protected@edef l_tmpa_tl { <stuff> }
There is at
missing, this is probably a mistake? (I'm not sure sinceexpl3
still looks like alien wizardry to me most of the time...)
– Marijn
10 mins ago
add a comment |
There is no equivalent of protected@edef
in expl3
as 'native' expl3
material is either fully expandable or engine-protected. As such, if you do need to take mixed LaTeX2e input and use it in expl3
, you'll need to stick to the LaTeX2e mechanism
protected@edef l_tmpa_tl { <stuff> }
There is at
missing, this is probably a mistake? (I'm not sure sinceexpl3
still looks like alien wizardry to me most of the time...)
– Marijn
10 mins ago
add a comment |
There is no equivalent of protected@edef
in expl3
as 'native' expl3
material is either fully expandable or engine-protected. As such, if you do need to take mixed LaTeX2e input and use it in expl3
, you'll need to stick to the LaTeX2e mechanism
protected@edef l_tmpa_tl { <stuff> }
There is no equivalent of protected@edef
in expl3
as 'native' expl3
material is either fully expandable or engine-protected. As such, if you do need to take mixed LaTeX2e input and use it in expl3
, you'll need to stick to the LaTeX2e mechanism
protected@edef l_tmpa_tl { <stuff> }
edited 5 mins ago
answered 44 mins ago
Joseph Wright♦
202k21554880
202k21554880
There is at
missing, this is probably a mistake? (I'm not sure sinceexpl3
still looks like alien wizardry to me most of the time...)
– Marijn
10 mins ago
add a comment |
There is at
missing, this is probably a mistake? (I'm not sure sinceexpl3
still looks like alien wizardry to me most of the time...)
– Marijn
10 mins ago
There is a
t
missing, this is probably a mistake? (I'm not sure since expl3
still looks like alien wizardry to me most of the time...)– Marijn
10 mins ago
There is a
t
missing, this is probably a mistake? (I'm not sure since expl3
still looks like alien wizardry to me most of the time...)– Marijn
10 mins ago
add a comment |
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f467329%2fprotected-expansion-in-expl3%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
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