4

I have a (hopefully quickly solvable) issue with Biblatex & footnote-dw. Since some of my short titles are very short (in some cases only one letter), I would prefer to not have a comma between them and the pages. "B, 869" looks strange. I would prefer to just change it globally, for the sake of uniformity.

So I gather I would need to change the postnotedelim for shorthand cases (only), but I couldn't find a simple way to do this without inserting something into the bibliography file for each entry.

MWE as requested (FN 2 & 6 are the issue):

\documentclass[fontsize=11.5pt,twoside]{scrreprt}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage[]{english}


\begin{filecontents*}{test.bib} 
    @book{Kant1, 
        author={Manu Kant}, 
        title={Critique of Pure Treason}, 
        subtitle={Why are there no pink MandMs},
        address={Chocolvania}, 
        shorthand={A},
        year=2017
    } 

    @book{Kant4, 
    author={Franz Kant}, 
title={Down with pink}, 
subtitle={A heteronormative misogynist manifesto},
address={Reesestown}, 
shorthand={Manifesto},
year=2008
}

        @book{Kant2, 
    author={Franz Kant}, 
    title={Ignore my Brother}, 
    subtitle={Hes an idiot},
    address={Reesestown}, 
    shorthand={Moron},
    year=2018
}   
\end{filecontents*}



\usepackage[style=footnote-dw,
backend=biber,
%ibidem=strict,
edbyidem=true,
nopublisher=true,
edsuper=true,
idembibformat=dash,
%ibidemfont=italic,
doi=false,isbn=false,url=false,
]{biblatex}

%get rid of p.
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
\DeclareFieldFormat{pages}{#1}

\addbibresource{test.bib}

\begin{document}
The argument between the Brothers Kant\footnote{See \cite[123]{Kant1} and \cite[5]{Kant2}.} seems to boil\cite[43]{Kant1} down\cite[2]{Kant1} mostly to sugary treats.\cite[7]{Kant2} Mmmmmhmmm sugary treats.\footnote{Yet see also the sexist underpinnings in \cite{Kant1}, cf. \cite{Kant4}!} But I wanna check \cite[6]{Kant1} again.
\end{document}
5
  • 1
    Please show us a short compilable code we can play with. And do not forget to add two bib entrys to your question!
    – Mensch
    May 27, 2018 at 13:00
  • Of course - coming!
    – Paul Burgh
    May 27, 2018 at 13:59
  • @PaulBurgh, and note 4 should have a comma? Also, citations without shorthands should have one?
    – gusbrs
    May 27, 2018 at 14:07
  • @gusbrs Since note 4 is also a given shorthand, it should also lose its comma. Normal citations should keep their comma, however.
    – Paul Burgh
    May 27, 2018 at 16:10
  • @PaulBurgh, then I guess David's answer should fit your bill perfectly.
    – gusbrs
    May 27, 2018 at 16:22

1 Answer 1

3

Here's a possible solution.

I set the \postnotedelim in \AtEveryCitekey using the same logic as found in the cite bibmacro from footnote-dw.cbx so that it print \addspace when the shorthand is printed and \addcomma\space otherwise.

\documentclass[fontsize=11.5pt,twoside]{scrreprt}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage[]{english}

\begin{filecontents}{test.bib} 
@book{Kant1, 
  author={Manu Kant}, 
  title={Critique of Pure Treason}, 
  subtitle={Why are there no pink MandMs},
  address={Chocolvania}, 
  shorthand={A},
  year=2017
} 
@book{Kant4, 
  author={Franz Kant}, 
  title={Down with pink}, 
  subtitle={A heteronormative misogynist manifesto},
  address={Reesestown}, 
  shorthand={Manifesto},
  year=2008
}
@book{Kant2, 
  author={Franz Kant}, 
  title={Ignore my Brother}, 
  subtitle={Hes an idiot},
  address={Reesestown}, 
  shorthand={Moron},
  year=2018
}   
\end{filecontents}

\usepackage[style=footnote-dw,
edbyidem=true,
nopublisher=true,
edsuper=true,
idembibformat=dash,
doi=false,isbn=false,url=false,
]{biblatex}

%get rid of p.
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
\DeclareFieldFormat{pages}{#1}

% set \postnotedelim at every citation
\newbibmacro*{setpostnotedelim}{%
  \ifboolexpr{
    test {\ifciteseen}
    and not
    bool {cbx:textcitefull}
  }
    {\iffieldundef{shorthand}
       {\gdef\postnotedelim{\addcomma\space}}
       {\ifbool{cbx:shorthandibid}
          {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
             {\gdef\postnotedelim{\addcomma\space}}
             {\gdef\postnotedelim{\addspace}}}
          {\gdef\postnotedelim{\addspace}}}}
    {\gdef\postnotedelim{\addcomma\space}}}

\AtEveryCitekey{\usebibmacro{setpostnotedelim}}

\addbibresource{test.bib}

\begin{document}
\null\vfill
The argument between the Brothers Kant\footnote{See \cite[123]{Kant1} and
\cite[5]{Kant2}.} seems to boil\cite[43]{Kant1} down\cite[2]{Kant1} mostly to
sugary treats.\cite[7]{Kant2} Mmmmmhmmm sugary treats.\footnote{Yet see also
the sexist underpinnings in \cite{Kant1}, cf. \cite{Kant4}!} But I wanna
check \cite[6]{Kant1} again.
\end{document}

enter image description here

5
  • +1 But I would not make \postnotedelim long. Is there any particular reason for that?
    – moewe
    May 27, 2018 at 15:21
  • @moewe, embarrassingly because I misremembered which way round \newcomand and \newcommand* go... I removed the \long commands. May 27, 2018 at 21:45
  • @DavidPurton, why do we need the Citekey hook here? As far as I see, \postnotedelim is only used in citations and is a global definition (but I tested, and it doesn't work without it, that is by redefining the delimiter directly).
    – gusbrs
    May 28, 2018 at 10:40
  • 1
    @gusbrs, I tried that first too. \ifciteseen seems to always return true by the time you get to inserting postnotedelim. Although I didn't look through the code, my assumption is that it's set to true after finishing the loopcode of a citation command, but before running the postcode. May 28, 2018 at 10:47
  • @DavidPurton Mmh, I wouldn't have guessed that. I tried it too, but didn't think of using a hook. Thanks! (+1 had already been given)
    – gusbrs
    May 28, 2018 at 10:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .