如何使用 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}

在此輸入影像描述

相關內容