0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

VSCodeでmarkdown上に数式を書いてPDFで出力する

Last updated at Posted at 2020-08-22

概要

データエンジニア(≠データサイエンティスト)のキャリアを歩みたいと思っていますが、
ちょっと数式を書けると格好良いのでちょっと調べてみた。

VSCodeでmarkdownに数式を書く

VSCodeでmarkdown上で数式を書くときは、Markdown+Mathを使う

数式で1行使いたいとき

$$ f(x)=e^{x} $$ 式1

$$ f(x)=e^{x} $$ 式1

数式の前後で改行したくないとき

$ x_{ij} $ の前後で改行しない

$ x_{ij} $ の前後で改行しない

数式の記法は、KATEXの公式ドキュメント参照。

VSCodeでmarkdownをPDFに変換

おまじないとして、ファイルの最初に下記を埋め込む

<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax:{inlineMath:[['\$','\$'],['\\(','\\)']],processEscapes:true},CommonHTML: {matchFontHeight:false}});</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"></script>

markdownからPDFを出力は、markdown-pdfを使う

⌘ + Shift + p でコマンドパレットを開いて、
Markdown PDF Export (pdf) を入力して選択するとPDFで出力される

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?