[R] Sweave documents have corrupted double quotes

Marc Schwartz marc_schwartz at comcast.net
Fri Jan 16 19:16:05 CET 2009


on 01/16/2009 11:34 AM David Winsemius wrote:
> Looking at the display I see this line:
> 
> \texttt{Typewriter Font has ``double quotes''}
> 
> ... displayed with leading <backquotes> but trailing <singlequotes>. Was
> that intended?

David,

That is correct. If using Emacs with Auctex or another LaTeX aware
editor, when you press the double quote key, it will automatically be
converted the the proper LaTeX double quote characters as you note
above. LaTeX requires these incantations for double quotes.

More info here:

  http://en.wikibooks.org/wiki/LaTeX/Formatting#Quotes

The 'noae' option has been discussed previously. As I understand it,
this may be needed because any font encodings placed *before* the
\usepackage{Sweave} directive will be ignored, as ae.sty will be called
by Sweave.

Another solution may be to manually place \usepackage{Sweave} in the
preamble at the beginning of the .Rnw file, so that all other directives
come after. Paul did not post the foo.tex file. This would confirm the
location of the \usepackage{Sweave} line that Sweave would insert if it
does not already exist. It is likely that the line was inserted after
the others.

HTH,

Marc Schwartz




More information about the R-help mailing list