How can I change fonts in a beamer presentation that uses Sweave?

谁都会走 提交于 2020-01-02 05:24:10

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!