# XeLaTex to PDF rendering ampersands incorrectly (Windows 10 / MikTex / TexMaker)

I'm new to Latex and related topics but I'm learning quickly and really loving it.

I'm taking a crack at adapting my CV to Dario Taraborelli's cvtex template for XeTex, and while I've gotten it to render (and quite beautifully, I should add - cheers to DT), it's behaving a unusually with regard to things like ampersands. Typing \& renders the character Ș, which I'd prefer not to have.

I'm using TexMaker and MikTex in Windows 10 to do all this, and within TexMaker I have this setup for compiling/rendering:

Because I'm such a novice, I'll also tell you that what I'm doing is first clicking the arrow on the left, waiting for it to finish without errors, and then clicking the arrow on the right to see my pdf.

Here's some hopefully reproducible code for you, much of which is untouched material from the original cvtex template:

\documentclass[10pt]{article}
\usepackage{fontspec}

\usepackage{geometry}
\geometry{letterpaper, textwidth=5.5in, textheight=8.5in, marginparsep=7pt, marginparwidth=.6in}
\setlength\parindent{0in}

\usepackage[usenames,dvipsnames]{color}
\usepackage{xunicode}
\usepackage{xltxtra}
\defaultfontfeatures{Mapping=tex-text}

\chardef\&="E050
\newcommand{\html}[1]{\href{#1}{\scriptsize\textsc{[html]}}}
\newcommand{\pdf}[1]{\href{#1}{\scriptsize\textsc{[pdf]}}}
\newcommand{\doi}[1]{\href{#1}{\scriptsize\textsc{[doi]}}}

\usepackage{marginnote}
\newcommand{\amper{}}{\chardef\amper="E0BD }
\newcommand{\years}[1]{\marginnote{\scriptsize #1}}
\renewcommand*{\raggedleftmarginnote}{}
\setlength{\marginparsep}{7pt}
\reversemarginpar

\usepackage{sectsty}
\usepackage[normalem]{ulem}
\sectionfont{\mdseries\upshape\Large}
\subsectionfont{\mdseries\scshape\normalsize}
\subsubsectionfont{\mdseries\upshape\large}

pdftitle={Albert Einstein - vita},
pdfauthor={My name},
pdfproducer={http://nitens.org/taraborelli/cvtex}
]{hyperref}
\hypersetup{linkcolor=blue,citecolor=blue,filecolor=black,urlcolor=MidnightBlue} 
\begin{document}
\end{document}

Any idea what could be happening here? (I've done a pretty thorough check of previous se/tex posts for anything similar, but I couldn't find anything. If I've missed something obvious, I apologize.)

• Welcome to TeX.SX! Try removing \chardef\&="E050 from the preamble. – Ruixi Zhang Jan 31 at 21:04
• YOU LEGEND! YOU MYTH! That worked! I can't thank you enough, Ruixi Zhang! You want to move that over to an answer, or shall I do so myself? – logjammin Jan 31 at 21:07
• And remove also xunicode and xltxtra. – Ulrike Fischer Jan 31 at 21:10
• @UlrikeFischer oh interesting! Why, exactly? What are those things doing? (No need to respond if too time-consuming, happy to poke around myself!) – logjammin Jan 31 at 21:13
• they were needed in the past, but nowadays the stuff is in the latex kernel and in fontspec. – Ulrike Fischer Jan 31 at 21:15

According to http://nitens.org/taraborelli/cvtex and https://github.com/dartar/cvtex, the cvtex “template” has not been updated for more than 8 years (and judging by this issue I’d argue that it has not been maintained for over 6 years). During this period, fontspec no longer depended on xunicode and the alike. So you may safely remove those from the preamble as @UlrikeFischer commented.