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?

LaTeXで文中でも斜体太字にする方法

Posted at

はじめに

LaTeXで数式中の記号や文字を太字で表したい場合、\mathbf{}\bm{}が使えるが、文章中では使用できない。そのため、文章中で斜体の太字を出力できる自作コマンドを紹介する。

以下のように出力できるようになる。

まず、プリアンブルに次の設定を追加する。

\newcommand{\boldsymbolmath}[1]{{\mbox{\boldmath $#1$}}}

使い方

文章中で次のように記述すると、文字や記号を太字で表示できる。

\boldsymbolmath{A}  
\boldsymbolmath{\alpha}  
\boldsymbolmath{v = (x, y, z)}

解説

  • \newcommandで新しいコマンド\boldsymbolmath{}を定義している。
  • \mboxは中身を1つのボックスとして扱うことで、文字崩れを防ぐ。
  • \boldmathは数式モードで文字を太字にする命令である。
  • $#1$の部分で、引数を数式として解釈させている。
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?