<!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>
<!-- Material Design fonts -->
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/icon?family=Material+Icons">
$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>
$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>

<div class="header-panel shadow z-2">
    <div class="container-fluid">
        <div class="row">
            <div class="col-xs-3">
    $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$
</div>
</div>
</div>
</div>


<div class="container-fluid main-container">
    <div class="row">
      <nav class="col-xs-3 menu" id="toc">
        $toc$
      </nav>
     <div class="pages col-xs-9">
     <div class="row">
       <div class="col-xs-10">

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


$body$

    </div>
    <div class="col-xs-2">
    $if(code_folding)$
    <div class="btn-toolbar">
    <div class="btn-group">
    <a href="#" class="btn btn-raised btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="text-muted">Code</span> <span class="text-muted caret"></span></a>
    <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>
    </div>
    $endif$
    </div>
  </div>
  </div>
  </div>
  <div class="row">
$for(include-after)$
$include-after$
$endfor$
    </div>
  </div>

<script>
$$(document).ready(function () {
  // add bootstrap table styles to pandoc tables
  $$('tr.header').parent('thead').parent('table').addClass('table table-striped table-hover');

  $if(thumbnails)$
  var images = $$('.pages img');
  images.filter(function() {
      if ($$(this).parent().attr("class") == "figure") {
          return(false)
      } else {
          return(true);
      }
  }).wrap("<div class='figure'></div>");
  images.addClass("image-thumb").wrap("<div class='panel-body'></div>");
  $$('.figure p.caption').wrap("<div class='panel-footer'></div>");
  $$('.figure').addClass('panel panel-default');
  $endif$

  $if(lightbox)$
  $$('.pages img')
 	  .addClass("image-lb");
  $$('.pages').magnificPopup({
	      type:'image',
	      closeOnContentClick: false,
	      delegate: 'img',
	      gallery: {enabled: $gallery$ },
          removalDelay: 500,
          callbacks: {
              beforeOpen: function() {
                // just a hack that adds mfp-anim class to markup
                this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
              }
          },
          mainClass: 'mfp-move-from-top',
	      image: {
	        verticalFit: true,
            titleSrc: 'alt'
	      }
 	    });
 	$endif$

    window.page = window.location.hash;
    if (window.page != "") {
      $$(".menu").find("li[data-target=" + window.page + "]").trigger("click");
    }

    /* init material bootstrap js */
    $$.material.init();
});
</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>
