我想在参考书目和括号引用中用与号 (&) 替换“and”。
例如,我想要以下内容:
In-text citation: Smith and John (2013)
Parenthetical citation: (Smith & John, 2013)
Bibliography: Smith, A.B. & John, C.D. (2013)
我该怎么做?我已经修改了我的 bst 文件,现在甚至文内引用都有 &。
你可以使用我的 overleaf 帐户完整地查看工作示例: https://v2.overleaf.com/read/ttqcqmvtxtvz
我的自定义 .bst -->https://pastebin.com/8N3536Pj
我的 customthesisbib.bib -->
@Article{buczak2016survey,
author = {Buczak, Anna L. and Guven, Erhan},
title = {A survey of data mining and machine learning methods for cyber security intrusion detection},
journal = {Institute of Electrical and Electronics Engineers Communications Surveys and Tutorials},
year = {2016},
volume = {18},
number = {2},
pages = {1153--1176},
__markedentry = {[Hp i7:1]},
doi = {10.1109/COMST.2015.2494502},
}
我的最小工作示例 -->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Welcome to Overleaf --- just edit your LaTeX on the left,
% and we'll compile it for you on the right. If you give
% someone the link to this page, they can edit at the same
% time. See the help menu above for more info. Enjoy!
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[11pt]{article} %reminder to add twoside command when printing
\pagestyle{plain}
\usepackage[english]{babel}
\usepackage{url}
\usepackage{hyperref}
\usepackage[longnamesfirst,semicolon]{usbib}
\renewcommand{\bibname}{Reference List}
\usepackage{ragged2e}
\setlength\RaggedRightParindent{\parindent} % default value of this parameter is `0pt`
\bibliographystyle{Custom.bst}
\begin{document}
\section*{Custom}
In this section we reference the journal article with '&' \citep{buczak2016survey}, \newline \newline
now in text with 'and' \citet{buczak2016survey}, \newline
\bibliography{customthesisbib.bib}
\end{document}
答案1
@samcarter 是正确的。这是因为 overleaf 使用 latexmk -f 来生成 pdf,因此无法显示错误。我对您想要的引用样式感到困惑。由于您将选项 longnamesfirst 传递给 usbib 并最终传递给 natbib,因此任何参考文献的第一次引用(如 natbib 文档中所述)都相当于带星号的变体(完整作者列表,或示例中的“Smith and John”),后续引用则变为正常(缩写列表,或示例中的“Smith & John”)。 – Zeping Lee 50 分钟前
这条评论解决了我的问题。我自己已经正确修改了 .bst 文件,但是由于使用了 longnamefirst 选项,它不起作用。删除该选项后一切都很完美。谢谢