如何自定义(一分为二)?同上

如何自定义(一分为二)?同上

好吧,伙计们,这是一个非常棘手的问题,所以我不需要专家,而是需要超级英雄。我需要定制我的 idem/ibidem 以匹配这些可能性:

  • 相同的 bibentry,相同的页面 ->同上。[不打印页码]
  • 相同的 bibentry,不同的页面 -> Ivi,页码
  • 同一作者,不同作品 -> ID。以及以下内容

我几乎到达那里,但我的 MWE 的脚注 2 应该是:2。同上。

也许我应该引入一个新命令,它基本上是:如果有同上内容引用同一页,则打印同上。并删除页码。问题是我不知道如何向 LaTeX 先生解释这一点。

我将非常感谢任何关于这个地狱问题的帮助

梅威瑟:

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

\begin{filecontents}{archivio.bib}

@article{Ben:Mat,
    Author = {Lise {Bender Jørgensen}},
    Journal = {Antiquité Tardive},
    Pages = {87-99},
    Title = {A Matter of Material: Changes in Textiles from Roman Sites in Egypt's Eastern Desert},
    Volume = {11},
    Year = {2004}}

@book{Jor:For,
    Address = {København},
    Author = {Lise {Bender Jørgensen}},
    Publisher = {Nordiske Fortidsminder},
    Title = {Forhistoriske textiler i Skandinavien},
    Year = {1986}}

\end{filecontents}

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

%%% bibliografia
\usepackage[babel,italian=guillemets]{csquotes}
\usepackage{xpatch}     
\usepackage[    style=verbose-trad2,            
            language=italian,
            useprefix=true,                 
            firstinits=true,    
            citepages=omit,                 
            backend=biber,  
        ]{biblatex} 

\DefineBibliographyStrings{italian}{%                           Customizza Idem
  idem   = {\textsc{id}},
  ibidem = {Ivi},
}

%Idem appears on the second occurrence of the author name
\xpatchbibmacro{author}{\printnames{author}}{\iffootnote{\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}{\usebibmacro{cite:idem}}{\printnames{author}}}{\printnames{author}}}{}{}
\xpatchbibmacro{editor}{\printnames{editor}}{\iffootnote{\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}{\usebibmacro{cite:idem}}{\printnames{editor}}}{\printnames{editor}}}{}{}
\xpatchbibmacro{translator}{\printnames{translator}}{\iffootnote{\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}{\usebibmacro{cite:idem}}{\printnames{translator}}}{\printnames{translator}}}{}{}


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

\begin{document}

First citation\footcite[88]{Ben:Mat}\\
I'citing the same page I need an \textit{ibidem}\footcite[88]{Ben:Mat} and no page number printed \\
Now I'm citing a different page, so I need \textit{Ivi}\footcite[87]{Ben:Mat}. \\
Here I'm citing just the same author, and I'd need \textsc{id.}\footcite{Jor:For}

\printbibliography

\end{document}

答案1

ibidpage选项几乎可以做到这一点。我们只需要定义两个新字符串并使用它们。您还需要为 idem 修补略有不同的宏。

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Ben:Mat,
  Author = {Bender Jørgensen, Lise},
  Journal = {Antiquité Tardive},
  Pages = {87-99},
  Title = {A Matter of Material: Changes in Textiles from Roman Sites in Egypt's Eastern Desert},
  Volume = {11},
  Year = {2004},
}

@book{Jor:For,
  Address = {København},
  Author = {Bender Jørgensen, Lise},
  Publisher = {Nordiske Fortidsminder},
  Title = {Forhistoriske textiler i Skandinavien},
  Year = {1986},
}
\end{filecontents}

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

\usepackage[autostyle,italian=guillemets]{csquotes}
\usepackage{xpatch}     
\usepackage[style=verbose-trad2,            
            language=italian,
            useprefix=true,                 
            giveninits=true,    
            citepages=omit,                 
            backend=biber,  
            ibidpage=true,
        ]{biblatex} 

\NewBibliographyString{ibidemloccit,ibidemnoloccit}
\DefineBibliographyStrings{italian}{%
  idem           = {\textsc{id}},
  ibidemloccit   = {\mkbibemph{\autocap{i}bid\adddot}},
  ibidemnoloccit = {Ivi},
}

\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}}}}}

\addbibresource{\jobname.bib}
\begin{document}
First citation\footcite[88]{Ben:Mat}\\
I'm citing the same page I need an \textit{ibidem}\footcite[88]{Ben:Mat} and no page number printed \\
Now I'm citing a different page, so I need \textit{Ivi}\footcite[87]{Ben:Mat}. \\
Here I'm citing just the same author, and I'd need \textsc{id.}\footcite{Jor:For}

\printbibliography
\end{document}

在此处输入图片描述

相关内容