3 つの異なる長さの 3 つの異なる方程式を左揃えにしたいと思います。現在、次のコードを使用しています。
\begin{equation}
log_{10}M_{200} = (0.94\pm0.005)log_{10}N_{gal}+(12.11\pm0.009)\hspace{10mm} \left[for N_{gal}>20\right]
\label{equation:power_law_rich20}
\end{equation}
\begin{equation}
log_{10}M_{200} = (0.74\pm0.003)log_{10}N_{gal}+(12.46\pm0.005)\hspace{10mm} \left[for M_{200}>2X10^{13}M_{\odot}\right]
\label{equation:power_law_mass2e13}
\end{equation}
\begin{equation}
log_{10}M_{200} = (0.85\pm0.005)log_{10}N_{gal}+(12.28\pm0.008)\hspace{10mm} \left[for (N_{gal}>20+M_{200}>2X10^{13}M_{\odot})\right]
\label{equation:power_law_rich20_mass2e13}
\end{equation}
次のような出力が得られます:
これら3つの式を別々に左揃えにしたい。つまり、式番号(5)と(6)を、最も長い式である式(7)に揃えたい。
答え1
使用するalign
環境:
\documentclass{article}
\usepackage[margin=1cm,a4paper]{geometry}
\usepackage{amsmath}
\usepackage{lipsum} % just for the example
\begin{document}
\lipsum*[2]
\begin{align}
\log_{10}M_{200} &= (0.94\pm0.005)\log_{10}N_{\mathrm{gal}}+(12.11\pm0.009)
&&\text{for $N_{\mathrm{gal}}>20$}
\label{equation:power_law_rich20}
\\
\log_{10}M_{200} &= (0.74\pm0.003)\log_{10}N_{\mathrm{gal}}+(12.46\pm0.005)
&&\text{for $M_{200}>2\times10^{13}M_{\odot}$}
\label{equation:power_law_mass2e13}
\\
\log_{10}M_{200} &= (0.85\pm0.005)\log_{10}N_{\mathrm{gal}}+(12.28\pm0.008)
&&\text{for $(N_{\mathrm{gal}}>20+M_{200}>2\times10^{13}M_{\odot})$}
\label{equation:power_law_rich20_mass2e13}
\end{align}
\lipsum[3]
\end{document}
\log
の代わりに を使用する必要があることに注意してくださいlog
。また、\times
その場合の製品の正しい記号は であり、 ではありませんX
。
スペースの制約が厳しい場合は、multlined
以下を使用できますmathtools
。
\documentclass{article}
%\usepackage[margin=1cm,a4paper]{geometry}
\usepackage{amsmath,mathtools}
\usepackage{lipsum} % just for the example
\begin{document}
\lipsum*[2]
\begin{gather}
\begin{multlined}[c][\dimexpr\displaywidth-5em]
\log_{10}M_{200} = (0.94\pm0.005)\log_{10}N_{\mathrm{gal}}+(12.11\pm0.009)
\\\text{for $N_{\mathrm{gal}}>20$}
\end{multlined}
\label{equation:power_law_rich20}
\\
\begin{multlined}[c][\dimexpr\displaywidth-5em]
\log_{10}M_{200} = (0.74\pm0.003)\log_{10}N_{\mathrm{gal}}+(12.46\pm0.005)
\\\text{for $M_{200}>2\times10^{13}M_{\odot}$}
\end{multlined}
\label{equation:power_law_mass2e13}
\\
\begin{multlined}[c][\dimexpr\displaywidth-5em]
\log_{10}M_{200} = (0.85\pm0.005)\log_{10}N_{\mathrm{gal}}+(12.28\pm0.008)
\\\text{for $(N_{\mathrm{gal}}>20+M_{200}>2\times10^{13}M_{\odot})$}
\end{multlined}
\label{equation:power_law_rich20_mass2e13}
\end{gather}
\lipsum[3]
\end{document}