pandoc

Batch processing Pandoc conversions in Windows

谁说胖子不能爱 提交于 2019-11-29 07:37:10
I am trying to convert a large number of HTML files into Markdown using Pandoc in Windows, and have found an answer on how to do this on a Mac , but receive errors when attempting to run the following in Windows PowerShell. find . -name \*.md -type f -exec pandoc -o {}.txt {} \; Can someone help me translate this to work in Windows? to convert files in folders recursively try this (Windows prompt command line): for /r "startfolder" %i in (*.htm *.html) do pandoc -f html -t markdown "%~fi" -o "%~dpni.txt" For use in a batch file double the % . Endoro's answer is great, don't get confused by the

pandoc “cannot parse yaml header” when converting md to pdf

杀马特。学长 韩版系。学妹 提交于 2019-11-29 07:02:50
问题 I am trying to convert a markdown document to pdf using pandoc, and it was working fine until it just started to show an error: pandoc: Could not parse YAML header: did not find expected alphabetic or numeric character "source" (line 32, column 85 pandoc: YAML header is not an object "source" (line 17, column 1) pandoc: Could not parse YAML header: did not find expected alphabetic or numeric character "source" (line 8, column 91) Lines 32 and 8 are blank lines between paragraphs, and all that

NOTE or WARNING from package check when README.md includes images

為{幸葍}努か 提交于 2019-11-29 06:21:59
I have a package with a README.Rmd that I pass to rmarkdown::render() producing README.md and a directory README_files , which contains images in README.md . This looks like the tree below. README_files is not a standard package directory , so if it isn't in .Rbuildignore , checking the package with R CMD check shows a note: * checking top-level files ... NOTE Non-standard file/directory found at top level: README_files But including the directory in .Rbuildignore leads to a warning, if and only if checking the package --as-cran . IIUC Pandoc tries to generate HTML from README.md , but the

Pandoc - Inserting pages before generated Table of Contents

不羁岁月 提交于 2019-11-29 05:59:00
I've been playing around with Pandoc. Is there anyway to insert pages before the generated Table of Contents? For example: Title Page Insert Custom Page 001 Insert Custom Page 002 (Generated) Table of Contents Many thanks in advance! For this answer, I'm going to assume you are generating markdown, though the process is the same for other file formats as well. The key insight is that Pandoc uses templates to determine the final placement. It has default templates and if you modify them, you can change the order of sections. Find the default template > pandoc -D markdown $if(titleblock)$

Pandoc insert appendix after bibliography

≡放荡痞女 提交于 2019-11-28 18:18:32
I'm using the knitr package and pandoc in R to convert a .Rmd file to a PDF. Pandoc is linked to a .bib file and automatically inserts the bibliography at the end of the PDF The entries in my .bib file look like these, taken from http://johnmacfarlane.net/pandoc/demo/biblio.bib : @Book{item1, author="John Doe", title="First Book", year="2005", address="Cambridge", publisher="Cambridge University Press" } @Article{item2, author="John Doe", title="Article", year="2006", journal="Journal of Generic Studies", volume="6", pages="33-34" } To build my bibliography, I'm using the following function,

Pandoc and foreign characters

若如初见. 提交于 2019-11-28 17:10:05
I've been trying to use Pandoc to convert some Markdown into a PDF file. This is a sample that Pandoc will not convert for me: # Header! ## Sub Header themselves derived respectively from the Greek ἀναρχία i.e. 'anarchy' That's just something I grabbed from the top of the wikipedia database dump. Pandoc doesn't like that at all. This is the error message it gives me: pandoc: Error producing PDF from TeX source. ! Package inputenc Error: Unicode char \u8:ἀ not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.53 ...es

Regression tables in Markdown format (for flexible use in R Markdown v2)

时间秒杀一切 提交于 2019-11-28 17:06:50
The new version of R Markdown is based on pandoc, so you can easyly change the output format. My Problem is to get markdown formated tables from e.g. regression models, because LATEX and HTML tables do not survive the pandoc conversion. I know packages that generate LATEX/HTML output from a variety of models (stargazer, texreg, asprtable...) and I'm aware of functions/packages, that generate markdown tables from data frames and matrices but not from other objects. Any suggestions? daroczig My above comment in more details: Define a few models for reproducible example: lm0 <- lm(hp ~ wt, mtcars

Chrome rendering MathJax equations with a trailing vertical line

∥☆過路亽.° 提交于 2019-11-28 17:00:14
I am working through Andrew Ng's machine learning course on Coursera using the Octave kernel for Jupyter and of course MathJax provides the equation rendering. This thin bar appears on the right side of every equation, and only in Chrome. Any thoughts on where in the stack things might be going wrong? This is a known issue caused by Chrome changing its rounding behavior. It will be fixed in the next release. See https://github.com/mathjax/MathJax/issues/1300 A quick and dirty method is right click one of them and select another renderer in Math Setting -> Math Renderer Another method is create

Pandoc markdown page break

╄→гoц情女王★ 提交于 2019-11-28 16:46:37
Recently I started using Pandoc markdown which seems a good alternative to LaTeX, as my document does not have many mathematical formulas, and I do not have ANY experience with LaTeX, which combined with less than 2 week submission deadline makes it a good solution. One thing I haven't been able to come around is how to force it to leave rest of the page empty, can anyone help? It looks like pandoc markdown uses standard LaTeX tags for this purpose: \newpage and \pagebreak TL;DR : use \newpage and the Lua filter below to get page breaks in many formats. Pandoc parses all inputs into an

Simple manual RMarkdown tables that look good in HTML, PDF and DOCX

三世轮回 提交于 2019-11-28 15:25:51
How can I manually and simply format a table in RMarkdown that will look good when converted to HTML (using the knitr and markdown packages), PDF (using pandoc and miktex) and docx (using pandoc)? I want to be able to write small tables in RMarkdown that are not a result of R functions that look good in the three formats I use most often. So far I've found a format that looks good in 2 of the 3 formats, is 3/3 possible? One. This looks good after Knit HTML but not good in the PDF or docx <table> <tr> <td>Eggs</td> <td>Ham</td> </tr> <tr> <td>Basil</td> <td>Tomato</td> </tr> </table> Two. This