如何在文章類別中使用 \nocite{*} 指令而不在文字正文中出現問號?

如何在文章類別中使用 \nocite{*} 指令而不在文字正文中出現問號?

\nocite{*}我在使用該命令避免在文本正文中引用時遇到一些麻煩。我已經編譯了很多次,但它一直在\nocite{*}的位置顯示問號。無論我使用什麼參考書目風格,它仍然顯示問號。此外,我嘗試過使用該listbib軟體包,但也沒有得到很好的結果。

請不要將此問題標記為已提出,因為與此相關的唯一問題涉及其他問題

這是(希望如此)MWE:

\documentclass[12pt ,a4paper]{article}

\usepackage[brazil]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ae}
\usepackage{harvard}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{parskip}
\usepackage{indentfirst}
\usepackage{hyperref}
\usepackage{amssymb,fancyhdr,fancybox,epsfig,psfrag,amsmath,tabularx}
\usepackage[paperwidth=8.5in,paperheight=11in,hmargin={25mm,20mm},vmargin={20mm,20mm}]{geometry} %tamanho letter
\usepackage{fancyhdr}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@book{key,
author = {Author, A.},
year = {2001},
title = {Title},
publisher = {Publisher},
}
\end{filecontents}

\begin{document}
Hello world
\nocite{key} 
\thispagestyle{empty}
\newpage
\bibliographystyle{abbrv}
\bibliography{\jobname} % or \addbibressource{/jobname.bib}
\end{document}

答案1

MWE可以簡化為以下程式碼:

\documentclass{article}

\usepackage{harvard}
\usepackage{filecontents}
\bibliographystyle{abbrv}

\begin{filecontents}{\jobname.bib}
@book{key,
author = {Author, A.},
year = {2001},
title = {Title},
publisher = {Publisher},
}
\end{filecontents}

\begin{document}
Hello world \nocite{key} 
\bibliography{\jobname}
\end{document}

仍然存在這個問題。我沒有查看harvard包代碼的詳細信息,但它似乎沒有\nocite與 LaTeX 內建支援或其他包一致地處理巨集。

作為解決方法,可以將文件遷移到,同時仍使用透過替換natbib提供的所有引用命令harvard

\usepackage{harvard}

\usepackage{natbib}
\usepackage{har2nat}

如中所述har2nat 包文件

這是完整修改後的 MWE:

\documentclass{article}

\usepackage{natbib}
\usepackage{har2nat}
\usepackage{filecontents}
\bibliographystyle{abbrv}

\begin{filecontents}{\jobname.bib}
@book{key,
author = {Author, A.},
year = {2001},
title = {Title},
publisher = {Publisher},
}
\end{filecontents}

\begin{document}
Hello world \nocite{key} 
\bibliography{\jobname}
\end{document}

以及結果輸出(沒有問號!:-):

在此輸入影像描述

相關內容