[R] Sweave documents have corrupted double quotes

Peter Dalgaard p.dalgaard at biostat.ku.dk
Sat Jan 17 22:40:54 CET 2009


Paul Johnson wrote:
> Hey, everybody.
> 
> I am concluding that this Sweave wrecks quotation marks in typewriter
> font is a bug in Sweave.

No. It's generic to the ae package. Try this:


\documentclass{article}
\usepackage{ae}
\begin{document}
\noindent
\texttt{``double quotes''}\\
\texttt{"double quotes"}\\
\texttt{`single quotes'}\\
\texttt{`{}`double single quotes'{}'}\\
\end{document}

Basically, TeX is trying to use symbols which are not present in the AE 
fonts. Sweave uses the ae package by default, which may or may not be a 
good idea (AE fonts tend to behave somewhat better than Computer Modern 
bitmaps in PDF files).


> 
> I've uploaded the foo.tex file so now you can see the Rnw, tex, and
> pdf file side by side.
> 
> http://pj.freefaculty.org/latex
> 
> As previous poster noted, the Sweave instruction is added at the end
> of the preamble in foo.tex. However, moving the \usepackage{Sweave} to
> the beginning of the preamble has no effect. Same black boxes.
> 
> It is true that one can work around this by inserting the declaration
> 
> \usepackage[noae]Sweave
> 
> into the Rnw file (or in the tex file).  That solves the problem,
> however, the user is left with a suspicious feeling.  What will go
> wrong in my output after [noae] is inserted? If nothing, why was it
> there in the first place?
> 
> pj
> 
> 


-- 
    O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
   c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907




More information about the R-help mailing list