1

The TexCalendarCompetition.Rnw refers to Nicholas Hamilton's code contribution to the TUG calendar 2015 (see Nicholas' answer for details)

1 Answer 1

1

These are the steps for debian jessie (currently aka debian testing) using texlive 2014 (updates: frozen):

  1. Install debian's R-package (current version: 3.1.1-1+b2):

    sudo apt-get install r-base-core

  2. Create a folder for testing (called e.g. TCC)

    mkdir TCC

  3. Download the bibcloud library (bibcloud_1.0.tar.gz) into the previously created folder

    (download location see Nicholas' answer)

  4. Extract the library

    tar xzvf bibcloud_1.0.tar.gz

  5. Copy the template (Rnw-file) and data (bibtex file: phd.bib) into the current folder

    cp bibcloud/.DynamciDocument/TexCallendarCompetition.Rnw ./TexCalendarCompetition.Rnw

    cp bibcloud/.DynamciDocument/phd.bib .

  6. Install dependent R libraries:

    Note: To install the libraries in system scope, start R with sudo

    sudo R

    install.packages("wordcloud", dependencies=TRUE)

    install.packages("tikzDevice", dependencies=TRUE)

    install.packages("scales", dependencies=TRUE)

    q()

  7. Install Nicholas' bibcloud library:

    R CMD INSTALL bibcloud_1.0.tar.gz

  8. (Try to) build the tex-file from the Rnw-file:

    R -e 'library(knitr);knit("TexCalendarCompetition.Rnw")'

  9. (Try to) build a pdf from the previously generated tex-file:

    latexmk -outdir=tmp -pdf TexCalendarCompetition.tex

    The resulting pdf-file (tmp/TexCalendarCompetition.pdf) contains only the error message "## Error: inherits(doc, "TextDocument") is not TRUE" (s. screenshot )

enter image description here

  1. Apply the following patch (details) to the bibcloud library:

    Note: I don't know whether it makes sense to update the version number.

    cat << EOF | patch -p0
    diff -Naur bibcloud/bibcloud.Rproj bibcloud_1.0.1/bibcloud.Rproj
    --- bibcloud/bibcloud.Rproj     2014-10-26 21:20:57.000000000 +0100
    +++ bibcloud_1.0.1/bibcloud.Rproj       2015-04-23 22:06:39.501517732 +0200
    @@ -1,4 +1,4 @@
    -Version: 1.0
    +Version: 1.0.1
    
     RestoreWorkspace: Default
     SaveWorkspace: Default
    diff -Naur bibcloud/R/cloud.R bibcloud_1.0.1/R/cloud.R
    --- bibcloud/R/cloud.R  2013-11-21 23:48:09.000000000 +0100
    +++ bibcloud_1.0.1/R/cloud.R    2015-04-23 22:07:05.749516333 +0200
    @@ -85,7 +85,7 @@
       }
    
       lords <- tm_map(lords, stripWhitespace)
    -  lords <- tm_map(lords, tolower)
    +  lords <- tm_map(lords, content_transformer(tolower))
       lords <- tm_map(lords, removeWords, EXCLUDE)
       lords <- tm_map(lords, removePunctuation)
       lords <- tm_map(lords, removeWords, stopwords("english"))
    EOF
    

    Note: The message "Hunk #1 succeeded at 85 with fuzz 2." does not appear in case the diff is applied using a patch file (instead of until EOF).

  2. Create archive bibcloud_1.0.1.tar.gz:

    tar -czvf bibcloud_1.0.1.tar.gz bibcloud

  3. Install bibcloud_1.0.1.tar.gz

    R CMD INSTALL bibcloud_1.0.1.tar.gz

    Note: I guess this command replaces version 1.0 by 1.0.1?

  4. (Try again to) build the tex-file from the Rnw-file:

    see step 8.

    Note: The command runs for some minutes, at least here (you can "watch" its activity using e.g. top or lsof)

  5. (Try again to) build a pdf from the previously generated tex-file:

    see step 9.

    Now the pdf builds fine, at least here.

Done.

You must log in to answer this question.