3

IEEE wants each of a reference in separate brackets (like this: [1],[3]-[5]). How can I achieve this style with memoir class?

I used cite and natbib packages but I get [1,3-5] instead of [1],[3]-[5]....

Ex:

\documentclass[a4paper,12pt,reqno,oneside,openbib]{memoir}
\usepackage[square,numbers,sort&compress]{natbib}
\begin{document}
as in \cite{ref1,ref3,ref4,ref5}
\end{document}

and I get:

as in [1,3-5]

instead of:

as in [1],[3]-[5]

3
  • Welcome to TeX - LaTeX! Please provide a minimal working example (MWE) showing what you have so far. Nov 25, 2016 at 14:40
  • If this is for IEEE, shouldn't you be using one of their document classes? Nov 25, 2016 at 15:35
  • 1
    It's not for IEEE, but I need IEEE citation style. In fact it's a thesis.
    – eepgmja
    Nov 25, 2016 at 15:43

1 Answer 1

1

Here is one approach, using \citenumfont to set brackets around each number and using \setcitestyle to kill the outermost brackets that would otherwise be placed around the whole group.

Sample output

\documentclass[a4paper,12pt,reqno,oneside,openbib]{memoir}

\usepackage[square,numbers,sort&compress]{natbib}

\setcitestyle{open={},close={}}
\def\citenumfont#1{[#1]}

\begin{document}

As in
\cite{article-minimal,incollection-minimal,manual-full,booklet-full}.

\nocite{booklet-minimal}

\bibliographystyle{plainnat}
\bibliography{xampl}

\end{document}
1
  • This worked well until I needed \citep[p.~18]{article-minimal}, i.e., a page/comment. In this case, this yields "[1], p. 18" instead of "[1, p.18]" :( One could use \setcitestyle{open={},close={]},citesep={],},notesep={,~}} and \def\citenumfont#1{[#1} instead, but then again this doesn't work when citing multiple sources with compression turned on. It becomes "[3-[5]" instead of "[3]-[5]". It is not possible to change the compression character "--" to "{]}--" to hot-fix this since it is hardcoded in natbib.dtx like this: \def@NAT@last@yr{--\NAT@penalty}% Jul 6, 2023 at 14:04

You must log in to answer this question.

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