Repository: kaisugi/marp-theme-academic Branch: main Commit: 04b7271881a4 Files: 5 Total size: 5.5 KB Directory structure: gitextract_g2kecmxt/ ├── .github/ │ └── workflows/ │ └── demo-file-generation.yml ├── LICENSE ├── README.md ├── demo.md └── themes/ └── academic.css ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/workflows/demo-file-generation.yml ================================================ name: generate demo files on: push: branches: [ main ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: generate pdf run: | docker run --rm --init -v $PWD:/home/marp/app/ -e LANG="ja_JP.UTF-8" -e MARP_USER="$(id -u):$(id -g)" marpteam/marp-cli demo.md --theme themes/academic.css --pdf --allow-local-files - name: generate png run: | docker run --rm --init -v $PWD:/home/marp/app/ -e LANG="ja_JP.UTF-8" -e MARP_USER="$(id -u):$(id -g)" marpteam/marp-cli demo.md --theme themes/academic.css --images --allow-local-files - name: commit & push run: | if ! git diff --exit-code --quiet then git add -A git config user.name github-actions git config user.email github-actions@github.com git add . git commit -m "update demo files" git push fi ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2022 Kaito Sugimoto Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # marp-theme-academic ![](./demo.001.png) ![](./demo.002.png) ![](./demo.003.png) ![](./demo.004.png) ![](./demo.005.png) ![](./demo.006.png) ================================================ FILE: demo.md ================================================ --- marp: true theme: academic paginate: true math: katex --- # Marpで研究室の発表スライドを作る #### 〜Beamerを卒業しよう〜
**著者 太郎** ほげほげ研究室 M2 YYYY/MM/DD --- 1. はじめに 1. コードブロック 1. 数式 1. 図 --- - Marp とは **Markdown** で**スライド**を作成するためのソフトウェアである。 - 基本的な Markdown のシンタックスがサポートされている。 - Markdown 上で `---` という区切り線を入れるだけで、次のページに移動することができる。$^1$ > 1: Marp は CommonMark という Markdown の仕様に沿って開発されているため、CommonMark に含まれていない「脚注」の文法(`[^1]` を使うもの)が提供されていない。そこで、https://github.com/marp-team/marp/discussions/150#discussioncomment-1302384 を参照して擬似的に脚注を実現した。 --- ```python import torch print(torch.cuda.is_available()) ``` こんな感じでコードブロックを書くことができる。 ```python from transformers import AutoModelForMaskedLM, AutoTokenizer model = AutoModelForMaskedLM.from_pretrained("cl-tohoku/bert-base-japanese-whole-word-masking") tokenizer = AutoTokenizer.from_pretrained("cl-tohoku/bert-base-japanese-whole-word-masking") inputs = tokenizer.encode_plus("私はとても[MASK]です。", return_tensors='pt') outputs = model(**inputs) tokenizer.convert_ids_to_tokens(outputs.logits[0][1:-1].argmax(axis=-1)) ``` 横幅は自動調整される(ドキュメントの[Auto-scaling](https://github.com/marp-team/marp-core#auto-scaling-features)を参照)。 --- $$ I_{xx}=\int\int_Ry^2f(x,y)\cdot{}dydx $$ $$ f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x} \,d\xi $$ こんな感じで数式を書くことができる。もちろんインラインの $\LaTeX$ も使える。 ついでに絵文字も使える:smile: --- 1. まず[このいらすとやのリンク](https://www.irasutoya.com/2018/10/blog-post_723.html)から画像(`kenkyu_woman_seikou.png`)を右クリックでダウンロードしてください。 2. この Markdown のあるディレクトリの中に `images` という名前のディレクトリを作り、先ほどダウンロードした画像を配置してください。これで準備が整いました。 ![w:300 center](./images/kenkyu_woman_seikou.png) ================================================ FILE: themes/academic.css ================================================ /* @theme academic */ @import 'gaia'; @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap'); :root { --color-background: #fff; --color-foreground: #333; --color-highlight: #800000; } section { background-image: none; font-family: 'Noto Sans JP', sans-serif; padding-top: 90px; padding-left: 40px; padding-right: 40px; } /* https://github.com/marp-team/marpit/issues/271 */ section::after { font-weight: 700; content: attr(data-marpit-pagination) '/' attr(data-marpit-pagination-total); } ul ul { font-size: 0.9em; } section.lead h1 { color: #800000; text-align: left; } section.lead h1 strong { -webkit-text-stroke: 1px #800000; } section.lead h2 { color: #800000; text-align: left; } section.lead h2 strong { -webkit-text-stroke: 1px #800000; } section.lead h3 { color: #800000; text-align: left; } section.lead h3 strong { -webkit-text-stroke: 1px #800000; } section.lead h4 { color: #800000; text-align: left; } section.lead h4 strong { -webkit-text-stroke: 1px #800000; } section.lead h5 { color: #800000; text-align: left; } section.lead h5 strong { -webkit-text-stroke: 1px #800000; } section.lead p { text-align: right; } header { background-color: #800000; color: #fff; font-size: 1em; font-weight: 700; } blockquote { max-width: 90%; border-top: 0.1em dashed #555; font-size: 60%; position: absolute; bottom: 20px; } blockquote::before { content: ""; } blockquote::after { content: ""; } img[alt~="center"] { display: block; margin: 0 auto; } code { font-family: 'Source Code Pro', monospace; }