我正在尝试完成以下任务:
在我的论文中,我必须参考大量文献,这非常适合使用正常的作者年份格式。我从我的研究所获得了一个模板,我设法使它与 biblatex 和 biber 配合使用。
不过,我必须引用一些规范,应该是这样的:
DIN ISO 18351:2010-06:标题(斜体)、版本(草案、最终版本...)
有人能帮我吗?我尝试添加“DIN ISO 18351:2010-06“作为作者或标签,但在参考书目中却添加了日期不明之类的内容……我必须为此定义自定义条目类型吗?此外,我想将其称为(DIN ISO 18351, 2010) 。这很难实现吗?还是我可以用标准命令以某种方式做到这一点?这里的问题是我想在文本中引用标题而不是作者。
平均能量损失
\documentclass{article}
\usepackage[
backend=biber,
style=alphabetic,
citestyle=authoryear,
sorting=ynt
]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@misc{key, author = {DIN ISO 18351}, year = {2010-6}, title = {Title} }
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\section{First section}
\cite{key}
\medskip
\printbibliography
\end{document}
输出:
答案1
您的问题不够清楚,无法回答,但这将帮助您解决大部分问题,并且可能只需要进行调整。
解释在评论中。
\documentclass{article}
\usepackage[
style=alphabetic,
citestyle=authoryear,
sorting=ynt
]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@diniso{diniso18351,
title = {Title},
number = {18351},
version = {1.0},
pubstate = {final},
date = {2010-06}}
\end{filecontents*}
\addbibresource{\jobname.bib}
% add new diniso entry type
\DeclareDatamodelEntrytypes{
diniso}
% set bibliography label template for diniso entry type
\DeclareLabelalphaTemplate[diniso]{%
\labelelement{
\field{number}
}
}
% use comma before year in citations without authors
% this will apply to all entry types
\renewcommand*{\nonameyeardelim}{\addcomma\space}
% field formats for diniso entry type
\DeclareFieldFormat[diniso]{version}{#1}
\DeclareFieldFormat[diniso]{pubstate}{\mkbibparens{#1}}
\DeclareFieldFormat[diniso]{date}{%
\thefield{year}%
\bibdatesep
\mkmonthzeros{\thefield{month}}}
% custom driver for diniso entry type
\DeclareBibliographyDriver{diniso}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\printtext{DIN ISO}%
\setunit{\addspace}%
\printfield{number}%
\setunit{\addcolon}%
\printdate
\setunit{\addcolon\space}%
\usebibmacro{title}%
\setunit{\addcomma\space}%
\printfield{version}%
\setunit{\addspace}%
\printfield{pubstate}%
\usebibmacro{finentry}}
% custom citation label for diniso entry type
\newbibmacro*{cite:label}{%
\iffieldundef{label}
{\ifentrytype{diniso}
{\printtext[bibhyperref]{%
\printtext{DIN ISO}%
\setunit{\addspace}%
\printfield{number}}}
{\printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}}
{\printtext[bibhyperref]{\printfield{label}}}}
\pagestyle{empty}
\begin{document}
\section{First section}
\parencite{diniso18351}
\printbibliography
\end{document}