Replace ligature in bookmarks

The name of the pictureThe name of the pictureThe name of the pictureClash 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?







share|improve this question
























    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?







    share|improve this question






















      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?







      share|improve this question












      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?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 6 at 17:32









      epR8GaYuh

      7841416




      7841416




















          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





          share|improve this answer






















          • 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










          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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%2f449742%2freplace-ligature-in-bookmarks%23new-answer', 'question_page');

          );

          Post as a guest






























          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





          share|improve this answer






















          • 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














          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





          share|improve this answer






















          • 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












          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





          share|improve this answer














          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






          share|improve this answer














          share|improve this answer



          share|improve this answer








          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 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
















          • 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















          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

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          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













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          Installing NextGIS Connect into QGIS 3?

          One-line joke