# How do I change all curly single and double quote marks to basic ascii ' and " quotes?

I noticed XeLaTeX uses different unicode such as the SINGLE RIGHT QUOTATION MARK (and related others), and for hyphens too. How can I get it to just use ' and " and - regular ascii marks like you use for programming, so (a) when you copy-paste the stuff from the PDF it doesn't use the special unicode characters for quotations/hyphens, and (b) I don't have to write \regularsinglequote or something like that for every quote I want to use, I can just write a sentence "hello world, I don't use unicode quotes-or-hyphens" and it uses the plain ascii versions of quotes/hyphens.

The document I'm using is basically this:

\documentclass[a4paper]{book}

\renewcommand{\contentsname}{Contents}

\usepackage{fontspec}
\usepackage{fullpage}
\usepackage{geometry}
\usepackage{sectsty}
\hypersetup{
citecolor=black,
filecolor=black,
urlcolor=black
}
\setmainfont{MyMonospaceFont}
\newlength{\characterwidth}
\settowidth{\characterwidth}{\normalfont x}
\geometry{margin=0.7in,textwidth=96\characterwidth,lines=48}
\AtBeginDocument{\raggedright\setlength{\parindent}{3\characterwidth}}
\frenchspacing
\begin{document}
\title{xyz}
\maketitle
\tableofcontents

\chapter{Foo}
\section*{A}
hello world
\section*{B}
\section*{C}
\chapter{Bar}
\end{document}

• Show a small complete example that can be used for tests. – Ulrike Fischer Aug 21 '19 at 11:54
• Disable Ligatures=TeX for your monospaced font – egreg Aug 21 '19 at 14:03
• How to do that? \DisableLigatures{encoding = *, family = *} – Lance Pollard Aug 21 '19 at 14:12
• You just asked for the font that I was using, it's not a publicly available font... – Lance Pollard Aug 21 '19 at 14:50

You can suppress the replacement of the quotes and dashes with the option [Ligatures=TeXReset]:

\documentclass[a4paper]{book}

\usepackage{fontspec}

\setmainfont{TeX Gyre Heros}[Ligatures=TeXReset]

\begin{document}
"abc--cde 'quote' text"
\end{document}


• I get LaTeX error: "kernel/key-choice-unknown" ! Key 'fontspec/Ligatures' accepts only a fixed set of choices. – Lance Pollard Aug 21 '19 at 14:52
• then either update your texsystem or check the fontspec documentation or the code for the name your version used. – Ulrike Fischer Aug 21 '19 at 14:55