【发布时间】:2017-09-23 05:53:07
【问题描述】:
以下代码用于Sweave/Latex beamer:
\begin{frame}[fragile]
\frametitle{Function Basics}
\begin{block}{Elementary Functions}
<<>>=
pi # \texttt{pi} is a predefined const.
sin(pi) # \texttt{sin(pi)}$\neq$0, due to computing error.
sinpi(1) # Instead, we use \texttt{sinpi(x=1)} to get around.
exp(1)
log(10)
@
\end{block}
\end{frame}
我的问题:
上述三个#cmets中,经过Sweave编译后,\texttt{}、$\neq$仍然存在。 Sweave 无法识别 R 块中的 Latex 代码。
另一方面,Latex 似乎也无法识别 R 块中的任何代码(R 或 Latex)。
那么,在这种情况下,如何以 Latex 数学格式显示 \texttt{}、$\neq$?提前谢谢!
【问题讨论】:
-
Tex stackexchange 管理员说这似乎是一个纯粹的问题。建议发到R论坛。