Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am writing a proposal with lots of bibliographic references. What I would like is to cite my own papers in bold, others in plain style like so [2,11-13,14,15]. Is there any way to do this? At the moment, I have to do it like this [2,11-13,15][14], but that is ugly. A related question was answered before (Bold citation number), but makes all citations bold, which I do not want.

I am using \bibitem's at the end of the document.

\documentclass{article}
\usepackage{cite}
\begin{document}

Some text where I cite papers of which I have written one~\cite{refA, refB, refC, 
refD}\textbf{\cite{myPaper}}; I have to cite them in this awkward form. 

Instead I would like the citation to appear like [1-3,{\textbf 4},5]. No way to do 
that with the \texttt{$\backslash$cite} command?

\begin{thebibliography}{}
\bibitem{refA}
RefA
\bibitem{refB}
RefB
\bibitem{refC}
RefC
\bibitem{myPaper}
My Paper; I have written this one.
\bibitem{refD}
RefD
\end{thebibliography}

\end{document}

LaTeX output

share|improve this question
    
Any chance you can provide a minimum working example? Maybe a screenshot? What software are you using to view the output, does this appear in print too or only in the viewer? (Some render funny) –  DetlevCM Nov 14 '13 at 18:57
    
Done, thanks for your interest. –  Günther Nov 14 '13 at 19:43
1  
It is not too hard to do in biblatex. Is biblatex an option for you? –  Guido Nov 14 '13 at 20:13
    
