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?

More than 3 years have passed since last update.

Qiita用MathJaxマクロ集

Last updated at Posted at 2020-05-01

$\phantom{}$$
\newcommand\nr{\notag\\}%タグなし改行用
\newcommand\ret{\notag\\&\qquad}%数式改行用
\newcommand\I{\mathrm{i}}
\newcommand\D{\mathrm{d}}
\newcommand\E{\mathrm{e}}
\newcommand\hc{\mathrm{h.c.}}
\newcommand\cc{\mathrm{c.c.}}
\newcommand\O[1]{\mathscr{O}\left(#1\right)}
\newcommand\abs[1]{{\left\rvert #1 \right\lvert}}
\newcommand\Res{\mathop{\mathrm{Res}}}
\newcommand\bra[1]{\mathinner{\langle{#1}|}}
\newcommand\ket[1]{\mathinner{|{#1}\rangle}}
\newcommand\braket[1]{\mathinner{\langle{#1}\rangle}}
\newcommand\Bra[1]{\left\langle#1\right|}
\newcommand\Ket[1]{\left|#1\right\rangle}
\newcommand\Braket[1]{\left\langle #1 \right\rangle}
\newcommand|{\middle|}%\Braket用
\DeclareMathOperator{\Log}{Log}
\DeclareMathOperator{\Arg}{Arg}
\DeclareMathOperator{\sgn}{sgn}
\DeclareMathOperator{\Tr}{Tr}
\newcommand\dashint{\mathchoice
{\int\kern-10pt-}
{\int\kern-8.5pt-}
{\int\kern-6.1pt-}
{\int\kern-4.58pt-}}
\newcommand\set[1]{\left\{#1\right\}}
\newcommand\for[1]{\quad\mathrm{for}\quad #1}
\newcommand\LHS{\mathrm{(LHS)}}
\newcommand\RHS{\mathrm{(RHS)}}
$定義した記号は以下の通り.

名称 入力 数式モード出力
虚数単位 \I $\I$
微分 \D $\D$
ネイピア数 \E $\E$
複素共役 \cc $\cc$
エルミート共役 \hc $\hc$
絶対値 \abs{\frac{a}{b}} $\abs{\frac{a}{b}}$
オーダ \O{N^2} $\O{N^2}$
主値対数 \Log z $\Log z$
主値偏角 \Arg z $\Arg z$
符号関数 \sgn x $\sgn x$
留数 \Res_{z=a} f(z) $\Res_{z=a} f(z)$
トレース \Tr A $\Tr A$
主値積分 \dashint $\dashint$
ブラベクトル \bra{a} $\bra{a}$
ケットベクトル \ket{a} $\ket{a}$
ブラケット \braket{a|A|b} $\braket{a|A|b}$
ブラベクトル (自動リサイズ) \Bra{\frac{1}{A}} $\Bra{\frac{1}{A}}$
ケットベクトル (自動リサイズ) \Ket{\frac{1}{B}} $\Ket{\frac{1}{B}}$
ブラケット (自動リサイズ) \Braket{a \| \frac{1}{A} \| b} $\Braket{a\|\frac{1}{A}\|b}$
集合 \set{n} $\set{n}$
for y=f(x)\for{x\in\mathbb{R}} $y=f(x)\for{x\in\mathbb{R}}$
left-hand-side \LHS $\LHS$
right-hand-side \RHS $\RHS$

これらを使えば,例えば

\dashint \D x \frac{\E^{\I a x}}{x} = \I \pi \sgn(a) \for{a\in\mathbb{R}},

\dashint \D x \frac{\E^{\I a x}}{x} = \I \pi \sgn(a) \for{a\in\mathbb{R}},

のように略記できる.
以下をページの先頭に貼り付けておけばよい.
一度もMathJaxを呼び出していない状態ではなぜか表示がバグるので1行目に\phantom{}をおいた.

$\phantom{}$$
\newcommand\nr{\notag\\\\}%タグなし改行用
\newcommand\ret{\notag\\\\&\qquad}%数式改行用
\newcommand\I{\mathrm{i}}
\newcommand\D{\mathrm{d}}
\newcommand\E{\mathrm{e}}
\newcommand\hc{\mathrm{h.c.}}
\newcommand\cc{\mathrm{c.c.}}
\newcommand\O[1]{\mathscr{O}\left(#1\right)}
\newcommand\abs[1]{{\left\rvert #1 \right\lvert}}
\newcommand\Res{\mathop{\mathrm{Res}}}
\newcommand\bra[1]{\mathinner{\langle{#1}|}}
\newcommand\ket[1]{\mathinner{|{#1}\rangle}}
\newcommand\braket[1]{\mathinner{\langle{#1}\rangle}}
\newcommand\Bra[1]{\left\langle#1\right|}
\newcommand\Ket[1]{\left|#1\right\rangle}
\newcommand\Braket[1]{\left\langle #1 \right\rangle}
\newcommand\|{\middle|}%\Braket用
\DeclareMathOperator{\Log}{Log}
\DeclareMathOperator{\Arg}{Arg}
\DeclareMathOperator{\sgn}{sgn}
\DeclareMathOperator{\Tr}{Tr}
\newcommand\dashint{\mathchoice
  {\int\kern-10pt-}
  {\int\kern-8.5pt-}
  {\int\kern-6.1pt-}
  {\int\kern-4.58pt-}}
\newcommand\set[1]{\left\\{#1\right\\}}
\newcommand\for[1]{\quad\mathrm{for}\quad #1}
\newcommand\LHS{\mathrm{(LHS)}}
\newcommand\RHS{\mathrm{(RHS)}}
$
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?