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}
\usepackage{yfonts}
\addtokomafont{disposition}{\frakfamily\fraklines}
\usepackage[hidelinks]{hyperref}
\usepackage{xstring}
\newcommand{\removeLigatures}[1]{%
\IfSubStr{#1}{s:}{%
\StrSubstitute{#1}{s:}{s}%
}{#1}
}
\newcommand{\mySection}[1]{%
\section{\texorpdfstring{#1}{\removeLigatures{#1}}}
}
\begin{document}
\frakfamily
\tableofcontents
\mySection{Jus:t a tes:t}
\end{document}
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?