I want to be able to display a bibliography entry but I want to highlight some part of it, specifically some author, but not all. So far I am able to create the bib entry in the middle of the text, and I am also able to do a find and replace of text (copied from here). However, when I try to do the find and replace the text of the bib entry it does not work.

Here is my example bib tex file:


  author    = {Radu Bogdan Rusu and Steve Cousins},
  title     = {{3D is here: Point Cloud Library (PCL)}},
  booktitle = {{IEEE International Conference on Robotics and Automation (ICRA)}},
  month     = {May 9-13},
  year      = {2011},
  address   = {Shanghai, China}
  title={Open Source Computer Vision Library},
  howpublished = {\url{https://github.com/itseez/opencv}}
  title = {The OpenCV Reference Manual},
  organization = {Itseez},
  edition = {},
  month = {April},
  year = {2014},
  notes = {See \url{http://opencv.org/}}



% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
    \begin{NoHyper}% In my real project I need the bibentry package to work with hyperref package.
    First time: \auxbibliography \\
    Second time: \auxbibliography


\newcommand{\afgfgft}{Rusu, R. B. and Cousins, S.}
\afgfgft \\
\searchreplace{\afgfgft}{Rusu, R. B.}{\textbf{Rusu, R. B.}}

Here are some citations for articles: \cite{pcl} and \cite{opencv} and \bibelement{opencv_manual} and the one which I want to highlight:
    \item \bibelementhighlight{pcl}{Rusu}



When I compile this code I get the following (note that there is also added drawing and text explaining what I want to get): enter image description here

where everything works fine except for the substitution of Rusu the second time the bibelement is displayed. After messing arround I think that this might be because \bibitem is expanded after the string replace. Can somebody give me a hint on how to solve it?

  • I cannot get your MWE to compile. It says there is a runaway argument. – Steven B. Segletes Apr 12 '18 at 10:49
  • 1
    I can compile this exact same code with [sharelatex](www.sharelatex.com) and in my computer using Ubungu 14.04 by doing pdflatex+bibtex+pdflatex. I do not know what your error is... – apalomer Apr 12 '18 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.