1. Install Sublime Text plugin randy3k/R-box

2 Windows

2.1. Create my own sublime-build for R markdown files

The default build system of R-box doesn’t work, and get the error

Error: '\G' is an unrecognized escape in character string starting "'C:\G"
Execution halted
[Finished in 0.4s with exit code 1]

since the windows path escape is not correctly handled.

This issue can be resolved by regular expression replacement 1

{
    "selector": "text.html.markdown.rmarkdown",
    "working_dir": "${project_path:${folder}}",
    "cmd": [
        "Rscript", "-e",
        "library(rmarkdown); render('${file/\\\\/\\/\/g}')"
    ]
}

2.2. Apply fix for pandoc 1.4 2

To support latex in R markdown document, I added to the file …3.tex:

    %fix for pandoc 1.14
    \providecommand{\tightlist}{
      \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

3. Mac

The default R markdown build system gets the error

str expected, not list

it is because the PATH variable used by sublime text3 is /usr/bin:/bin:/usr/sbin:/sbin while my TexLive is installed at /usr/local/texlive/2016/bin/x86_64-darwin. This can be hacked by editing the PATH variable of sublime text3, described in the post Hacking the PATH variable in Sublime Text

First Post

Below is just about everything you’ll need to style in the theme. Check the source code to see the many embedded elements within paragraphs.

Mathjax 1

LaTeX math delimiters: \\(a^2 + b^2 = c^2\\) or “\(a^2 + b^2 = c^2\)” for inline math \(a^2 + b^2 = c^2\); and \\[a^2 + b^2 = c^2\\] for displayed equations \[a^2 + b^2 = c^2\].

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Body text

Lorem ipsum dolor sit amet, test link adipiscing elit. This is strong. Nullam dignissim convallis est. Quisque aliquam.

Smithsonian Image {: .image-right}

This is emphasized. Donec faucibus. Nunc iaculis suscipit dui. 53 = 125. Water is H2O. Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. The New York Times (That’s a citation). Underline. Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy. Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus.

HTML and CSS are our tools. Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus.

Blockquotes

Lorem ipsum dolor sit amet, test link adipiscing elit. Nullam dignissim convallis est. Quisque aliquam.

List Types

Ordered Lists

  1. Item one
  2. sub item one
  3. sub item two
  4. sub item three
  5. Item two

Unordered Lists

  • Item one
  • Item two
  • Item three

Tables

Header1 Header2 Header3
cell1 cell2 cell3
cell4 cell5 cell6
—-
cell1 cell2 cell3
cell4 cell5 cell6
=====
Foot1 Foot2 Foot3

{: rules=“groups”}

Code Snippets

Syntax highlighting via Rouge

#container {
  float: left;
  margin: 0 -240px 0 0;
  width: 100%;
}

Non Pygments code example

<div id="awesome">
    <p>This is great isn't it?</p>
</div>

Buttons

Make any link standout more when applying the .btn class.

<a href="#" class="btn btn-success">Success Button</a>