pandoc

Using Pandoc with Swift

喜你入骨 提交于 2019-12-02 02:30:31
问题 I'm trying to use Pandoc to convert LaTeX to Markdown. I need to create a file and then run the pandoc terminal command. The problem is the file I create isn't in the same directory that I'm running the terminal commands in. I tried using shell("cd") but it doesn't move you to the user's folder. Any ideas? import Cocoa class ViewController: NSViewController { func shell(args: String...) -> Int32 { let task = NSTask() task.launchPath = "/usr/bin/env" task.arguments = args task.launch() task

Bookdown add URL as footnote

我的梦境 提交于 2019-12-02 01:34:22
I am having problems getting correct pdf output of figure legends that contain a url. It works as bookdown::gitbook but not as bookdown::pdf_book Here is an example: --- output: bookdown::pdf_book --- ## Reference with URL doesn't work In this experiment, we will use a [spectrophotometer] (https://en.wikipedia.org/wiki/Spectrophotometry) to measure the absorption of light of different wavelength by colored solutions. (ref:spectrum) [Spectrum of light. V, violet; B, blue; G, green Y, yellow; O, orange; R, red](https://commons.wikimedia.org/wiki/File:Linear_visible_spectrum.svg) ```{r spectrum,

Fonts for Rmarkdown document

久未见 提交于 2019-12-02 01:04:37
Here is a minimal working example. --- date : 2018-May-26 output: pdf_document title: "Testing Rmarkdown" --- ```{r,comment = NA} Gender <- gl(2,1000,labels = c("Men","Women")) SmokerM <- sample(c("Y","N"),1000,replace = T , prob = c(.3,.7)) SmokerW <- sample(c("Y","N"),1000,replace = T , prob = c(.5,.5)) Smoker <- c(SmokerM,SmokerW) mydata <- data.frame(Gender,Smoker) table(mydata$Gender,mydata$Smoker) ``` This is a text in the body of the document.What font is this ? What is font for the output of table ? How can we change these 2 fonts ? What other categories of items are there in an

Using Pandoc with Swift

☆樱花仙子☆ 提交于 2019-12-02 00:57:06
I'm trying to use Pandoc to convert LaTeX to Markdown. I need to create a file and then run the pandoc terminal command. The problem is the file I create isn't in the same directory that I'm running the terminal commands in. I tried using shell("cd") but it doesn't move you to the user's folder. Any ideas? import Cocoa class ViewController: NSViewController { func shell(args: String...) -> Int32 { let task = NSTask() task.launchPath = "/usr/bin/env" task.arguments = args task.launch() task.waitUntilExit() return task.terminationStatus } override func viewDidLoad() { super.viewDidLoad() shell(

Text Justification in Rmarkdown word document

∥☆過路亽.° 提交于 2019-12-01 15:54:52
When I create the word document in Rmarkdown, text is always left-aligned: Is it possible (and how) to justify the text in Rmarkdown? michael A template (i.e., like a custom style sheet) can be created in Word (or LibreOffice / OpenOffice), containing whatever page formatting and document styles you wish, and referenced from the rmarkdown file, i.e., --- title: "My Document" output: word_document: reference_docx: mystyles.docx --- ...rest of your rmarkdown here... See: https://vimeo.com/110804387 http://rmarkdown.rstudio.com/word_document_format.html http://rmarkdown.rstudio.com/articles_docx

Getting .Rprofile to Load at Startup

拟墨画扇 提交于 2019-12-01 15:36:10
I have a global ~/.Rprofile file and another .Rprofile file located in my project's current working directory and both of the have the following contents: .First() <- function() { options(rstudio.markdownToHTML = function(inputFile, outputFile) { system(paste("pandoc", shQuote(inputFile), "-s --webtex -o", shQuote(outputFile))) } ) } Unfortunately, when I open the RStudio app neither of them appear to be working. The aim of what I'm trying to do is to make the "Knit HTML" button render the Markdown file, which has inline LaTeX, process through Pandoc using webtex as the LaTeX renderer. Does

Text Justification in Rmarkdown word document

旧城冷巷雨未停 提交于 2019-12-01 15:33:13
问题 When I create the word document in Rmarkdown, text is always left-aligned: Is it possible (and how) to justify the text in Rmarkdown? 回答1: A template (i.e., like a custom style sheet) can be created in Word (or LibreOffice / OpenOffice), containing whatever page formatting and document styles you wish, and referenced from the rmarkdown file, i.e., --- title: "My Document" output: word_document: reference_docx: mystyles.docx --- ...rest of your rmarkdown here... See: https://vimeo.com

How can I use pandoc for all files in the folder in Windows?

爱⌒轻易说出口 提交于 2019-12-01 14:40:19
In the FAQ on pandoc.org there is the instruction for Linux and Mac users: for f in *.txt; do pandoc "$f" -s -o "${f%.txt}.rtf"; done but there is no instruction for Windows users. From pandoc-discuss : for %F in (*.txt) do pandoc %F > %F~n.html I faced the same problem and I couldn't find a solution. The problem is that in PowerShell you can't use wildcards like *.md. This simply is a Unix thing. You will have to work with a single file in windows. I was frustrated by this issue, so I wrote a batch file that you can run from cmd or from PowerShell that invokes pandoc on all the files of a

Getting .Rprofile to Load at Startup

不羁的心 提交于 2019-12-01 14:31:01
问题 I have a global ~/.Rprofile file and another .Rprofile file located in my project's current working directory and both of the have the following contents: .First() <- function() { options(rstudio.markdownToHTML = function(inputFile, outputFile) { system(paste("pandoc", shQuote(inputFile), "-s --webtex -o", shQuote(outputFile))) } ) } Unfortunately, when I open the RStudio app neither of them appear to be working. The aim of what I'm trying to do is to make the "Knit HTML" button render the

Convert IPython 2.0 notebook to html from the 'file' menu

≯℡__Kan透↙ 提交于 2019-12-01 11:12:21
问题 I am trying to convert my notebook to html from the file menu (nice feature added in 2.0), but when I do this I get a 500 : Internal Server Error screen with the text: nbconvert failed: Pandoc wasn't found. Please check that pandoc is installed: http://johnmacfarlane.net/pandoc/installing.html I've installed Pandoc from the link using the windows installer but keep getting the same error. Any suggestions on how to fix this? Where do I need to put the Pandoc folder or pandoc.exe that I just