# Conflicts between usepackage {inputenc} and {fontenc} by BibLateX

In previous questions (see Special character \oe and BiblateX with XeLateX andProblem of compilation with XelateX (Package soul error), I presented my problem related to the taking into account of the special character \oe by BibLateX in a Tufte-book documentclass. Actually, I just found the root of the problem, but don't know how to fix it: the problem is solved when I delete the \usepackage[T1]{fontenc}, which conflics with \usepackage[utf8,french,latin9]{inputenc}.Unfortunately, I need to keep the inputenc package for formatting special characters for other functions (TikZ for example). How to modify the code so that BibLateX alone uses \usepackage[T1]{fontenc}?

This is my code:

\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

\usepackage{csquotes}
\usepackage[backend=biber, style=authoryear-icomp]{biblatex}
\makeatletter
\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}}}
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
{}
{\usebibmacro{cite:postnote}}
\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}
\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}

• with xelatex you should neither use inputenc nor [T1]fontenc, and using inputenc with three options is senseless. Jul 22, 2020 at 12:04
• Oops, there was one extra line of code... @UlrikeFischer Even if I understand your comment, the result is different with and without these lines of code ... Jul 22, 2020 at 12:09
• Sure the result is different. T1-fontenc does harm with xelatex. Remove the lines, and if you still have problems, ask again how to correctly solve them. Jul 22, 2020 at 12:14
• Seeing your old question: you have been already told not to use \usepackage{fbb} with xelatex. Remove this too. Jul 22, 2020 at 12:41
• @UlrikeFischer: Yes it works, problem solved without the lines you indicate. One last question: the font of the main text has been changed and I preferred the old one. How do I know which font was in use and how do I restore it? Thank you ! Jul 22, 2020 at 12:52

The problem is solved with the following modifications:

\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

\usepackage{csquotes}
\usepackage[backend=biber, style=authoryear-icomp]{biblatex}
\makeatletter
\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}}}
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
{}
{\usebibmacro{cite:postnote}}
{\setunit{\multicitedelim}}
\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}
\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}

• If you wanted to keep the fbb font, you could have replaced \usepackage{fbb} with \setmainfont{fbb} (as indeed you did in tex.stackexchange.com/q/548738/35864). In any case inputenc and fontenc should definitely not be used with XeLaTeX (tex.stackexchange.com/q/2984/35864, tex.stackexchange.com/q/470976/35864) and \usepackage{fbb} is also not compatible with XeTeX/LuaTeX because it loads fontenc with the T1 option. Jul 22, 2020 at 15:04
• That all said, if you use XeLaTeX it is much nicer to give the Unicode characters directly instead of their ASCII-macro version. I.e. Jean-Sébastien Bach instead of Jean-S\'{e}bastien Bach and siècles instead of si{e}cles. Jul 22, 2020 at 15:05