XeTeX 中的 BibLaTeX

XeTeX 中的 BibLaTeX

我目前正在从 pdfLaTeX 切换到 XeLaTeX,一切都进行得很顺利。不幸的是,我的 TeXmaker 上的 biber 似乎有问题。由于我所在大学的先决条件,我需要对参考书目进行相当大的更改:

\usepackage[nottoc,notlot,notlof]{tocbibind}
\usepackage[backend=biber,style=authoryear,sorting=nyt]{biblatex}
\addbibresource{Bibliography.bib}
\DefineBibliographyStrings{german}{references={Bibliographie}}
\DeclareFieldFormat{superedition}{\textsuperscript{#1}}
\DeclareNameAlias{sortname}{last-first}
\renewbibmacro*{date+extrayear}{%
  \iffieldundef{\thefield{datelabelsource}year}%
    {}{%
       \printtext[parens]{%
         \iffieldnum{edition}{\printfield[superedition]{edition}\global\clearfield{edition}}{}%
         \iffieldsequal{year}{\thefield{datelabelsource}year}%
           {\printdateextralabel}{\printfield{labelyear}\printfield{extrayear}}%
       }%
      }%
}
\renewcommand*{\bibpagespunct}{\addcomma\space}
\DeclareFieldFormat{pages}{#1}
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\renewbibmacro*{byeditor+others}{%
  \ifnameundef{editor}
   {}{%
      \printnames[byeditor]{editor}%
      \setunit{\addspace}%
      \usebibmacro{byeditor+othersstrg}%
      \clearname{editor}\newunit%
   }%
   \usebibmacro{byeditorx}%
   \usebibmacro{bytranslator+others}%
}
\renewbibmacro*{byeditor+othersstrg}{\usebibmacro{editor+othersstrg}}
\renewbibmacro*{bytranslator+othersstrg}{\usebibmacro{translator+othersstrg}}
\renewbibmacro*{bytypestrg}[2]{%
  \iffieldundef{#1type}{\bibstring{#2}}{%
    \ifbibxstring{\thefield{#1type}}%
      {\bibstring{\thefield{#1type}}}{\printtext{\thefield{#1type}}}%
  }%
}
\renewcommand*{\multinamedelim}{/}
\renewcommand*{\finalnamedelim}{/}
\renewcommand*{\postnotedelim}{\addcolon\space}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}

@Book{coseriu1992,
  Title                    = {Einführung in die Allgemeine Sprachwissenschaft \textup{(Uni-Taschenbücher 1372)}},
  Author                   = {Coseriu, Eugenio},
  Location                 = {Tübingen},
  Publisher                = {Francke},
  Year                     = {1992},
  Edition                  = {2},
}

\begin{document}
\tableofcontents
\newpage

Blub\parencite[cf.][9]{coseriu1992}
\newpage

\printbibliography[heading=bibintoc]
\end{document}

它仍然应该产生与通过 pdfLaTeX 相同的输出,但我得到的只是这个错误消息:

这是 BibTeX,版本 0.99d(TeX Live 2017/TeX Live for SUSE Linux) 顶级辅助文件:KonSysRum.aux 在读取文件 KonSysRum.aux 时,我没有找到 \citation 命令 在读取文件 KonSysRum.aux 时,我没有找到 \bibdata 命令 在读取文件 KonSysRum.aux 时,我没有找到 \bibstyle 命令

我已经尝试将 {ngerman} 更改为 {german},因为我认为 {ngerman} 是 babel 的一部分,我将引用方式从大部分 \parencite* 更改为仅 \cite,并且删除了 .aux 文件,但没有任何变化。我的 .aux 文件确实不包含错误消息中的三个命令...

答案1

我之前回答的代码BibLaTeX:版本作为年份前的上标,但年份在作者之后需要更新以适应较新版本的biblatex

需要\renewbibmacro*{date+extradate}

\renewbibmacro*{date+extradate}{%
  \iffieldundef{labelyear}
    {}
    {\printtext[parens]{%
       \iflabeldateisdate
         {\iffieldnum{edition}
            {\printfield[superedition]{edition}%
             \global\clearfield{edition}}
            {}%
          \printdateextra}
         {\printlabeldateextra}}}}

现在。

平均能量损失

\documentclass[a4paper,12pt,numbers=endperiod]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=authoryear]{biblatex}

\addbibresource{biblatex-examples.bib}

\DefineBibliographyStrings{ngerman}{references={Bibliographie}}

\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\renewbibmacro*{byeditor+others}{%
  \ifnameundef{editor}
    {}
    {\printnames[byeditor]{editor}%
     \setunit{\addspace}%
     \usebibmacro{byeditor+othersstrg}%
     \clearname{editor}%
     \newunit}%
  \usebibmacro{byeditorx}%
  \usebibmacro{bytranslator+others}}
\renewbibmacro*{byeditor+othersstrg}{\usebibmacro{editor+othersstrg}}
\renewbibmacro*{bytranslator+othersstrg}{\usebibmacro{translator+othersstrg}}
\renewbibmacro*{bytypestrg}[2]{%
  \iffieldundef{#1type}
    {\bibstring{#2}}
    {\ifbibxstring{\thefield{#1type}}
       {\bibstring{\thefield{#1type}}}
       {\printtext{\thefield{#1type}}}}}

\DeclareDelimFormat{multinamedelim}{/}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}

\DeclareDelimFormat[bib,biblist]{nametitledelim}{\addcolon\space}
\renewcommand*{\postnotedelim}{\addcolon\space}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}

\DeclareFieldFormat{superedition}{\textsuperscript{#1}}

\renewbibmacro*{date+extradate}{%
  \iffieldundef{labelyear}
    {}
    {\printtext[parens]{%
       \iflabeldateisdate
         {\iffieldnum{edition}
            {\printfield[superedition]{edition}%
             \global\clearfield{edition}}
            {}%
          \printdateextra}
         {\printlabeldateextra}}}}

\renewcommand*{\bibpagespunct}{\addcolon\space}
\DeclareFieldFormat{pages}{#1}

\DeclareNameAlias{sortname}{family-given}

\begin{document}
\nocite{sigfridsson,companion,cotton,iliad,malinowski,
        gaonkar:in,westfahl:space,pines,brandt,hyman,kant:kpv}
\printbibliography
\end{document}

MWE 的参考书目部分

此答案已更新,以反映 的新版本中的变化biblatex。如果您使用的是旧版本且无法更新,请参阅编辑历史记录。

相关内容