Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MathJax and an example slide #2

Merged
merged 1 commit into from
Feb 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions demo.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ class: center, middle, inverse
---
#remark
[ri-mahrk]

.author[Foo Bar]

.institution[University of There]

.date[27 January]
.footnote[Go directly to [project site](https://github.com/gnab/remark)]
---
## What is it and why should I be using it?
Expand Down Expand Up @@ -330,6 +336,29 @@ Getting up and running is done in only a few steps:
For more information on using remark, please check out the [wiki](https://github.com/gnab/remark/wiki) pages.
]
---
class: left

## How About Some Gnarly Equations?

I'm glad you asked. With a link to the MathJax Javascript library, you can
write inline equations `\(E=mc^2\)`, or full-line equations like:

`$$\Gamma(t)= \pi \, \Im\left\{ \mathbf{x}_+^H(t) \, \frac{\mathrm{d}}{\mathrm{d} t}\mathbf{x}_+(t)\right\}$$`

You can just write in LaTeX, with minor modifications for specifying in-line or
full-line equations. Also, in Remark, the equations are surrounded by
backquotes, as you see in the source.


[{MathJax}](https://www.mathjax.org/) lets you write your equations in other ways; see the documentation for details.


Note that writing equations in MathJax impacts the portability of your talk.
Currently, this template links to a local copy of Remark, but a remote (online)
copy of MathJax. If you want the equations to work when you are offline, you
need to copy the entire MathJax project, about 150 Mb. See the comments at the
bottom of this file.
---
name: last-page
template: inverse

Expand Down
33 changes: 33 additions & 0 deletions templates/slides.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@
float: right;
padding-top: 1em;
}

/* Some special classes */
.title {font-size: 3.3em; color:#606060;font-weight:bold;letter-spacing:0.05em}
.subtitle {font-size: 1.4em}
.author {font-size: 1.4em; color:#606060;font-weight:bold;letter-spacing:0.02em}
.coauthor {font-size: 1.0em; color:#606060;font-weight:bold;letter-spacing:0.02em}
.institution {font-size: 1.0em;}
.date {font-size: 1.0em;font-style: italic}

.cite {font-size: 0.8em; color:#33AA99;font-style: italic}
.strike {color:salmon;text-decoration:line-through}
</style>
</head>
<body>
Expand All @@ -137,5 +148,27 @@
highlightLines: true
}) ;
</script>
<!-- This is the link to the remote MathJax libraries -->
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML&delayStartupUntil=configured" type="text/javascript"></script>
<!-- If you want to run your presentation offline, you need to download the MathJax -->
<!-- libraries, then uncomment the line below and comment out the one above.-->
<!--<script src="../javascript/MathJax/MathJax.js?config=TeX-AMS_HTML&delayStartupUntil=configured,local/local" type="text/javascript"></script> -->
<!-- Note: see comment at http://stackoverflow.com/questions/19208536/mathjax-not-working-if-loaded-from-local-js-file-or-if-the-source-code-is-includ-->

<script type="text/javascript">
// Setup MathJax
MathJax.Hub.Config({
tex2jax: {
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre']
}
});
MathJax.Hub.Queue(function() {
$(MathJax.Hub.getAllJax()).map(function(index, elem) {
return(elem.SourceElement());
}).parent().addClass('has-jax');
});

MathJax.Hub.Configured();
</script>
</body>
</html>