Replace ligature in bookmarks
Clash Royale CLAN TAG#URR8PPP
up vote
5
down vote
favorite
I am trying to replace the s:
ligature in the bookmarks by just an s
. This is needed as my document is written using a fraktur font, but the colon appears inside the bookmarks as they are not in fraktur.
My current code is the following one:
documentclass[a4paper]scrartcl
usepackageyfonts
addtokomafontdispositionfrakfamilyfraklines
usepackage[hidelinks]hyperref
usepackagexstring
newcommandremoveLigatures[1]%
IfSubStr#1s:%
StrSubstitute#1s:s%
#1
newcommandmySection[1]%
sectiontexorpdfstring#1removeLigatures#1
begindocument
frakfamily
tableofcontents
mySectionJus:t a tes:t
enddocument
There seems to be some issue with my code, as I get a bookmark with the text Jus:t a tes:ts:s:sJus:t a tes:t
. How can I fix this to achieve the desired results?
ligatures
add a comment |Â
up vote
5
down vote
favorite
I am trying to replace the s:
ligature in the bookmarks by just an s
. This is needed as my document is written using a fraktur font, but the colon appears inside the bookmarks as they are not in fraktur.
My current code is the following one:
documentclass[a4paper]scrartcl
usepackageyfonts
addtokomafontdispositionfrakfamilyfraklines
usepackage[hidelinks]hyperref
usepackagexstring
newcommandremoveLigatures[1]%
IfSubStr#1s:%
StrSubstitute#1s:s%
#1
newcommandmySection[1]%
sectiontexorpdfstring#1removeLigatures#1
begindocument
frakfamily
tableofcontents
mySectionJus:t a tes:t
enddocument
There seems to be some issue with my code, as I get a bookmark with the text Jus:t a tes:ts:s:sJus:t a tes:t
. How can I fix this to achieve the desired results?
ligatures
add a comment |Â
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I am trying to replace the s:
ligature in the bookmarks by just an s
. This is needed as my document is written using a fraktur font, but the colon appears inside the bookmarks as they are not in fraktur.
My current code is the following one:
documentclass[a4paper]scrartcl
usepackageyfonts
addtokomafontdispositionfrakfamilyfraklines
usepackage[hidelinks]hyperref
usepackagexstring
newcommandremoveLigatures[1]%
IfSubStr#1s:%
StrSubstitute#1s:s%
#1
newcommandmySection[1]%
sectiontexorpdfstring#1removeLigatures#1
begindocument
frakfamily
tableofcontents
mySectionJus:t a tes:t
enddocument
There seems to be some issue with my code, as I get a bookmark with the text Jus:t a tes:ts:s:sJus:t a tes:t
. How can I fix this to achieve the desired results?
ligatures
I am trying to replace the s:
ligature in the bookmarks by just an s
. This is needed as my document is written using a fraktur font, but the colon appears inside the bookmarks as they are not in fraktur.
My current code is the following one:
documentclass[a4paper]scrartcl
usepackageyfonts
addtokomafontdispositionfrakfamilyfraklines
usepackage[hidelinks]hyperref
usepackagexstring
newcommandremoveLigatures[1]%
IfSubStr#1s:%
StrSubstitute#1s:s%
#1
newcommandmySection[1]%
sectiontexorpdfstring#1removeLigatures#1
begindocument
frakfamily
tableofcontents
mySectionJus:t a tes:t
enddocument
There seems to be some issue with my code, as I get a bookmark with the text Jus:t a tes:ts:s:sJus:t a tes:t
. How can I fix this to achieve the desired results?
ligatures
asked Sep 6 at 17:32
epR8GaYuh
7841416
7841416
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
7
down vote
accepted
You must do the replacement before feeding the argument to texorpdfstring. E.g. with expl3:
documentclass[a4paper]scrartcl
usepackageyfonts
usepackage[hidelinks]hyperref
usepackageexpl3
ExplSyntaxOn
newcommandremoveLigatures[1]%
tl_set:Nn l_tmpa_tl#1
regex_replace_all:nnN s: s l_tmpa_tl
newcommandmySection[1]%
removeLigatures#1
sectiontexorpdfstring#1l_tmpa_tl
ExplSyntaxOff
addtokomafontsectioningfrakfamily
begindocument
frakfamily
tableofcontents
mySectionJus:t a tes:t
enddocument
While this works for the basic case, this eliminates all colons froms::
, too. Instead this should be translated tos:
as inside the document text itself (where it is represented by thes:
ligature followed by a regular colon). This seems to be just a little regex fix.
â epR8GaYuh
Sep 7 at 5:23
yes, sorry I forgot the s in the regex.
â Ulrike Fischer
Sep 7 at 7:05
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
7
down vote
accepted
You must do the replacement before feeding the argument to texorpdfstring. E.g. with expl3:
documentclass[a4paper]scrartcl
usepackageyfonts
usepackage[hidelinks]hyperref
usepackageexpl3
ExplSyntaxOn
newcommandremoveLigatures[1]%
tl_set:Nn l_tmpa_tl#1
regex_replace_all:nnN s: s l_tmpa_tl
newcommandmySection[1]%
removeLigatures#1
sectiontexorpdfstring#1l_tmpa_tl
ExplSyntaxOff
addtokomafontsectioningfrakfamily
begindocument
frakfamily
tableofcontents
mySectionJus:t a tes:t
enddocument
While this works for the basic case, this eliminates all colons froms::
, too. Instead this should be translated tos:
as inside the document text itself (where it is represented by thes:
ligature followed by a regular colon). This seems to be just a little regex fix.
â epR8GaYuh
Sep 7 at 5:23
yes, sorry I forgot the s in the regex.
â Ulrike Fischer
Sep 7 at 7:05
add a comment |Â
up vote
7
down vote
accepted
You must do the replacement before feeding the argument to texorpdfstring. E.g. with expl3:
documentclass[a4paper]scrartcl
usepackageyfonts
usepackage[hidelinks]hyperref
usepackageexpl3
ExplSyntaxOn
newcommandremoveLigatures[1]%
tl_set:Nn l_tmpa_tl#1
regex_replace_all:nnN s: s l_tmpa_tl
newcommandmySection[1]%
removeLigatures#1
sectiontexorpdfstring#1l_tmpa_tl
ExplSyntaxOff
addtokomafontsectioningfrakfamily
begindocument
frakfamily
tableofcontents
mySectionJus:t a tes:t
enddocument
While this works for the basic case, this eliminates all colons froms::
, too. Instead this should be translated tos:
as inside the document text itself (where it is represented by thes:
ligature followed by a regular colon). This seems to be just a little regex fix.
â epR8GaYuh
Sep 7 at 5:23
yes, sorry I forgot the s in the regex.
â Ulrike Fischer
Sep 7 at 7:05
add a comment |Â
up vote
7
down vote
accepted
up vote
7
down vote
accepted
You must do the replacement before feeding the argument to texorpdfstring. E.g. with expl3:
documentclass[a4paper]scrartcl
usepackageyfonts
usepackage[hidelinks]hyperref
usepackageexpl3
ExplSyntaxOn
newcommandremoveLigatures[1]%
tl_set:Nn l_tmpa_tl#1
regex_replace_all:nnN s: s l_tmpa_tl
newcommandmySection[1]%
removeLigatures#1
sectiontexorpdfstring#1l_tmpa_tl
ExplSyntaxOff
addtokomafontsectioningfrakfamily
begindocument
frakfamily
tableofcontents
mySectionJus:t a tes:t
enddocument
You must do the replacement before feeding the argument to texorpdfstring. E.g. with expl3:
documentclass[a4paper]scrartcl
usepackageyfonts
usepackage[hidelinks]hyperref
usepackageexpl3
ExplSyntaxOn
newcommandremoveLigatures[1]%
tl_set:Nn l_tmpa_tl#1
regex_replace_all:nnN s: s l_tmpa_tl
newcommandmySection[1]%
removeLigatures#1
sectiontexorpdfstring#1l_tmpa_tl
ExplSyntaxOff
addtokomafontsectioningfrakfamily
begindocument
frakfamily
tableofcontents
mySectionJus:t a tes:t
enddocument
edited Sep 7 at 7:05
answered Sep 6 at 17:51
Ulrike Fischer
178k7281650
178k7281650
While this works for the basic case, this eliminates all colons froms::
, too. Instead this should be translated tos:
as inside the document text itself (where it is represented by thes:
ligature followed by a regular colon). This seems to be just a little regex fix.
â epR8GaYuh
Sep 7 at 5:23
yes, sorry I forgot the s in the regex.
â Ulrike Fischer
Sep 7 at 7:05
add a comment |Â
While this works for the basic case, this eliminates all colons froms::
, too. Instead this should be translated tos:
as inside the document text itself (where it is represented by thes:
ligature followed by a regular colon). This seems to be just a little regex fix.
â epR8GaYuh
Sep 7 at 5:23
yes, sorry I forgot the s in the regex.
â Ulrike Fischer
Sep 7 at 7:05
While this works for the basic case, this eliminates all colons from
s::
, too. Instead this should be translated to s:
as inside the document text itself (where it is represented by the s:
ligature followed by a regular colon). This seems to be just a little regex fix.â epR8GaYuh
Sep 7 at 5:23
While this works for the basic case, this eliminates all colons from
s::
, too. Instead this should be translated to s:
as inside the document text itself (where it is represented by the s:
ligature followed by a regular colon). This seems to be just a little regex fix.â epR8GaYuh
Sep 7 at 5:23
yes, sorry I forgot the s in the regex.
â Ulrike Fischer
Sep 7 at 7:05
yes, sorry I forgot the s in the regex.
â Ulrike Fischer
Sep 7 at 7:05
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%2f449742%2freplace-ligature-in-bookmarks%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