[R] Sweave: font problems with Signif. codes lines

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Dec 22 22:44:23 CET 2009


On Tue, 22 Dec 2009, Michael Friendly wrote:

> [Environment: Win Xp, Miktex 2.7, R 2.9.2]

If you want to set R output in a TeX font that (as most are) is very 
limited in its coverage, try options(useFancyQuotes = FALSE).

We don't have the 'at a minimum' information asked for in the posting 
guide.  If we did, I suspect it would say that you are using the 
encoding CP1252, and you have not told LaTeX that: I think you need 
something like

\usepackage[cp1252]{inputenc}
\inputencoding{cp1252}

However you will then need a font which contains glyphs for 
\textquoteleft and \textquoteright: those designed by Knuth, including 
cmtt10, only cover most of ASCII and a few other gyphs but a number of 
alternatives are available.

(People using UTF-8 locales on other OSes will need to declare 
LaTeX encoding utf8 for fancy quotes in a similar way.)


> In an Sweave document, I'm displaying the results of car:::Anova() tests, 
> that look like this in the
> generated .tex file:
>
> \begin{Soutput}
> Type III MANOVA Tests: Pillai test statistic
> Df test stat approx F num Df den Df Pr(>F)
> (Intercept) 1 0.86 90.38 4 60 <2e-16 ***
> ---
> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> \end{Soutput}
>
> When processed with pdfLaTeX, using
> \usepackage{Sweave}
> the Signif. codes lines appears as
>
> Signif. codes: 0 S***S 0.001 S**S 0.01 S*S 0.05 S.S 0.1 S S 1
>
> except that the Ss have funny accents. If I try again, using the noae option
> \usepackage[noae]{Sweave}
>
> the funny S characters disappear (are blank), but I get messages in the log:
>
> Missing character: There is no ‘ in font cmtt10!
> Missing character: There is no ’ in font cmtt10!
>
> There seems to be a font problem somewhere, but I don't know how to track it 
> down. In my preamble, I am loading the
> following packages:
>
> \documentclass[12pt]{article}
> \usepackage{float}
> \usepackage{amssymb, amsmath, amsfonts}
> \usepackage[noae]{Sweave}
> % \usepackage{fancyvrb} % loaded by Sweave
> \usepackage{color}
> \usepackage{url}
> \usepackage[round]{natbib}
> \usepackage{bm}
>
> Does this ring a bell for anyone?
>
> thanks,
> -Michael
>
>
> -- 
> Michael Friendly     Email: friendly AT yorku DOT ca Professor, Psychology 
> Dept.
> York University      Voice: 416 736-5115 x66249 Fax: 416 736-5814
> 4700 Keele Street    http://www.math.yorku.ca/SCS/friendly.html
> Toronto, ONT  M3J 1P3 CANADA
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


More information about the R-help mailing list