我正在尝试改变引用样式,以便它以以下样式显示:(名称、年份、页数)。
我最接近的是使用以下代码:
\documentclass[openany, a4paper, oneside, 10pt]{article}
\usepackage[backend=biber,style=authoryear-icomp , maxbibnames=9,
maxcitenames=2,backend=biber]{biblatex}
%I added the next 7 lines after researching them online
\usepackage{babel,csquotes,xpatch}
\renewcommand*{\nameyeardelim}{\addcomma\space}
\renewcommand*{\postnotedelim}{\addcolon\space}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
\xpretobibmacro{date+extrayear}{\addperiod\space}{}{}
\xapptobibmacro{date+extrayear}{\nopunct}{}{}
\addbibresource{literaturVerzeichnis.bib}
\begin{document}
In 1988 C was totally awesome. \cite{park2019role}
According to \cite{ansari2018probabilistic} C++ was even better.
\printbibliography
\end{document}
例如,结果为:Park, 2019。我要查找的是:(Park, 2019, p.370-374)。以下是结果的照片:
我只是引用article
,所有页面都在我的.bib
文件中。以下是我在示例文本中提到的两个:
@article{park2019role,
title={The role of satisfaction on customer reuse to airline services: An application of Big Data approaches},
author={Park, Eunil},
journal={Journal of Retailing and Consumer Services},
volume={47},
pages={370--374},
year={2019},
publisher={Elsevier}
}
@article{ansari2018probabilistic,
title={Probabilistic Topic Model for Hybrid Recommender Systems: A Stochastic Variational Bayesian Approach},
author={Ansari, Asim and Li, Yang and Zhang, Jonathan Z},
journal={Marketing Science},
volume={37},
number={6},
pages={987--1008},
year={2018},
publisher={INFORMS}
}
有任何想法吗?
答案1
括号内的引文可通过以下方式获得\parencite
\parencite{park2019role}
一般来说,如果直接在引文中添加页码,则
\parencite[371-372]{park2019role}
页码引用指向与此特定引文相关的所引著作的特定部分,而不是所引著作的完整页码范围。读者可能不会从仅引用参考书目中已显示的整个著作的页码引用中受益。因此,在示例中添加“第 370-374 页”只会在文本中添加噪音。
\documentclass[a4paper, 10pt, ngerman]{article}
\usepackage{babel,csquotes}
\usepackage[backend=biber, style=authoryear-icomp,
maxbibnames=9, maxcitenames=2]{biblatex}
\DeclareDelimFormat{nameyeardelim}{\addcomma\space}
\DeclareDelimFormat[bib]{nameyeardelim}{\addperiod\space}
\begin{filecontents}{\jobname.bib}
@article{park2019role,
title = {The role of satisfaction on customer reuse to airline services:
An application of Big Data approaches},
author = {Park, Eunil},
journal = {Journal of Retailing and Consumer Services},
volume = {47},
pages = {370--374},
year = {2019},
}
@article{ansari2018probabilistic,
title = {Probabilistic Topic Model for Hybrid Recommender Systems:
A Stochastic Variational Bayesian Approach},
author = {Ansari, Asim and Li, Yang and Zhang, Jonathan Z.},
journal = {Marketing Science},
volume = {37},
number = {6},
pages = {987--1008},
year = {2018},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
In 1988 C was totally awesome. \parencite[372-373]{park2019role}
In 1990 C was still totally awesome. \parencite{park2019role}
According to \textcite{ansari2018probabilistic} C++ was even better.
\printbibliography
\end{document}
如果你绝对需要在引用中包含页码引用,而你自己又没有提供后记,请尝试以下方法
\documentclass[a4paper, 10pt, ngerman]{article}
\usepackage{babel,csquotes}
\usepackage[backend=biber, style=authoryear-icomp,
maxbibnames=9, maxcitenames=2]{biblatex}
\DeclareDelimFormat{nameyeardelim}{\addcomma\space}
\DeclareDelimFormat[bib]{nameyeardelim}{\addperiod\space}
\renewbibmacro*{cite:postnote}{%
\ifbool{cbx:loccit}
{}
{\setunit{\printdelim{postnotedelim}}%
\iffieldundef{postnote}
{\printfield{pages}}
{\printfield{postnote}}}}
\begin{filecontents}{\jobname.bib}
@article{park2019role,
title = {The role of satisfaction on customer reuse to airline services:
An application of Big Data approaches},
author = {Park, Eunil},
journal = {Journal of Retailing and Consumer Services},
volume = {47},
pages = {370--374},
year = {2019},
}
@article{ansari2018probabilistic,
title = {Probabilistic Topic Model for Hybrid Recommender Systems:
A Stochastic Variational Bayesian Approach},
author = {Ansari, Asim and Li, Yang and Zhang, Jonathan Z.},
journal = {Marketing Science},
volume = {37},
number = {6},
pages = {987--1008},
year = {2018},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
In 1988 C was totally awesome. \parencite[372-373]{park2019role}
In 1990 C was still totally awesome. \parencite{park2019role}
According to \textcite{ansari2018probabilistic} C++ was even better.
\printbibliography
\end{document}
目前这显然不适用于\textcite
引用,但可以通过添加
\renewbibmacro*{textcite:postnote}{%
\ifbool{cbx:loccit}
{}
{\ifnameundef{labelname}
{\setunit{%
\global\booltrue{cbx:parens}%
\printdelim{extpostnotedelim}\bibopenparen}}
{\setunit{\printdelim{postnotedelim}}}%
\iffieldundef{postnote}
{\printfield{pages}}
{\printfield{postnote}}}%
\ifthenelse{\value{multicitecount}=\value{multicitetotal}}
{\setunit{}%
\printtext{%
\ifbool{cbx:parens}
{\bibcloseparen\global\boolfalse{cbx:parens}}
{}}}
{\setunit{%
\ifbool{cbx:parens}
{\bibcloseparen\global\boolfalse{cbx:parens}}
{}%
\textcitedelim}}}
请注意,我从 MWE 中删除了部分代码,因为它们与所需输出(\renewcommand*{\postnotedelim}{\addcolon\space}
、\DeclareFieldFormat{postnote}{#1}
和\DeclareFieldFormat{multipostnote}{#1}
)背道而驰。我还简化了年之前的代码(xpatch
内容)。