Skip to content

Commit a93fc74

Browse files
committed
Merge pull request #2 from robertodr/master
Add support for MathJax and an example slide
2 parents c7a1df4 + d68927a commit a93fc74

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

demo.mkd

+29
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ class: center, middle, inverse
44
---
55
#remark
66
[ri-mahrk]
7+
8+
.author[Foo Bar]
9+
10+
.institution[University of There]
11+
12+
.date[27 January]
713
.footnote[Go directly to [project site](https://github.com/gnab/remark)]
814
---
915
## What is it and why should I be using it?
@@ -330,6 +336,29 @@ Getting up and running is done in only a few steps:
330336
For more information on using remark, please check out the [wiki](https://github.com/gnab/remark/wiki) pages.
331337
]
332338
---
339+
class: left
340+
341+
## How About Some Gnarly Equations?
342+
343+
I'm glad you asked. With a link to the MathJax Javascript library, you can
344+
write inline equations `\(E=mc^2\)`, or full-line equations like:
345+
346+
`$$\Gamma(t)= \pi \, \Im\left\{ \mathbf{x}_+^H(t) \, \frac{\mathrm{d}}{\mathrm{d} t}\mathbf{x}_+(t)\right\}$$`
347+
348+
You can just write in LaTeX, with minor modifications for specifying in-line or
349+
full-line equations. Also, in Remark, the equations are surrounded by
350+
backquotes, as you see in the source.
351+
352+
353+
[{MathJax}](https://www.mathjax.org/) lets you write your equations in other ways; see the documentation for details.
354+
355+
356+
Note that writing equations in MathJax impacts the portability of your talk.
357+
Currently, this template links to a local copy of Remark, but a remote (online)
358+
copy of MathJax. If you want the equations to work when you are offline, you
359+
need to copy the entire MathJax project, about 150 Mb. See the comments at the
360+
bottom of this file.
361+
---
333362
name: last-page
334363
template: inverse
335364

templates/slides.html

+33
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,17 @@
119119
float: right;
120120
padding-top: 1em;
121121
}
122+
123+
/* Some special classes */
124+
.title {font-size: 3.3em; color:#606060;font-weight:bold;letter-spacing:0.05em}
125+
.subtitle {font-size: 1.4em}
126+
.author {font-size: 1.4em; color:#606060;font-weight:bold;letter-spacing:0.02em}
127+
.coauthor {font-size: 1.0em; color:#606060;font-weight:bold;letter-spacing:0.02em}
128+
.institution {font-size: 1.0em;}
129+
.date {font-size: 1.0em;font-style: italic}
130+
131+
.cite {font-size: 0.8em; color:#33AA99;font-style: italic}
132+
.strike {color:salmon;text-decoration:line-through}
122133
</style>
123134
</head>
124135
<body>
@@ -137,5 +148,27 @@
137148
highlightLines: true
138149
}) ;
139150
</script>
151+
<!-- This is the link to the remote MathJax libraries -->
152+
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML&delayStartupUntil=configured" type="text/javascript"></script>
153+
<!-- If you want to run your presentation offline, you need to download the MathJax -->
154+
<!-- libraries, then uncomment the line below and comment out the one above.-->
155+
<!--<script src="../javascript/MathJax/MathJax.js?config=TeX-AMS_HTML&delayStartupUntil=configured,local/local" type="text/javascript"></script> -->
156+
<!-- 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-->
157+
158+
<script type="text/javascript">
159+
// Setup MathJax
160+
MathJax.Hub.Config({
161+
tex2jax: {
162+
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre']
163+
}
164+
});
165+
MathJax.Hub.Queue(function() {
166+
$(MathJax.Hub.getAllJax()).map(function(index, elem) {
167+
return(elem.SourceElement());
168+
}).parent().addClass('has-jax');
169+
});
170+
171+
MathJax.Hub.Configured();
172+
</script>
140173
</body>
141174
</html>

0 commit comments

Comments
 (0)