0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Markdownでmathjaxのインラインが使えない時の対処法

Posted at

VScodeでのmarkdown記法

まず、前提としてmarkdownで数式を出力するにはこういうのを使わなければいけない。その上でMarkdown PDFでエクスポートする。

<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.min.js">
</script>
<script type="text/x-mathjax-config">
 MathJax.Hub.Config({
 tex2jax: {
 inlineMath: [['$', '$']],
 displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
 }
 });
</script>

まあここまではいいでしょう。しかし例えば以下のような構文を使うと数式として認識されなくなる(僕はそうだった)

$ \hat a $

いや意味が分からん。あらゆるサイトからそのままコピペしただけなのに数式として使えないなんておかしいじゃないか!しかし上記のスクリプトではなく以下のような構文を用いるとうまくいった

<script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_CHTML"></script>
<script type="text/x-mathjax-config">
 MathJax.Hub.Config({
 tex2jax: {
 inlineMath: [["$","$"], ["\\(","\\)"]],
 displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
 }
 });
</script>

displayと似たような感じにすればうまくいった。これで無理なら他の記事を見るべきだ。私では無理だ

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?