Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
Would you mind showing us a short MWE? –  moewe Nov 8 '13 at 19:09
    
Thanks for the comment, moewe. I added a MWE. –  Philip Nov 8 '13 at 19:20
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 8 '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 8 '13 at 20:04

1 Answer 1

up vote 3 down vote accepted

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 http://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}
share|improve this answer
    
Thank you so much! I added a S. in front of the \renewcommand*{\elementsep}{}% and now it works perfectly. –  Philip Jul 26 at 8:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.