How to write the result of a citation to a file?

You can't use \cite because this has several instruction for printing the citation key.

You need to use \[email protected]<key>, for instance like this:


      \@ifundefined{[email protected]\next}{[<\next>]}{[\csname [email protected]\next\endcsname]}%



\bibitem{Ab} Author, title, 2016.
\bibitem{Cd} Common, Second, 2015.


Contents after the first run


Contents after the second run