LoginSignup
2
3

More than 1 year has passed since last update.

Google SitesでMathJaxの数式を入力できるようにする

Posted at

Googleサイトには数式を入力する機能はありません。

MathJaxのHTMLを埋め込むことで、簡単に数式を$\LaTeX$形式入力することができます。

1. Google SitesでHTML埋め込み画面にする

Google Sitesで、任意の場所をダブルクリックして、左側の「埋め込む」のボタンをクリックします。
image.png

2. 数式を入力する

「埋め込みコード」で、以下のように$$$$の間に数式を書きます。

image.png

<body>
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
</script>
</head>
$$
\frac{-b\pm\sqrt{b^2-4ac}}{2a}
$$
</body>
</html>

すると、プレビュー画面で、きちんとMathJaxで数式が美しく表示されます。
image.png

「保存」をクリックすると、無事に埋め込まれました。

image.png

コピペ用にこちらをお使いください。

コピペ用
<body>
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
</script>
</head>
$$

$$
</body>
</html>
2
3
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
2
3