knitr将降价文字视为逐字

时间:2015-10-07 17:50:49

标签: r knitr r-markdown pander

我正在尝试使用R中的this.Brush.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_5); function fl_ClickToDrag_5(event:MouseEvent):void { this.Brush.startDrag(); } stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_5); function fl_ReleaseToDrop_5(event:MouseEvent):void { this.Brush.stopDrag(); } knitr包创建一个包含表的pdf,但似乎我的表中的某些文本被误解为代码,因为结果文档在不应该的情况下逐字显示文本。以下是我能够复制问题的示例代码。

pander

我尝试使用--- title: "Untitled" author: "Me" date: "10/07/2015" output: pdf_document classoption: landscape --- \footnotesize ```{r,echo=F,message=F} library(pander) dat <- data.frame(test_name=c("Short","Really, really long test name","Other","The rest/Other/whatever"), campaigns=c("AAA BBB CCC","AAA","BBB CCC","DDD"), objective=c("We want to test whether or not the changes we made to our proceedure will change the outcome. We will test this from January 2015 to January 2016.","I am not very creative and cannot think of any other objectives especially since I made up the rest of this stuff.","Our objective is to improve the quality of our product.","The objective is to find out if people will like this other product better."), results=c("The test we did resulted in the following results that were counter-intuitive since we expected other results.","None","This other test resulted in everything as we expected, blah, blah, blah.","None")) myTable <- pander(dat,split.cells=c(20,10,60,60),split.table=Inf,style='grid',emphasize.strong.cols=c(1)) return(myTable) ``` 代替pander_return函数,然后使用pander将该文本转换为LaTeX,以便我可以替换所有Pandoc.convert\begin{verbatim}什么都没有,但那没用。这是有道理的,因为我试图在我的Rmd文件中这样做。

enter image description here

在发布此问题之前,我确实注意到,如果我从\end{verbatim}列中删除所有/,我就不再有该列的逐字问题,但问题是仍存在于test_namecampaigns列中。

enter image description here

如何让它识别文本是降价而不是逐字代码?非常感谢任何帮助。

编辑:一旦我从第一列中删除“特殊字符”,它似乎只在单元格中的单个单词时将单元格文本视为逐字代码。否则它看起来很好。

1 个答案:

答案 0 :(得分:0)

根据@rawr的评论,将justify= 'left'添加到pander函数修复了问题。