\’e to represent é causing error (utf8x and undefined control sequence error)

compilation errorlettersundefined

I am writing and using \'e to represent é as in Lévy.

This method is giving me a few error messages (including the utf8x Error) using overleaf as I have shown below. Is there perhaps a package that I need to import to get this to work?

I have added a minimum working example with my current packages below the image.

enter image description here

minimum example

\documentclass[12pt,oneside,openany,a4paper,afrikaans,english,masters-t,goldenblock]{usthesis}

%% Language and font encodings
\usepackage[afrikaans, english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}

%%%%%%%%%%%%%%%%%%%%%%% Packages %%%%%%%%%%%%%%%%%%%%%%%
\usepackage{graphicx}
\usepackage{svg} % To be able to add SVG images
\usepackage{usbib}
\bibliographystyle{unsrt}
\setcitestyle{square}
\bibpunct{[}{]}{,}{n}{,}{,}
\usepackage{caption}
\usepackage{subcaption}

%%%%%%%%%%%%%%%%%%%%%%% Sets page size and margins %%%%%%%%%%%%%%%%%%%%%%%
\usepackage{geometry}
\geometry{a4paper,  total={210.2mm,297.3mm}, left=25mm, right = 25mm, top=26.3mm, bottom=43.8mm }

\begin{document}


% error generater here
In text : \’e

\bibliography{sample} % no need for bibliography

\end{document}
  • I have tried adding \usepackage{fontspec}, but this made the pdf crash.

Best Answer

The code for é is \'e with a straight ascii quotation mark/apostrophe.

You're using \’e which is non-ascii "smart" punctuation. ' and are not the same.

If you have something on your computer that is trying to "help" you by changing what you type into "smart quotes", turn it off.

An alternative is to use é itself.

This isn't the cause of your problem, but you might consider switching away from the utf8x option to inputenc to utf8 for reasons given here, if it's at all possible.

If you want to use fontspec, you need to compile with XeLaTeX or LuaLaTeX (and remove \usepackage[T1]{fontenc}).

Related Question