1

Using the answer provided in How to change the shape of reference numbers in the bibliography, I have a document where the reference numbers in the bibliography are shown as boldface.

Now at the same time that this number is shown in boldface in the bibliography I would like that when citing that reference in the body of the text, the reference number appears as italic, i.e. \cite{one} writes the number of the reference as italic (and not the [ ]'s), like [1].

    \documentclass{article}
    \makeatletter
    \def\@biblabel#1{[\textbf{#1}]}
    \makeatother
    \begin{document}

    See the reference \cite{one}.

    \begin{thebibliography}{MM}
    \bibitem{one}

\end{thebibliography}
\end{document}
Name
  • 2,816

1 Answers1

3

I don't know whether this is a good idea. Why having two diffrent formats for one same object? On the other hand, having the number in italics but the brackets in normal round font looks unpleasing.

In any case, here's how you can do it: simply redefine \@cite (I also used italics for eventual anotations, but if that is not required, replace

\def\@cite#1#2{[\textit{#1\if@tempswa , #2\else\kern.15em\fi}]}

with

\def\@cite#1#2{[\textit{#1\if@tempswa} , #2\fi]}

The \kern comes from an attempt to get italic correction (see discussion in comments).

The complete code:

\documentclass{article}

\makeatletter
\def\@biblabel#1{[\textbf{#1}]}
\def\@cite#1#2{[\textit{#1\if@tempswa , #2\else\kern.15em\fi}]}
\makeatother

\begin{document}

See the reference~\cite{one}.

\begin{thebibliography}{MM}
\bibitem{one}
\end{thebibliography}

\end{document}

The result:

enter image description here

Gonzalo Medina
  • 505,128
  • Ooh, that looks strange. Maybe the brackets should be italic too? Alltough, not touching any of this seems to be the best idea :-) – Johannes_B Jun 27 '15 at 13:49
  • @Johannes_B I know, but the OP explicitly mentioned number=italics, brackets=normalfont. – Gonzalo Medina Jun 27 '15 at 13:51
  • Oh, you are right. But i can hardly look at the output. – Johannes_B Jun 27 '15 at 13:52
  • 1
    \itshape doesn't automatically add the italic correction at the end; you have to do that. so:\def@cite#1#2{[{\itshape#1\if@tempswa , #2\fi}/]}` should work, but it doesn't. will report a problem to latex-bugs. – barbara beeton Jun 27 '15 at 14:33
  • @barbarabeeton You're right. Do you think that \def\@cite#1#2{[\textit{#1\if@tempswa , #2\else\,\fi}]} would be a better redefinition? – Gonzalo Medina Jun 27 '15 at 14:51
  • @GonzaloMedina -- well, it would behave uniformly. certainly something is needed to space that out nicely. try out the \, and also an ordinary [{\itshape 1\/}] to see if the spacing is close to the same; maybe a small \kern .Nem would be closer; don't know without trying. and try a couple different numerals (although they're all the same width in cm, so the extra tests are only for confirmation). – barbara beeton Jun 27 '15 at 14:57
  • @barbarabeeton After some tests, I added a kerning that seems reasonable. What do you think of it now? – Gonzalo Medina Jun 27 '15 at 15:04
  • @GonzaloMedina -- a lot nicer (after i clicked to see the edit). – barbara beeton Jun 27 '15 at 16:38