对疯狂的引用风格进行微调

对疯狂的引用风格进行微调

我快完成了。在过去的几天里,我根据出版商的要求建立了引用样式。

艰苦的工作已经完成在此主题中,当我们定义Idem、Ibidem和“Ivi”的行为时。

不幸的是,把所有东西放在一起,有些东西坏了。在我的例子中,由于这个原因不能那么“最小”,我有两个问题:

  1. 书籍驱动程序中的日期和附注之间缺少逗号
  2. 脚注 3 中的“Ivi”后面用冒号代替逗号。

我试图移动一些东西,但情况却变得更糟,所以我再次请求帮助。

这是不那么最小的 WE:

% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode

\begin{filecontents}{archivio.bib}

@incollection{Rae:Rap,
    Author = {Gilbert Raes},
    Booktitle = {La S. Sindone. Ricerche e studi della commissione di esperti nominata dall'Arcivescovo di Torino},
    Editor = {P. Caramello},
    Pages = {79-83},
    Series = {Supplemento Rivista diocesana torinese},
    Title = {Rapport d'analyse},
    Year = {gennaio 1976}}


@incollection{Rae:His,
    Address = {Paris},
    Author = {Gilbert Raes},
    Booktitle = {Prélèvement sur le linceul effectué le 21 avril 1988 et études du tissu},
    Date-Added = {2017-07-30 14:20:28 +0000},
    Date-Modified = {2018-02-28 16:02:55 +0000},
    Pages = {71-74},
    Publisher = {\textsc{o.e.i.l.}},
    Title = {Historique de l'échantillon remis le 24 novembre 1973. Problème de la bande latérale. Fibres de coton dans l'échantillon remis au laboratoire d'Oxford},
    Year = {1990}}

@article{Dan:Ind,
    Author = {Avinoam Danin},
    Date-Added = {2017-08-29 20:03:51 +0000},
    Date-Modified = {2017-08-29 20:04:48 +0000},
    Journal = {Il Telo},
    Pages = {12-21},
    Title = {Indicazioni floreali per l'origine geografica della Sindone di Torino},
    Volume = {II},
    Year = {2001}}

@book{Lan:Rom,
    Address = {Edinburgh},
    Author = {Bertrand Lancon AND Antonia Nevill},
    Publisher = {Edinburgh University Press},
    Title = {Rome in Late Antiquity: Everyday Life and Urban Change, \textsc{ad} 312-609},
    Year = {2000}}


@book{Hal:Sul,
    Address = {Vindobonae},
    Editor = {C. Halm},
    Langid = {german},
    Number = {1},
    Publisher = {C. Geroldi filium bibliopolam academiae},
    Series = {\textsc{csel}},
    Title = {Sulpici Severi libri qui supersunt},
    Year = {1866}}


\end{filecontents}

\documentclass[11pt, openany]{book}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{italian}
\setotherlanguages{latin, english, french}

\usepackage[]{csquotes} %autostyle,italian=guillemets
\usepackage{xpatch}     
\usepackage[style=verbose-trad2,            
            language=auto,
            ibidpage=true,
            babel=other,                        % Ed / hrsg / Éd
            useprefix=true,                 
            giveninits=true,    
         indexing=cite,                 % 
            citepages=permit,                   % 
            backend=biber,  
        ]{biblatex}

\DeclareFieldFormat[article, inbook, incollection, inproceedings]{title}{\mkbibemph{#1}}    
\DeclareFieldFormat{journaltitle}{\textquotedblleft #1\textquotedblright}                   % Journaltitle in double inverted commas
\DeclareFieldFormat[book, inbook, incollection, inproceedings]{volume}{#1}              % kills "vol."

\renewcommand*{\postnotedelim}{\addcolon\space}
\DeclareFieldFormat[article, incollection, inproceedings]{postnote}{\addcolon\space\mkpageprefix[pagination]{#1}}
\DeclareFieldFormat[article, incollection, inproceedings]{multipostnote}{\addcolon\space\mkpageprefix[pagination]{#1}}

\renewbibmacro*{byeditor+others}{%  Ed/Edd after Editor name 
 \ifnameundef{editor}
 {}
 {\printnames[byeditor]{editor}%
 \setunit{\addspace}%
 \usebibmacro{editor+othersstrg}%
 \clearname{editor}%
 \newunit}%
 \usebibmacro{byeditorx}%
 \usebibmacro{bytranslator+others}}

 \xpatchbibdriver{incollection}{%           Editore before title in incollection
  \usebibmacro{maintitle+booktitle}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
}%
  {%
  \usebibmacro{byeditor+others}%
  \setunit{\addcomma\space}\newblock
  \usebibmacro{maintitle+booktitle}%
  }%
  {}{}%


\makeatletter                           % All this shit just to kill a comma between Editor and (Ed.) 
\renewbibmacro*{bbx:editor}[1]{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\usebibmacro{bbx:dashcheck}
       {\bibnamedash}
       {\printnames{editor}%
%   \setunit{\addcomma\space}% DELETED
    \setunit{\addspace}% ADDED
    \usebibmacro{bbx:savehash}}%
%     \usebibmacro{#1}% DELETED
     {\usebibmacro{#1}}% ADDED
     \clearname{editor}}
    {\global\undef\bbx@lasthash}}
\makeatother

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\renewcommand*{\newunitpunct}{\addcomma\space}                              % Comma between units
 \xpatchbibmacro{name:andothers}{%                                              % et al. emphatic (xpatch needed)
  \bibstring{andothers}%
}{%
  \bibstring[\emph]{andothers}%
}{}{}
\renewcommand{\finalnamedelim}{\addcomma\space}                         % comma instead of AND between multiple authors
\renewbibmacro{in:}{\bibstring{in}\space}                                           % no colon after IN



\NewBibliographyString{ibidemloccit,ibidemnoloccit}     % Customising Idem e Ibidem e Ivi
\DefineBibliographyStrings{italian}{%
  idem           = {\textsc{id}},
  idemsm = {\textsc{id}},
  idemsf= {\textsc{id}},
  idemsn = {\textsc{id}},
  idempm = {\textsc{id}},
  idempf = {\textsc{id}},
  idempn = {\textsc{id}},
  idempp = {\textsc{id}},
  ibidemloccit   = {\mkbibemph{\autocap{i}bid\adddot}}, %  ibidem = {Ibid\adddot},
  ibidemnoloccit = {Ivi},
  opcit  = {cit\adddot},
  loccit = {loc\adddotspace cit\adddot},
}


\xpatchbibmacro{author}
  {\printnames{author}}
  {\iffootnote
     {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
       {\usebibmacro{cite:idem}}
       {\printnames{author}}}
     {\printnames{author}}}
  {}{}
\xpatchbibmacro{bbx:editor}
  {\printnames{editor}}
  {\iffootnote
     {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
        {\usebibmacro{cite:idem}}
        {\printnames{editor}}}
     {\printnames{editor}}}
  {}{}
\xpatchbibmacro{bbx:translator}
  {\printnames{translator}}
  {\iffootnote
     {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
        {\usebibmacro{cite:idem}}
        {\printnames{translator}}}
     {\printnames{translator}}}
  {}{}

\renewbibmacro*{cite:ibid}{%
  \printtext{%
    \bibhyperlink{cite\csuse{cbx@lastcite@\thefield{entrykey}}}{%
      \ifloccit
        {\bibstring[\mkibid]{ibidemloccit}%
         \global\toggletrue{cbx:loccit}}
        {\bibstring[\mkibid]{ibidemnoloccit}}}}}


\DefineBibliographyExtras{italian}{%            %% I always want the short dash
  \protected\def\bibrangedash{%
    -\penalty\hyphenpenalty}}


\DeclareFieldFormat[article, inbook, incollection, inproceedings]{citetitle}{\mkbibemph{#1}}        % Title emphatic in shorthands

  \renewbibmacro*{cite:title}{%                 "cit" in tondo              
  \printtext[bibhyperlink]{%
    \printfield[citetitle]{labeltitle}%
    \addcomma\setunit{\addspace}%               Comma before di cit.
    \bibstring{opcit}}}                   

   \DefineBibliographyStrings{italian}{opcit = {cit\adddot\nopunct}}        % no comma after cit. If it doesn't work see:
                                                % https://tex.stackexchange.com/questions/417733/custom-short-citations-biblatex-verbose/418206#418206



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 \renewbibmacro*{publisher+location+date}{%             First publisher, then location
  \printlist{publisher}%
  \iflistundef{location}
    {\setunit*{\addcomma\space}}
    {\setunit*{\addcomma\space}}%
  \printlist{location}%
  \setunit*{\space}%
  \usebibmacro{date}%
  \newunit}

\renewbibmacro*{series+number}{%                            
\iffieldundef{series}{}{%
  \printtext[parens]{\printfield{series}%\addcomma%
  \setunit*{\addspace}%
  \printfield{number}}}%
  \newunit}

\DeclareBibliographyDriver{book}{%                  %  pub+loc+year before ser+num
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{maintitle+title}%
    \newunit
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit
  \printfield{pagetotal}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\addsemicolon\space}\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \newunit\newblock 
  \usebibmacro{pageref}%
  \newblock\nopunct%            
    \usebibmacro{series+number}\addcomma%       Comma added by me. It works, but is this the right place?
  \newunit\newblock
  \usebibmacro{finentry}}



\addbibresource{archivio.bib}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\textit{Incollection:}\\
\cite[80]{Rae:Rap}\\

\textit{Book without author but with series}\\
\cite[55-56]{Hal:Sul}\\

\textit{Book}\\
\cite[55-56]{Lan:Rom}\\

\textit{Article with specific pagerange cited}\\
\cite[19-20]{Dan:Ind}\\

First cite\footcite[1]{Rae:Rap}, Same work, same page->ibidem\footcite[1]{Rae:Rap}, Same work, different page->ivi\footcite[3]{Rae:Rap} and same author, different work->idem\footcite[4]{Rae:His}

\end{document}

答案1

您可以通过滥用该选项来获取附注中页面的不同分隔符citepages=separate

我们不要重新定义\postnotedelim为冒号,我们不会干涉postnotemultipostnote格式,相反,我们只需要

\renewbibmacro*{cite:postnote:pages}{%
  \setunit{\addcolon\space}%
  \printfield{postnote}}

我还修改了其他一些内容,因此请仔细检查代码和输出。(警告!如果编译,MWEfilecontents将使用.bib与文件相同的基本名称并覆盖该文件.tex。请在单独的目录中进行测试,以确保这不会损坏您的生产环境。)我已删除您的评论并自己添加了评论以解释小的代码更改。

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@incollection{Rae:Rap,
    Author = {Gilbert Raes},
    Booktitle = {La S. Sindone. Ricerche e studi della commissione di esperti nominata dall'Arcivescovo di Torino},
    Editor = {P. Caramello},
    Pages = {79-83},
    Series = {Supplemento Rivista diocesana torinese},
    Title = {Rapport d'analyse},
    date = {1976-01}}% gennaio 1976 is not a valid year value. Use this (and dateabbrev=false) instead

@incollection{Rae:His,
    Address = {Paris},
    Author = {Gilbert Raes},
    Booktitle = {Prélèvement sur le linceul effectué le 21 avril 1988 et études du tissu},
    Pages = {71-74},
    Publisher = {\textsc{o.e.i.l.}},
    Title = {Historique de l'échantillon remis le 24 novembre 1973. Problème de la bande latérale. Fibres de coton dans l'échantillon remis au laboratoire d'Oxford},
    Year = {1990}}

@article{Dan:Ind,
    Author = {Avinoam Danin},
    Journal = {Il Telo},
    Pages = {12-21},
    Title = {Indicazioni floreali per l'origine geografica della Sindone di Torino},
    Volume = {II},
    Year = {2001}}

@book{Lan:Rom,
    Address = {Edinburgh},
    Author = {Bertrand Lancon AND Antonia Nevill},
    Publisher = {Edinburgh University Press},
    Title = {Rome in Late Antiquity: Everyday Life and Urban Change, \textsc{ad} 312-609},
    Year = {2000}}


@book{Hal:Sul,
    Address = {Vindobonae},
    Editor = {C. Halm},
    Langid = {german},
    Number = {1},
    Publisher = {C. Geroldi filium bibliopolam academiae},
    Series = {\textsc{csel}},
    Title = {Sulpici Severi libri qui supersunt},
    Year = {1866}}
\end{filecontents}

\documentclass[11pt, openany]{book}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{italian}
\setotherlanguages{latin, english, french}

\usepackage[]{csquotes}
\usepackage{xpatch}
\usepackage[style=verbose-trad2,
            language=auto,
            ibidpage=true,
            autolang=other,% use new option name
            useprefix=true,
            giveninits=true,
            indexing=cite,%
            citepages=separate,%
            dateabbrev=false,
            backend=biber,
        ]{biblatex}

\DeclareFieldFormat[article, inbook, incollection, inproceedings]{title}{\mkbibemph{#1}}
\DeclareFieldFormat{journaltitle}{\textquotedblleft #1\textquotedblright}
\DeclareFieldFormat[book, inbook, incollection, inproceedings]{volume}{#1}

% the colon/comma issues for pages together with citepages=separate
\renewbibmacro*{cite:postnote:pages}{%
  \setunit{\addcolon\space}%
  \printfield{postnote}}

\renewbibmacro*{byeditor+others}{%
 \ifnameundef{editor}
   {}
   {\printnames[byeditor]{editor}%
    \setunit{\addspace}%
    \usebibmacro{editor+othersstrg}%
    \clearname{editor}%
    \newunit}%
 \usebibmacro{byeditorx}%
 \usebibmacro{bytranslator+others}}

\xpatchbibdriver{incollection}{%
  \usebibmacro{maintitle+booktitle}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
}%
  {%
  \usebibmacro{byeditor+others}%
  \setunit{\addcomma\space}\newblock
  \usebibmacro{maintitle+booktitle}%
  }%
  {}{}%


% NEW
% All this shit just to kill a comma between Editor and (Ed.)
% nope, it's easier
\DeclareDelimFormat{editortypedelim}{\addspace}
% I assume you also have ?
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
% same for translator
\DeclareDelimFormat{translatortypedelim}{\addspace}
\DeclareFieldFormat{translatortype}{\mkbibparens{#1}}

\renewcommand*{\newunitpunct}{\addcomma\space}

\xpatchbibmacro{name:andothers}{%
  \bibstring{andothers}%
}{%
  \bibstring[\emph]{andothers}%
}{}{}

% NEW
\DeclareDelimAlias{finalnamedelim}{multinamedelim}% comma instead of AND between multiple authors

\renewbibmacro{in:}{\bibstring{in}\space}

\NewBibliographyString{ibidemloccit,ibidemnoloccit}
\DefineBibliographyStrings{italian}{%
  idem   = {\textsc{id}},
  idemsm = {\textsc{id}},
  idemsf = {\textsc{id}},
  idemsn = {\textsc{id}},
  idempm = {\textsc{id}},
  idempf = {\textsc{id}},
  idempn = {\textsc{id}},
  idempp = {\textsc{id}},
  ibidemloccit   = {\mkbibemph{\autocap{i}bid\adddot}},
  ibidemnoloccit = {Ivi},
  opcit  = {cit\adddot\nopunct},
  loccit = {loc\adddotspace cit\adddot},
}

\xpatchbibmacro{author}
  {\printnames{author}}
  {\iffootnote
     {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
       {\usebibmacro{cite:idem}}
       {\printnames{author}}}
     {\printnames{author}}}
  {}{}
\xpatchbibmacro{bbx:editor}
  {\printnames{editor}}
  {\iffootnote
     {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
        {\usebibmacro{cite:idem}}
        {\printnames{editor}}}
     {\printnames{editor}}}
  {}{}
\xpatchbibmacro{bbx:translator}
  {\printnames{translator}}
  {\iffootnote
     {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
        {\usebibmacro{cite:idem}}
        {\printnames{translator}}}
     {\printnames{translator}}}
  {}{}

\renewbibmacro*{cite:ibid}{%
  \printtext{%
    \bibhyperlink{cite\csuse{cbx@lastcite@\thefield{entrykey}}}{%
      \ifloccit
        {\bibstring[\mkibid]{ibidemloccit}%
         \global\toggletrue{cbx:loccit}}
        {\bibstring[\mkibid]{ibidemnoloccit}}}}}


\DefineBibliographyExtras{italian}{%
  \protected\def\bibrangedash{%
    -\penalty\hyphenpenalty}}


\DeclareFieldFormat[article, inbook, incollection, inproceedings]{citetitle}{\mkbibemph{#1}}

% I don't think you needed the redefinition of cite:title.

% slightly simplified
\renewbibmacro*{publisher+location+date}{%
  \printlist{publisher}%
  \setunit*{\addcomma\space}%
  \printlist{location}%
  \setunit*{\space}%
  \usebibmacro{date}%
  \newunit}

\renewbibmacro*{series+number}{%
  \iffieldundef{series}
    {}
    {\setunit{\addspace}%
     \printtext[parens]{%
       \printfield{series}%
       \setunit*{\addspace}%
       \printfield{number}}}%
  \newunit}


% modified
\DeclareBibliographyDriver{book}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{maintitle+title}%
    \newunit
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit
  \printfield{pagetotal}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}


\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}

\textit{Incollection:}\\
\cite[80]{Rae:Rap}\\

\textit{Book without author but with series}\\
\cite[55-56]{Hal:Sul}\\

\textit{Book}\\
\cite[55-56]{Lan:Rom}\\

\textit{Article with specific pagerange cited}\\
\cite[19-20]{Dan:Ind}\\

First cite\footcite[1]{Rae:Rap}, Same work, same page->ibidem\footcite[1]{Rae:Rap}, Same work, different page->ivi\footcite[3]{Rae:Rap} and same author, different work->idem\footcite[4]{Rae:His}

\footcite{westfahl:frontier}

\footcite{westfahl:space}

\footcite[1]{Rae:Rap}
\end{document}

在此处输入图片描述


如果需要同时为几种语言设置“idem”,

\newcommand*{\mklangidem}[1]{%
  \DefineBibliographyStrings{#1}{%
    idem   = {\textsc{id}},
    idemsm = {\textsc{id}},
    idemsf = {\textsc{id}},
    idemsn = {\textsc{id}},
    idempm = {\textsc{id}},
    idempf = {\textsc{id}},
    idempn = {\textsc{id}},
    idempp = {\textsc{id}},
    ibidemloccit   = {\mkbibemph{\autocap{i}bid\adddot}},
    ibidemnoloccit = {Ivi},
    opcit  = {cit\adddot\nopunct},
    loccit = {loc\adddotspace cit\adddot},
  }}

\forcsvlist{\mklangidem}{english,italian}

可能会派上用场。目前还没有覆盖所有语言的功能,不久前有一个功能请求,但细节尚未确定https://github.com/plk/biblatex/issues/560

相关内容