# Asymmetric quoting in LyX

In LyX, when I enter quoted text, the generated LaTeX source has uses different quotes for left and right:  for the former and '' for the latter so that

"Ugly quotes"


produces

Ugly quotes''


which (for some fonts and engines) produces corresponding (unacceptable) output for the left quotes.

Is there a way to prevent this? Are there packages that I can use to "repair" the left quotes?

[OS X 10.7.3; LyX 2.0.3]

-
What unacceptable output do you get? –  Ben Alpert Mar 11 '12 at 22:53
If you're using XeLaTeX, you need to teach LyX to add the Ligatures=TeX option to the font definition with \fontspec or \setmainfont (or the other similar commands). –  egreg Mar 11 '12 at 22:56
@egreg: Cool. That fixes the immediate problem (though it's still odd that they're there in the source). –  raxacoricofallapatorius Mar 11 '12 at 23:06
It's by no means odd: opening quotes should be different from closing ones. Inputting both as " requires some kind of intervention. You can input them as “ and ” –  egreg Mar 11 '12 at 23:11
@ereg: That's what they look like as displayed by LyX, but the code changes them as above. In any case, It looks like your comments are my answer. –  raxacoricofallapatorius Mar 11 '12 at 23:37

A convenient way to input quotes is to write

"text"


but, of course, the quotes must be rendered differently. The traditional TeX way is to input quotes as

text''


and it seems that "smart quotes" in LyX does this translation. However this will produce by default the correct and expected result in case XeLaTeX is used for typesetting with system font different from the default Latin Modern.

There are two way out:

1. Teach LyX to add the option Ligatures=TeX when the document fonts are chosen with \setmainfont or similar commands

\setmainfont[Ligatures=TeX]{Linux Libertine O}

2. Input quotes with the proper Unicode characters

“text”

-
That works. It would be nice if there were a LyX setting to generate unicode quotes. –  raxacoricofallapatorius Mar 12 '12 at 0:39

You can set the quote style in LyX for each document. Just go to Document Settings > Language > Quote Style

See 3.9.3.2 Quotes in the User Guide (Help > User Guide)

-
I can't get that to have any effect. –  raxacoricofallapatorius Mar 12 '12 at 0:35