title: Trouble with Pandoc installation on Ubuntu 14.04LTS for using with R Markdown
body: <p>This question is a corollary of my attempts to get some experience with <strong>creating reproducible reports</strong> from <code>R Markdown</code> documents via <code>knitr</code> and <code>rmarkdown</code> R packages. While it seems that <code>.Rmd =&gt; HTML</code> conversion is automated from within RStudio (<code>Knit HTML</code> button), my attempt to do the same outside of RStudio (<code>Rscript -e 'library(rmarkdown); render("knitr-example-slides-1.Rmd")'</code>) failed due to, according to the message, lack of <code>pandoc</code> on my system. This is most likely false, since RStudio somehow managed to perform the conversion. Therefore, it is most likely an <em>access and/or path issue</em>.</p>
  
  <p>Without knowledge of where RStudio maintains <code>pandoc</code> and details about the access, I have decided to <strong>install</strong> <code>pandoc</code> myself. Unfortunately, <code>sudo apt-get install pandoc</code> has not been very helpful, due to the fact that current version of <code>pandoc</code> in Ubuntu's <code>trusty</code> repository (14.04LTS) is 1.12.2.1. According to <code>rmarkdown</code>'s message, version 1.12.3 or higher is required. "Not a big deal", I have thought, and followed instructions on installing <code>pandoc</code> in case of too old version in repository (<a href="http://johnmacfarlane.net/pandoc/installing.html" rel="noreferrer">http://johnmacfarlane.net/pandoc/installing.html</a>). That requires installing the <em>Haskell platform</em>, which is pretty big and which output is rather verbose. After some time, I finally has been greeted with the following <strong>failure message</strong>:</p>
  
  <pre><code>[ 6 of 57] Compiling Text.Pandoc.Readers.TeXMath ( src/Text/Pandoc/Readers/TeXMath.hs, dist/build/Text/Pandoc/Readers/TeXMath.o )
  
  src/Text/Pandoc/Readers/TeXMath.hs:30:38:
      Ambiguous occurrence `readTeXMath'
      It could refer to either `Text.Pandoc.Readers.TeXMath.readTeXMath',
                               defined at src/Text/Pandoc/Readers/TeXMath.hs:56:1
                            or `Text.TeXMath.readTeXMath',
                               imported from `Text.TeXMath' at src/Text/Pandoc/Readers/TeXMath.hs:33:1-19
                               (and originally defined in `Text.TeXMath.Parser')
  Failed to install pandoc-1.12.4.2
  cabal: Error: some packages failed to install:
  pandoc-1.12.4.2 failed during the building phase. The exception was:
  ExitFailure 1
  pandoc-citeproc-0.3.1 depends on pandoc-1.12.4.2 which failed to install.
  </code></pre>
  
  <p>Firstly, I'm not sure how to <strong>fix</strong> it. Secondly, I very much suspect that there should be an <strong>easier way</strong> to enjoy generating reproducible reports with <code>rmarkdown</code> and <code>pandoc</code> than this. <strong>Your advice will be appreciated!</strong></p>
  
  <p><strong>UPDATE (see comments):</strong></p>
  
  <pre><code>Rscript -e 'library(rmarkdown); render("knitr-example-slides-1.Rmd")'
  
  
  processing file: knitr-example-slides-1.Rmd
    |.......                                                          |  11%
    ordinary text without R code
  
    |..............                                                   |  22%
  label: setup (with options)
  List of 1
   $ include: logi FALSE
  
  Quitting from lines 6-8 (knitr-example-slides-1.Rmd)
  Error in eval(expr, envir, enclos) : object 'opts_chunk' not found
  Calls: render ... handle -&gt; withCallingHandlers -&gt; withVisible -&gt; eval -&gt; eval
  
  Execution halted
  </code></pre>