如何更改使用 Sweave 的投影仪演示文稿中的字体?
当我在 Beamer 演示文稿的序言中包含 \usepackage{Sweave}
时,Beamer 会忽略对字体的更改,例如 \usepackage{helvet}
。
这是一个最小的例子:
\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}
文本是用计算机现代格式设置的,而不是黑体。如果注释掉 \usepackage{Sweave}
,则文本将以 helvetica 格式设置。
因此我的问题是:是否有办法更改包含 Sweave 内容的投影仪演示文稿中的字体?
我意识到我这里的示例不包含任何实际的“Sweable”R 代码,但这似乎并不重要,因为不需要的字体切换行为似乎是由 Sweave.sty 引起的。我更大的目标是将 pgfSweave 与 beamer 一起使用,但我在那里遇到了同样的问题。我想我已经追踪到了 \usepackage{Sweave}
。
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}
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Roger Peng 在 R-help 邮件列表中建议
参见 http://tolstoy。 newcastle.edu.au/R/e2/help/06/11/4803.html
另请参阅http:// /www.researchkitchen.com/blog/archives/118
From the R-help mailing list, Roger Peng suggests
See http://tolstoy.newcastle.edu.au/R/e2/help/06/11/4803.html
Also see http://www.theresearchkitchen.com/blog/archives/118
这是在黑暗中拍摄的,但是如果将
\usepackage{helvet}
放在\usepackage{Sweave}
之后,你会得到相同的结果吗?有时,包声明的顺序在 LaTeX 中很重要。此外,您还可以在 TeX-LaTeX Stack Exchange 上找到知识更丰富的受众。
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.