Difference between ERT and LyX' custom knitr insets

痞子三分冷 提交于 2019-12-23 20:11:30

问题


What's the difference, if any, in terms of control, between using ERTs, as in the minimal example, and using, instead, LyX' own Custom Insets (Chunk, S/R expression, Sweave options) for knitr?

I've replicated the "minimal" examples, using also the Options inset inside a Chunk inset, and I can see no differences. (I am still ignorant on how to use the Sweave options inset.)


回答1:


There are currently only small differences. Using the chunk inset takes a bit more time, unless you set up shortcuts, because you have to insert the inset, then insert the options. The main advantages are simply that it is marked as a chunk, and you do not have to manually enter "<<>>=" and "@". Sometimes I forget whether it is "<>=" and sometimes I forget the equals sign so this is nice for my bad memory. If you want to get fancy, you can customize the font size and color within the chunk inset (you could do this for ERT also but that would apply for all ERTs, not just knitr chunks). If interested, see Help > Customization in LyX.

We hope to implement some features that might enhance the use of chunk insets over ERT. For example, it would be nice to navigate chunk insets in the outline pane. This is http://www.lyx.org/trac/ticket/7790 It would also be nice to ensure that knitr chunks start and end with newlines. This would prevent some not-so-rare problems. This is http://www.lyx.org/trac/ticket/8875

It comes down to a matter of preference. I prefer the chunk inset, but note that the author of knitr prefers ERT.



来源:https://stackoverflow.com/questions/25807378/difference-between-ert-and-lyx-custom-knitr-insets

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