如何使用 natbib 引用标题?

如何使用 natbib 引用标题?

我到处寻找解决方案,但还没有找到一个有效的解决方案。最突出的解决方案如下: \citetitle 和 \citeeditor 使用 natbib 和 hyperref 包https://stackoverflow.com/questions/2496599/how-do-i-cite-the-title-of-an-article-in-latex

我的相关设置是:

\documentclass[a4paper,11pt,oldfontcommands]{memoir}
\usepackage[colorlinks=true]{hyperref}
\usepackage{natbib}
%\bibliographystyle{agsm}
\bibliographystyle{myabbrvnat}
\newcommand{\myand}{\&\ }
\setcitestyle{authoryear,aysep={},open={(},close={)}}
\begin{document}
In the book (Book Name) such and such is told to be true \citep{RefWorks:}.
\bibliography{cource}
\end{document}

我的 source.bib 文件如下所示:

@book{RefWorks:1
     author={John Johnson},
     year={2015},
     title={Book Name},
     publisher={Publishing Company},
     address={United States of America},
     edition={1st},
     isbn={XXX-X-XXXX-XXXX-X}
}

我找到的一些建议不起作用的原因可能是\bibliographystyle{myabbrvnat}。我不记得在哪里找到的,但它是按照我需要的方式设置我的参考书目。这重要吗?如果需要发布,我可以在哪里发布文本,因为它超出了这里的字符限制?

我知道有一种“类似”的解决方案,我可以创建一个引用别名\defcitealias{RefWorks:1}{Book Name},然后将其插入文本中,\citetalias{RefWorks:1}以提供来源的标题。这很好,但这不是我想要的,因为那样我就需要为我的整个图书馆设置它,这会很累。

有没有办法设置一个\cite+-type 来给出来源的标题?

编辑:我忘记在我的设置中放入 hyperref 包。

答案1

我修改abbrvnat.bst为问题\myand{}而不是and(更改出现的位置" and ")。然后准备此输入文件:

\begin{filecontents*}{\jobname.bib}
@book{RefWorks:1,
     author={John Johnson},
     year={2015},
     title={Book Name},
     publisher={Publishing Company},
     address={United States of America},
     edition={1st},
     isbn={XXX-X-XXXX-XXXX-X}
}
@book{RefWorks:2,
     author={John Johnson and Jack Jackson},
     year={2015},
     title={Book Name},
     publisher={Publishing Company},
     address={United States of America},
     edition={1st},
     isbn={XXX-X-XXXX-XXXX-X}
}
\end{filecontents*}

\documentclass[a4paper,11pt,oldfontcommands,article]{memoir}

\usepackage{natbib}
\usepackage{usebib}
\bibliographystyle{myabbrvnat}
\setcitestyle{authoryear,aysep={},open={(},close={)}}
\bibinput{\jobname} % <--- the same argument as in \bibliography
\newcommand{\myand}{\&}

\begin{document}

In the book ``\usebibentry{RefWorks:1}{title}'' by 
\citeauthor{RefWorks:1}, such and such is told 
to be true \citep{RefWorks:1}.

In the book ``\usebibentry{RefWorks:2}{title}'' by 
\citeauthor{RefWorks:2}, such and such is told 
to be true \citep{RefWorks:2}.

\bibliography{\jobname}

\end{document}

这是输出

在此处输入图片描述

请注意,这filecontents只是为了方便,您可以使用自己的文件。请记住该字段.bib的限制usebib必须用括号括起来,而不是用"

另一方面,可以强制biblatex产生所需的输出:

\begin{filecontents*}{\jobname.bib}
@book{RefWorks:1,
     author={John Johnson},
     year={2015},
     title={Book Name},
     publisher={Publishing Company},
     address={United States of America},
     edition={1st},
     isbn={XXX-X-XXXX-XXXX-X}
}
@book{RefWorks:2,
     author={John Johnson and Jack Jackson},
     year={2015},
     title={Book Name},
     publisher={Publishing Company},
     address={United States of America},
     edition={1st},
     isbn={XXX-X-XXXX-XXXX-X}
}
\end{filecontents*}

\documentclass[a4paper,11pt,oldfontcommands,article]{memoir}

\usepackage[style=authoryear,firstinits,uniquename=init]{biblatex}
\addbibresource{\jobname.bib}
\AtBeginBibliography{%
  \DeclareNameAlias{author}{first-last}%
}
\renewcommand{\finalnamedelim}{%
  \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
  \addspace\&\space
}

\begin{document}

In the book ``\citetitle{RefWorks:1}'' by 
\citeauthor{RefWorks:1}, such and such is told 
to be true \parencite{RefWorks:1}.

In the book ``\citetitle{RefWorks:2}'' by 
\citeauthor{RefWorks:2}, such and such is told 
to be true \parencite{RefWorks:2}.

\printbibliography

\end{document}

在此处输入图片描述

相关内容