ラベルに最初の著者のみを記載した著者年形式の参考文献を作成するよう依頼されました。野心的なラベルの場合は、年に文字を追加します。これは、次のコードで簡単に作成できます(biblatex と biber を使用して固定インデントと著者年ラベル付きの参考文献を作成する):
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[style=ext-authoryear, backend=biber, maxcitenames=1, uniquename=false, uniquelist=false, introcite=label, dashed=false]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{Shepard2001a,
author = {Shepard, Frank and Fisher, John},
year = {2001},
title = {Livestock management},
}
@book{Shepard2001b,
author = {Shepard, Frank and Farmer, Boris},
year = {2001},
title = {On food supplies},
}
\end{filecontents*}
\addbibresource{\jobname.bib} % if you’re using biblatex\addbibresource{biblatex-examples.bib}
\setlength{\bibitemsep}{0.5\baselineskip plus 0.5\baselineskip}
\setlength{\introcitewidth}{6em}
\begin{document}
\cite{Shepard2001a, Shepard2001b}
\printbibliography
\end{document}
ご覧のとおり、私は from を と共に使用してext-authoryear
いbiblatex-ext
ますintrocite=label
。
これは良いのですが、参考文献のエントリでは、年に追加された文字を削除する必要があります。私は「問題のある」文字を赤い線でマークしました。つまり、ラベルには文字が必要ですが、参考文献のエントリ自体には不要です。MWE のエントリは次のようになります。
Shepard et al. 2001a
Shepard, Frank and Boris Farmer (2001), ...
どこを変更すればよいのか分かりませんでした。
答え1
マクロ内の\printdateextra
を置き換えます:\printdate
data+extradate
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[style=ext-authoryear, backend=biber, maxcitenames=1, uniquename=false, uniquelist=false, introcite=label, dashed=false]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{Shepard2001a,
author = {Shepard, Frank and Fisher, John},
year = {2001},
title = {Livestock management},
}
@book{Shepard2001b,
author = {Shepard, Frank and Farmer, Boris},
year = {2001},
title = {On food supplies},
}
\end{filecontents*}
\addbibresource{\jobname.bib} % if you’re using biblatex\addbibresource{biblatex-examples.bib}
\setlength{\bibitemsep}{0.5\baselineskip plus 0.5\baselineskip}
\setlength{\introcitewidth}{6em}
\makeatletter
\renewbibmacro*{date+extradate}{%
\iffieldundef{labelyear}
{}
{\printtext[\blx@delimcontext labeldate]{%
\iflabeldateisdate
{\printfield{issue}%
\setunit*{\addspace}%
\printdate}
{\printlabeldateextra}}}}%
\renewbibmacro*{bbx:ifmergeddate}{\iflabeldateisdate}%
\renewbibmacro*{issue+date}{%
\usebibmacro{bbx:ifmergeddate}
{}
{\printtext[issuedate]{%
\printfield{issue}%
\setunit*{\addspace}%
\printdate}}}
\makeatother
\begin{document}
\cite{Shepard2001a, Shepard2001b}
\printbibliography
\end{document}
答え2
日付印刷のコードは、選択したmergedate
設定によって異なります。プリセットは で、mergedate=true
これは と同等ですがmergedate=compact
、次のように変更を抑制できます。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[style=ext-authoryear, backend=biber,
maxcitenames=1, uniquename=false, uniquelist=false,
introcite=label, dashed=false]{biblatex}
\setlength{\bibitemsep}{0.5\baselineskip plus 0.5\baselineskip}
\setlength{\introcitewidth}{6em}
\makeatletter
\renewbibmacro*{date+extradate}{%
\iffieldundef{labelyear}
{}
{\printtext[\blx@delimcontext labeldate]{%
\iflabeldateisdate
{\printdate}
{\printlabeldate}}}}
\makeatother
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{Shepard2001a,
author = {Shepard, Frank and Fisher, John},
year = {2001},
title = {Livestock management},
}
@book{Shepard2001b,
author = {Shepard, Frank and Farmer, Boris},
year = {2001},
title = {On food supplies},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\cite{Shepard2001a, Shepard2001b}
\printbibliography
\end{document}
もう一つの答えのコードにmergedate=maximum
基づいて と も再定義しましたbbx:ifmergeddate
がissue+date
、これは必要ではありませんでした。このコードでは、 がfalse のextradate
場合の情報も削除しました。\iflabeldateisdate
出力が異なる別のオプションとしては、authoryear
引用と参考authortitle
文献を組み合わせることが挙げられます。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[backend=biber, bibstyle=ext-authortitle, citestyle=ext-authoryear,
sorting=nyt,
maxcitenames=1, uniquename=false, uniquelist=false,
introcite=label, dashed=false]{biblatex}
\setlength{\bibitemsep}{0.5\baselineskip plus 0.5\baselineskip}
\setlength{\introcitewidth}{6em}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{Shepard2001a,
author = {Shepard, Frank and Fisher, John},
year = {2001},
title = {Livestock management},
}
@book{Shepard2001b,
author = {Shepard, Frank and Farmer, Boris},
year = {2001},
title = {On food supplies},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\cite{Shepard2001a, Shepard2001b}
\printbibliography
\end{document}