Update: After Ulrike's comments I see that I ask the impossible. I might later re-write the question but I need time to ask a better question.
- I want to show some
biblatexstuff in the PDF bookmarks which is a difficult thing to do. - Luckily, I found How can I make \citetitle work in a hyperref section bookmark? and tried the two proposed answers.
- The idea of Heiko's answer is to store the result of a
biblatexcommand and then reuse it in the\sectionetc. command. egreg's answer is good and I will use it for a smaller project but for a larger project, Heiko's solution would be beneficial. - I tried to do the same thing with
\textcitebut failed, see below. - Question: How to store the result of
\textciteso that it can be reused in\sectionetc. and be also shown in the PDF bookmarks?
\documentclass{article}
\usepackage[style = authoryear-comp]{biblatex}
% See https://ctan.org/tex-archive/macros/latex/contrib/biblatex/doc/examples
\addbibresource{biblatex-examples.bib}
\usepackage{hyperref}
% https://tex.stackexchange.com/questions/73678
% This is my own (not working) creation based on Heiko's code.
\makeatletter
\newcommand*{\myTextciteStore}[2]{%
\begingroup
\global\let\myTextciteStore@Result\relax
\textcite{#2}%
\endgroup
\let#1\myTextciteStore@Result
}
\makeatother
\begin{document}
\section{\textcite{padhye}}
% Does not work, it prints the citation actually.
\myTextciteStore\myTemp{padhye}
\section{\myTemp}
\end{document}

\contentsline {section}{\numberline {4.1}\textcite {Kelsch2012}: \citetitle {Kelsch2012}}{23}{section.4.1}%– Dr. Manuel Kuehner Feb 22 '22 at 18:06\citeauthorand\citetitle. The former seems much more complex than the latter although I have a simplistic version. – cfr Mar 20 '22 at 05:58