\LaTeX におけるルート(根号,累乗根)のコマンドと高さ・深さの変え方,添え字の位置の変え方を説明します。
なお,amsmath パッケージの使用は仮定しています。
ルート(根号)sqrtの基本的な使い方
| 記号 | コマンド |
|---|---|
| \sqrt{x} | \sqrt{x} |
| \sqrt[n]{x} | \sqrt[n]{x} |
ルートの中身を {} 内に指定し,n乗根を表したいときは [] を付けて表します。
ルート(根号)sqrtに関するテクニック
\sqrt に関するテクニックをまとめましょう。
ルート(根号)の高さを変える
ルート(根号)の高さを変えるテクニックを紹介しましょう。以下の表を見てください。
| 出力 | コマンド | 解説 |
|---|---|---|
| \sqrt{a}+\sqrt{b} | \sqrt{a}+\sqrt{b} | |
| \sqrt{a}+\sqrt{\smash[t]{b}} | \sqrt{a}+\sqrt{\smash[t]{b}} | bの高さを潰す |
| \sqrt{\mathstrut a}+\sqrt{\mathstrut b} | \sqrt{\mathstrut a}+\sqrt{\mathstrut b} | a,bの高さ,深さを上げる |
| \sqrt{\smash[b]{\mathstrut a}} + \sqrt{\smash[b]{\mathstrut b}} | \sqrt{\smash[b]{\mathstrut a}}+\sqrt{\smash[b]{\mathstrut b}} | aの高さを上げ,bの深さを潰す |
| \sqrt{x}+\sqrt{y} | \sqrt{x}+\sqrt{y} | |
| \sqrt{x} + \sqrt{\smash[b]{y}} | \sqrt{x}+\sqrt{\smash[b]{y}} | yの深さを潰す |
| \sqrt{\mathstrut x} + \sqrt{\mathstrut y} | \sqrt{\mathstrut x}+\sqrt{\mathstrut y} | x,yの高さを上げる |
| \sqrt{\smash[b]{\mathstrut x}} + \sqrt{\smash[b]{\mathstrut y}} | \sqrt{\smash[b]{\mathstrut x}}+\sqrt{\smash[b]{\mathstrut y}} | x,yの高さを上げ,深さを潰す |
| \sqrt{g}+\sqrt{h} | \sqrt{g}+\sqrt{h} | |
| \sqrt{\smash{g}}+\sqrt{\smash{h}} | \sqrt{\smash{g}}+\sqrt{\smash{h}} | g,hの深さ,高さを潰す |
| \sqrt{\mathstrut g}+\sqrt{\mathstrut h} | \sqrt{\mathstrut g}+\sqrt{\mathstrut h} | g,hの高さを上げる |
| \sqrt{\smash[b]{\mathstrut g}} + \sqrt{\smash[b]{\mathstrut h}} | \sqrt{\smash[b]{\mathstrut g}}+\sqrt{\smash[b]{\mathstrut h}} | gの深さを潰し,hの高さを上げる |
| \sqrt{\vphantom{gh} g} + \sqrt{\vphantom{gh} h} | \sqrt{\vphantom{gh}g}+\sqrt{\vphantom{gh}h} | 「gh」と同じ高さ,深さで 幅ゼロの文字を挿入 |
| \sqrt{2+\sqrt{2}} | \displaystyle\sqrt{2+\sqrt{2}} | ディスプレイスタイルの二重根号 |
| \textstyle\sqrt{2+\sqrt{2}} | \textstyle\sqrt{2+\sqrt{2}} | テキストスタイルの二重根号 |
想定していますから,文中数式だと少し出力が変わる可能性があります。
\smash は高さ・深さを潰す命令で,\smash[b]{} で深さを,\smash[t]{} で高さを潰します。\mathstrut は数式用の支柱で,高さ・深さを上げるための命令です。
また,\vphantom{<formula>} は<formula>と同じ高さ・深さを設定する命令です。類似のものに,\hphantom{<formula>} (<formula>と同じ幅の空白を出力する),\phantom{<formula>} (<formula>と同じ高さ・深さ・幅の空白を出力する)があります。
さまざまなものを試し,良いと思うものを使うとよいでしょう。
二重根号については,ディスプレイスタイルだと高さが高くなるため,気になるのであれば,テキストスタイルで書くようにすればよいでしょう。
ルート(根号)の左の添え字の位置を変える
n乗根における,左の添え字の位置を変える方法を紹介します。以下の表を見てください。
| 出力 | コマンド | 解説 |
|---|---|---|
![]() | \sqrt[\beta]{k} | |
![]() | \sqrt[\leftroot{-2}\beta]{k} | \beta を右に2動かす |
![]() | \sqrt[\uproot{2}\beta]{k} | \beta を上に2動かす |
![]() | \sqrt[\leftroot{-2}\uproot{2}\beta]{k} | \beta を右,上に2ずつ動かす |
\leftroot{} は添え字を左に,\uproot{} は添え字を上に動かす命令です。

![\sqrt[\leftroot{-2}\beta]{k}](https://mathlandscape.com/wp-content/uploads/2021/04/latex-sqrt2.png)
![\sqrt[\uproot{2}\beta]{k}](https://mathlandscape.com/wp-content/uploads/2021/04/latex-sqrt3.png)
![\sqrt[\leftroot{-2}\uproot{2}\beta]{k}](https://mathlandscape.com/wp-content/uploads/2021/04/latex-sqrt4.png)


