! Argument of @firstoftwo has an extra }Use the SplitArgument function to pass an array of token-separated...

A Missing Symbol for This Logo

Can you tell from a blurry photo if focus was too close or too far?

How should I handle players who ignore the session zero agreement?

Early credit roll before the end of the film

How would an AI self awareness kill switch work?

What's a good word to describe a public place that looks like it wouldn't be rough?

Find the longest word in set D that is a subsequence of string S

How can I get my players to come to the game session after agreeing to a date?

What does it mean for a caliber to be flat shooting?

Is a new Boolean field better than a null reference when a value can be meaningfully absent?

Do theoretical physics suggest that gravity is the exchange of gravitons or deformation/bending of spacetime?

What would the chemical name be for C13H8Cl3NO

What would be the rarity of this magic item(s)?

Odd 74HCT1G125 behaviour

How does Leonard in "Memento" remember reading and writing?

SET NOCOUNT Error in handling SQL call after upgrade

If I delete my router's history can my ISP still provide it to my parents?

Why did Luke use his left hand to shoot?

Is using an 'empty' metaphor considered bad style?

Create a Price Tag Icon with Rounded Corners

Why is it that Bernie Sanders is always called a "socialist"?

Removing disk while game is suspended

Why did Democrats in the Senate oppose the Born-Alive Abortion Survivors Protection Act (2019 S.130)?

Eww, those bytes are gross



! Argument of @firstoftwo has an extra }


Use the SplitArgument function to pass an array of token-separated values as a single argumentApply command list to argument correctlySplitting delimited token list argumentincluding chapters in mdframed referencesMixing cleveref, vref and ref: Argument of @firstoftwo has an extra }LaTeX3 clist_sort:Nn — How has this function been implemented?hyperref error : ! Argument of @providesfile has an extra }hyperref error: Argument of Hy@setref@link has an extra }LaTeX3: clist_gpop has extra pop in tabularxError: Argument of newcommand{…} has an extra }













0















I am attempting to write macro that extracts and formats information from a label.



I get the messages:




! Argument of @firstoftwo has an extra }.

par
l.84 ... is text that refers to fullcref{sec:foo}
.
? x




From this code:



documentclass{article}

usepackage{amsmath}
usepackage{amsthm}
usepackage{mathtools}
usepackage{xparse}

