问题描述

问题描述

问题描述

这个问题源自@egreg 在在 apalike2 参考书目样式中将 natbib 包和引文中的“&”替换为“and”他提到apalike2书目格式现在已经过时了。所以我有兴趣采用apalike2书目格式以及natbib在软件包但这次使用 biblatex备注:换句话说,我希望在 biblatex 中使用教授@egreg 建议的这种书目风格。以下是 MWE,这是 @egreg 针对我在在 apalike2 参考书目样式中将 natbib 包和引文中的“&”替换为“and”

\begin{filecontents*}{\jobname.bib}
@book{hapa:graphenum,
    author =     {F. Harary and E. M. Palmer},
    title =      {Graphical Enumeration},
    publisher =      {Academic Press},
    pages={465--523},
    year =   1973
}
@book{Knuth94:TheTeXbook,
    author =     {Knuth, Donald Ervin},
    title =      {The \TeX book},
    publisher =      {Addison-Wesley Publishing Company},
    pages={465--523},
    year =   1994,
    series =     {Computers \& Typesetting A},
    address =    {Reading, MA},
    titlenote  =        {with illustrations by Duane Bibby}
}
@book{datta2017latex,
    title={LaTeX in 24 Hours: A Practical Guide for Scientific Writing},
    author={Datta, Dilip},
    pages={465--523},
    year={2017},
    publisher={Springer}
}
\end{filecontents*}

\documentclass[12pt,openany]{book}

\usepackage{natbib}

\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    citecolor=red,      
    urlcolor=yellow,
}

\begin{document} 
    
I want this citation \cite{hapa:graphenum} to be 
\textcolor{red}{Harary and Palmer }\textcolor{black}{(\textcolor{red}{1973})}. 
I want this citation \cite{Knuth94:TheTeXbook} to be 
\textcolor{red}{Knuth }\textcolor{black}{(\textcolor{red}{1994})}.
This text is quoted from \citep{datta2017latex} should be 
(\textcolor{red}{Datta\textcolor{black}{,} 2017}).

\nocite{*}

\bibliographystyle{apalike2-and}
\bibliography{\jobname}
    
\end{document}

其中apalike2-and参考书目只是apalike2在以下行号处修改的样式:

 297                 { " et~al." * }
    298                 { " \& " * t * }    % changed from " and " for names -- BJR 10/5/89
    299               if$

    329                 { " et~al." * }
    330                 { " \& " * t * }    % changed from " and " for names -- BJR 10/5/89
    331               if$

   1018             { " et~al." * }
   1019             { " \& " * s #2 "{vv~}{ll}" format.name$ * } % " and " --  BJR 10/5/89
   1020           if$

到目前为止我尝试过

根据@Ulrike Fischer 的评论,我修改了代码,但出现了以下问题(由于使用biblatex):

  1. 引文没有超链接,这是我不喜欢的,而且
  2. 使用生成的参考书目biblatex与使用生成的参考书目不同natbibapalike2 我附加了显示我的问题的图片(使用的结果biblatex):
    问题 1问题 2
    以及我期望得到什么(从natbib旁边apalike2):
    所需输出 1期望输出 2 以下是我的 MWE:
\begin{filecontents*}{references.bib}
@book{hapa:graphenum,
    author =     {F. Harary and E. M. Palmer},
    title =      {Graphical Enumeration},
    publisher =      {Academic Press},
    pages={465--523},
    year =   1973
}
@book{Knuth94:TheTeXbook,
    author =     {Knuth, Donald Ervin},
    title =      {The \TeX book},
    publisher =      {Addison-Wesley Publishing Company},
    pages={465--523},
    year =   1994,
    series =     {Computers \& Typesetting A},
    address =    {Reading, MA},
    titlenote  =        {with illustrations by Duane Bibby}
}
@book{datta2017latex,
    title={LaTeX in 24 Hours: A Practical Guide for Scientific Writing},
    author={Datta, Dilip},
    pages={465--523},
    year={2017},
    publisher={Springer}
}
\end{filecontents*}



\documentclass[12pt,openany]{book}
\usepackage[ 
left=2.5cm,
right=2.5cm, 
top=3cm,
bottom=3cm,
headheight = 3\baselineskip,
headsep = 5mm,
a4paper
]{geometry}
\usepackage[table]{xcolor}
\usepackage{graphicx}
\newcommand\HRule{\noindent\rule{\linewidth}{1.5pt}}
\usepackage{background}
\backgroundsetup{contents={}}
\usepackage{fancyhdr}
\usepackage{hhline}
\pagestyle{fancy}   

\usepackage{etoolbox}
\usepackage{csquotes}

\usepackage[backend=biber, style=apa]{biblatex}

\addbibresource{references.bib}

\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    citecolor=red,      
    urlcolor=yellow,
}
\usepackage{showframe}
\begin{document} 
    
    \chapter*{Acknowledgements}
    I want this citation \textcite{hapa:graphenum} to be \textcolor{red}{Harary and Palmer }\textcolor{black}{(\textcolor{red}{1973})}. I want this citation \textcite{Knuth94:TheTeXbook} to be \textcolor{red}{Knuth }\textcolor{black}{(\textcolor{red}{1994})}.This text is quoted from \parencite{datta2017latex} should be (\textcolor{red}{Datta\textcolor{black}{,} 2017}).
    \mainmatter
    \setcounter{tocdepth}{1}
    
    \chapter{Introduction}
    
    \backmatter
    
    \nocite{*}
    \printbibliography
    
\end{document}

答案1

一般来说,在样式定制方面,biblatex通常被认为比 BibTeX 的样式更现代、更灵活。还提供了一些 BibTeX 无法提供的功能(完整的 Unicode 支持、源映射等)。.bstbiblatex

但是如果你已经有了一套基于 BibTeX 的设置,并且它完全满足你的需要,那么切换到 并不总是biblatex最好的选择。你不能使用.bst来使用现有的文件biblatex,所以你必须用 来重新创建它的输出biblatex。用 来重新创建该样式的每一个细节可能会非常痛苦biblatex——即使biblatex允许你相当轻松地对你的样式进行一些修改。

如果您愿意接受一些内容,并希望使用biblatexBibTeX 未提供的一些更高级的功能,那么切换到biblatex是一个好主意。但是,如果您只想要与使用 BibTeX 时完全相同的输出,那么获得正确结果所需的时间可能最好花在其他地方。


这将超出此站点上合理简短的答案所能提供的范围,以重新创建apalike2输出biblatex,因此,我仅提几点。

相关内容