我看到在 texlive 2011 和 2012 之间开发了许多新样式。但我仍然需要看到一种针对科学编辑委员会引文样式的样式。我绝对不会用硬核tex 代码,但我确实尝试阅读和理解 biblatex 手册和 biblatex 样式文件的源文件,但我无法理解从哪里开始,所以如果有人尝试开发一种 CSE 样式,我将非常感激,特别是姓名-年份引用顺序?
此外,是否有人有一个简单的解决方法,而不需要开发 CSE 样式?
更新日期:2012 年 12 月 24 日
我想要实现的目标可以在以下外部网站中看到:
答案1
有不CSE Name-Yearbiblatex
样式包尚未推出。但我正在努力改进。请原谅我代码太丑。如果您有什么建议,请告诉我,以便我可以向您学习,或者更好的是,自己改进代码。
由于这个问题太过宽泛,我犹豫了好几次才回答。也许部分原因是这是我的第一个问题,我不知道该怎么问。我从几篇帖子中借用了答案,特别是:
- 自定义 biblatex 样式的指南
- Biblatex:更改条目的顺序
- \DeclareNameAlias{sortname}{last-first} 不对编辑器名称进行排序
- biblatex 条件打印额外日期
- biblatex:删除参考书目中姓氏和名字之间的逗号
这是biblatex.cfg
文件。
\ProvidesFile{biblatex.cfg}
\DefineBibliographyStrings{english}{%
references = {Cited References}, % Use "Cited References" as bibliography heading
january = {Jan}, % Change how the names of months appear
february = {Feb},
march = {Mar},
april = {Apr},
may = {May},
june = {Jun},
july = {Jul},
august = {Aug},
september = {Sep},
october = {Oct},
november = {Nov},
december = {Dec}
}
\ExecuteBibliographyOptions{
firstinits=true,
isbn=true,
dashed=false,
eprint=true,
maxbibnames=99,
alldates=long,
doi=true,
uniquename=init
}
% ... and remove italization of titles
\renewcommand{\bibinitperiod}{}
\renewcommand{\bibinitdelim}{}
\renewcommand{\finalnamedelim}{, }
\renewcommand*{\revsdnamepunct}{}
% Remove quotation marks around journal titles etc.
\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]
{title}{#1\isdot}
% Print last name first before first name
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first} % changes that of the editor and others
%\DeclareNameAlias{editorname}{last-first}
\DeclareNameAlias{editora}{editor}
\DeclareNameAlias{editorb}{editor}
\DeclareNameAlias{editorc}{editor}
% ... and remove italization of titles
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat{maintitle}{#1}
\DeclareFieldFormat{sorttitle}{#1}
\DeclareFieldFormat{title}{#1}
\DeclareFieldFormat{booktitle}{#1}
\DeclareFieldFormat{issuetitle}{#1}
\DeclareFieldFormat{pages}{#1}% no prefix for the `pages` field in the bibliography
% Make all titles except for journal title and journalsubtitle Sentence case
\DeclareFieldFormat{titlecase}{\MakeTitleCase{#1}}
\newrobustcmd{\MakeTitleCase}[1]{%
\ifthenelse{%
\ifcurrentfield{booktitle}\OR\ifcurrentfield{booksubtitle}%
\OR\ifcurrentfield{maintitle}\OR\ifcurrentfield{mainsubtitle}%
\OR\ifcurrentfield{journaltitle}\OR\ifcurrentfield{journalsubtitle}%
%\OR\ifcurrentfield{issuetitle}\OR\ifcurrentfield{issuesubtitle}%
%\OR\ifentrytype{book}\OR\ifentrytype{mvbook}\OR\ifentrytype{bookinbook}%
%\OR\ifentrytype{booklet}\OR\ifentrytype{suppbook}%
%\OR\ifentrytype{collection}\OR\ifentrytype{mvcollection}%
%\OR\ifentrytype{suppcollection}\OR\ifentrytype{manual}%
%\OR\ifentrytype{periodical}\OR\ifentrytype{suppperiodical}%
%\OR\ifentrytype{proceedings}\OR\ifentrytype{mvproceedings}%
%\OR\ifentrytype{reference}\OR\ifentrytype{mvreference}%
%\OR\ifentrytype{report}\OR\ifentrytype{thesis}
}
{#1}
{\MakeSentenceCase{#1}
}}
% Remove parentheses around dates
\renewbibmacro*{date+extrayear}{%
\iffieldundef{year}
{}
{\printtext{%
\addperiod\space\printfield{labelyear}%
\printfield{extrayear}}}}
\NewBibliographyString{available}
\NewBibliographyString{cited}
\DefineBibliographyStrings{english}{%
available = {Available from},
}
% Redefined url+urldate macro
\DeclareFieldFormat{url}{\bibstring{available}\addcolon\space\url{#1}}
\DeclareFieldFormat{urldate}{#1}
\DeclareFieldFormat{urlday}{#1}
\renewbibmacro*{url+urldate}{%
\iffieldundef{urlyear}
{}
% {\setunit*{\addspace}%
% }
{\printtext{[}%
\iffieldundef{urlupyear}
{}
{\printtext{updated}\space\printfield{urlupyear}
\mkbibmonth{\thefield{urlupmonth}}
\stripzeros{\thefield{urlupday}}\addsemicolon\space
}%
\printtext{cited}\space%
\printfield{urlyear}
\mkbibmonth{\thefield{urlmonth}}
\stripzeros{\thefield{urlday}}%
\printtext{].}\space%
\printfield{url}%
}
}
% Add another bibtex entry for medium designator in online titles
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=medium, fieldtarget=usera]
\step[fieldsource=urlupdate, fieldtarget=extradate]
}
}
}
% This is a problematic part
\renewbibmacro*{title}{%
\ifboolexpr{
test {\iffieldundef{title}}
and
test {\iffieldundef{subtitle}}
}
{}
{\printtext[title]{%
\printfield[sentencecase]{title}%
\setunit{\subtitlepunct}%
\printfield[sentencecase]{subtitle}
\setunit{}%
\iffieldundef{usera}
{}
{\printtext{[}\printfield{usera}\printtext{]}}}%
\newunit}%
\printfield{titleaddon}}
\DeclareBibliographyDriver{online}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bytranslator+others}%
\newunit\newblock
\printfield{version}%
\newunit\newblock
\usebibmacro{publisher+location+date}
\addsemicolon
\newunit\newblock
\usebibmacro{url+urldate}
\usebibmacro{finentry}}
% Driver for article
% Order of fields for article
\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bytranslator+others}%
\newunit\newblock
\printfield{version}%
\newunit\newblock
\usebibmacro{journal+issuetitle}%
\newunit
\usebibmacro{byeditor+others}%
\newunit
\usebibmacro{note+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\usebibmacro{related}%
\usebibmacro{finentry}}
% cbx part
\renewcommand*{\nameyeardelim}{\addspace}
\endinput
还有一个biblatex-dm.cfg
文件:
\DeclareDatamodelFields[type=field, datatype=date, skipout]{urlupdate}
\DeclareDatamodelFields[type=field, datatype=integer]{
urlupday,
urlupendday,
urlupendmonth,
urlupendyear,
urlupmonth,
urlupyear}
\DeclareDatamodelEntryfields{
urlupdate,
urlupday,
urlupendday,
urlupendmonth,
urlupendyear,
urlupmonth,
urlupyear}
\endinput
现在,我知道这个答案会使事情变得复杂,因为这个问题要求答案与网站中的其他答案重复。但是,我相信这种风格的潜在用户可以通过复制上述代码并随意修改直接受益。所以我也把这个答案设为 CW。
我之前曾与 Joseph Wright 在聊天中讨论过这个答案,目前我正在努力将其做成一个biblatex
样式包。