I use the code as in the following MWE:
\documentclass{article}
\usepackage[english]{babel}
\useshorthands*{"}
\defineshorthand{"-}{\texorpdfstring{\babelhyphen{repeat}}{\discretionary{-}{-}{-}}}
\usepackage{biblatex}
\usepackage{csquotes}
\usepackage{xstring}
\verbtocs{\lecture}|Lecture, topic: \enquote {|
\makeatletter
\newbibmacro{unpublished+titles}[1]{%
\iffieldundef{title}%
{#1}%
{%
% https://tex.stackexchange.com/a/155276:
\edef\mytemporary{\thefield{title}}%
\edef\mytitle{\expandafter\strip@prefix\meaning\mytemporary}%
\IfBeginWith*{\mytitle}{\clt}%
{#1}%
{\mkbibquote{#1\isdot}}%
}%
}
\makeatother
\DeclareFieldFormat[unpublished]{citetitle}{\usebibmacro{unpublished+titles}{#1}}
\DeclareFieldFormat[unpublished]{title}{\usebibmacro{unpublished+titles}{#1}}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Unpublished{A1,
author = {Author},
title = {Some other work}
}
@Unpublished{A2,
author = {Author},
title = {Lecture, topic: \enquote{test}}
}
@Unpublished{A3,
author = {Author},
title = {Test"-test}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\noindent Citations: \cite{A1}~\cite{A2}%~\cite{A3}
\printbibliography
\end{document}
In this case it detects bibliography entries of type unpublished and if their titles start with “Lecture, topic: \enquote{”, it removes the first part of title from the bibliographical quotation. An illustrative result looks is:
Nevertheless, this works only for entries that do not include "- shorthand in their titles. If they do, the following problem occurs:
Uncommenting %~\cite{A3} in MWE causes such error.
Is it possible to expand this feature to cover also titles that contains "- shorthand? Either by correcting the code above or in other way that would produce the desired result.


