babel conflicts with, I think, refcount
Clash 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.
babel refcount
add a comment |Â
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.
babel refcount
add a comment |Â
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.
babel refcount
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
babel refcount
asked 2 hours ago
Erwann
1357
1357
add a comment |Â
add a comment |Â
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:
Note: I initially added detokenize
to the document commands defined, but there remained a problem with getpagerefnumber
.
add a comment |Â
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
.
add a comment |Â
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:
Note: I initially added detokenize
to the document commands defined, but there remained a problem with getpagerefnumber
.
add a comment |Â
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:
Note: I initially added detokenize
to the document commands defined, but there remained a problem with getpagerefnumber
.
add a comment |Â
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:
Note: I initially added detokenize
to the document commands defined, but there remained a problem with getpagerefnumber
.
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:
Note: I initially added detokenize
to the document commands defined, but there remained a problem with getpagerefnumber
.
answered 2 hours ago
jfbu
41.5k61134
41.5k61134
add a comment |Â
add a comment |Â
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
.
add a comment |Â
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
.
add a comment |Â
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
.
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
.
answered 1 hour ago
egreg
682k8318123060
682k8318123060
add a comment |Â
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%2f450771%2fbabel-conflicts-with-i-think-refcount%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