Over at How to quote encyclopedia articles differently from books, magazines, etc. with Biblatex?, I was greatly helped with a macro which solved the question as it was asked.
I'd now like to change this macro so that it works like a regular Biblatex cite command. Below is what I've attempted so far. Unfortunately it doesn't compile:
\documentclass{scrartcl}
\usepackage{csquotes}
\usepackage{polyglossia}
\setmainlanguage[spelling=new]{german}
% example bib file
\begin{filecontents}{test.bib}
@mvreference{ml,
title = {Müllers Lexikon},
}
@inreference{ml:thermoskanne,
crossref = {ml},
title = {Thermoskanne},
volume = {2},
}
\end{filecontents}
\usepackage[backend=biber,citestyle=authoryear-icomp]{biblatex}
\addbibresource{test.bib}
% no quotes, italic font instead
\DeclareFieldFormat*{citetitle}{\emph{#1}}
% shot at a solution based on cfr's original answer
\usepackage{xparse}
\NewDocumentCommand{\parencitetitle}
{ > { \SplitArgument { 1 } { : } } m }
{ \myparencitetitle #1 }
\NewDocumentCommand{\myparencitetitle}
{ m m }
{
\boolfalse{citetracker}
\boolfalse{pagetracker}
\usebibmacro{prenote}
\parentext{\mkbibemph{\MakeUppercase{#1}}:\citetitle{#1:#2}}
\usebibmacro{postnote}
}
% some sample text, etc.
\begin{document}
Some things need to be said, some things need to be written. One place to put them in is an encyclopedia.
This is what it should look like, just without the space: (cf. \citetitle[\emph{ML:}][]{ml:thermoskanne}, 234).
And this is what it looks like right now: \parencitetitle[cf.][234]{ml:thermoskanne}.
\printbibliography
\end{document}
From what I understand so far, it is wrong (and impossible) to try and use Biblatex's prenotes and postnotes commands with this approach, and instead SplitArgument should be further exploited (how, though?)


mlis to be displayed as "ML". We would have to have something like that in the.bibfile. I would suggest changing to@inreferenceinstead of@incollection(even if you didn't like the idea in your earlier question). As far as I can tell you will not need substantial modifications to your bib style, but it will make our life here much easier (you will have to change your.bibfile of course, but probably not a lot). – moewe Jul 28 '15 at 17:08%)? As for this thing here, am I right in assuming that onlySplitArgumentis a command of packagexparse? – Sixtyfive Jul 28 '15 at 17:10\DeclareCiteCommandaccept additional arguments without a lot of fuss. What one could try to do (not what your title asks for exactly) is to replicate the behaviour ofbiblatex's\citecommands as defined viaDeclareCiteCommandin\NewDocumentCommand \myparencitetitle(xparseis quite powerful, and we will just need pre and postnotes). – moewe Jul 28 '15 at 17:13crossref. Since you say it will help, though, l've changed them here in the example. In real life, the change is a bit more complicated as it hinges on the resolution of https://github.com/ZotPlus/zotero-better-bibtex/issues/278#issuecomment-125677625. – Sixtyfive Jul 28 '15 at 17:14\DeclareCiteCommand) would be just fine. I made the title like that because I thought that would be the only way to get\cite-like behaviour... – Sixtyfive Jul 28 '15 at 17:15@inreferences (encyclopedia entries etc.) different from@incollections(which would not necessarily have to be a reference entry). And as you have said the treatment by standard styles is the same, so you would not face trouble from that side. So the only problem is your literature database programme. – moewe Jul 28 '15 at 17:17