Related to my previous question, which could be solved with a change in the TeXStudio configuration
bibtex.exe -- ?*.aux
I am still having trouble with the natbib and multiref combination.
My example
\documentclass[a4paper]{article}
\usepackage{filecontents}
\begin{filecontents}{bib.bib}
@book{tolkien_93,
title={The Lord of the Rings: Part 1: The Fellowship of the Ring},
author={Tolkien, John Ronald Reuel},
year={1993},
publisher={Christian Blind Mission International}
}
@book{tolkien_66,
title={The Lord of the Rings. Part 2: The Two Towers},
author={Tolkien, John Ronald Reuel},
year={1966},
publisher={Allen and Unwin}
}
@book{tolkien_55,
title={The Lord of the Rings. Part 3: The Return of the King},
author={Tolkien, John Ronald Reuel},
year={1955},
publisher={Allen \& Unwin}
}
@book{tolkien_79,
title={The silmarillion},
author={Tolkien, JR John Ronald Reuel},
year={1979},
publisher={Random House LLC}
}
\end{filecontents}
\usepackage[
colorlinks=true,
linkcolor=black,
pagecolor=black,
citecolor=black,
filecolor=black,
urlcolor=black,
menucolor=black,
]{hyperref}
\usepackage[numbers, super, sort&compress, square]{natbib}
\makeatletter
\def@mb@citenamelist{cite,citep,citet,citealp,citealt,citepalias,citetalias}
\makeatother
\usepackage[resetlabels]{multibib}
\newcites{pub}{Publications}
\usepackage{lipsum}
\usepackage{booktabs}
\defcitealias{tolkien_93}{HDR-1}
\defcitealias{tolkien_66}{HDR-2}
\defcitealias{tolkien_55}{HDR-3}
\defcitealias{tolkien_79}{silmarillion}
\begin{document}
\section{Lipsum \protect \citepaliaspub{tolkien_93}}
\lipsum[2][1]\cite{tolkien_66} \lipsum[5][7]\citepub{tolkien_93} \\
\lipsum[1][2]\citepaliaspub{tolkien_79} \lipsum[25][13]\citepalias{tolkien_55}.
\begin{table}[htb!]
\centering
\caption[short caption \protect \citepaliaspub{tolkien_93}]{caption. \protect \citepaliaspub{tolkien_93}}
\begin{tabular}{lcc}
\toprule
lipsum & lipsum & lipsum \\ \midrule
lipsum & lipsum & lipsum \\
lipsum & lipsum & lipsum \\
\bottomrule
\end{tabular}
\end{table}
\bibliographystyle{angew}
\bibliography{bib}
\let\noopsort\undefined
\let\printfirst\undefined
\let\singleletter\undefined
\let\switchargs\undefined
\bibliographystylepub{angew}
\bibliographypub{bib}
\end{document}
did produce the error Use of \mb@@citex doesn't match its definition. ...ipsum \protect \citepaliaspub{tolkien_93}}
Is there some way to tackle this problem? The problem results from the caption environment, since everything works fine without it.
EDIT 1
As soon as I posted the question, I already found the solution here. When using \protect it works fine for the caption, so I also tried it in the section, and there the error stays the same even after adding \protect.
EDIT 2
Also, I did some research and found this answer, where using \cite<seq> in the \section shows no errors using \protect, but for me the error
Use of \mb@@citex doesn't match its definition. ...ipsum \protect \citepaliaspub{tolkien_93}}
remains. Any suggestions, what I did wrong?
EDIT 3
When I uncomment \usepackage{hyperref}, \protect is working like it should, and, according to this answer, the order of the packages plays an additional role. So as soon as I find a part of the answer, another problem occurs.