Have not worked with biblatex so far, but I am willing to learn. The reason though, why I chose the \bibitem environment (so far), is because it allows me to freely format the bibliography. I need to do that, because I want to put my and my coworkers' author names in bold letters, just as I want to do that with the citations. And there is no easy way to do just that in BiBTeX, except this solution: tex.stackexchange.com/questions/33330/…. –  Günther Nov 14 '13 at 20:24
1  
When I originally looked at your post I thought some were bold and you didn't want it bold - but you do and they are not. I.e. I misunderstood your question before - thanks for the example. I would think that one could possibly redefine the citation command - could be messy but basically insert another attribute in the bibitem and then highlight a reference if that is present - I'd really have to start digging about for that though (I'm sure it would be trivial for those versed in TeX). –  DetlevCM Nov 15 '13 at 9:18

2 Answers 2

Here a partial solution to the problem, which is too long and too formated to fit as a comment. Partial because it has the following drawbacks and undesired output formatting:

  • \bibitem should be replaced by \mybibitem for the citations number to be set in bold. (This is a drawback since probable the programm latex-bibitemstyler mentioned by Günter in the comments will no longer work. However, it is likely that this replacement can be made with sed)
  • Bold reference numbers come first
  • Bold reference numbers are not sorted
  • Bold reference numbers are not compressed

You latter three effects can be seen in the following image.

This having said. Here my definition for \mybibitem:

\newcommand{\mybibitem}[1]{\stepcounter{enumiv} \bibitem[\textbf{\arabic{enumiv}}]{#1}}

And for the sake of completeness the whole code to generate the above example:

\documentclass{article}
\usepackage{cite}

\newcommand{\mybibitem}[1]{\stepcounter{enumiv} \bibitem[\textbf{\arabic{enumiv}}]{#1}}      

\begin{document}

Bold reference numbers come first: \cite{refA, refB, refI, refD} 

Bold papers are not compressed: \cite{refD, refE, refF}

Bold reference numbers are not sorted: \cite{refF, refD, refE}

Combination of mentioned effects: \cite{refA, refF, refH, refD, refE,  refB, refC, refG, refI}

\begin{thebibliography}{}
\bibitem{refA} RefA
\bibitem{refB} RefB
\bibitem{refC} RefC
\mybibitem{refD} RefD
\mybibitem{refE} RefE
\mybibitem{refF} RefF
\bibitem{refG} RefG
\bibitem{refH} RefH
\bibitem{refI} RefI
\end{thebibliography}

\end{document}
share|improve this answer
    
Wow, thanks a million for the effort. How elegant the \newcommand looks! But yes, limitations are there. The first one (the incompatibility with latex-bibitemstyler can easily be overcome by formating my papers as \bibitem{mypaperRefA}, let bibitemstyler sort, and then make a batch replacement of \bibitem{mypaper with \mybibitem{. Easy! –  Günther Nov 15 '13 at 13:42

Another solution to the problem can be achieved with user-defined scripts in the recently-developed Bibulous bibliography processor for TeX/LaTeX. For this, we can define the function that generates the citation label, and make sure that it appears bold any time that the reference includes, say, "de Broglie" as an author. Thus, with the following files

main.bib

@Article{refA,
  title = {Can quantum-mechanical description of physical reality be considered complete?},
  author = {A. Einstein and B. Podolsky and N. Rosen},
  journal = {Phys.\ Rev.},
  volume = {47},
  year = {1935},
  pages = {777--780}
}

@Book{refB,
  title = {Probability Theory: The Logic of Science},
  year = {2003},
  author = {E. T. Jaynes},
  publisher = {Cambridge University Press}
}

@Incollection{refC,
  title = {On the present status of the radiation problem},
  author = {Albert Einstein},
  booktitle = {The Collected Papers of Albert Einstein},
  publisher = {Princeton University Press},
  year = {1989},
  pages = {357--375},
  volume = {2}
}

@Mastersthesis{refD,
  title = {Optical aberration coefficients},
  author = {Matthew Peter Rimmer},
  school = {University of Rochester},
  year = {1963}
}

@Phdthesis{refBOLD,
  title = {On the theory of quanta},
  author = {Louis-Victor de Broglie},
  school = {University of Paris},
  year = {1925}
}

main.bst

TEMPLATES:
article = <au>, \enquote{<title>,} \textit{<journal>} \textbf{<volume>},{ }...
          [<startpage>--<endpage>|<startpage>|<eid>|] (<year>).
book = <au>, \textit{<title>} (<publisher>, <year>).
incollection = <au>, \enquote{<title>,} in \textit{<booktitle>}, [Chap.~<chapter>, ]...
        [pp.~<startpage>--<endpage>|p.~<startpage>|<eid>|] (<publisher>, <year>).
mastersthesis = <au>, \enquote{<title>,} M.S. dissertation (<school>, <year>).
phdthesis = <au>, \enquote{<title>,} Ph.D. dissertation (<school>, <year>).

SPECIAL-TEMPLATES:
authorlist = <author.to_namelist()>
editorlist = <editor.to_namelist()>
au = <authorlist.format_authorlist()>
ed = <editorlist.format_editorlist()>

OPTIONS:
allow_scripts = True         ## whether to allow user scripts in BST files

VARIABLES:
citelabel = create_citelabel(entry, options)

DEFINITIONS:
def create_citelabel(entry, options):
    numnames = len(entry['authorlist'])
    if (numnames == 0): return(entry['citenum'])
    foundit = False
    for name in entry['authorlist']:
        if (name['last'] == 'Broglie') and (name['prefix'] == 'de'):
            foundit = True
            break
    if foundit:
        return(r'\textbf{' + entry['citenum'] + '}')
    else:
        return(entry['citenum'])

main.tex

\documentclass{article}
\usepackage{cite}
\begin{document}

Some text where I cite papers, where I want to highlight all publications 
by de Broglie~\cite{refA, refB, refC, refBOLD, refD}. It would be nice for 
the citations to to appear sorted like [1-3,{\textbf 4},5].

\bibliography{main}
\bibliographystyle{main}
\end{document}

we can get the formatted result:

Formatted reference list

This result has the same problems mentioned by @crixtox: the bold number is not properly sorted or compressed. Doing these operations would require changes to the cite package to accommodate the formatting. On the other hand, compressing the bold citation would also remove one feature that the OP is looking for: highlighting certain references. And having a bold reference always appear first in the list is certainly another to highlight it, although it may contradict the requirements of many publishers.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.