让 \cite{ref} 显示第一作者的姓氏

让 \cite{ref} 显示第一作者的姓氏

我正在尝试获取一种非标准引用样式,其中仅包含第一作者的姓氏和出版年份。目前我有以下示例:

myref.bib

@article{Stupid1999,

author = {Styleiz Stupid and Don Knowhy},
title = {Using totally random citation styles to write a thesis},
year = {1999},
volume = {11},
pages = {232-254},
journal = {Journal of Stupid Citation Styles}

}

在 tex 文件中我引用

A stupid random citation style was also used by \cite{Stupid1999}

输出结果为:

A stupid random citation style was also used by [Stupid and Knowhy, 1999]

我希望它是:

A stupid random citation style was also used by [Stupid,1999]

类似这样的没有逗号的输出也会受到欢迎,我只是需要它不包括任何第二作者或等人在内联引用中。

此外,在参考部分,我还需要像这样的输出

    [Stupid,1999] Stupid, S., Knowhy, D., Using totally random citation 
                  styles to write a thesis. Journal of Stupid Citation 
                  Styles, 1999, vol. 11, p. 232-254

关于此输出的重要部分是它需要采用这种缩进样式。引用的顺序也可以是(作者、年份、标题、休息)。目前我正在使用它,\bibliographystyle{apalike}因为它是唯一类似的选项,但这不适合完成我的工作。

提前期待您的建议。

亲切的问候

带有包列表的示例代码:

\documentclass[12pt,twoside]{book}

\usepackage{graphicx}
\usepackage{color}
\usepackage[latin1]{inputenc}
\usepackage[UKenglish]{babel}
\usepackage{utilmat}
\usepackage{margen}
\usepackage{pinlabel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{rotating}
\usepackage{titlesec}
\usepackage{enumerate}
\usepackage{nccmath}
\usepackage{bigints}
\usepackage{caption}
\usepackage[a4paper]{geometry}
\usepackage{verbatim}  % Needed for the "comment" environment to make LaTeX comments
\usepackage{vector}  % Allows "\bvec{}" and "\buvec{}" for "blackboard" style bold vectors in maths
%\usepackage{epstopdf}
\usepackage[version=3]{mhchem}
\usepackage{enumerate}
\usepackage[official]{eurosym}
\usepackage{multirow}
\usepackage[font=small, labelfont=bf, justification=centering, format=hang]{caption}
\usepackage{hyperref}
\usepackage{array}
\usepackage{subfigure}
\usepackage{multicol}
\usepackage{rotating}
\usepackage{float}
%raggedrigh
\usepackage{mhchem}
\usepackage{fancyhdr}
\usepackage{booktabs}
\usepackage{breakcites}
%\usepackage[square]{natbib}
%\usepackage{apalike}
%\bibpunct{[}{]}{;}{a}{,}{-}
\usepackage{csquotes}
%
\usepackage[%
style=verbose
,backend=bibtex      % biber or bibtex
,backref=true
,style=authoryear    % Alphabeticalsch
,style=numeric-comp  % numerical-compressed
,sorting=nyt        % no sorting
,sortcites=true      % some other example options ...
,block=none
,indexing=false 
,citereset=none
,isbn=true
,giveninits=true
,url=true
,doi=true            % prints doi
,natbib=true         % if you need natbib functions
]{biblatex} 


\addbibresource{myref.bib}

\begin{document}
    A stupid random citation style was also used by \cite{Stupid1999}

\printbibliography
\end{document}

Errors:

biblatex.sty error line 3350 Command \Rn already defined \endgroup} and multiple warnings

答案1

这个答案已针对biblatex3.13 和完全重新修改biblatex-ext

请参阅滥用风格的版本的编辑历史alphabetic

谢谢https://github.com/plk/biblatex/issues/861authoryear即使在样式中也可以正确地隐藏“et al.” (参见仅从引文中删除“et al.”并将其保留在参考书目中)。这意味着我们可以使用该authoryear样式ext-authoryear作为introcite参考书目中的标签。

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber,
  bibstyle=ext-authortitle,
  citestyle=ext-authoryear,
  sorting=nyt,
  mincitenames=1, maxcitenames=1,
  nohashothers=true, nosortothers=true,
  uniquelist=false,
  introcite=label, dashed=false]{biblatex}

\DeclareDelimFormat{nameyeardelim}{\addcomma\space}

\DeclareFieldFormat{bbx@introcite}{\mkbibbrackets{#1}}

\DeclareOuterCiteDelims{parencite}{\bibopenbracket}{\bibclosebracket}

\DeclareNameFormat{labelname}{%
  \ifcase\value{uniquename}%
    \usebibmacro{name:family}
      {\namepartfamily}
      {\namepartgiven}
      {\namepartprefix}
      {\namepartsuffix}%
  \or
    \ifuseprefix
      {\usebibmacro{name:given-family}
        {\namepartfamily}
        {\namepartgiveni}
        {\namepartprefix}
        {\namepartsuffixi}}
      {\usebibmacro{name:given-family}
        {\namepartfamily}
        {\namepartgiveni}
        {\namepartprefixi}
        {\namepartsuffixi}}%
  \or
    \usebibmacro{name:given-family}
      {\namepartfamily}
      {\namepartgiven}
      {\namepartprefix}
      {\namepartsuffix}%
  \fi}

\addbibresource{biblatex-examples.bib}

\begin{document}
\autocite{sigfridsson,worman,geer,knuth:ct:a,knuth:ct:b}
\printbibliography
\end{document}

相关内容