tex

tex で絶対値記号やノルムの縦棒を長くする方法

投稿日:2020年12月25日 更新日:

ノルムの絶対値記号を単純に入力しただけでは短くて困ることがあるので、長くしたいときがある。

\amsmath パッケージで、 \lVert や \rVert, \lvert や \rvert  を使う。

以下のコマンドでは、ノルム(\norm)と絶対値(\abs)のコマンドを自分で定義して使用している。

\usepackage{amsmath}

\newcommand{\norm}[1]{\left\lVert#1\right\rVert}
\newcommand{\abs}[1]{\left\lvert#1\right\rvert}

\begin{document}

\begin{equation}
    \norm{\sum_{k=1}^{n} a_k }
\end{equation}

\begin{equation}
    \abs{\sum_{k=1}^{n} a_k }
\end{equation}

\end{document}

結果

-tex
-

執筆者:


comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

関連記事

no image

tex でブロック行列を入力する方法

ゼロの成分が多いブロック行列を tex で出力する。 \usepackage{amsmath} を使う。 例 \usepackage{amsmath} \begin{document} $$ \lef …

no image

tex でバックスラッシュを入力する方法

テキストモードでは \textbackslash 数式モード内では \backslash を、それぞれ使う。 例 $\backslash$ \textbackslash 結果

no image

tex の equation 環境で複数行の数式を入力する(\split を使う)

\equation の中で \split を使う。 \tag を使って、自分で定義した式番号を使える。 例 \begin{equation} \begin{split} a \\ b \\ c \en …

no image

tex でパーセント記号のフォントを変更する方法

tex で、パーセント記号の一部がくっついて表示される場合、パーセント記号の部分だけ別のフォントで表示するという解決法がある。 例 \DeclareRobustCommand{\percent}{{\ …

no image

tex で表の縦横軸を調整する方法

例 \begin{center} \begin{table}[] \begin{tabular}{|c|c|c|c|} \hline 氏名 & 生年 & 没年 & 著書 …