关于创建合集和 incollection 驱动程序还有一个问题。我引用的某些书有几个章节,是多位编辑编辑的合集的一部分。简而言之,合集只有编辑,而 incollection 的作者可能是编辑之一,也可能是完全不同的人。
现在,我还必须遵循一些非常严格的规则,包括作者、编辑、标题的格式,以及在编辑列表末尾添加标签“(编辑)”。我从标准 biblatex 中获取了代码,并根据我上次对书籍/论文的疑问对其进行了更改,以回收“引用为”功能。
目前,我已完成目标的 60%,因为交叉引用工作正常。但我阻止了一些格式化元素,并且可能根据 bibmacro 上的最佳实践进行了一些重新调整。
这也是我给出的参考/示例。(1) 是收藏品,(2) 是收藏品。
以下是我使用当前代码获得的结果:
问题 (1)
- 编辑器的格式已关闭,因此
\DeclareNameAlias[collection, incollection]{editor}{given-family:plain}
没有效果。 - 收藏集中的标题格式也不正确。
- 缺少标签“(编辑)”
- 我确信所选的字段不适合书名等。
- 收藏/收藏条目前面有一些有趣的间距
- 我不确定该合集永远不会显示“引用为”。该合集本身永远不会出现在引文中,但必须作为 crossref 的结果出现
问题 (2)
感谢@moewe 的评论,我能够解决第 1 部分中的大部分问题。“编辑”部分仍然存在一些空白,因此在此添加。
缺少标签“(编辑)”的问题已通过使用正确方法\DeclareBibliographyStrings{editor = {{\'editeur}{\'edit\adddot}}}
和标准得到解决{editor}
,其定义在 biblatex.def 中。这会产生这种输出:
Chiocchetti, édit., Commentario
我需要在编辑中做一些小的修改,使它变成这样:
Chiocchetti (édit.), Commentario
我尝试复制粘贴并编辑标准 bibmacro,然后更改宏。现在我遇到了一些间距错误。输出格式中缺少空格“”,如下所示:
Chiocchetti(édit.), Commentario
\renewbibmacro*{editors}{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\printnames{editor}%
\setunit{\printdelim{editortypedelim}}%
\printtext[parens]{\usebibmacro{editorstrg}}%
\clearname{editor}}
{}}
所以我 (1) 不确定我的错误在哪里以及 (2) 不确定这是否是正确的方法。
问题 (3) 刚刚注意到此示例中的另一个有趣的效果,与其他条目相比,编辑/作者是颠倒的。“François Bohnet”而不是“Bohnet François”。我不明白为什么\DeclareNameAlias{sortname}{family-given}
在这种情况下不起作用?
平均能量损失
.tex
\documentclass{article}
\usepackage[maxbibnames=99, style=biblatex-xawi, language=french, backend=biber, bibencoding=UTF8, dashed=false]{biblatex}
\addbibresource{Commentaires.bib}
\begin{document}
\printbibliography{}
\nocite{*}
\section{Expectations}
\subsection{Requirements}
Small caps only in the incollection authors, No small caps for editors in the collection or incollection.
Italics for title of the collection entry, in both collection and incollection
Cited-as should appears only if needed in the incollection entry.
\subsection{First example}
\textsc{Bohnet} François, art. 85 CPC, in : Bohnet François /Haldy Jacques /Jeandin Nicolas /Schweizer Philippe /Tappy Denis (édit.), \textit{Code de procédure civile commenté}, Bâle 2011.
Bohnet François / Haldy Jacques / Jeandin Nicolas / Schweizer Philippe / Tappy Denis (édit.), \textit{Code de procédure civile commenté}, Bâle 2011.
\subsection{Second example}
\textsc{Trezzini} Francesco, art. 85 CPC, in : Trezzini Francesco / Fornara Stefano / Cocchi Bruno / Bernasconi Giorgio / Verda Chiocchetti Francesca (édit.), \textit{Commentario pratico al Codice di diritto processuale civile svizzero – Volume I Parte prima: Disposizioni generali (Art. 1-196)}, Pregassona 2017.
Trezzini Francesco / Fornara Stefano / Cocchi Bruno / Bernasconi Giorgio / Verda Chiocchetti Francesca (édit.), \textit{Commentario pratico al Codice di diritto processuale civile svizzero – Volume I Parte prima: Disposizioni generali (Art. 1-196)}, Pregassona 2017.
\end{document}
。围兜
@collection{CPC_It,
editor = {Trezzini, Francesco and Fornara, Stefano and Cocchi, Bruno and Bernasconi, Giorgio A. and {Verda Chiocchetti}, Francesca},
booktitle = {Commentario pratico al Codice di diritto processuale civile svizzero},
booksubtitle = {Volume I Parte prima: Disposizioni generali (Art. 1-196) },
location = {Pregassona},
date = {2017},
}
@incollection{IT_CPC85,
author = {Trezzini, Francesco},
title = {art. 85 CPC},
crossref = {CPC_It},
}
@collection{CR_CPC,
editor = {Bohnet, François and Haldy, Jacques and Jeandin, Nicolas and Schweizer, Philippe and Tappy, Denis},
booktitle = {Code de procédure civile commenté},
date = {2011},
location = {Bâle},
}
@incollection{CR_CPC85,
author = {Bohnet, François},
title = {art. 85 CPC},
date = {2011},
location = {Bâle},
label = {Commentaire},
crossref = {CR_CPC},
}
@book{bohnetProc,
author = {Bohnet, François},
title = {Procédure civile},
edition = 2,
date = {2014},
location = {Bâle},
label = {Procédure},
}
.bbx
\ProvidesFile{biblatex-xawi.bbx}[2018/04/13 v1.1 alpha)]
% Dépendances
\RequireBiber[2]
\RequireBibliographyStyle{authortitle}
% Localisation
\DeclareLanguageMapping{french}{biblatex-xawi-french}
% Suppression des commandes de formattage des noms propres
\UndefineBibliographyExtras{french}{\restorecommand\mkbibnamefamily}
\renewcommand*{\mkbibnamefamily}{\textsc}
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---%
% --- --- Setting default options --- --- %
\ExecuteBibliographyOptions{%
maxbibnames=99, % nombre max. de noms pour les entrées
maxcitenames=4, % nombre max. de noms pour les citations
mincrossrefs=1, % nombre min pour les références croisées
bibwarn=false, % avertissement uniques pour les entrés bibliographiques
dashed=false, % Nom entier même si répétition
singletitle=true,
uniquename=full,
uniquelist=true
}
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---%
% --- --- Formatage général des citations & bibliogryphies --- --- %
% Formatage global :
\DeclareNameAlias{sortname}{family-given}
% Dans les citations, pas d'espaces entre les slash (contrairement à la bibliographie)
\renewcommand*{\multinamedelim}{\ifcitation{\slash}{\addnbspace\slash\addspace}}
\renewcommand*{\finalnamedelim}{\multinamedelim}
% BibLatex v2.8+ : Format des séparateurs entre les noms: des slash
% \DeclareDelimFormat{multinamedelim}{\slash}
% \DeclareDelimFormat[bib,biblist]{multinamedelim}{\addnbspace\slash\addspace}
% \DeclareDelimAlias{finalnamedelim}{multinamedelim}%
\renewcommand*{\multilistdelim}{\slash}
%\renewcommand*{\multilistdelim}{\addnbspace\slash\addspace}
\renewcommand*{\finallistdelim}{\multilistdelim}
\renewcommand*{\newunitpunct}{\addcomma\space}
\renewcommand*{\revsdnamepunct}{}
\DeclareFieldFormat*{title}{\mkbibemph{#1}}
% Ponctuation entre le titre et le sous-titre
\renewcommand{\subtitlepunct}{\addnbspace\textendash\addnbspace}
% Remove all possible shorthand
% https://tex.stackexchange.com/questions/244714/how-to-disable-the-use-of-shorthands-in-biblatex
\DeclareFieldInputHandler{shorthand}{\def\NewValue{}}
\DeclareNameFormat{given-family:plain}{%
\let\mkbibnamefamily\@firstofone
\ifgiveninits%
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}%
\usebibmacro{name:andothers}}
\DeclareNameAlias[collection]{author}{given-family:plain}
\DeclareNameAlias[collection, incollection]{editor}{given-family:plain}
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---%
% --- --- Pilote de bibliographie pour les livres et autres ouvrages généraux --- --- %
\DeclareBibliographyDriver{book}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\printdelim{nametitledelim}}\newblock
\usebibmacro{maintitle+title}%
\newunit\newblock
\printfield{edition}%
\newunit\newblock
\usebibmacro{location+date}%
\setunit{\addspace}%
\usebibmacro{citedas}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\usebibmacro{finentry}}
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---%
% --- --- Pilote de bibliographie pour les collection / incollections --- --- %
\newbibmacro{editors}{%
\ifnameundef{editor}%
{}%
{\printnames{editor}}%
}%
\DeclareBibliographyDriver{collection}{
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{editors}%
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\printfield{edition}%
\newunit\newblock
\usebibmacro{location+date}%
\finentry
}
\DeclareBibliographyDriver{incollection}{
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\usebibmacro{maintitle+title}%
\usebibmacro{in:}%
\usebibmacro{editors}%
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\printfield{edition}%
\setunit{\addspace}%
\usebibmacro{citedas}%
\finentry
}
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---%
% --- Formatage de la citation spécifique dans la bibliographie --- %
% format : (cité : Auteur-label)
% Voir aussi partie "CBX" pour la partie "citation"
\newbibmacro{citedas:cite}{%
\begingroup
\delimcontext{cite}%
\DeclareFieldFormat{bibhyperref}{##1}%
\csuse{blx@hook@cite}%
\csuse{blx@hook@citekey}%
\undef\cbx@lasthash
\undef\cbx@lastyear
\citetrackerfalse\pagetrackerfalse\backtrackerfalse
\defcounter{maxnames}{\blx@maxcitenames}%
\usebibmacro{cite}%
\endgroup
}
\newbibmacro{citedas}{%
\ifsingletitle
{}{%
\printtext[parens] {%
\bibstring{citedas}%
\addcolon\space
\usebibmacro{citedas:cite}}}}
\renewbibmacro*{location+date}{%
\printlist{location}%
\setunit*{\addspace}%
\usebibmacro{date}%
\newunit
}
\newbibmacro{thesis:type+institution}{%
\printfield{type}%
\setunit*{\addspace}%
\printlist{institution}%
\newunit
}
\endinput % seulement à la fin
.cbx
% PREAMBULE / REGLES GENERALES
\ProvidesFile{biblatex-xawi.cbx}[2018/04/13 v1.0 alpha]
\RequireCitationStyle{authortitle}
% --- --- Formatage général des citations --- --- %
\DeclareFieldFormat*{citetitle}{#1}
\DeclareDelimFormat{nametitledelim}{\textendash}
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---%
% --- Formatage de la citation spécifique dans les citations --- %
% Definition de la partie "Labeltitle"
\DeclareLabeltitle{%
\field{label}
\field{shorttitle}
\field{title}
\field{maintitle}
}
\renewbibmacro*{cite}{%
\iffieldundef{shorthand}
{\ifnameundef{labelname}
{\usebibmacro{cite:title}}
{\ifsingletitle
{\printtext[bibhyperref]{\printnames{labelname}}}
{\printnames{labelname}%
\setunit{\printdelim{nametitledelim}}%
\usebibmacro{cite:title}}}}%
{\usebibmacro{cite:shorthand}}}
\renewbibmacro*{textcite}{%
\ifnameundef{labelname}
{\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\iffieldundef{shorthand}
{\usebibmacro{cite:title}}%
{\usebibmacro{cite:shorthand}}}
{\ifthenelse{\ifsingletitle\AND
\(\iffieldundef{prenote}\OR\value{citecount}>1\)}
{\printtext[bibhyperref]{\printnames{labelname}}}
{\printnames{labelname}%
\setunit{%
\global\booltrue{cbx:parens}%
\addspace\bibopenparen}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\iffieldundef{shorthand}
{\usebibmacro{cite:title}}%
{\usebibmacro{cite:shorthand}}}}}
\endinput
.lbx
\ProvidesFile{biblatex-xawi-french}[2018/04/25 v0.1 Biblatex Swiss Legal]
\InheritBibliographyExtras{french}
% Nouvelles chaines de caractère pour le style
\NewBibliographyString{
thesis,
habilthesis,
}
\DefineBibliographyStrings{french}{
citedas = {cit\'e},
thesis = {th\`ese},
habilthesis = {th\`ese d'habilitation},
}
\endinput % seulement à la fin
答案1
我的变更摘要:
问题 1a. - 各种编辑器格式
编辑器的格式已关闭,\DeclareNameAlias[collection, incollection]{editor}{given-family:plain} 没有效果。
moewe 评论说“\DeclareNameAlias 在可选参数中只能接受一个值,它不能接受多个以逗号分隔的值。因此您需要两行 \DeclareNameAlias[collection]{editor}{given-family:plain} \DeclareNameAlias[incollection]{editor}{given-family:plain}。”
已更改
更换线条
\DeclareNameAlias[collection]{author}{given-family:plain}
\DeclareNameAlias[collection, incollection]{editor}{given-family:plain}
经过
\DeclareNameAlias[collection]{author}{given-family:plain}
\DeclareNameAlias[collection]{editor}{given-family:plain}
\DeclareNameAlias[incollection]{editor}{given-family:plain}
问题 1b. - 格式化标题
收藏集中的标题格式也不正确。
moewe 评论说“[f] 您想要的标题 \DeclareFieldFormat[incollection]{title}{#1}。带星号的 \DeclareFieldFormat*{title} 将所有标题变为斜体,随后的 \DeclareFieldFormat[incollection]{title}` 将更改 @incollection 的格式”
已更改
更换线路
\DeclareFieldFormat*{title}{\mkbibemph{#1}}
经过
\DeclareFieldFormat*{title}{\mkbibemph{#1}}
\DeclareFieldFormat[incollection]{title}{#1}
问题 1c。- 修正间距(缺失部分 %)
收藏/收藏条目前面有一些有趣的间距
moewe 评论说“[t]不需要的空格再次出现,因为忘记了 %s,您需要 \DeclareBibliographyDriver{collection}{% 和 \DeclareBibliographyDriver{incollection}{% (即您必须在 { 后添加 % )”
已更改
更换线路
\DeclareBibliographyDriver{collection}{
经过
\DeclareBibliographyDriver{collection}{%
和
更换线路
\DeclareBibliographyDriver{incollection}{
经过
\DeclareBibliographyDriver{incollection}{%
问题 1d。- 格式化(编辑)
缺少标签“(编辑)”
这个问题有两个原因:(1)当前 ShareLatex 版本为 3.7。Biblatex v3.8 提供了更多定制功能(2)我的 lbx 格式错误,缺少一些字段重新定义。因此进行了更改
已更改
- 设置.bbx文件中的格式。
然后将该代码插入到 bbx 文件中。
% set delimiter of editor-type to a space (instead of ", ")
\DeclareDelimFormat{editortypedelim}{\addspace}
% add parenthesis around the label of editortype
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
- 针对 v3.7 代码的解决方法(最新版本中不需要)
间距不起作用,但这是由于我的 biblatex 版本过时了。因此,我只是复制了最新版本的代码。
% Workaround, due to v3.7, solved in v3.8+ %
% Need to copy the current biblatex 3.11 macro %
\renewbibmacro*{editor}{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\printnames{editor}%
\setunit{\printdelim{editortypedelim}}%
\usebibmacro{editorstrg}%
\clearname{editor}}
{}}
- 使用自定义“编辑”更改 lbx 代码
为了正常工作,我的 lbx 代码需要更好的格式,正如 Moewe 的评论。此后的代码将使用我的更新版本更改默认的“编辑器”条目类型。
\DeclareBibliographyStrings{%
inherit = {french},
editor = {{\'editeur}{\'edit\adddot}},
editors = {{\'editeurs}{\'edit\adddot}},
}