pandoc

How to change pandoc option in R Studio

家住魔仙堡 提交于 2020-02-23 09:49:33
问题 Installing package rmarkdown in R Studio you can create docx documents using a Rmd-file and pressing the Knit Word button. The invoked command is then: "C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS hallo.utf8.md --to docx --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output hallo.docx --highlight-style tango Question How to add other options? I want to add: --filter ./pandoc-word-pagebreak to get: "C:/Program Files/RStudio

How do I keep title & subtitle when using pandoc to convert .docx to .md in R?

拥有回忆 提交于 2020-02-04 23:04:26
问题 I'm downloading a Google Doc as .docx and then converting to markdown for manipulation and export to multiple formats. Problem: When I convert using pandoc, it strips title (and subtitle) and does not add any YAML header information. I could add title manually in the header, but I need it to be scripted, so need to not lose the title (ideally) or extract title from docx and add to YAML header, which would then be concatenated to the converted markdown file. Example Code, where title is lost

How do I keep title & subtitle when using pandoc to convert .docx to .md in R?

二次信任 提交于 2020-02-04 22:58:36
问题 I'm downloading a Google Doc as .docx and then converting to markdown for manipulation and export to multiple formats. Problem: When I convert using pandoc, it strips title (and subtitle) and does not add any YAML header information. I could add title manually in the header, but I need it to be scripted, so need to not lose the title (ideally) or extract title from docx and add to YAML header, which would then be concatenated to the converted markdown file. Example Code, where title is lost

Table with borders in HTML and LaTeX output from Markdown source with Pandoc

空扰寡人 提交于 2020-02-03 04:31:26
问题 This is a sample table in Markdown for Pandoc. Simple tables look like this: Right Left Center Default ------- ------ ---------- ------- 12 12 12 12 123 123 123 123 1 1 1 1 Table: Demonstration of simple table syntax. It does not add borders unfortunately. I might code it as an HTML table, but in this case it will not work in LaTeX. How can I make a table with borders working both with LaTeX and HTML output? If Pandoc can't do the job, is there a similar tool which is able to? 回答1: The

How do I get (LaTeX math) typeset matrix with borders in HTML output from *.Rmd?

自闭症网瘾萝莉.ら 提交于 2020-01-25 23:41:57
问题 The following rmarkdown works fine when compiling to PDF (via LaTeX), but not when compiling to HTML (via Markdown). PDF (via LaTeX) --- title: "test" author: "Maximilian Held" output: pdf_document documentclass: memoir --- (@matrix-test2) $$ \bordermatrix{ ~ & Petra & Ingrid \cr Petra & 1 & 0 \cr Ingrid & 0 & 1 \cr } $$ HTML (via Markdown) --- title: "test" author: "Maximilian Held" output: html_document documentclass: memoir --- (@matrix-test2) $$ \bordermatrix{ ~ & Petra & Ingrid \cr Petra

pandoc filter in lua and walk_block

风流意气都作罢 提交于 2020-01-24 15:35:28
问题 I'm trying to apply a LUA filter that would only alter the body of a document, leaving the Metadata untouched. And it's harder than I thought. The filter should prepend and append text to inline elements as well as block elements. If it works for the inline element, here Code , it fails for the block element CodeBlock . function Pandoc(doc) blocks = {} for k,block in pairs(doc.blocks) do table.insert(blocks, pandoc.walk_block(block, { -- Doesn't work!? CodeBlock = function(el) return { pandoc

pandoc: Could not fetch http://www.r-pkg.org/badges/version/package TlsExceptionHostPort (HandshakeFailed

我是研究僧i 提交于 2020-01-23 16:45:28
问题 When running R CMD check package_0.1.0.tar.gz --as-cran I see the following warning * checking top-level files ... WARNING Conversion of ‘README.md’ failed: pandoc: Could not fetch http://www.r-pkg.org/badges/version/package_name TlsExceptionHostPort (HandshakeFailed (Error_Misc "user error (unexpected type received. expecting handshake and got: Alert [(AlertLevel_Fatal,HandshakeFailure)])")) "www.r-pkg.org" 80 I can see some answers (e.g. here) but it seems they are by windows users (I'm on

Converting Markdown to HTML5 slides via Pandoc through knitr in R

吃可爱长大的小学妹 提交于 2020-01-22 15:56:08
问题 Since version 1.2 knitr has a new function pandoc to convert markdown document to other formats via pandoc directly in R (See here). For example library(knitr) pandoc('foo.md', format='html') # HTML I wonder how to convert Markdown document (See knitr-slides.md for MWE) to HTML5 slides. Thanks 回答1: First, add the following to your .Rmd document: <!--pandoc s: S: i: mathjax: --> Then use the command library(knitr) knit("foo.Rmd") pandoc("foo.md", format="dzslides") This will still create the

Batch convert files with pandoc in windows

孤街醉人 提交于 2020-01-22 12:57:27
问题 I looked around and the only answer I found was pandoc (if anybody knows any programs with a ui that can do this in batches that would be great). If not what I'd like to do is have two bat files in a directory, one to be able to convert all the files in a directory and any subdirectories from markdown to HTML, the other to convert back. I just don't get how to get the "for in" recursive thing working in the command prompt (noob here). I got how to convert single files to and from with the

Using table caption on R markdown file using knitr to use in pandoc to convert to pdf

一世执手 提交于 2020-01-20 17:26:46
问题 I am wondering if it is possible to use the table captions like figure captions using knitr in .Rmd file ? I saw options for figure caption but I couldn't see the option for the table caption. I also want to remove the message such as "% latex table generated in R 2.15.2 by xtable 1.7-0 package % Wed Mar 06 15:02:11 2013" . I used X table to create the table: The sample code I used is as follows: ```{r table2, results='asis', message=FALSE} library(xtable) print(xtable(head(iris))) ``` The