小编rsa*_*acc的帖子

让.Rprofile在启动时加载

我有一个全局~/.Rprofile文件和另一个.Rprofile位于我项目当前工作目录中的文件,它们都具有以下内容:

.First() <- function() {
options(rstudio.markdownToHTML = 
  function(inputFile, outputFile) {      
    system(paste("pandoc", shQuote(inputFile), "-s --webtex -o", shQuote(outputFile)))
  }
)  
}
Run Code Online (Sandbox Code Playgroud)

不幸的是,当我打开RStudio应用程序时,它们似乎都没有工作.我正在尝试做的目的是使"Knit HTML"按钮渲染Markdown文件,该文件具有内联LaTeX,使用webtex作为LaTeX渲染器通过Pandoc进行处理.

有谁知道我如何检查我的.Rprofile文件是否在启动时加载?

谢谢你的帮助!

POST ANSWER EDIT(在Josh的回答之后): 为了清楚起见,我的工作项目的.Rprofile文件(有效)现在如下所示:

options(rstudio.markdownHTML =
  function(inputFile, outputFile) {
    system(paste("pandoc", shQuote(inputFie), "-s --webtex -o", shQuote(outputFile)))
  }
)
 \\ you will need to end with a blank carriage return underneath
Run Code Online (Sandbox Code Playgroud)

r pandoc rstudio rprofile

10
推荐指数
1
解决办法
9326
查看次数

使用Pandoc的Webtex URI处理更大的Latex方程

我正在尝试通过在终端中使用以下命令来增加Pandoc使用Google Charts API输出的LaTeX方程的大小:

pandoc -s --webtex=http://chart.apis.google.com/chart?cht=tx&chs=500&chf=bg,s,FFFFFF00&chl= --self-contained test.Rmd -o test.html
Run Code Online (Sandbox Code Playgroud)

但是,LaTeX代码的输出没有变化(它的大小没有增加),实际上,当我查看呈现的html文件段(在哪里$\frac{1}{x}$)时,看到的图像源标签是:

<img style="vertical-align:middle" src="http://chart.apis.google.com/chart?cht=tx%5Cfrac%7B1%7D%7Bx%7D" alt="\frac{1}{x}" title="\frac{1}{x}" />
Run Code Online (Sandbox Code Playgroud)

我在哪里使用--webtex[=URL]不正确?

google-visualization pandoc

3
推荐指数
1
解决办法
354
查看次数

使用jQuery计算所选选项的数量

我的selectDOM中有超过53个类似的部分,我需要计算用户选择了多少特定选项.

我的DOM的一个例子是这样的:

<select name="attendance" class="dd" id="20130101">
  <option>p</option>
  <option>a</option>
  <option>s</option>
</select>
<select name="attendance" class="dd" id="20130102">
  <option>p</option>
  <option>a</option>
  <option>s</option>
</select>
... x 51 more times!
Run Code Online (Sandbox Code Playgroud)

我想要做的是返回用户选择"a"的选项的数量(计数).我试过$('.dd option:selected').length但它会返回所有选择部分的总数(为53).

谢谢你的帮助!

jquery

0
推荐指数
1
解决办法
5734
查看次数

标签 统计

pandoc ×2

google-visualization ×1

jquery ×1

r ×1

rprofile ×1

rstudio ×1