DIN 1505 要求标点符号前有可拆分的单词间空格。参考书目条目应如下所示:
Lastname1, Firstname1 ; Lastname2, Firstname2: Title : Subtitle [...]
^ ^
我尝试通过重新定义\multinamedelim
和\subtitlepunct
命令来实现这一点。不幸的是,分别\addspace
前面的不会显示在结果文件中。原因是命令删除了前面的空格。它由隐式执行。\addsemicolon
\addcolon
\unspace
\addspace
梅威瑟:
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[
style=alphabetic,
backend=biber,
]{biblatex}
\addbibresource{test.bib}
\begin{filecontents}{test.bib}
@BOOK{Author2001,
author = {Alastname, Afirstname},
title = {Title},
subtitle = {Subtitle},
year = {2001},
}
\end{filecontents}
% Setup bibliography
\DeclareNameAlias{default}{last-first}
\renewcommand*{\multinamedelim}{\addspace\addsemicolon\addspace}
\renewcommand*{\finalnamedelim}{\addspace\addsemicolon\addspace}
\renewcommand*{\multilistdelim}{\addspace\addsemicolon\addspace}
\renewcommand*{\finallistdelim}{\addspace\addsemicolon\addspace}
\renewcommand*{\labelnamepunct}{\addcolon\addspace}
\renewcommand*{\subtitlepunct}{\addspace\addcolon\addspace}
\renewcommand*{\finentrypunct}{}
\begin{document}
Filler text \cite{Author2001}
\printbibliography
\end{document}
我找到了一个 DIN 1505 样式的例子(看这里)。作者\addspace
用代替\mbox{ }
。不幸的是 不正式支持biblatex
。有人知道更好的解决方案吗?
答案1
您可以分别用普通的或替换\addsemicolon
/等命令,这样就变成了。这样就不会检查标点符号前面的空格,但也不会像以前那样检查前面的标点符号。\addcolon
;
:
\DeclareDelimFormat{multinamedelim}{\addspace\addsemicolon\addspace}
\DeclareDelimFormat{multinamedelim}{\addspace;\addspace}
biblatex
\addsemicolon
我们还可以更深入地研究 的内部结构biblatex
,并尝试定义我们自己的空间保留宏\addsp<punct>
。这些宏是通过 定义的,它本质上是带有注释掉的\blx@addsppunct
宏。\blx@addpunct
\unspace
现在,当您不希望前面的空格消失时,可以使用\addspsemicolon
and\addspcolon
代替\addsemicolon
and 。\addcolon
平均能量损失
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[
style=alphabetic,
backend=biber,
]{biblatex}
\makeatletter
% see biblatex.sty for these macros
\blx@regimcs{%
\addspsemicolon \addspcolon \addspcomma}
\def\blx@addsppunct#1{% <---- new name for spaced punctuation
%\unspace <----- commented out
\ifnum\blx@spacefactor<\blx@sf@threshold@low
\csuse{blx@qp@#1}\csuse{abx@#1}%
\else
\ifnum\blx@spacefactor>\blx@sf@threshold@high
\csuse{blx@qp@#1}\csuse{abx@#1}%
\else
\ifcsdef{blx@pp@\the\csname blx@sf@#1\endcsname @\blx@spacefactor}
{\csuse{blx@qp@#1}\csuse{abx@#1}}
{\csuse{blx@qp@#1}}%
\fi
\fi
\csuse{blx@pq@#1}}
\protected\def\blx@imc@addspsemicolon{\blx@addsppunct{semicolon}}
\protected\def\blx@imc@addspcolon{\blx@addsppunct{colon}}
\protected\def\blx@imc@addspcomma{\blx@addsppunct{comma}}
\makeatother
% Set up bibliography
\DeclareNameAlias{default}{family-given}
\DeclareDelimFormat{multinamedelim}{\addspace\addspsemicolon\space}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}
\DeclareDelimFormat{multilistdelim}{\addspace\addspsemicolon\space}
\DeclareDelimAlias{finallistdelim}{multilistdelim}
\DeclareDelimFormat[bib]{nametitledelim}{\addcolon\space}
\renewcommand*{\subtitlepunct}{\addspace\addspcolon\space}
\renewcommand*{\finentrypunct}{}
\addbibresource{biblatex-examples.bib}
\begin{document}
\cite{sigfridsson,worman}
\printbibliography
\end{document}
编辑代码已针对biblatex
3.8 及更新版本进行了现代化处理。请参阅旧版本的编辑历史。