BibLateX 的 usepackage {inputenc} 和 {fontenc} 之间存在冲突

BibLateX 的 usepackage {inputenc} 和 {fontenc} 之间存在冲突

在之前的问题中(见特殊字符 \oe 和 BiblateX 与 XeLateXXelateX 编译问题(Package soul 错误),我介绍了与 BibLateX 在 Tufte-book 文档类中考虑特殊字符 \oe 相关的问题。实际上,我刚刚找到了问题的根源,但不知道如何解决它:当我删除与 \usepackage[utf8,french,latin9]{inputenc} 冲突的 \usepackage[T1]{fontenc} 时,问题就解决了。不幸的是,我需要保留 inputenc 包来为其他函数(例如 TikZ)格式化特殊字符。如何修改代码以便 BibLateX 单独使用 \usepackage[T1]{fontenc}?

这是我的代码:

\documentclass[nobib,twoside,symmetric,justified,marginals=raggedouter]{tufte-book}

\usepackage{fontspec}
\usepackage{fbb}

\usepackage[utf8,french,latin9]{inputenc}% Required for including letters with accents
\usepackage[T1]{fontenc}% Use 8-bit encoding that has 256 glyphs
\usepackage[french]{babel}%.................. Language setup
\addto\captionsfrench{\def\tablename{Tableau}}
\addto\captionsfrench{\def\figurename{Figure}}

\usepackage{csquotes}
\usepackage[backend=biber, style=authoryear-icomp]{biblatex}
\makeatletter
\newbibmacro*{adtcite}{%
  \iffieldundef{shorthand}
    {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
       {\usebibmacro{cite:ibid}}
       {\iffieldequals{namehash}{\cbx@lasthash}
          {\setunit{\compcitedelim}}
          {\printnames{labelname}%
           \setunit*{\printdelim{nameyeardelim}}%
           \printlabeldateextra
           \setunit*{\printdelim{nametitledelim}}%
           \savefield{namehash}{\cbx@lasthash}}%
        \usebibmacro{cite:title}}}%
    {\usebibmacro{cite:shorthand}%
     \usebibmacro{cite:reinit}}%
  \setunit{\multicitedelim}}
\makeatother
\newbibmacro*{cite:title}{%
  \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}
\DeclareCiteCommand{\fadtcite}[\mkbibfootnote]
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{adtcite}}
  {}
  {\usebibmacro{cite:postnote}}
\DeclareMultiCiteCommand{\fadtcites}[\mkbibfootnote]{\fadtcite}{\setunit{\multicitedelim}}
\DeclareAutoCiteCommand{fadt}{\fadtcite}{\fadtcites}
\ExecuteBibliographyOptions{autocite=fadt}
\usepackage{mdframed}
\newmdenv[skipabove=3.5ex plus 1ex minus .2ex,% Equal to section title spacing
  innerleftmargin=0pt,innerrightmargin=0pt,%
  innerbottommargin=0pt,innertopmargin=0pt,linewidth=0pt,innermargin=0pt,%
  outermargin=\dimexpr-\marginparwidth-\marginparsep\relax]{mdfullwidth}
\defbibenvironment{bibliography}
  {\list{}{\parsep\bibparsep}}
  {\endlist}
  {\item}
\AtEveryBibitem{\hskip-\bibhang}
\begin{filecontents}{\jobname.bib}
@BOOK{Buchet,
  author    = {Buchet, Edmond},
  title     = {Jean-S\'{e}bastien Bach. L'\oe uvre et la vie.
               Deux si\`{e}cles d'\'{e}tudes et de t\'{e}moignages},
  year      = {1963},
  publisher = {\'{E}ditions Les Libraires Associ\'{e}s},
  place     = {Saverne},
  pagetotal = {267},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\PassOptionsToPackage{hyphens}{url}

\begin{document}
\frenchspacing
\newthought{How to fix} the problem with "\oe uvre"\autocite[42]{Buchet}?

\begin{fullwidth}
\bibhang=0pt
\printbibliography
\end{fullwidth}
\end{document}

答案1

通过以下修改可以解决该问题:

\documentclass[nobib,twoside,symmetric,justified,marginals=raggedouter]{tufte-book}

\usepackage{fontspec}
%\usepackage{fbb} <= DELETED

%\usepackage[utf8,french,latin9]{inputenc}% <= DELETED
%\usepackage[T1]{fontenc}% <= DELETED
\usepackage[french]{babel}%.................. Language setup
\addto\captionsfrench{\def\tablename{Tableau}}
\addto\captionsfrench{\def\figurename{Figure}}

\usepackage{csquotes}
\usepackage[backend=biber, style=authoryear-icomp]{biblatex}
\makeatletter
\newbibmacro*{adtcite}{%
  \iffieldundef{shorthand}
    {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
       {\usebibmacro{cite:ibid}}
       {\iffieldequals{namehash}{\cbx@lasthash}
          {\setunit{\compcitedelim}}
          {\printnames{labelname}%
           \setunit*{\printdelim{nameyeardelim}}%
           \printlabeldateextra
           \setunit*{\printdelim{nametitledelim}}%
           \savefield{namehash}{\cbx@lasthash}}%
        \usebibmacro{cite:title}}}%
    {\usebibmacro{cite:shorthand}%
     \usebibmacro{cite:reinit}}%
  \setunit{\multicitedelim}}
\makeatother
\newbibmacro*{cite:title}{%
  \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}
\DeclareCiteCommand{\fadtcite}[\mkbibfootnote]
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{adtcite}}
  {}
  {\usebibmacro{cite:postnote}}
\DeclareMultiCiteCommand{\fadtcites}[\mkbibfootnote]{\fadtcite} 
   {\setunit{\multicitedelim}}
    \DeclareAutoCiteCommand{fadt}{\fadtcite}{\fadtcites}
    \ExecuteBibliographyOptions{autocite=fadt}
    \usepackage{mdframed}
    \newmdenv[skipabove=3.5ex plus 1ex minus .2ex,% Equal to section title spacing
      innerleftmargin=0pt,innerrightmargin=0pt,%
      innerbottommargin=0pt,innertopmargin=0pt,linewidth=0pt,innermargin=0pt,%
      outermargin=\dimexpr-\marginparwidth-\marginparsep\relax]{mdfullwidth}
    \defbibenvironment{bibliography}
  {\list{}{\parsep\bibparsep}}
  {\endlist}
  {\item}
\AtEveryBibitem{\hskip-\bibhang}
\begin{filecontents}{\jobname.bib}
@BOOK{Buchet,
  author    = {Buchet, Edmond},
  title     = {Jean-Sébastien Bach. L'\oe uvre et la vie.
               Deux siècles d'études et de témoignages},
  year      = {1963},
  publisher = {\'{E}ditions Les Libraires Associés},
  place     = {Saverne},
  pagetotal = {267},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\PassOptionsToPackage{hyphens}{url}

\begin{document}
\frenchspacing
\newthought{How to fix} the problem with "\oe uvre"\autocite[42]{Buchet}?

\begin{fullwidth}
\bibhang=0pt
\printbibliography
\end{fullwidth}
\end{document}

相关内容