[Tex/LaTex] How to input normal quotes in LyX

lyxpunctuation

For example, if I type "this" into LyX file, the output PDF will show “this”, the quotes change to a set of curly quotes. But I want it looks like "this".

Especially in LyX, there are six quotes styles:

  • “this”
  • ”this”
  • „this“
  • „this”
  • «this»
  • »this«

But none of them is the normal type, "this".

Moreover, if I paste the quotes, “”, into another TeX file, the output characters may become garbled code, e.g., âĂIJâĂİ.

It really puzzled me.

How can I obtain the quotes as " when input "?

Thanks very much!

P.S.
Add a statement by @JimOldfieldJi about the difference between this question and How to get straight quotation marks? :

Reason why not a duplicate: LyX escapes characters / turns them into
commands automatically e.g. typing – will output \textendash{} in the
LaTeX. So this question is not about which command to use, but just
how to enter a literal plain old quote character into LyX.

Best Answer

(Copied here from my comments, with some additions.)

LyX automatically escapes things before passing them to LaTeX. For example, – is replaced by \textendash, $ is replaced by \$, and indeed " is replaced by \textquotedbl. LyX also takes care of which packages to load and encoding to use (but isn't perfect). So the concern here is not which macro to use but just how to enter a straight quote " without LyX automatically converting it into open and close quotes “”.

There are several ways to do this:

  • The simplest is to type " into any text editor (e.g. Notepad in Windows) and copy it from there and paste into LyX. Once you've done that once you can copy it straight from LyX and paste into another part of the document.
  • Depending on your operating system, you can use the system for entering Unicode characters. On Windows this means holding the Alt key and typing the digits 034 on the numeric keypad.
  • If you need this a lot you can set up a keyboard shortcut. You can do this in the preference dialogue box under the shortcuts page, and in the add shortcut dialogue box type this function: unicode-insert 0x0022

Addendum (possibly the answer to the question you should have asked): You mentioned that copying from LyX and pasting to a LaTeX editor sometimes gives garbled output. But as I already said, the text in LyX is not LaTeX. It just shows $ instead of \$, " instead of \textquotedbl etc, and this is what is copied to the clipboard too. (Math is copied as LaTeX, but this is really the exception.) If you want to get LaTeX out of LyX, export a LaTeX file (in the file menu) or open the LaTeX source pane (using the view menu) and copy from there. Then copying even “proper quotes” will give you valid LaTeX.