logo

テックスで項の数を示す表現 브레이스 📂論文作成

テックスで項の数を示す表現 브레이스

コード

TeXで項の数を表す際、よく複数の項をまとめる表現として \overbrace, \underbrace コマンドが使用される。この2つのコマンドを使用するには、\usepackage{amsmath}を用いて amsmath パッケージを含める必要がある。

\documentclass{article}
\usepackage{amsmath}

\begin{document}
$$
x + n = x + \overbrace{1 + \cdots + 1}^{n \text{ times}}
$$

$$
xn = \underbrace{x + \cdots + x}_{n \text{ times}}
$$
\end{document}

両方のコマンドは、1つ目の引数としてまとめられる数式が入り、2つ目の引数としてどのようにまとめるかが入る。\overbrace では2つ目の引数の前にキャレット ^ が来て、\underbrace では2つ目の引数の前にアンダースコア _ が来ることに注意しよう。

x+n=x+1++1n times x + n = x + \overbrace{1 + \cdots + 1}^{n \text{ times}}

xn=x++xn times xn = \underbrace{x + \cdots + x}_{n \text{ times}}