Tanka Theme Demo

Nan Xiao 2020-11-21 2 min read

Tanka is a Bootstrap-based minimalist theme for Hugo.

Vik, Iceland. Photo by Adam Jang.

Typography

Follows the Bootstrap typography.

h1 Heading

h2 Heading

h3 Heading

h4 Heading

h5 Heading
h6 Heading

This is bold text

This is bold text

This is italic text

This is italic text

Deleted text

Block quotes are written like so.

They can span multiple paragraphs, if you like.

Some text, and some code and then a nice plain link with title.

and then

  • Create a list by starting a line with +, -, or *
  • Sub-lists are made by indenting 2 spaces:
    • Marker character change forces new list start:
      • Ac tristique libero volutpat at
  • Very easy!

vs.

  1. Lorem ipsum dolor sit amet
  2. Consectetur adipiscing elit
  3. Integer molestie lorem at massa

Math

Inline formula $S_n = \sum_{i=1}^n X_i$ example.

$$S(n, k) = \frac{1}{k!}\sum_{i=0}^{k} (-1)^{i} \binom{k}{i} (k-i)^n.$$

Code

Inline code example

R

library("msaenet")

dat = msaenet.sim.gaussian(
  n = 150, p = 500, rho = 0.5,
  coef = rep(1, 10), snr = 5, p.train = 0.7,
  seed = 1001
)

msaenet.fit = msaenet(
  dat$x.tr, dat$y.tr,
  alphas = seq(0.1, 0.9, 0.1),
  nsteps = 10L, tune.nsteps = "ebic",
  seed = 1005
)

msaenet.fit$best.step
msaenet.nzv(msaenet.fit)
plot(msaenet.fit, label = TRUE)
plot(msaenet.fit, type = "criterion")
plot(msaenet.fit, type = "dotplot", label = TRUE, label.cex = 1)

Python

@requires_authorization(roles=["ADMIN"])
def somefunc(param1='', param2=0):
    r'''A docstring'''
    if param1 > param2: # interesting
        print 'Gre\'ater'
    return (param2 - param1 + 1 + 0b10l) or None

class SomeClass:
    pass

>>> message = '''interpreter
... prompt'''

Stan

// Multivariate Regression Example
// Taken from stan-reference-2.8.0.pdf p.66

data {
  int<lower=0> N;             // num individuals
  int<lower=1> K;             // num ind predictors
  int<lower=1> J;             // num groups
  int<lower=1> L;             // num group predictors
  int<lower=1,upper=J> jj[N]; // group for individual
  matrix[N,K] x;              // individual predictors
  row_vector[L] u[J];         // group predictors
  vector[N] y;                // outcomes
}
parameters {
  corr_matrix[K] Omega;       // prior correlation
  vector<lower=0>[K] tau;     // prior scale
  matrix[L,K] gamma;          // group coeffs
  vector[K] beta[J];          // indiv coeffs by group
  real<lower=0> sigma;        // prediction error scale
}
model {
  tau ~ cauchy(0,2.5);
  Omega ~ lkj_corr(2);
  to_vector(gamma) ~ normal(0, 5);
  {
    row_vector[K] u_gamma[J];
    for (j in 1:J)
      u_gamma[j] <- u[j] * gamma;
    beta ~ multi_normal(u_gamma, quad_form_diag(Omega, tau));
  }
  {
    vector[N] x_beta_jj;
    for (n in 1:N)
      x_beta_jj[n] <- x[n] * beta[jj[n]];
    y ~ normal(x_beta_jj, sigma);
  }
}

# Note: Octothorpes indicate comments, too!