Emacs でプレゼン資料を作る方法 - org-beamer-mode 編 / How to use org-beamer-mode

Emacs でプレゼン資料を作る方法 - org-beamer-mode 編 / How to use org-beamer-mode

Emacs の org-beamer-mode でプレゼン資料を作るためのセットアップ方法を紹介しています。

F738b5a32aca20c2fe5ff47571ab7f01?s=128

mugijiru

June 01, 2020
Tweet

Transcript

  1. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ ഴो

    June 1, 2020 ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  2. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ Outline  ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ ! org-beamer-mode

    " ࠷ޙʹ ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  3. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ ͜ͷࢿྉͷ໨త ࠷ۙٱʑʹొஃͨ͠ͷ͚ͩͲɺͦͷ࣌ʹ org-beamer-mode Λ ࢖ͬͨ ࢖ͬͯΈͨ͜ͱΛه࿥͓͖͔ͯͨͬͨ͠

    ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  4. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ ϓϨθϯࢿྉ࡞੒πʔϧͷϦετ Emacs ͰϓϨθϯࢿྉΛ࡞ΔͨΊͷύοέʔδྨ͸ࣗ෼͕࠷ۙௐ ΂ͨൣғͩͱ org-re-reveal org-tree-slide

    org-beamer-mode ͷ 3 छྨ͕͋Δɻ org-* ʹภͬͯΔͷ͸ɺଟ෼ org-mode Ͱ࢖͑Δ΍ͭΛ୳͔ͯͨ͠ Β (͋Μ·Γ֮͑ͯͳ͍) ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  5. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ org-re-reveal https://gitlab.com/oer/org-re-reveal reveal.js ͱ͍͏ HTML ͰͷϓϨθϯςʔγϣϯ༻ͷ

    JS ͕ ͋Δ ͦΕ༻ʹ org ͔Β export ͢ΔͨΊͷύοέʔδ͕͜Ε classmethod ͷ͜ͷهࣄ ͕ଟ෼ৄ͍͠ https: //dev.classmethod.jp/articles/org-mode-re-reveal/ ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  6. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ org-tree-slide https://github.com/takaxp/org-tree-slide org-mode ͷ֤πϦʔΛεϥΠυΈ͍ͨʹදࣔ͢Δ΍ͭ Emacs ಺Ͱͦͷ··࢖͑ͯศར͛

    org-mode ͳͷͰͦͷ··ಡΊͯྑ͍ ެࣜ Wiki ʹৄ͘͠ॻ͔ΕͯΔ https://pxaka.tokyo/wiki/emacs:org-tree-slide ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  7. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ org-beamer-mode https: //orgmode.org/worg/exporters/beamer/tutorial.html org-mode ʹඪ४Ͱ༻ҙ͞ΕͯΔ minor-mode

    Beamer ޲͚ͷίϚϯυ౳͕༻ҙ͞ΕͯΔ Beamer ͸ L )TEX ϕʔεͰεϥΠυ༻ PDF Λੜ੒Ͱ͖ΔΫ ϥε ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  8. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ બ୒ཧ༝ PDF ͕ੜ੒͞ΕΔͷͰࢿྉڞ༗͕͠΍͍͔͢Β ࢼ͠ʹม׵ͯ͠ΈͨΒͦΕͬΆ͍ݟͨ໨ʹͳ͔ͬͨΒ ߄͍͔ͯͯͨΒਖ਼௚͋·ΓͪΌΜͱݕূ͸ͯ͠ͳ͍ ഴो

    Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  9. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ ར༻ʹඞཁͳ΋ͷ Emacs org-mode Ghostscript L )TEX

    ؀ڥ ࠓճࢼͨ͠ͷ͸ macOS ޲͚ͷ BasicTeX ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  10. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ BasicTex ͷ༻ҙ 1 ͜ΜͳࢿྉΛಡΉΑ͏ͳਓ͸ Emacs ΋

    org-mode ΋ೖΕͯΔ ͱ͸ࢥ͏ͷͰ L )TEX ؀ڥͷ༻ҙͷΈॻ͍͓͖ͯ·͢ɻ େମ https://texwiki.texjp.org/?BasicTeX ʹॻ͍͍ͯ Δ಺༰Ͱ͢ɻ(ࣗ෼͸ͦΕ͚ͩͩͱͪΐͬͱͭ·͍ͮͨʜʜ) ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  11. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ BasicTex ͷ༻ҙ 2 BasicTeX ͷΠϯετʔϧ http://tug.org/mactex/morepackages.html

    ͔Βμ΢ϯ ϩʔυ͢Δ͔ brew cask install basictex ͰΠϯεί ࠷৽൛·ͰΞοϓσʔτ $ sudo tlmgr update --self --all σϑΥϧτͷ༻ࢴαΠζΛ A4 ʹ͢Δ $ sudo tlmgr paper a4 ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  12. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ BasicTex ͷ༻ҙ 3 ೔ຊޠ؀ڥΛೖΕΔ $ sudo

    tlmgr install collection-langjapanese latexmk ΛೖΕΔ $ sudo tlmgr install latexmk ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  13. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ BasicTex ͷ༻ҙ 4 ࢿྉ࡞੒தɺม׵࣌ʹΤϥʔʹͳͬͨ࣌ʹద౰ʹೖΕͯΈͨ΍ͭ org-latex-default-packages-alist ʹೖͬͯΔ͔ΒೖΕ͓͍ͯͨํ͕

    ྑͦ͞͏ capt-of ਤදʹΩϟϓγϣϯΛ෇͚ΔͨΊͷ΋ͷΒ͍͠ ࢀߟ: http: //konoyonohana.blog.fc2.com/blog-entry-202.html $ sudo tlmgr install capt-of wrap-g wrapg.sty ͱ͍͏ը૾ͷճΓࠐΈ༻ͷελΠϧϑΝΠϧ $ sudo tlmgr install wrap-fig ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  14. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ latexmk ͷઃఆ ࣗ෼͸ ~/.latexmkrc ʹ͜͏ॻ͍͓͍ͯͨɻ ͳͥͳΒ

    https://texwiki.texjp.org/?Emacs%2FOrg%20mode ʹॻ ͍ͯΔ௨Γͩͱ͏·͍͔͘ͳ͔͔ͬͨΒɻ ্ه URL Ͱ͸ emacs lisp Ͱઃఆ͍ͯ͠Δ಺༰Λ .latexmkrc ʹҠಈ͍ͯ͠Δ͚ͩ ઃఆྫ $latex='uplatex %S'; $bibtex='upbibtex %B'; $biber='biber --bblencoding=utf8 -u -U --output_safechars %B'; $makeindex='upmendex -o %D %S'; $dvipdf='dvipdfmx -o %D %S'; ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  15. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ Emacs ͷઃఆ ͜Ε΋ https://texwiki.texjp.org/?Emacs%2FOrg%20mode ʹॻ ͍ͯ͋Δ಺༰͔Βഈआ

    ઃఆྫ (setq org-latex-pdf-process '("latexmk -gg -pdfdvi %f")) ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  16. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ ࢿྉͷઃఆ 1 ઃఆྫ #+LATEX_CLASS: beamer #+LATEX_CLASS_OPTIONS:

    [dvipdfmx,presentation] #+OPTIONS: H:2 toc:t num:t author:t #+LATEX_HEADER: \usepackage{pxjahyper} #+LATEX_HEADER: \usepackage{beamerthemeshadow} #+LATEX_HEADER: \RequirePackage{fancyvrb} #+LATEX_HEADER: \DefineVerbatimEnvironment{verbatim}{Verbatim}% #+LATEX_HEADER: {fontsize=\scriptsize} #+TITLE: Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ #+AUTHOR: ഴो ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  17. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ ࢿྉͷઃఆ 2 Emacs Org Mode ͷ

    Beamer Export ʹ͍ͭͯগ͠ | 㦌๏Ӎ Λࢀߟʹͨ͠ ͱ͍͏͔΄΅ύΫͬͨ https://ryogan.org/blog/2016/01/06/ emacs-org-mode-%E3%81%AE-beamer-export-%E3%81%AB% E3%81%A4%E3%81%84%E3%81%A6%E5%B0%91%E3%81%97/ ઃఆྫͷίʔυͷϑΥϯτ͕େ͖͍໰୊͸ https://emacs.stackexchange.com/questions/23871/ Ͱղফͨ͠ ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  18. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ ؆୯ͳ࢖͍ํ 1 org-mode ͷϑΝΠϧΛ։͘ 2 ϑΝΠϧઌ಄ʹࢿྉ༻ͷઃఆΛೖΕΔ

    3 M-x org-beamer-mode Ͱ org-beamer-mode Λ༗ޮʹ͢Δ 1 C-c C-b Ͱ֤ϒϩοΫຖʹ columns ͱ͔ exampleblock ͱ͔ ෇͚ͯՃ޻͢Δ 4 ࠷ޙʹ M-x org-beamer-export-to-pdf ͱ͔͢Δͱ PDF ग़ྗ͞ΕΔ ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  19. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ ͏·͘ PDF ͕ग़ྗͰ͖ͳ͍࣌͸ *Org PDF LaTex

    Output* ΤϥʔΛோΊͯؤுΔ େମ tex ϑΝΠϧ·Ͱ͸ੜ੒͞ΕΔͷͰίϚϯυϥΠϯ͔Β latexmk Λୟ͍ͯ֬ೝͯ͠ΈΔ dvi ·Ͱग़ͯΔ͔ͱ͔ͷ੾Γ෼͚͕Ͱ͖Δɺ͸ͣ ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  20. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ ͜Ε͔Β࣮ࡍʹग़ྗ͞ΕΔࢿྉ ग़ྗͯ͠ Speakerdeck ʹ্͓͖͛ͯ·ͨ͠ https://speakerdeck.com/mugijiru/ how-to-use-org-beamer-mode

    ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  21. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ ·ͱΊ org-beamer-mode Λ࢖͏ͱ org-mode ͔Β L

    )TEX Beamer ͷ PDF ͕ు͚ͯྑ͍ ίϚϯυΛ੔͑ͨΒ org ˠ tex ˠ dvi ˠ pdf ͕ҰൃͰࡁΉ org-mode ͱ͍͏ॻ͖׳Εͨ΍ͭͰϓϨθϯࢿྉ͕࡞Εͯศར ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ
  22. ͸͡Ίʹ ֤ϓϨθϯࢿྉ࡞੒πʔϧͷ؆୯ͳઆ໌ org-beamer-mode ࠷ޙʹ ࠓޙ΍͍͖͍ͬͯͨ͜ͱ org-beamer-select-environment ͱ͔࢖͍౗͍ͨ͠ theme มߋ͍ͨ͠ Linux

    Ͱ΋࢖ͬͯΈ͍ͨ org-tree-slide ͳͲ΋ࢼͯ͠Έ͍ͨ ͨͩ͠ڵຯ͕ਚ͖ͨΒ΍Βͳ͘ͳΔ͸ͣʜʜw ഴो Emacs ͰϓϨθϯࢿྉΛ࡞Δํ๏ - org-beamer-mode ฤ