newcommand pagecref [1]
{
fullcref{#1} on cpageref{#1}
}

newcommand Pagecref [1]
{
Fullcref{#1} on cpageref{#1}
}

ExplSyntaxOn

% Remove when added to expl3
cs_generate_variant:Nn str_show:n {e}
cs_generate_variant:Nn tl_log:n {e}
cs_generate_variant:Nn tl_show:n {e}

% Render type # (description)
% begin{equation} does not retain optional parameter in nameref{label}
NewDocumentCommand fullcref {m}
{
fullcref:nn {cref} {#1}
}

NewDocumentCommand Fullcref {m}
{
fullcref:nn {Cref} {#1}
}

cs_new:Npn fullcref:nn #1 #2
{
% str_show:e {fullcref:~#2~has~tl_count:n {#2}~tokens}
% str_show:e {fullcref:~#2~labels~a~namecref{#2}}
% tl_show:e {fullcref:~#2~has~environment~type~#1{#2}}
bool_if:nTF
{
% str_if_eq_p:ee {nameref{#2}} {equation} ||
str_if_eq_p:ee {str_range:nnn {#2} {1} {3}} {eq:} ||
str_if_eq_p:ee {namecref{#2}} {}
}
{
% str_show:n {true}
% #1 {#2} on cpageref{#2}
true
}
{
% str_show:n {false}
% #1 {#2} (nameref{#2}) on cpageref{#2}
false
}
}

ExplSyntaxOff


newtheorem{theorem}{Theorem}[section]

theoremstyle{definition}
newtheorem{definition}[theorem]{Definition}
defdefinitionutorefname{Definition} % Needed for autoref
newtheorem{example}[theorem]{Example}

usepackage[colorlinks,hidelinks,draft=false]{hyperref}

usepackage{cleveref}
usepackage[draft]{showlabels}

begin{document}
section{foo bear}
label{sec:foo}
This is dummy text.

begin{equation}
label{eq:foo}
end{equation}

This is text that refers to fullcref{sec:foo}. \

This is text that refers to fullcref{eq:foo}. \

This is text that refers to fullcref{def:foo}. \

This is text that refers to fullcref{def:bar}. \

This is text that refers to pagecref{sec:foo}. \

This is text that refers to pagecref{eq:foo}. \

This is text that refers to pagecref{def:foo}. \

This is text that refers to pagecref{def:bar}. \

begin{definition}
label{def:foo}
This is a definition without descriptive text.
end{definition}

Fullcref{sec:foo}. \

Fullcref{eq:foo}. \

Fullcref{def:foo}. \

Fullcref{def:bar}. \

Pagecref{sec:foo}. \

Pagecref{eq:foo}. \

Pagecref{def:foo}. \

Pagecref{def:bar}. \

begin{definition}[dummy definition]
label{def:bar}
This is a definition with descriptive text.
end{definition}

end{document}








share

























  • the ref commands are not expandable, so can't be used in edef (or an e argument)

    – David Carlisle
    2 mins ago











  • If you want expandable ref commands, use the zref package.

    – Ulrike Fischer
    just now
















0















I am attempting to write macro that extracts and formats information from a label.



I get the messages:




! Argument of @firstoftwo has an extra }.

par
l.84 ... is text that refers to fullcref{sec:foo}
.
? x




From this code:



documentclass{article}

usepackage{amsmath}
usepackage{amsthm}
usepackage{mathtools}
usepackage{xparse}

newcommand pagecref [1]
{
fullcref{#1} on cpageref{#1}
}

newcommand Pagecref [1]
{
Fullcref{#1} on cpageref{#1}
}

ExplSyntaxOn

% Remove when added to expl3
cs_generate_variant:Nn str_show:n {e}
cs_generate_variant:Nn tl_log:n {e}
cs_generate_variant:Nn tl_show:n {e}

% Render type # (description)
% begin{equation} does not retain optional parameter in nameref{label}
NewDocumentCommand fullcref {m}
{
fullcref:nn {cref} {#1}
}

NewDocumentCommand Fullcref {m}
{
fullcref:nn {Cref} {#1}
}

cs_new:Npn fullcref:nn #1 #2
{
% str_show:e {fullcref:~#2~has~tl_count:n {#2}~tokens}
% str_show:e {fullcref:~#2~labels~a~namecref{#2}}
% tl_show:e {fullcref:~#2~has~environment~type~#1{#2}}
bool_if:nTF
{
% str_if_eq_p:ee {nameref{#2}} {equation} ||
str_if_eq_p:ee {str_range:nnn {#2} {1} {3}} {eq:} ||
str_if_eq_p:ee {namecref{#2}} {}
}
{
% str_show:n {true}
% #1 {#2} on cpageref{#2}
true
}
{
% str_show:n {false}
% #1 {#2} (nameref{#2}) on cpageref{#2}
false
}
}

ExplSyntaxOff


newtheorem{theorem}{Theorem}[section]

theoremstyle{definition}
newtheorem{definition}[theorem]{Definition}
defdefinitionutorefname{Definition} % Needed for autoref
newtheorem{example}[theorem]{Example}

usepackage[colorlinks,hidelinks,draft=false]{hyperref}

usepackage{cleveref}
usepackage[draft]{showlabels}

begin{document}
section{foo bear}
label{sec:foo}
This is dummy text.

begin{equation}
label{eq:foo}
end{equation}

This is text that refers to fullcref{sec:foo}. \

This is text that refers to fullcref{eq:foo}. \

This is text that refers to fullcref{def:foo}. \

This is text that refers to fullcref{def:bar}. \

This is text that refers to pagecref{sec:foo}. \

This is text that refers to pagecref{eq:foo}. \

This is text that refers to pagecref{def:foo}. \

This is text that refers to pagecref{def:bar}. \

begin{definition}
label{def:foo}
This is a definition without descriptive text.
end{definition}

Fullcref{sec:foo}. \

Fullcref{eq:foo}. \

Fullcref{def:foo}. \

Fullcref{def:bar}. \

Pagecref{sec:foo}. \

Pagecref{eq:foo}. \

Pagecref{def:foo}. \

Pagecref{def:bar}. \

begin{definition}[dummy definition]
label{def:bar}
This is a definition with descriptive text.
end{definition}

end{document}








share

























  • the ref commands are not expandable, so can't be used in edef (or an e argument)

    – David Carlisle
    2 mins ago











  • If you want expandable ref commands, use the zref package.

    – Ulrike Fischer
    just now














0












0








0








I am attempting to write macro that extracts and formats information from a label.



I get the messages:




! Argument of @firstoftwo has an extra }.

par
l.84 ... is text that refers to fullcref{sec:foo}
.
? x




From this code:



documentclass{article}

usepackage{amsmath}
usepackage{amsthm}
usepackage{mathtools}
usepackage{xparse}

newcommand pagecref [1]
{
fullcref{#1} on cpageref{#1}
}

newcommand Pagecref [1]
{
Fullcref{#1} on cpageref{#1}
}

ExplSyntaxOn

% Remove when added to expl3
cs_generate_variant:Nn str_show:n {e}
cs_generate_variant:Nn tl_log:n {e}
cs_generate_variant:Nn tl_show:n {e}

% Render type # (description)
% begin{equation} does not retain optional parameter in nameref{label}
NewDocumentCommand fullcref {m}
{
fullcref:nn {cref} {#1}
}

NewDocumentCommand Fullcref {m}
{
fullcref:nn {Cref} {#1}
}

cs_new:Npn fullcref:nn #1 #2
{
% str_show:e {fullcref:~#2~has~tl_count:n {#2}~tokens}
% str_show:e {fullcref:~#2~labels~a~namecref{#2}}
% tl_show:e {fullcref:~#2~has~environment~type~#1{#2}}
bool_if:nTF
{
% str_if_eq_p:ee {nameref{#2}} {equation} ||
str_if_eq_p:ee {str_range:nnn {#2} {1} {3}} {eq:} ||
str_if_eq_p:ee {namecref{#2}} {}
}
{
% str_show:n {true}
% #1 {#2} on cpageref{#2}
true
}
{
% str_show:n {false}
% #1 {#2} (nameref{#2}) on cpageref{#2}
false
}
}

ExplSyntaxOff


newtheorem{theorem}{Theorem}[section]

theoremstyle{definition}
newtheorem{definition}[theorem]{Definition}
defdefinitionutorefname{Definition} % Needed for autoref
newtheorem{example}[theorem]{Example}

usepackage[colorlinks,hidelinks,draft=false]{hyperref}

usepackage{cleveref}
usepackage[draft]{showlabels}

begin{document}
section{foo bear}
label{sec:foo}
This is dummy text.

begin{equation}
label{eq:foo}
end{equation}

This is text that refers to fullcref{sec:foo}. \

This is text that refers to fullcref{eq:foo}. \

This is text that refers to fullcref{def:foo}. \

This is text that refers to fullcref{def:bar}. \

This is text that refers to pagecref{sec:foo}. \

This is text that refers to pagecref{eq:foo}. \

This is text that refers to pagecref{def:foo}. \

This is text that refers to pagecref{def:bar}. \

begin{definition}
label{def:foo}
This is a definition without descriptive text.
end{definition}

Fullcref{sec:foo}. \

Fullcref{eq:foo}. \

Fullcref{def:foo}. \

Fullcref{def:bar}. \

Pagecref{sec:foo}. \

Pagecref{eq:foo}. \

Pagecref{def:foo}. \

Pagecref{def:bar}. \

begin{definition}[dummy definition]
label{def:bar}
This is a definition with descriptive text.
end{definition}

end{document}








share
















I am attempting to write macro that extracts and formats information from a label.



I get the messages:




! Argument of @firstoftwo has an extra }.

par
l.84 ... is text that refers to fullcref{sec:foo}
.
? x




From this code:



documentclass{article}

usepackage{amsmath}
usepackage{amsthm}
usepackage{mathtools}
usepackage{xparse}

newcommand pagecref [1]
{
fullcref{#1} on cpageref{#1}
}

newcommand Pagecref [1]
{
Fullcref{#1} on cpageref{#1}
}

ExplSyntaxOn

% Remove when added to expl3
cs_generate_variant:Nn str_show:n {e}
cs_generate_variant:Nn tl_log:n {e}
cs_generate_variant:Nn tl_show:n {e}

% Render type # (description)
% begin{equation} does not retain optional parameter in nameref{label}
NewDocumentCommand fullcref {m}
{
fullcref:nn {cref} {#1}
}

NewDocumentCommand Fullcref {m}
{
fullcref:nn {Cref} {#1}
}

cs_new:Npn fullcref:nn #1 #2
{
% str_show:e {fullcref:~#2~has~tl_count:n {#2}~tokens}
% str_show:e {fullcref:~#2~labels~a~namecref{#2}}
% tl_show:e {fullcref:~#2~has~environment~type~#1{#2}}
bool_if:nTF
{
% str_if_eq_p:ee {nameref{#2}} {equation} ||
str_if_eq_p:ee {str_range:nnn {#2} {1} {3}} {eq:} ||
str_if_eq_p:ee {namecref{#2}} {}
}
{
% str_show:n {true}
% #1 {#2} on cpageref{#2}
true
}
{
% str_show:n {false}
% #1 {#2} (nameref{#2}) on cpageref{#2}
false
}
}

ExplSyntaxOff


newtheorem{theorem}{Theorem}[section]

theoremstyle{definition}
newtheorem{definition}[theorem]{Definition}
defdefinitionutorefname{Definition} % Needed for autoref
newtheorem{example}[theorem]{Example}

usepackage[colorlinks,hidelinks,draft=false]{hyperref}

usepackage{cleveref}
usepackage[draft]{showlabels}

begin{document}
section{foo bear}
label{sec:foo}
This is dummy text.

begin{equation}
label{eq:foo}
end{equation}

This is text that refers to fullcref{sec:foo}. \

This is text that refers to fullcref{eq:foo}. \

This is text that refers to fullcref{def:foo}. \

This is text that refers to fullcref{def:bar}. \

This is text that refers to pagecref{sec:foo}. \

This is text that refers to pagecref{eq:foo}. \

This is text that refers to pagecref{def:foo}. \

This is text that refers to pagecref{def:bar}. \

begin{definition}
label{def:foo}
This is a definition without descriptive text.
end{definition}

Fullcref{sec:foo}. \

Fullcref{eq:foo}. \

Fullcref{def:foo}. \

Fullcref{def:bar}. \

Pagecref{sec:foo}. \

Pagecref{eq:foo}. \

Pagecref{def:foo}. \

Pagecref{def:bar}. \

begin{definition}[dummy definition]
label{def:bar}
This is a definition with descriptive text.
end{definition}

end{document}






hyperref expl3 cleveref latex3





share














share












share



share








edited 2 mins ago









Sebastiano

10.3k41960




10.3k41960










asked 7 mins ago









shmuelshmuel

535211




535211













  • the ref commands are not expandable, so can't be used in edef (or an e argument)

    – David Carlisle
    2 mins ago











  • If you want expandable ref commands, use the zref package.

    – Ulrike Fischer
    just now



















  • the ref commands are not expandable, so can't be used in edef (or an e argument)

    – David Carlisle
    2 mins ago











  • If you want expandable ref commands, use the zref package.

    – Ulrike Fischer
    just now

















the ref commands are not expandable, so can't be used in edef (or an e argument)

– David Carlisle
2 mins ago





the ref commands are not expandable, so can't be used in edef (or an e argument)

– David Carlisle
2 mins ago













If you want expandable ref commands, use the zref package.

– Ulrike Fischer
just now





If you want expandable ref commands, use the zref package.

– Ulrike Fischer
just now










0






active

oldest

votes











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477047%2fargument-of-firstoftwo-has-an-extra%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477047%2fargument-of-firstoftwo-has-an-extra%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Paper upload error, “Upload failed: The top margin is 0.715 in on page 3, which is below the required...

Emraan Hashmi Filmografia | Linki zewnętrzne | Menu nawigacyjneGulshan GroverGulshan...

How can I write this formula?newline and italics added with leqWhy does widehat behave differently if I...