# How to change the shape of reference numbers in both bibliography (as boldface) and citations (as italic)

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}

• Are you really doing the bibliography by hand? – Johannes_B Jun 27 '15 at 13:37
• @Johannes_B if do not use bibtex. – Name Jun 27 '15 at 13:40

## 1 Answer

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:

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