4

I've read a whole bunch of questions here regarding biblatex and citation formatting. I've been a programmer for over 20 years in C and Java and Python and so on and I can't make any headway: it seems as opaque and unforgiving as anything I've ever come across. My contact with TeX is only occasional: I'm trying to write my thesis not become a TeX guru. For the most part I write in pandoc (markdown) and convert it to TeX. But probably as I get to final production, I will use raw TeX because it gives me better flexibility to get a much nicer result.

As far as I can tell, what I want to do is simple and yet many, many, hours later (read: time not spending writing the thesis, therefore unproductive) reading various biblatex.def, standard.bbx files and examples and so forth and various webpages I am totally lost.

I read a page here: "Guidelines for customizing bib latex styles". It was some help but didn't get me over the line. It's like I'm missing a basic piece of information here.

I use biblatex with Biber and the philosophy-classic style as it's close to what I need. I import it like this:

\usepackage[backend=biber,sorting=nyt,style=philosophy-classic]{biblatex}
\renewbibmacro{in:}{}

As you can see I'm also getting rid of the "In: " for journals and book chapters.

I cite a lot of books and journals and the style I must use includes at most citations, the page number:

\autocite[151]{Fabrizi2015} ...
\autocite[44-49]{Levene2010}

These come out as

(Fabrizi 2015, p. 151) ... (Levene 2010, pp. 44-49)

This is not what I need, although it's the closest to style to what I require which I've found thus far. I need it to be formatted as follows:

(Fabrizi 2015: 151) ... (Levene 2010: 44-49)

I've tried using

\usepackage[backend=biber,sorting=nyt,citestyle=authoryear-comp, bibstyle=authoryear]{biblatex}
\renewbibmacro{in:}{}
\DeclareFieldFormat{pages}{#1}

Which I've seen in many comments/answers but it doesn't seem to make any difference (nor when I use style=philosophy-classic rather than the cite style and bib style entries as above).

I also use textcite and autocites with and without page numbers (when they don't have page numbers, \textcite and \autocite come out OK):

For example, see \textcite[37-38]{Burck1971}. 
Contra to this position is \textcite{Miles1988}.
a map of the places described \autocites[64]{Levene2010}[2]{Fabrizi2015}.

These come out in a similar way to the above.

For example, see Burck (1971, pp. 37-38). ... Contra to this position is Miles (1988). ... a map of the places described (Levene 2010, p. 64; Fabrizi 2015, p. 2).

These all should be:

For example, see Burck (1971: 37-38). ... Contra to this position is Miles (1988). ... a map of the places described (Levene 2010: 64; Fabrizi 2015: 2).

This question here looks almost like mine: BibLaTeX customisation: Pages prefix to suffix but not quite close enough and I can't really make sense of the answer (and it doesn't help the answer is not accepted).

Bibliography is OK for moment. There are some annoyances with the way it prints volumes and issues of journal articles, but the major flaw is the 'pp.' it uses to label the pages on which the article is found. This:

Levene D.S. (2006), ‘History, Metahistory,and Audience Response in Livy 45’, Classical Antiquity, 25, 1, pp. 73-108.

Should be:

Levene D.S. (2006), ‘History, Metahistory,and Audience Response in Livy 45’, Classical Antiquity, 25, 1. 73-108.

But at this point I am not so concerned on the formatting of the bibliography as I am the citation style. There seems to be enough information about the bibliography formatting that I will be able to overcome that problem on my own.

So how do I change the ", p." and ", pp." between the year and the page number?

  • You also need \DeclareFieldFormat{postnote}{#1} and \DeclareFieldFormat{multipostnote}{#1} as well as \renewcommand*{\bibpagespunct}{\addcolon\space} and maybe \renewcommand{\postnotedelim}{% \iffieldpages{postnote} {\addcolon} {\addspace}} – moewe Mar 26 '16 at 14:31
  • Note that the answer you refer to is for a very specific case and requires quite complicated and low level code that has quite little to do with the garden–variety changes needed here. (Of course I would still be interested in what I can do to make my answer easier to understand.) Cf. also Colon instead of “p.” in Biblatex authoryear-comp – moewe Mar 26 '16 at 14:37
  • Thank you that first comment fixed it! Well I had to modify it a bit but this works: \DeclareFieldFormat{postnote}{#1} \DeclareFieldFormat{multipostnote}{#1} \renewcommand*{\bibpagespunct}{\addcolon\addspace} \renewcommand{\postnotedelim}{% \iffieldpages{postnote} {\addcolon\addspace} {\addspace}} – scot Mar 26 '16 at 14:45
  • Yes, I forgot one \space there. Do you want an answer, or do you think your question is sufficiently similar to the one I linked to in my second comment to say it is a duplicate? – moewe Mar 26 '16 at 14:47
  • No, it's not the same as the other one (you were right, it's more complex). Post it up as an answer and I will vote it up! – scot Mar 26 '16 at 14:49
6

You can combine the approach from Colon instead of “p.” in Biblatex authoryear-comp and Biblatex: No \postnotedelim for citations that aren't numerals

\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
\renewcommand*{\bibpagespunct}{\addcolon\addspace}
\renewcommand{\postnotedelim}{%
  \iffieldpages{postnote}
    {\addcolon\space}
    {\addspace}}
0

Thanks to user moewe who provided most of the answer in comments:

\usepackage[backend=biber,sorting=nyt,citestyle=authoryear-comp, bibstyle=authoryear,firstinits=true,isbn=false,doi=false,url=false,eprint=false]{biblatex}
\renewbibmacro{in:}{}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
\renewcommand*{\bibpagespunct}{\addcolon\addspace}
\renewcommand{\postnotedelim}{% 
\iffieldpages{postnote} {\addcolon\addspace} {\addspace}}

The new parts being

\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
\renewcommand*{\bibpagespunct}{\addcolon\addspace}
\renewcommand{\postnotedelim}{% 
\iffieldpages{postnote} {\addcolon\addspace} {\addspace}}

This now prints citations as desired.

-1

I used the new parts provided above and it worked well. But to get rid of the 'pp.' in the Bibliography, I added:

\DeclareFieldFormat{pages}{#1}

  • 2
    Welcome to TeX.SX! - Could you add some working code to your answer? At the moment your answeer is a low -quality answer. A few remarks would also help. Thanks, you are welcome. – Bobyandbob Oct 4 '18 at 9:38
  • There is nothing new in your answer. With sufficient reputation you will be able to write comments like this one here. – strpeter Oct 4 '18 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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