# Correct output format of page number using \cite command

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}

\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}
}

• 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. Apr 5, 2017 at 18:48
• @AndrewSwann Thanks for the tip. I have added that now. Apr 5, 2017 at 20:17
• 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. Apr 6, 2017 at 6:34

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]

• Apr 6, 2017 at 8:43

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

Check Section 3.13.3 of manual for more details.

• 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. Apr 5, 2017 at 18:59
• To make it clear, you get [1,123] and want [1:123] instead? Apr 5, 2017 at 19:02
• Yes. Also there is an extra space there I would like to get rid of. Apr 5, 2017 at 19:34

Try this code:

\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}

• 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. Apr 5, 2017 at 19:33
• Please elaborate on what this does. 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. Apr 5, 2017 at 20:04
• @Tja...: It's important that you've identified using biblatex here. That's the difference.
– Werner
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 Apr 5, 2017 at 20:19