5

I do not like the way the commands \cite or \parencite produce page numbers. If I give a command \cite[43]{XXX2015}, it produces:

XXX2015, p.43.

What I would like is:

XXX2015:43.

I understand that the command \citet is supposed to give me this, and I also understand from searching around that I should load the natbib package to get that. However, there is some compatibility issue related to what I already have in my preamble. I guess it must be the biblatex package or backend package (if that is indeed a package). If I just load the natbib package I get the error message:

command \bighang already defined.

Can I continue to use the backend package with this setting and just add something? Here is a MWWW:

\documentclass[12]{article}

\usepackage[english]{babel}
\usepackage[backend=biber, style=authoryear-comp, sortcites=false, maxcitenames=2, mincitenames=1, maxbibnames=4, uniquelist=false]{biblatex}

\addbibresource{ref.bib}

\begin{document}

Blablabla. \cite[43]{Wolfe2015} 

\end{document}
  • biblatex has a natbib option to emulate these natbib commands. See p. 6 of the documentation of biblatex. – Bernard Jul 5 '18 at 14:15
  • I have read page 6, none the wiser. In any case, I am using Biber with Biblatex as an extension, if I am not mistaken. So it don't manage to emulate natbib with this particular setting.. – EspenJK Jul 5 '18 at 14:33
  • In the one of the sections linked to,it's explained, if I remember well , that \citet and citep commands are defined to emulate the corresponding commands of natbib. I can't say more, not using natbib personally. – Bernard Jul 5 '18 at 14:40
8

natbib and biblatex are indeed incompatible. biblatex is incompatible with most bibliography management packages, since it implements citations and bibliography in a way that is fundamentally different from the traditional BibTeX way of doing things. Normally that is not too bad, since biblatex can do many things out of the box so that the extra packages are not needed.

Fortunately natbib is irrelevant to your issue. biblatex can do what you want without additional packages (and without the natbib compatibility mode, that I would avoid if it is not necessary, see also Is there a disadvantage to using natbib=true with biblatex?).

You only need to redefine the postnote formats to stop printing the page prefix. Then we change the punctuation between citation and postnote to a colon.

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=authoryear-comp, sortcites=false, maxcitenames=2, mincitenames=1, maxbibnames=4, uniquelist=false]{biblatex}


\addbibresource{biblatex-examples.bib}

\DeclareFieldFormat{postnote}{\mknormrange{#1}}
\DeclareFieldFormat{volcitepages}{\mknormrange{#1}}
\DeclareFieldFormat{multipostnote}{\mknormrange{#1}}

\renewcommand*{\postnotedelim}{\addcolon}

\begin{document}
\autocite[380]{sigfridsson}
\printbibliography
\end{document}

gives

enter image description here

Incidentally, \citet would normally give citations of the form

Sigfridsson and Ryde (1998)

the biblatex equivalent to \citet is \textcite (just like the equivalent to \citep is \parencite). The natbib compatibility mode allows you to write \citet to get \textcite with biblatex, but it also changes the behaviour of the starred versions and changes some punctuation (Is there a disadvantage to using natbib=true with biblatex?).

  • Typically you wouldn't have a space after the colon. – Alan Munn Jul 5 '18 at 14:45
  • 1
    Oh probably. Vive la ponctuation libre! – Alan Munn Jul 5 '18 at 14:52
  • 1
    @EspenJK In that case you are using an older version of biblatex. Add \providecommand*{\mknormrange}[1]{#1} to your preamble or update to biblatex 3.11. – moewe Jul 5 '18 at 15:03
  • 2
    @EspenJK It is a wise decision not to rush into updating packages shortly before a deadline. I would rather not add the work-around for older biblatex to the answer, though, because usually I like to encourage people to use the current code. – moewe Jul 5 '18 at 15:19
  • 1
    @EspenJK What line specifically? As you can see from the screenshot the MWE does not have a comma there. The standard separator between author and year is a space, if you use the natbib compatibility mode natbib=true that changes to a comma and space (see also tex.stackexchange.com/q/149313/35864). If you don't need \citep and are OK with \parencite just remove the natbib=true. If you must have natbib=true you will want \DeclareDelimFormat{nameyeardelim}{\addspace} or in older versions \renewcommand*{\nameyeardelim}{\addspace}. – moewe Jul 8 '18 at 11:50

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.