[ESS] /bin/bash markdown : command not found

Paul Johnson p@u|john32 @end|ng |rom gm@||@com
Mon Feb 23 17:48:46 CET 2015


Thanks to everybody for clearing this up.  I did not realize there was
another "markdown" processor besides pandoc.  How innocent I was.

I never did figure out how to knit and then run the markdown program from
Emacs markdown-mode, but after installing polymode, I find this much easier
to understand because it has the 2 separate keystrokes to knit and process
the markdown file.  That's a little inconvenient, but the polymode makes it
super clear what's happening to the various pieces. And the second stage
has a lot of choices concealed by the RStudio menus.  Some don't work right
"out of the box" but they are surely encouraging.

There's no denying that the RStudio folks have pushed ahead the dialogue on
how to write markdown.  I don't like their editor very much, but I admire
the effort to make a "one click" compile to presentation tool. The work in
the rmarkdown package for R is truly impressive, they make a lot of moving
pieces turn in the same direction. I've not found an Emacs-based way that
works as well.

Here's what I do to turn the markdown from Emacs into a presentation. Run
this shell script.

#!/bin/bash

R -e "library(rmarkdown); render(\"$1\")"

Here we stand on the shoulders of the rmarkdown package.

On Linux, run "render whatever.Rmd" and that generates the output. Expect
will be fine in Mac, only Windows is a puzzler now (since they have no
standard "in the PATH" place for user scripts).

I found it difficult to figure this out because RStudio makes this so
easy.  The RStudio "knit" button is doing the 2-step "knit + pandoc" render
process. In case you are new to this too, I wrote out some notes to
de-construct the steps.

"RmdOnRmd" (clever title :))

 http://pj.freefaculty.org/R/rmdonrmd/rmdonrmd.Rmd
 http://pj.freefaculty.org/R/rmdonrmd/rmdonrmd.html

Am having some trouble figuring the shortest path from start to finish for
MS Windows users.

Incidentally, one part of this I did not appreciate is that the RStudio
template for Rmd presentations has the output specifiers in YAML. That
"output: slidy_presentation" is not just asking for slidy, but a lot of
slidy settings set by rmarkdown.  All of these can be customized, but I've
not digested it yet.  I had one jolt.  The slide declaration

##A long slide {.allowframebreaks}

is legal, but not compatible with all output formats.  So far, it only
works with slidy_presentations. Too bad, ioslides_presentation output is a
little more jazzy.

pj


On Mon, Feb 16, 2015 at 1:13 AM, Stephen Eglen <S.J.Eglen using damtp.cam.ac.uk>
wrote:

> >> Right now, I can open an Rmd file in Emacs, M-x markdown-mode, the
> correct
> >> menus appear. However when I try to compile something, I get the
> minibuffer
> >> error
> >> /bin/bash: markdown: command not found.
> >
> > That sounds like a pretty clear hint that you should install markdown.
> > But that will only give you .md --> .html, you will still need a way
> > to convert .Rmd --> .md. One way or another most people are using
> > pandoc for this, so you should probably install that too (if you don't
> > have it installed already).
>
>
> markdown-mode has a variable "markdown-command" which should point to
> the binary (normally "markdown") that makes the html.  Get markdown or
> try hooking pandoc in.
>
> I am a fan of pandoc -- especially after I read this page:
>
>   http://kieranhealy.org/blog/archives/2014/01/23/plain-text/
>
> which shows how you can get citations into markdown.  I'm currently
> writing a journal article with it, and the workflow is pretty nice.
> LaTeX is still king but pandoc is great if ever you need html or .docx
> from your source files.  One thing markdown currently misses is \label{}
> and \ref{} equivalents, but there's discussion about implementing that.
>
> Stephen
>



-- 
Paul E. Johnson
Professor, Political Science      Assoc. Director
1541 Lilac Lane, Room 504      Center for Research Methods
University of Kansas                 University of Kansas
http://pj.freefaculty.org               http://quant.ku.edu

	[[alternative HTML version deleted]]




More information about the ESS-help mailing list