Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Markdown to LaTeX

Markdown to LaTeX

Markdown to LaTeX

Avatar for Kaneko Tatsuya

Kaneko Tatsuya

April 14, 2013
Tweet

More Decks by Kaneko Tatsuya

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ • ۚࢠୡ࠸ • 〤〛〟 ID: catatsuy • twitter: catatsuy

    URL: • http://www.catatsuy.org • http://blog.catatsuy.org • https://matw.co
  2. ॴଐ • ౦ژ޻ۀେֶʢʺి௨େʣ • ৘ใ޻ֶՊ 4 ೥ʢ9 ݄ଔۀ༧ఆʣ • ٢੉ݚڀࣨ

    • ぢアゃゔがのぎがずふぜばを • C++11 ্〜まがへげこぎهड़〣てゎゔ゛がてゖアぇ『 ぀ DSL ぇఏڙ『぀゘ぐゅ゘゙ぇߴ଎Խ『぀ݚڀぇ「〛 ⿶〳『ʢ௕。〟぀〣〜ུʣ
  3. Pandoc ぐアとぷが゚ Ubuntu: sudo apt-get install haskell-platform Mac: brew install

    ghc brew install haskell-platform common: cabal update cabal install pandoc # ~/.cabal/bin/ ぶく゛ぜぷ゙ҎԼ〠 PATH ぇ௨『
  4. Pandoc 〣࢖⿶ํ # ຊจ〣〴 pandoc input.md -o output.tex # ふアゆ゛がぷࠐ〴

    pandoc -s input.md -o output.tex # beamerʢゆ゛にアʣग़ྗ pandoc -t beamer input.md -o output.tex # ม਺ࢦఆ pandoc -V fontsize=12Q input.md -o output.tex
  5. Pandoc 〣໰୊఺ • ‘gcc‘ 〝ॻ。〝 \texttt{gcc} 〠《ぁ〛「〳⿸ • ຊ౰〤 \verb+gcc+

    〝⿾〠「〛ཉ「⿶ • ふアゆ゛がぷ⿿೔ຊ〣 L A TEX ޲々〜〤〟⿶
  6. Github 〜 Fork 「〳「〔ʂ git clone git://github.com/catatsuy/pandoc.git cd pandoc git

    submodule init git submodule update # git://github.com/catatsuy/pandoc-templates.git # ⿿ data/templates ҎԼ〠 clone 《ぁ぀
  7. ‘ ‘ 〣ڍಈぇม⿺぀ src/Text/Pandoc/Writers/LaTeX.hs - rawCode = liftM (text .

    (\s -> "\\texttt{" ++ s ++ "}")) - $ stringToLaTeX False str + rawCode = liftM (text . (\s -> "\\verb‘" ++ s ++ "‘")) + $ stringToLaTeX True str
  8. cabal-dev • cabal 〤 ~/.cabal/ ҎԼ〠ぐアとぷが゚『぀ • 『〜〠ຊՈ〣 pandoc 〤ぐアとぷが゚ࡁ〴

    • じ゛アぷぶく゛ぜぷ゙্〜ぢアむぐ゚「〔⿶ cabal install cabal-dev cd pandoc cabal-dev install --sandbox=. # pandoc/bin/ ҎԼ〠࣮ߦやきぐ゚⿿ग़ྗ《ぁ぀
  9. ࢖〘〛〴〛෼⿾〘〔໰୊఺ • গ「〜〷ෳࡶ〟〷〣〤 L A TEX 〜ॻ。ඞཁ • Emacs 〣৭෼々⿿

    L A TEX ෦෼〜ޮ⿾〟⿶ • yatex 〣ڧྗ〟ิ׬ػೳ⿿࢖⿺〟⿶ • վߦ「〔〝〈あ〜とらがと⿿ೖ぀〈〝⿿⿴぀
  10. վળҊ • Markdown 〜 L A TEX 〣จষぇॻ。〣〜〤〟。 L A

    TEX 〣จষ্〜 Markdown ه๏ぇ෦෼త〠࢖⿸〮  • とらがと⿿ೖ〘〛〷໰୊〣〟⿶ॴ〜վߦ『぀ # ௕⿶〣〜 Makefile ࡞੒ਪ঑ pandoc -f markdown input.tex -o output.tex # yatex 〤ぶやさ゚ぷ〜ࣗಈվߦ「〛「〳⿸〣〜 .emacs 〠௥Ճ (add-hook ’ yatex-mode-hook ’(lambda () (auto-fill-mode -1)))
  11. ܽ఺ • ग़ྗぇҙࣝ「〟⿿〾ॻ。ඞཁ • L A TEX 〣ॻ ํ〠〷޻෉⿿ඞཁ • L

    A TEX ぇ७ਮ〠ॻ。〟〾ੜ」〟⿶ແବ〟೰〴⿿ൃੜ
  12. ඞཁ〟޻෉ • \\ ⿿ॻ々〟⿶ • \linebreak 〹 \newline 〟〞ぇ࢖⿸ඞཁ •

    ぢゐアぷぎげぷ⿿ % 〜〜 〟⿶ • comment.sty ⿾ \if0 \fi ぇ࢖⿸