User Tools

Site Tools


paper:latex:equation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
paper:latex:equation [2022/03/30 11:47]
odagawa
paper:latex:equation [2022/12/23 13:16] (current)
odagawa
Line 1: Line 1:
 =====数式の書き方===== =====数式の書き方=====
  
-前提として eqnarray 環境は非推奨.+  * 前提として eqnarray 環境は非推奨. 
 +  * 数式環境内に空白の行を作るとエラーになる 
 +  * amsmath や mathtools が必要なものもある 
 + 
 +  * 1行の数式を書きたいとき -> equation 環境 
 +<code latex> 
 +\begin{equation} 
 +y = ax 
 +\label{eq:proportional} 
 +\end{equation} 
 +</code> 
 + 
 +  *複数行の数式を書きたいとき,たとえば式変形をするとき -> align 環境 
 +  * 全部の行に式番号が入る 
 +  * & の部分が揃う 
 +<code latex> 
 +\begin{align} 
 +(a + b)^2 &= (a + b) (a +b) \label{eq:a_plus_b_1}\\ 
 +&= a^2 + 2ab + b^2 \label{eq:a_plus_b_2} 
 +\end{align} 
 +</code> 
 + 
 +  * 複数の数式を書きたいとき,たとえば複数の関数をならべるとき -> gather 環境 
 +  * 全部の行に式番号が入る 
 +  * 中央に揃う 
 +<code latex> 
 +\begin{gather} 
 +A(x) = x \label{eq:x}\\ 
 +B(x) = x^2 \label{eq:x2} 
 +\end{gather} 
 +</code> 
 + 
 +  * 長い数式を複数行にわけるとき -> split 環境 
 +  * 数式番号は全体でひとつ 
 +  * & の部分で揃う 
 +<code latex> 
 +\begin{equation} 
 +    \begin{split} 
 +    a &= \int_0^\infty f(x)\sin x\cos x dx \\ 
 +    &\quad - \int_0^\infty f(-x)\sin x\cos x dx 
 +    \end{split} \label{eq:int_plus_minus} 
 +\end{equation} 
 +</code> 
 + 
 +  * 長い数式を複数行にわけるとき -> multline 環境 
 +  * スペルに注意 
 +  * 一番上が左揃え,一番下が右揃えになる 
 +<code latex> 
 +\begin{multline} 
 +a + b + c + d + e + f + g \\ 
 ++ h + i + j + k + l + m + n + o \\ 
 ++ p + q + r + s + t + u + v + w + x + y + z 
 +\end{multline} 
 +</code> 
 + 
 +  * multline を split などと一緒に使いたい -> multlined 環境 
 +  * D 論の式 (9.4), (9.5) 
 +<code latex> 
 +\begin{align} 
 +\begin{split} 
 +\Delta\theta_\mathrm{rad'} &= \arctan\left(\frac{\bm{a}_1 \cdot \hat{\bm{r'}}}{\bm{a}_1 \cdot \hat{\bm{t}}} \right) \\ 
 +&= \!\begin{multlined}[t] 
 +\arctan\left( \left. \frac{-\tan\theta_{x0}\tan\theta_{x1} - \tan\theta_{y0}\tan\theta_{y1} + \tan^2\theta_{x0} + \tan^2\theta_{y0}}{\sqrt{\tan^2\theta_{x0} + \tan^2\theta_{y0} + (\tan^2\theta_{x0} + \tan^2\theta_{y0})^2}} \right. \right. \\ 
 +\hspace{0.3\textwidth} \left. \left. \middle/ \frac{\tan\theta_{x0}\tan\theta_{x1} + \tan\theta_{y0}\tan\theta_{y1} + 1}{\sqrt{\tan^2\theta_{x0} + \tan^2\theta_{y0} + 1}} \right. \right), 
 +\end{multlined} 
 +\end{split} \label{eq:mcs_radial_angle_difference} \\ 
 +\begin{split} 
 +\Delta\theta_\mathrm{lat'} &= \arctan\left(\frac{\bm{a}_1 \cdot \hat{\bm{l'}}}{\bm{a}_1 \cdot \hat{\bm{t}}} \right) \\ 
 +&= \!\begin{multlined}[t] 
 +\arctan\left(\left. \frac{-\tan\theta_{y0}\tan\theta_{x1} + \tan\theta_{x0}\tan\theta_{y1}}{\sqrt{\tan^2\theta_{x0} + \tan^2\theta_{y0}}} \right. \right. \\ 
 +\hspace{0.3\textwidth} \left. \left. \middle/ \frac{\tan\theta_{x0}\tan\theta_{x1} + \tan\theta_{y0}\tan\theta_{y1} + 1}{\sqrt{\tan^2\theta_{x0} + \tan^2\theta_{y0} + 1}} \right. \right). 
 +\end{multlined} 
 +\end{split} \label{eq:mcs_lateral_angle_difference} 
 +\end{align} 
 +</code>
paper/latex/equation.1648640821.txt.gz · Last modified: 2022/03/30 11:47 by odagawa