2

I am trying to get result like below image. enter image description here

Currently I get it by adding a line in the author field:

    Author = {{\includegraphics[scale = 0.03]{bullet3}}  Mosco Vicent}

but I want to find a way to do it automatically and adding different icons depending on the source. I know something similar can be done in beamer.

I think the best way is to create a custom bibliography style. I am using the following style:

https://drive.google.com/file/d/1ZXw4UA_d2rbcegvGrTGuMLuAdsiGE8XY/view?usp=sharing

Can someone guide me to the solution?

  • 1
    Please provide a minimal working example (MWE). –  Oct 01 '20 at 21:32
  • Hello thanks for commenting, I have only been able to obtain something similar with the line of code that is in the post. Which I add manually, I have no idea how to approach the problem. – Pascual Chavez Oct 01 '20 at 21:35

1 Answers1

1

You can do this by editing .bst bibliography style file: Find and Replace

FUNCTION {start.entry}
{ newline$
  "\bibitem{" write$
  cite$ write$
  "}" write$
  newline$
  ""
  initialize.prev.this.status
}

By

FUNCTION {start.entry}
{ newline$
  "\bibitem{" write$
  cite$ write$
  "}"  "\faBook\ " * write$
  newline$
  ""
  initialize.prev.this.status
}

and include \usepackage{fontawesome} package in your preamble and compile your file. Its output should be something like this:

enter image description here

You can change its color by \textcolor{blue}{\faBook} (here it is blue and you can use any color) after loading \usepackage{xcolor} and use it instead of \faBook in the above code. i.e.

FUNCTION {start.entry}
{ newline$
  "\bibitem{" write$
  cite$ write$
  "}"  "\textcolor{blue}{\faBook}\ " * write$
  newline$
  ""
  initialize.prev.this.status
}

here is a list of icons you can use from awesome package. (In my example it is \faBook. You can use \faNewspaperO also.). You can also use awesome5 which is newer and has more icons than awesome package.


Update: You can insert image using \includegraphics as follow: (Don't forget loading \usepackage{graphicx})

FUNCTION {start.entry}
{ newline$
  "\bibitem{" write$
  cite$ write$
  "}" "\includegraphics[width=7pt, height=10pt]{Image-root}" * write$
  newline$
  ""
  initialize.prev.this.status
}

After adding appropriate Image-root in the above its output should be something like this:

enter image description here

Or you can do it without editing .bst file. Just by adding the following in your preamble: (Inspired by Andrew Swann's answer)

 \makeatletter
 \def\@bibitem#1{\item\if@filesw \immediate\write\@auxout
    {\string\bibcite{#1}{\value{\@listctr}}}\fi\ignorespaces}
 \def\@biblabel#1{[#1] \includegraphics[width=7pt, height=10pt]{image-root}}
 \makeatother

enter image description here

  • My answer prints a logo for all bib items and all logos are same as each other. I think it is possible to change the above code such that for papers the logo is paper icon and for books the logo is book icon. –  Oct 01 '20 at 23:05
  • hi thanks for the answer, can I use \includegraphics to add my custom icon? – Pascual Chavez Oct 01 '20 at 23:25
  • That is why I am asking for a MWE. I don't know if you are using biblatex or not? if yes see this post. –  Oct 02 '20 at 07:39
  • Hello sorry for not being of much help, I understand that I use bibtex. I already managed to get it working by editing the .bst file. One question can I add an option for each type of information source? – Pascual Chavez Oct 02 '20 at 21:01