我使用了biblatex
如下例所示的方法。但遗憾的是, \printbibliography
它并没有生成我想要的布局。
现在:
[Buch00a] 名称,V.:标题。人力资源冯纳姆,V. Bd.授衔。地点:出版社,1996 年。
期望:
[Buch00] 姓名,V.;名称,V(Hrsg.):标题。授衔。地点:出版社,1996 年。
我怎样才能隐藏 citekey 中的“a”?
有人能帮助我定制书籍条目吗biblatex
?
以下是 MWE:
\documentclass[12pt,a4paper,oneside,ngerman]{scrbook}
\usepackage{setspace}
\setstretch{1.2}
%---package, default----------------------------------------------------------
\usepackage[latin1]{inputenc}
\usepackage{lmodern}
\usepackage{geometry}
\geometry{a4paper,left=3cm,right=2cm,top=2cm,bottom=2cm} %SpringerShaker
%---package, tikz, eps in pdf--------------------------------------------------
%%%\usepackage{subfigure}
%--new lit--------------------------------------------------------------------
\usepackage[ngerman]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[%
backend=biber,
% style=numeric, %> for counting
style=alphabetic,
firstinits=true,
maxbibnames=99,
maxcitenames=1
%backref=true
]{biblatex}
%
%
\DefineBibliographyStrings{german}{%
%byeditor ={\unspace\mkbibparens {Hrrsg\adddot})},
andothers = {{et\,al\adddot}}
}
% editor = {(Hrsg.)},
% editors = {(Hrsg.)}}
%
%bibkey in citiation
\DeclareFieldFormat{labelalpha}{\thefield{entrykey}}
%Hrsg with ()
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareFieldFormat{editorstype}{\mkbibparens{#1}}
%
% Titel nicht schräg
\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat{citetitle}{#1}
\DeclareFieldFormat{booktitle}{#1}
\DeclareFieldFormat{maintitle}{#1}
% Journal Titel nicht schräg
\DeclareFieldFormat{journaltitle}{#1}
%
\DeclareNameAlias{default}{last-first} %Autoren immer Nachname, Vorname sortieren
%
\renewcommand{\multinamedelim}{\addsemicolon\space} %Semikolon zum trennen der Autoren
\renewcommand{\finalnamedelim}{\addsemicolon\space}
\renewcommand{\labelnamepunct}{\addcolon\space} %Zwischen Autor und Titel Doppelpunkt, kein Punkt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for final
\defbibfilter{firstlev}{
type=article or
type=book or
type=thesis or
type=report or
type=inproceedings
}
\defbibfilter{secondlev}{
type=manual
}
% headings in lit
\defbibheading{firstlevel}{%
\chapter{Literaturverzeichnis}
%\section{Artikel, Bücher und Hochschulschriften}
}
\defbibheading{secondlevel}{%
\section*{Manuals}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\addbibresource{LitExampleBib.bib}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Start Doc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\cite{Buch00}
\cite{Buch01}
\cite{Article00}
\cite{Phd00}
\cite{Techreport00}
\cite{Manual00}
\cite{Conf00}
%%%%%%%%%%%% for final Diss
%\addcontentsline{toc}{chapter}{Literaturverzeichnis}
\printbibliography[filter=firstlev, heading=firstlevel]
\printbibliography[filter=secondlev, heading=secondlevel]
%%%% END %%%%%%%%%%%%5555%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
来源如下.bib
:LitExampleBib.bib
@Article{Article00,
author = {Vorname Name and Vorname Name},
title = {Titel},
journal = {Zeitschriftentitel},
year = {2004},
volume = {Jg. 106},
number = {H. 4},
pages = {S. 28-31},
month = {12},
groups = {1-Einleitung},
}
@PhdThesis{Phd00,
author = {Vorname Name},
title = {Titel},
school = {Universität},
year = {2009},
}
@TechReport{Techreport00,
author = {Vorname Name and Vorname Name},
title = {Titel},
institution = {Institution},
year = {2015},
}
@Manual{Manual00,
title = {Titel},
organization = {Organisation},
year = {2017},
location = {New York},
}
@Conference{Conf00,
author = {Vorname Name},
title = {Title},
booktitle = {Konferenzname},
year = {2015},
timestamp = {2016.04.29},
}
@Book{Buch01,
title = {Titel},
publisher = {Verlag},
year = {1996},
editor = {Vorname Name},
volume = {Auflage},
location = {Ort},
}
@Book{Buch00,
title = {Titel},
publisher = {Verlag},
year = {1996},
author = {Vorname Name},
editor = {Vorname Name},
volume = {Auflage},
location = {Ort},
}
答案1
如果你真的想使用.bib
条目的条目键作为文档中的引用键(我绝对不建议这样做),最好的办法是更改模板labelalpha
。删除\DeclareFieldFormat{labelalpha}{\thefield{entrykey}}
并添加
\DeclareLabelalphaTemplate{
\labelelement{
\field[final]{shorthand}
\field{label}
\field{citekey}
}
}
它\DeclareFieldFormat{labelalpha}{\thefield{entrykey}}
不会按预期工作,因为它没有考虑extraalpha
基于 Biber 生成的标准标签计算的字段,其中Buch00
和Buch01
都以“Nam96”结尾,因此必须添加“a”和“b”以使标签唯一。
我认为这种做法是个坏主意,因为它违背了输入键是条目的纯粹内部指定的想法,并且biblatex
Biber 应该计算在输出中出现的有用标签。
MWE 删除了与问题和评论无关的软件包,并进行了现代化改造,以便与当前版本的兼容biblatex
。
\documentclass[a4paper,ngerman]{article}
\usepackage{babel}
\usepackage[autostyle, german=quotes]{csquotes}
\usepackage[
backend=biber,
style=alphabetic,
giveninits=true,
maxbibnames=99,
maxcitenames=1,
]{biblatex}
\DeclareLabelalphaTemplate{
\labelelement{
\field[final]{shorthand}
\field{label}
\field{citekey}
}
}
\DefineBibliographyStrings{german}{%
andothers = {et\,al\adddot},
}
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat{citetitle}{#1}
\DeclareFieldFormat{booktitle}{#1}
\DeclareFieldFormat{maintitle}{#1}
\DeclareFieldFormat{journaltitle}{#1}
\DeclareNameAlias{default}{family-given}
\DeclareDelimFormat{multinamedelim}{\addsemicolon\space}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}
\DeclareDelimFormat[bib,biblist]{nametitledelim}{\addcolon\space}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Article{Article00,
author = {Vorname Name and Vorname Name},
title = {Titel},
journal = {Zeitschriftentitel},
year = {2004},
volume = {106},
number = {4},
pages = {28-31},
month = {12},
}
@PhdThesis{Phd00,
author = {Vorname Name},
title = {Titel},
school = {Universität},
year = {2009},
}
@TechReport{Techreport00,
author = {Vorname Name and Vorname Name},
title = {Titel},
institution = {Institution},
year = {2015},
}
@Manual{Manual00,
title = {Titel},
organization = {Organisation},
year = {2017},
location = {New York},
}
@Conference{Conf00,
author = {Vorname Name},
title = {Title},
booktitle = {Konferenzname},
year = {2015},
}
@Book{Buch01,
title = {Titel},
publisher = {Verlag},
year = {1996},
editor = {Vorname Name},
volume = {Auflage},
location = {Ort},
}
@Book{Buch00,
title = {Titel},
publisher = {Verlag},
year = {1996},
author = {Vorname Name},
editor = {Vorname Name},
volume = {Auflage},
location = {Ort},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{Buch00,Buch01,Article00,Phd00,Techreport00,Manual00,Conf00}
\printbibliography[nottype=manual]
\printbibliography[type=manual]
\end{document}
相当相关:使用标签作为 biblatex 键。还请注意,虽然其他地方biblatex
调用条目的条目键entrykey
,但这里调用的是citekey
。名称entrykey
将在未来的 Biber 版本中有效(https://github.com/plk/biber/issues/259)。