1

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}
\usepackage[hidelinks]{hyperref}
\hypersetup{
  colorlinks,
  citecolor=black,
  filecolor=black,
  linkcolor=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}
8

1 Answer 1

2

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}

enter image description here

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .