Table of Contents
Display math:
\[Y_{i+1} = \lambda_{i+1}\]$$ Y_{i+1} = \lambda_{i+1} $$
\[ Y_{i+1} = \lambda_{i+1} \]
\\[ Y_{i+1} = \lambda_{i+1} \\]
Inline math: $Y_{i+1} = \lambda_{i+1}$, \( Y_{i+1} = \lambda_{i+1} \),
\\( Y_{i+1} = \lambda_{i+1} \\)
, \(Y_{i+1} = \lambda_{i+1}\),
$$Y_{i+1} = \lambda_{i+1}$$
, \[ Y_{i+1} = \lambda_{i+1} \].
Solution to MathJax parsing problem:
$$
for display and inline math.$
for inline math when subscript does not need braces, because:
$Y_i$, $Y_100$, $Y_{i,j}$, $Y_{i}$, $Y_{i+1}$, $Y_{100}$, should look like
\(Y_i\), \(Y_100\), \(Y_{i,j}\), \(Y_{i}\), \(Y_{i+1}\), \(Y_{100}\).$$
and $$
+newline.$$
or $$
+non-whitespace.RStudo parsing before knitr should take care of these:
r
with {r}
$$
with $
Note: slides work OK, no need to tweak inline math
This Rmd
file demonstrates how we intend to host text/math/code
on the website. We have 3 aims:
pdf
, html
, slides, etc.),
while still properly displaying text formatting, code (with
syntax highlight), and math (using local MathJax client side rendering).Rmd
(R Markdown)file.test.Rmd
) as template,
espacially as concerns the yaml header. That is the lines between
the ---
triple dashes. It tells the website how to display
the content, while it gives directions to the knitr
R package
about how to turn the code into html. For different output,
the output
tag value can be edited. The only important
thing really is the layout
.datacloning.github.io
project
(or create a pull request). Make sure to push to the
master branch. Of course, we need to figure out
placement in the directory tree – this is under construction.This is plain text. This is footnote1 and this is reference Smith 2000. References can be treated as abbreviations, but that is not too $\LaTeX$ friendly, like Smith 2000
This is [an example][^id] reference-style link. [^id]: http://example.com/ “Optional Title Here”
This is some text1. Other text2. This is some text3. Other text4.
This text is italics and italics, while this is bold and bold.
For superscript$^2$, use inline math, such as these: $A = \pi*r^{2}$
(written as $A = \pi*r^{2}$
).
Test if single dollar sign works: $a^2 = \sum{z}$.
Forced new line.
This link takes you to a site.
endash: –
emdash: —
ellipsis: …
image:
horizontal rule (or slide break):
Definition 1
Definition 2
{ some code, part of Definition 2 }
Third paragraph of definition 2.
Table Header | Second Header |
---|---|
Table Cell | Cell 2 |
Cell 3 | Cell 4 |
Another table:
Option | Description |
---|---|
data | path to data files to supply the data that will be passed into templates. |
engine | engine to be used for processing templates. Handlebars is the default. |
ext | extension to be used for dest files. |
Make a code chunk with three back ticks followed by R (this helps figuring out highlight rules). End the chunk with three back ticks:
paste("Hello", "World!")
Place code inline with a single back ticks, like
this paste("Hello", "World!")
.
Using nohighlight
:
lapply <-
function (X, FUN, ...)
{
FUN <- match.fun(FUN)
if (!is.vector(X) || is.object(X))
X <- as.list(X)
.Internal(lapply(X, FUN))
}
a <- c(1,2,3) # x y z
b <- c(TRUE, FALSE)
## k c z
k <- c("a", "b")
Using blank:
lapply <-
function (X, FUN, ...)
{
FUN <- match.fun(FUN)
if (!is.vector(X) || is.object(X))
X <- as.list(X)
.Internal(lapply(X, FUN))
}
a <- c(1,2,3) # x y z
b <- c(TRUE, FALSE)
## k c z
k <- c("a", "b")
Using r
:
lapply <-
function (X, FUN, ...)
{
FUN <- match.fun(FUN)
if (!is.vector(X) || is.object(X))
X <- as.list(X)
.Internal(lapply(X, FUN))
}
a <- c(1,2,3) # x y z
b <- c(TRUE, FALSE)
## k c z
k <- c("a", "b")
superscript^2^
~strikeout~
to do.
\[\begin{align*} & \phi(x,y) = \phi \left(\sum_{i=1}^n x_ie_i, \sum_{j=1}^n y_je_j \right) = \sum_{i=1}^n \sum_{j=1}^n x_i y_j \phi(e_i, e_j) = \\ & (x_1, \ldots, x_n) \left( \begin{array}{ccc} \phi(e_1, e_1) & \cdots & \phi(e_1, e_n) \\ \vdots & \ddots & \vdots \\ \phi(e_n, e_1) & \cdots & \phi(e_n, e_n) \end{array} \right) \left( \begin{array}{c} y_1 \\ \vdots \\ y_n \end{array} \right) \end{align*}\]This is a paragraph.
A nested blockquote.
Headers work
- lists too
and all other block-level elements
This is a text with light and strong emphasis. This is emphasized as well. This does _not_ work. This does __not__ work either.
This is a R code fragment x = 1 + c(a, 2)
This is some code
.
A link and some tools.
These tags can be used to track changes in code:
Other cool features
Lowercased text.
Uppercased text.
Capitalized text.
These backgrounds can be used to highlight topics
primary
primary
success
info
warning
danger
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
Nullam id dolor id nibh ultricies vehicula ut id elit.
Etiam porta sem malesuada magna mollis euismod.
Donec ullamcorper nulla non metus auctor fringilla.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
Maecenas sed diam eget risus varius blandit sit amet non magna.
Use headings in quote block?
Why not!
That is the whole point!
Also:
Warning
This is a warning.
Smith 2000. The best paper ever. Journal, 1-2.
1. Footnote 1.
Kramdown syntax guide: http://kramdown.gettalong.org/syntax.html
paste("Hello", "World!")
paste("Hello", "World!")
## defining a website compatible palette
dcpal_flatly <- list(
"red"="#c7254e",
"palered"="#f9f2f4",
"primary"="#2c3e50",
"success"="#18bc9c",
"info"="#3498db",
"warning"="#f39c12",
"danger"="#e74c3c",
"pre_col"="#7b8a8b",
"pre_bg"="#ecf0f1",
"pre_border"= "#cccccc"
)
dcpal_reds <- colorRampPalette(c("#f9f2f4", "#c7254e"))
dcpal_ogrd <- colorRampPalette(c("#f39c12", "#e74c3c"))
dcpal_grbu <- colorRampPalette(c("#18bc9c",
"#3498db", "#2c3e50"))
op <- par(las=2, mar=c(6,5,2,2), mfrow=c(2,2))
barplot(1:length(dcpal_flatly),
names=names(dcpal_flatly),
border=dcpal_flatly$pre_border,
col=unlist(dcpal_flatly))
barplot(1:10, col=dcpal_reds(10), main="Reds")
barplot(1:10, col=dcpal_grbu(10), main="Green-Blue")
barplot(1:10, col=dcpal_ogrd(10), main="Orange-Red")
par(op)
Learning Objectives
- Learning objective 1
- Learning objective 2
a <- list("a", 1, FALSE, function(x) x+1) # no
## yes
a <- list("a", 1, FALSE, function(x) x+1) # no
## yes