windows – 将markdown斜体和粗体转换为乳胶
我希望能够将markdown斜体和粗体转换为乳胶版本(即,给文本字符串返回文本字符串).我觉得很容易.错误! (它仍然可能是).看到我在底部试过的窗台商务和错误.
我有什么(注意在降价时已经转义的起始星号): x <- "*note: I *like* chocolate **milk** too ***much***!" 我想要的是什么: "*note: I emph{like} chocolate textbf{milk} too textbf{emph{much}}!" 我不喜欢正则表达式,但更喜欢基础解决方案(虽然不是必需的). 愚蠢的业务: helper <- function(ins,outs,x) { gsub(paste0(ins[1],".+?",ins[2]),paste0(outs[1],outs[2]),x) } helper(rep("***",2),c("textbf{emph{","}}"),x) Error in gsub(paste0(ins[1],: invalid regular expression '***.+?***',reason 'Invalid use of repetition operators' 如果有帮助的话,我有7000 Ananda Mahto帮我做的.您可以通过wheresPandoc< - reports ::: wheresPandoc从报告中访问它 编辑Per Ben的评论我试过: action <- paste0(" echo ",x," | ",wheresPandoc()," -t latex ") system(action) *note: I *like* chocolate **milk** too ***much***! | C:PROGRA~2Pandocbinpandoc.exe -t latex EDIT2 Per Dason的评论我尝试过: out <- paste("echo",shQuote(x),"|"," -t latex"); system(out) system(out,intern = T) > system(out,intern = T) *note: I *like* chocolate **milk** too ***much***! | C:PROGRA~2Pandocbinpandoc.exe -t latex 解决方法
注意到我正在使用Windows和系统
以及来自?system2的说明
system2('pandoc','-t latex',input = '**em**',stdout = TRUE) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- Windows下用批处理批量创建快捷方式并改名
- 如何防止控制台窗口关闭在ghc应用程序?
- 如何使用REST Api在Windows Azure中列出管理证书
- windows – 是否有可能“欺骗”PrintScreen,在捕获之前用其
- 在Windows 8上无法发送带有php邮件功能的邮件
- 如何在Windows上调试Perl XS代码
- 如何将Windows AD登录限制为某个组?
- Windows Server 2016的2节点集群(主动 – 被动)
- windows-server-2012-r2 – WSUS和推出Win 10 1703更新和Wi
- windows-server-2008 – 大规模Active Directory更改和监视