问题
When I include \usepackage{Sweave}
in the preamble of a beamer presentation, beamer ignores changes to font, e.g., \usepackage{helvet}
.
Here is a minimal example:
\documentclass[professionalfonts]{beamer}
\usepackage[T1]{fontenc}
\usepackage{helvet}
\usepackage{Sweave}
\begin{document}
\begin{frame}
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat.
\end{frame}
\end{document}
The text is set in computer modern, rather than helvetica. If you comment out \usepackage{Sweave}
, then the text is set in helvetica.
Thus my question: Is there a way to change fonts in beamer presentations that include Sweave content?
I realize that my example here does not include any actual, "Sweable" R code, but it seems to not matter, because the unwanted font-switching behavior appears to result from Sweave.sty. My bigger goal is to use pgfSweave with beamer, but I'm having the same problem there. I think I have tracked it down to \usepackage{Sweave}
.
回答1:
From the R-help mailing list, Roger Peng suggests
\usepackage[noae]{Sweave}
See http://tolstoy.newcastle.edu.au/R/e2/help/06/11/4803.html
Also see http://www.theresearchkitchen.com/blog/archives/118
回答2:
Shot in the dark, here, but do you get the same result if you put \usepackage{helvet}
after \usepackage{Sweave}
? Sometimes order of package declarations matters in LaTeX.
Also, you may find a more knowledgeable audience at the TeX-LaTeX Stack Exchange.
来源:https://stackoverflow.com/questions/5600050/how-can-i-change-fonts-in-a-beamer-presentation-that-uses-sweave