1

In my document there are double quote characters ("). Instead to typeset exactly " (in Latex \textquotedbl) I obtain right double quote character (in Latex '' or \textquotedblright). Why does LaTex typeset

"Blablabla"

as “Blablabla” instead of "Blablabla"?

When I want “Blablabla” I type ``Blablabla'', so why does " become ?

I'm using LuaLatex and fontspec.

1

fontspec applies by default Ligatures=TeX to the fonts defined for \rmfamily and \sffamily. These ligatures are supposed to reproduce the standard LaTeX settings.

You can disable it, but you'll lose all of them. Note that you have to declare a main font, because the default one is preloaded with Ligatures=TeX set.

\documentclass{article}
\usepackage{fontspec}

\defaultfontfeatures[\rmfamily,\sffamily]{}

\setmainfont{Latin Modern Roman}

\begin{document}

"blabla"

``blabla''

“blabla”

\end{document}

enter image description here

| improve this answer | |
  • Many thanks. Now I know that the problem is concerning ligatures. Fortunately the problem is for \ttfamily, thus I can activate TeX legatures for all excluding \tt text only. – Bruno Guizzon Nov 29 '17 at 11:20
0

Use the character code for the desired character.

I use LuaLaTeX (which understands Unicode). The straight double quote is at hex character code 22. So, ^^^^0022 places it. I can do something similar for straight apostrophe: ^^^^0027. These placed characters will not be affected by TeX ligatures.

In pdflatex, which does not understand Unicode, there is a similar method. But pre-Unicode is so old, I forgot it.

Also: Some TeX editors (including TeXWorks) may automatically make character substitutions, right there in the editor as you type. Beware!

You can try locally disabling ligatures using fontspec:

In Preamble (note that the braces are doubled):

\newcommand\nolig[1]{{\addfontfeature{Ligatures=ResetAll}#1}}

In document:

\nolig{text without ligatures '' and so forth}
| improve this answer | |
  • Many thaks for your solutions. They are good, but the text is already typed by Authors and the search/replace is too long for all the text (it is a book of 1000 pages). – Bruno Guizzon Nov 29 '17 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.