数式が使える最強のプレゼンテーション環境
うれしい
使うもの
サンプル
導入手順
- ローカルに適当にディレクトリ(
slides
とする)を作る。 slides
ディレクトリにindex.html
を作り、同じディレクトリにcontents.md
を配置する。index.html
をブラウザで開けばOKスライドが見れる。index.html
<DOCTYPE html> <html> <head><title>Presentation</title></head> <body> <script src="https://remarkjs.com/downloads/remark-latest.min.js" type="text/javascript"></script> <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML&delayStartupUntil=configured" type="text/javascript"></script> </script> <script type="text/javascript"> var slideshow = remark.create({ sourceUrl: "contents.md" }); // 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>
contents.md
# slide 1 - 1ページ目 --- # slide 2 - 2ページ目 $$ x = a_{1} + b^{2} $$ ## フーリエ変換 $$ F(u) = \int\_{-\infty}^{\infty} f(x)\mathrm{e}^{-j2\pi ux}dx $$ ## 2次元のフーリエ変換 $$ F(u,v) = \int\_{-\infty}^{\infty} \int\_{-\infty}^{\infty} f(x,y)\mathrm{e}^{-j2\pi (ux + vy )}dxdy $$
ここまでで、ローカルでスライドが見れる環境ができる。 次は、github pagesを作って、github上でスライドが見れるようにする。
4. slides
上でgitレポジトリを作り、全部コミット。
git init git add . git commit -m 'Initial commit.'
5. githubにレポジトリを作り、slides
のレポジトリをpushする。
git remote add https://github.com/username/repository_namae/ git push origin master
6. gh-pagesを使う為、gh-pages
ブランチを作って、githubにpushする。
git checkout -b gh-pages git push origin gh-pages
7. https://username.github.io/repository_name
にアクセスするとレポジトリトップのindex.html
のファイルが表示される。
- uploadしたデータが反映されるまで10分ほどかかるみたいなので気長にまつ。
username
はgithubのユーザ名reposiotry_name
はレポジトリの名前
キー操作
j
次のスライドk
前のスライドc
スライドのclone- スライドを clone すると、元のスライドでページ移動した際、clone 先のスライドも同期して移動する。
f
フルスクリーンp
プレゼンモードh
ヘルプの表示
補足
contents.md
では、普通にmarkdown中にmathjaxを書けばOK。 具体的には、$$
で数式を囲む。- mathjaxのURLに
delayStartupUntil=configured
オプションを含めると、markdownで問題になる_
のエスケープなどが不要になるので便利。
個人的には、スライドごとにレポジトリを作る気分にあんまりならないので、下記のように1つのレポジトリをまとめている。
特に工夫はないが、レポジトリのトップのcontents.md
はレポジトリ内のスライドへのリンクテーブルになっている個人的に便利。
# link * [directory_name](http://user_name.github.io/repository_name/directory_name/) * sample
3. レポジトリにスライドごとにディレクトリを作り、各ディレクトリにindex.html
とcontents.md
を作る。