
初めて LaTeX に方程式を直接挿入するので、明らかなことを見逃しているに違いありません。
単純な 2 行 2 列のマトリックスがあります。ただし、マトリックスの一番上の行は希望どおり (左揃え) に配置されていますが、2 番目の行は中央揃えになっているようです。この行の配置を指定する方法はありますか?
現在の結果:
目標結果:
マークアップ:
\begin{figure}[h]
\Large
\begin{displaymath}
\Delta\tau_{xy}^{k} = \left\{\begin{matrix}
Q/L_k & if\; Agent\; k\; uses\; curve\; xy\; in\; its\; tour\\
0 & otherwise
\end{matrix}\right.
\end{displaymath}
\end{figure}
答え1
dcases*
から使用できますmathtools
。ここで、最初の列は数式モード、2 番目の列はテキスト モードです。
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\Delta\tau_{xy}^{k} =
\begin{dcases*}
Q/L_k & if Agent $k$ uses curve $xy$ in its tour\\
0 & otherwise
\end{dcases*}
\end{equation}
\end{document}
ここでも同じ使用法ですcases
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\Delta\tau_{xy}^{k} =
\begin{cases}
Q/L_k & \text{if Agent $k$ uses curve $xy$ in its tour}\\
0 & \text{otherwise}
\end{cases}
\end{equation}
\end{document}
この場合、2番目の列の内容を\tex{...}
マクロで囲む必要があることに注意してください。
答え2
matrix
の関連コマンドamsmath
すべてに列がc
入力されています。簡単な方法は、cases
と を使用することです。または、 で手動で設定して、array
希望する配置にすることもできます。
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\Delta\tau_{xy}^{k} = \left\{\begin{matrix}
Q/L_k & \text{if Agent~$k$ uses curve~$xy$ in its tour} \\
0 & \text{otherwise}
\end{matrix}\right.
\]
\[
\Delta\tau_{xy}^{k} = \left\{\begin{array}{@{}ll@{}}
Q/L_k & \text{if Agent~$k$ uses curve~$xy$ in its tour} \\
0 & \text{otherwise}
\end{array}\right.\kern-\nulldelimiterspace
\]
\end{document}