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:
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.