pandoc

Batch convert files with pandoc in windows

喜你入骨 提交于 2019-12-03 08:51:30
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 examples from pandoc: pandoc test.md -f markdown -t html -o test.html or backwards: pandoc test.html -f

Using a YAML header argument in knitr

萝らか妹 提交于 2019-12-03 08:13:42
I am making a set of slides using rmarkdown and the LaTeX option of outputting it to beamer . I have two templates I use in my slides - one specific for the LaTeX options, and one pandoc template that I have modified to account for some additional feature of my slides. I have defined an option in the YAML header called to_print which is a boolean TRUE/FALSE that I pass to the pandoc template that tells it to add a package and clean up the slides for printing. I also want to use this variable to define the name of the files. The basic idea being that I want to have one .rmd file for my slides,

Inserting a page break within a code chunk in rmarkdown (converting to pdf)

核能气质少年 提交于 2019-12-03 05:54:51
I am using rmarkdown, pandoc and knitr to create a pdf including chunks of r code. Within a code chunk I have a for loop which prints a number of graphs and some statistical output. I would like to insert a page break into the loop (to appear in the pdf output). This page break would occur after each graph is printed, to ensure each graph is printed on one page and the statistical output on the next. I have been unable to find a way of including a page break in my r code chunk. I have tried cat("\\newpage") and cat("\\pagebreak") in the hopes it would be recognized by pandoc but to no avail

IPython (Jupyter) MathJaX preamble

China☆狼群 提交于 2019-12-03 05:54:43
问题 Question How can I setup a MathJax "preamble" for use in IPython (or Jupyter) notebooks for repeated use in a way that is convenient for others to read my documents (on http://nbviewer.org) and that works for LaTeX/PDF generation? Background I would like to use IPython (now Jupyter) notebooks for documents that I later convert to PDF via LaTeX (using ipython nbconvert ). The problem is how to include a bunch of macro definitions that I use in almost every document. Something like: \newcommand

Whole site compilation of markdown/pandoc? [closed]

随声附和 提交于 2019-12-03 05:09:05
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . With Sphinx-doc, you can create a bunch of ReStructureText files, with an index.rst file which includes a table of contents macro that auto generates a table of contents from the other included files, and a conf.py that acts as a compilation config. You can then compile the lot into a single python-doc-style site,

pandoc doesn't text-wrap code blocks when converting to pdf

独自空忆成欢 提交于 2019-12-03 04:39:08
I'm using pandoc with xelatex engine to convert markdown to pdf. I'm running pandoc like this: pandoc -s 'backbone-fundamentals'.md -o 'backbone-fundamentals'.pdf \ --title-prefix 'Developing Backbone.js Applications' \ --normalize \ --smart \ --toc \ --latex-engine=`which xelatex` If a code line is longer than the pdf document width it just gets cutoff. Is there anyway to have pandoc text wrap long code lines? A. Donda Not having the text wrapped is (part of) the point of code blocks. As far as I know, the only way to wrap the code is manually. For most languages, not exceeding a certain line

Set double spacing and line numbers when converting from Markdown to PDF with pandoc

心不动则不痛 提交于 2019-12-03 04:24:27
问题 I am using markdown & pandoc for scientific writing, I know I can change margins of the final pdf using Set margin size when converting from Markdown to PDF with pandoc but very often the journals require double lines and line numbers in submitted manuscripts, the question is how to change these, I don't know much about LaTex so I am lost in that jungle. Thanks! 回答1: In more recent version of Pandoc, you can use a YAML header and include a bunch of metadata in that, instead of using options

rmarkdown: pandoc: pdflatex not found

痞子三分冷 提交于 2019-12-03 04:04:17
问题 When I use the render{rmarkdown} to produce pdf file from .Rmd file on my Mac, an error message says pandoc: pdflatex not found. pdflatex is needed for pdf output. Error: pandoc document conversion failed However when I check with pdflatex -v I got pdfTeX 3.1415926-2.4-1.40.13 (TeX Live 2012) kpathsea version 6.1.0 Copyright 2012 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). There is NO warranty. Redistribution of this software is covered by the terms of both the pdfTeX copyright and the

How to use latex equation environment in Pandoc Markdown?

末鹿安然 提交于 2019-12-03 03:53:28
问题 In Pandoc markdown, I can use '$$' to start a display math environment. However, these equations are not numbered in latex so I hope to use the equation environment instead, like this: \begin{equation} x+1 = 2 \\ y+2 = 3 \end{equation} That's fine if I convert markdown to latex. But it does't work when I convert it to HTML with Mathjax because Pandoc treats these lines as raw_latex ignores them in HTML. I tried to forbid the raw_latex extension pandoc -f markdown-raw_latex ... This time the

Converting all files in a folder to md using pandoc on Mac

折月煮酒 提交于 2019-12-03 03:49:31
问题 I am trying to convert an entire directory from html into markdown. The directory tree is quite tall, so there are files nested two and three levels down. In answering this question, John MacFarlane suggested using the following Makefile : TXTDIR=sources HTMLS=$(wildcard *.html) MDS=$(patsubst %.html,$(TXTDIR)/%.markdown, $(HTMLS)) .PHONY : all all : $(MDS) $(TXTDIR) : mkdir $(TXTDIR) $(TXTDIR)/%.markdown : %.html $(TXTDIR) pandoc -f html -t markdown -s $< -o $@ Now, this doesn't seem to go