<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$>

<head>

<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />

$for(author-meta)$
<meta name="author" content="$author-meta$" />
$endfor$

$if(date-meta)$
<meta name="date" content="$date-meta$" />
$endif$

<title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>

$for(header-includes)$
$header-includes$
$endfor$

$if(highlightjs)$
<style type="text/css">code{white-space: pre;}</style>
<link rel="stylesheet"
      href="$highlightjs$/$if(highlightjs-theme)$$highlightjs-theme$$else$default$endif$.css"
      $if(html5)$$else$type="text/css" $endif$/>
<script src="$highlightjs$/highlight.js"></script>
<style type="text/css">
  pre:not([class]) {
    background-color: white;
  }
</style>
<script type="text/javascript">
if (window.hljs && document.readyState && document.readyState === "complete") {
   window.setTimeout(function() {
      hljs.initHighlighting();
   }, 0);
}
</script>
$endif$

$if(highlighting-css)$
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
$highlighting-css$
</style>
<style type="text/css">
  pre:not([class]) {
    background-color: white;
  }
</style>

$endif$

$for(css)$
<link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/>
$endfor$

<!-- tabsets -->
<script>
$$(document).ready(function () {
  window.buildTabsets("$idprefix$TOC");
});
</script>

<!-- code folding -->
$if(code_folding)$
<script>
$$(document).ready(function () {
  window.initializeCodeFolding("$code_folding$" === "show");
});
</script>
$endif$

</head>

<body>

$if(theme)$
<style type = "text/css">
.main-container {
  max-width: 940px;
  margin-left: auto;
  margin-right: auto;
}
code {
  color: inherit;
  background-color: rgba(0, 0, 0, 0.04);
}
img {
  max-width:100%;
  height: auto;
}
</style>
<div class="container-fluid main-container">
  <div class="row">
    <div class="col-md-10 col-md-offset-1 page">
$endif$

$for(include-before)$
$include-before$
$endfor$

$if(code_folding)$
<div class="btn-group pull-right">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="text-muted">Code</span> <span class="text-muted caret"></span></button>
<ul class="dropdown-menu" style="min-width: 50px;">
<li><a id="rmd-show-all-code" href="#">Show All</a></li>
<li><a id="rmd-hide-all-code" href="#">Hide All</a></li>
</ul>
</div>
$endif$

$if(title)$
<div id="$idprefix$header">
<h1 class="title">$title$</h1>
$if(subtitle)$
<h1 class="subtitle">$subtitle$</h1>
$endif$
$for(author)$
$if(author.name)$
<h4 class="author"><em>$author.name$</em></h4>
$if(author.affiliation)$
<address class="author_afil">
$author.affiliation$<br>$endif$
$if(author.email)$
<a class="author_email" href="mailto:#">$author.email$</a>
</address>
$endif$
$else$
<h4 class="author"><em>$author$</em></h4>
$endif$
$endfor$
$if(date)$
<h4 class="date"><em>$date$</em></h4>
$endif$
</div>
$endif$

$if(toc)$
<div id="$idprefix$TOC">
$toc$
</div>
$endif$

<div id="content">
$body$
</div>

$for(include-after)$
$include-after$
$endfor$

$if(theme)$
    </div>
  </div>
</div>

<script>

// add bootstrap table styles to pandoc tables
$$(document).ready(function () {
  $$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
});

</script>
$endif$

<script>
$$(document).ready(function () {
 	$if(thumbnails)$
 	$$('#content img')
 	  .addClass("image-thumb");
  $endif$
  $if(lightbox)$
  $$('#content img')
 	  .addClass("image-lb");
  $$('#content').magnificPopup({
	      type:'image',
	      closeOnContentClick: false,
	      closeBtnInside: false,
	      delegate: 'img',
	      gallery: {enabled: $gallery$ },
	      image: {
	        verticalFit: true,
          titleSrc: 'alt'
	      }
 	    });
 	$endif$
});
</script>


$if(mathjax-url)$
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
  (function () {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src  = "$mathjax-url$";
    document.getElementsByTagName("head")[0].appendChild(script);
  })();
</script>
$endif$

</body>
</html>
