# Fontspec, Sweave and MacTeX 2016: Font shape undefined

When I compile the following MWE with xelatex, compilation goes fine but I get this warning message: Font shape T1/TimesNewRoman(0)/m/n undefined(Font) using T1/cmr/m/n instead. The problem appeared after updating to MacTeX 2016 (the problem shows from terminal, from TeXshop and from TeXstudio 2.11.0), and it doesn't show up if I comment out the Sweave package.

MWE:

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Times New Roman}

\usepackage{Sweave}

\begin{document}

ciao̥ʃ

\end{document}
• sweave must be forcing T1 encoding, a bad idea for xetex, can you not swap the order and load sweave first? – David Carlisle Aug 4 '16 at 16:25
• if your sweave.sty is svn.r-project.org/R/trunk/share/texmf/tex/latex/Sweave.sty then it looks like you want the [noae] option to stop it loading fontenc. – David Carlisle Aug 4 '16 at 16:30
• @DavidCarlisle It's a bad idea also to load ae, by the way. – egreg Aug 4 '16 at 16:37
• using the option or switching the order fixed it, if you put it as an answer I'll mark it as accepted! – Stefano Aug 4 '16 at 21:39