3

I am using biblatex, style=ieee, to create my bibliography.

In text I want the following cite with page number to look like this [1:123], but all online resources seem to insist that I should use \cite[p.~123]{keyword} giving the output [1, p. 123]. How do I get the format I want?

Edit

To make clear what my code looks like

\documentclass[12pt,titlepage,a4paper,draft]{article}
\usepackage[utf8]{inputenc}

\usepackage[style=ieee]{biblatex}
\addbibresource{References.bib}

\begin{document}

\section{Introduction}
This is a very nice introduction \cite[123]{Ref1}

\printbibliography

\end{document}

And my .bib file looks like this

@book{Ref1,
address = {North pole},
author = {Ann Author},
edition = {1},
publisher = {Name},
title = {{This is a very nice title}},
year = {2017}
}
3
  • 1
    Welcome to TeX - LaTeX! Usually it is best to provide a minimal document demonstrating your set-up. In this case, you should be precise about how you load the biblatex package. Commented Apr 5, 2017 at 18:48
  • @AndrewSwann Thanks for the tip. I have added that now.
    – Tja...
    Commented Apr 5, 2017 at 20:17
  • 2
    Note that for biblatex the online resources you consulted have it wrong. You should normally use \cite[123]{sigfridsson} (i.e. no manual p.~) and then use biblatex options to control whether you automatically want to add 'p.' or not.
    – moewe
    Commented Apr 6, 2017 at 6:34

3 Answers 3

5

With

\renewcommand*{\postnotedelim}{\addcolon}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}

we tell biblatex to use a colon between citation label and postnote, and to drop the 'p.' in postnotes.

So \cite[123]{sigfridsson} results in

[1:123]

1
1

Use the \nopp option. E.g. \cite[\nopp 123]{key}

Check Section 3.13.3 of manual for more details.

3
  • This doesn't do quite what I was hoping for. \nopp only suppresses the p. in [1, p. 123]. I wanted [1:123]. I realise though that this may be more complicated than a simple option.
    – Tja...
    Commented Apr 5, 2017 at 18:59
  • To make it clear, you get [1,123] and want [1:123] instead?
    – luchonacho
    Commented Apr 5, 2017 at 19:02
  • Yes. Also there is an extra space there I would like to get rid of.
    – Tja...
    Commented Apr 5, 2017 at 19:34
0

Try this code:

enter image description here

\documentclass{article}
\makeatletter
\def\@cite#1#2{[{#1\if@tempswa:#2\fi}]}
\makeatother
\begin{document}
\cite[123]{xxx}
\begin{thebibliography}{1}
\bibitem{xxx} xxx
\end{thebibliography}
\end{document}
5
  • I am creating the bibliography using the \printbibliography command and a .bib file. However, I used line 1-6 and it had no visible effect.
    – Tja...
    Commented Apr 5, 2017 at 19:33
  • 1
    Please elaborate on what this does.
    – TeXnician
    Commented Apr 5, 2017 at 19:40
  • @Werner When I copy the entire code into a separate Latex file it works really well. However, when attempting to use only lines 1-6 along with \usepackage[style=ieee]{biblatex} nothing happens.
    – Tja...
    Commented Apr 5, 2017 at 20:04
  • 1
    @Tja...: It's important that you've identified using biblatex here. That's the difference.
    – Werner
    Commented Apr 5, 2017 at 20:11
  • @Werner Yeah I realised it was probably something like that. I should have been more precise when I asked the question
    – Tja...
    Commented Apr 5, 2017 at 20:19

You must log in to answer this question.

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