4

For some unknown reason I prefer to write the page numbers in \autocite[34,79]{dR80} without a space behind the comma. Unfortunately, in the output it doesnt compile a space automatically. Is there a way to change the command in order to set one space behind a comma?

Edit1 (adding a MWE):

\documentclass{article}

\usepackage[ngerman]{babel}%dt.Silbentrennung

\usepackage[style=authortitle-icomp,autocite=footnote]{biblatex} \bibliography{TestLit}

\begin{document}

\autocite[34,39]{dR80a}

\end{document}

Where dR80a is the following bib entry.

@article{dR80a,
   author = {David~E. Rumelhart},
   title = {On Evaluating Story Grammars},
   journal = {Cognitive Science},
   pages = {313-316},
   year = {1980},
   volume = {4},
   }

The output you find here.

enter image description here

Preferably the page numbers would look like this: 34, 39 e.g. with a space behind the comma.

Philip
  • 3,415
  • Would you mind showing us a short MWE? – moewe Nov 08 '13 at 19:09
  • 1
    Since the text in the postnote could conceivably contain anything, it's not clear that your request is any more reasonable than asking TeX to insert spaces after commas more generally. (I.e., you wouldn't expect TeX to add spaces automatically in "John,who is professor,teaches math".) – Alan Munn Nov 08 '13 at 19:52
  • That is true Alan Munn. But I just use it for page numbers, so from this point of view a local adjustment of the autocite command shouldnt cause any problems. – Philip Nov 08 '13 at 20:04

1 Answers1

3

Rather than mess with biblatex citation commands directly, it would be much simpler to create a command which adds spaces to your postnote arguments and use that command inside the postnote. I've used Nicola Talbot's nice answer to Special case for last element with \foreach for the loop code.

The advantage of this approach is that is provides semantic markup for lists of page numbers (the \pps macro) and allows other material in the postnote if required.

\documentclass{article}
\usepackage[style=authortitle-icomp,autocite=footnote]{biblatex}
\addbibresource{biblatex-examples.bib}
\usepackage{etoolbox} % not strictly necessary, since loaded by biblatex

% List code adapeted from https://tex.stackexchange.com/a/164122/
\newcommand*{\elementsep}{}
\newcommand*{\lastelement}{}

% define the handler macro:
\newcommand*{\dodisplayelement}[1]{%
  \elementsep
  \lastelement
  \renewcommand{\lastelement}{%
    \renewcommand{\elementsep}{, }%
    #1%
  }}%

% define the new command to process a list of page numbers:
\newrobustcmd*{\pps}[1]{%
  % initialise:
  \renewcommand*{\elementsep}{}%
  \renewcommand*{\lastelement}{}%
  % Iterate through list
  \forcsvlist{\dodisplayelement}{#1}%
  % Finish off:
  \elementsep
  \lastelement
}


\begin{document}
Augustine said some stuff.\autocite[\pps{34,49,50}]{augustine}
\end{document}
Alan Munn
  • 218,180
  • Thank you so much! I added a S. in front of the \renewcommand*{\elementsep}{}% and now it works perfectly. – Philip Jul 26 '14 at 08:23