1

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 biblatex stuff 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 biblatex command and then reuse it in the \section etc. 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 \textcite but failed, see below.
  • Question: How to store the result of \textcite so that it can be reused in \section etc. 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}

enter image description here

Related

  • 1
    you can't. textcite is a too complex, noexpandable command. You can only extract the fields you need with the method described in the other posting and then build from is a faked version. Personally I think that if would be easier to write the names manually. How often do you have a cite in a sectioning heading? – Ulrike Fischer Feb 22 '22 at 08:43
  • @UlrikeFischer Ok, thanks for the reply. In my case, there are about 40 instances. – Dr. Manuel Kuehner Feb 22 '22 at 13:29
  • Maybe one can write the result in an aux file and read it back in the next compilation cycle? – Dr. Manuel Kuehner Feb 22 '22 at 13:38
  • 1
    writing requires expansion too. That is the same problem. – Ulrike Fischer Feb 22 '22 at 13:44
  • @UlrikeFischer hmmm, ok. The textcite command works at least in the section and in the toc correctly. Problem is the bookmarks onky. Therefore I thought that this is feasible. – Dr. Manuel Kuehner Feb 22 '22 at 13:46
  • 1
    well look into the toc-file and see what it contains. – Ulrike Fischer Feb 22 '22 at 13:48
  • @UlrikeFischer will do later, it's 0545 in the morning for me right now and I need to get up :). – Dr. Manuel Kuehner Feb 22 '22 at 13:51
  • @UlrikeFischer I see your point :) \contentsline {section}{\numberline {4.1}\textcite {Kelsch2012}: \citetitle {Kelsch2012}}{23}{section.4.1}% – Dr. Manuel Kuehner Feb 22 '22 at 18:06
  • 1
    The problem I have is that I'm not writing the citation commands manually so replacing them with the relevant details by hand isn't straightforward. I'm specifying a bibkey, but that is then doing a bunch of things which include, somewhere in the middle, writing the toc line. Pre-pandemic, I just didn't use hyperref ;). Mid-pandemic, I just let the bibkeys go into the bookmarks. So anything which improves on that is a plus. For me, that basically means \citeauthor and \citetitle. The former seems much more complex than the latter although I have a simplistic version. – cfr Mar 20 '22 at 05:58
  • @cfr Please see https://tex.stackexchange.com/questions/637962. – Dr. Manuel Kuehner Mar 22 '22 at 01:19
  • @cfr See https://tex.stackexchange.com/questions/637962/ for an answer from the biblatex author. – Dr. Manuel Kuehner Mar 22 '22 at 17:18

0 Answers0