
目前我透過在作者字段中添加一行來獲取它:
Author = {{\includegraphics[scale = 0.03]{bullet3}} Mosco Vicent}
但我想找到一種方法來自動執行此操作並根據來源添加不同的圖標。我知道可以在投影機中完成類似的事情。
我認為最好的方法是建立自訂參考書目風格。我正在使用以下樣式:
https://drive.google.com/file/d/1ZXw4UA_d2rbcegvGrTGuMLuAdsiGE8XY/view?usp=sharing
有人可以指導我解決方案嗎?
答案1
您可以透過編輯.bst
參考書目樣式文件來做到這一點:尋找和替換
FUNCTION {start.entry}
{ newline$
"\bibitem{" write$
cite$ write$
"}" write$
newline$
""
initialize.prev.this.status
}
經過
FUNCTION {start.entry}
{ newline$
"\bibitem{" write$
cite$ write$
"}" "\faBook\ " * write$
newline$
""
initialize.prev.this.status
}
並將\usepackage{fontawesome}
包包含在您的序言中並編譯您的文件。它的輸出應該是這樣的:
您可以在加載後更改其顏色\textcolor{blue}{\faBook}
(此處為藍色,您可以使用任何顏色)\usepackage{xcolor}
並使用它,而不是\faBook
在上面的程式碼中使用它。 IE
FUNCTION {start.entry}
{ newline$
"\bibitem{" write$
cite$ write$
"}" "\textcolor{blue}{\faBook}\ " * write$
newline$
""
initialize.prev.this.status
}
這是圖示列表您可以從awesome
包中使用。 (在我的範例中是\faBook
。您\faNewspaperO
也可以使用。)。您也可以使用awesome5
它比包更新並且有更多的圖標awesome
。
更新:
您可以使用以下方式插入圖像\includegraphics
:(不要忘記載入\usepackage{graphicx}
)
FUNCTION {start.entry}
{ newline$
"\bibitem{" write$
cite$ write$
"}" "\includegraphics[width=7pt, height=10pt]{Image-root}" * write$
newline$
""
initialize.prev.this.status
}
Image-root
在上面添加適當的內容後,其輸出應該是這樣的:
或者您可以在不編輯.bst
文件的情況下完成此操作。只需在序言中添加以下內容:(靈感來自安德魯·斯旺的回答)
\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