表とその注釈内の配置に関する問題

表とその注釈内の配置に関する問題

私の問題を説明するために、次の表を見てください。

ここに画像の説明を入力してください

1) 赤い部分を中央に近づけて、3 つの列がより中央にくるようにします。

2) 青い部分を縦に 1 行に揃えたいのですが、 を使用しようとしました{flalign*}が、これにより方程式が上部の列に揃えられ、「収益性計算」には揃えられません。

私が使用するコードは次のとおりです:

\documentclass[12pt]{article}
\usepackage{setspace,amsmath,graphicx,float}
\usepackage[english]{babel}
\usepackage{boldline}
\usepackage{array}
\usepackage[left=3cm,top=3.5cm,right=2.5cm,bottom=2.5cm]{geometry}
\usepackage{times}
\usepackage{threeparttable}
\usepackage[margin=1cm]{caption}
\usepackage{amssymb}
\usepackage{tabularx}

\begin{document}
\begin{table}[H]
\centering
\small
\caption[xxx]{Example calculation for a two-product SSNIP test \citep{QuantTech}.}
\begin{threeparttable}
\begin{tabularx}{\textwidth}{p{20em} >{\centering\arraybackslash}p{8em}  >{\centering\arraybackslash}p{7em}}    
\hlineB{3}
  & Product 1 & Product 2  \\ \hline
Margin & 10\% & 20\% \\
Diversion ratio & 0.29 & 0.5 \\ 
Own-price elasticity of demand & 2 & 4 \\ 
Ratio of prices $p_2 / p_1$ & 1 & 1 \\                       
\hlineB{3}
\end{tabularx}
\begin{tablenotes}
\setlength{\belowdisplayskip}{0pt} \setlength{\belowdisplayshortskip}{0pt}
\setlength{\abovedisplayskip}{0pt} \setlength{\abovedisplayshortskip}{0pt}
\item Profitability calculation:\\
\begin{align*}
\frac{p_1 - c_1}{p_1} \overset{?}{\leqslant} \frac{1}{\eta_{11}(p_1,p_2.\ldots,p_J)} + \frac{p_2 - c_2}{p_2} \frac{p_2}{p_1} DR_{12}, \qquad 0.1 \leqslant \frac{1}{2} + 0.2 \times 1 \times 0.29 = 0.56
 \end{align*}

\begin{align*}
\frac{p_2 - c_2}{p_1} \overset{?}{\leqslant} \frac{1}{\eta_{22}(p_1,p_2.\ldots,p_J)} + \frac{p_1 - c_1}{p_1} \frac{p_1}{p_2} DR_{21}, \qquad 0.2 \leqslant \frac{1}{4} + 0.1 \times 1 \times 0.5 = 0.30
\end{align*}

\end{tablenotes}
\end{threeparttable}
\label{ExampleSSNIP}   
\end{table}
\end{document}

どのような助けでも感謝します。ありがとうございます!

答え1

本当にテーブルをテキスト幅いっぱいに表示したい場合 (2 列の組版を行っている場合を除いて、そうすべきではありません)、少なくとも は使用しないでください\small

threeparttableこの場合、は必要ありません。 のみを使用します\raggedright

newtxtext私はと を使用しましたnewtxmath。 を使用することもできますmathptmxが、結果は悪くなりますtimes。ドキュメントに数式が含まれている場合は、絶対に を使用しないでください。

\documentclass[12pt]{article}
\usepackage[left=3cm,top=3.5cm,right=2.5cm,bottom=2.5cm]{geometry}
\usepackage{amsmath}
\usepackage{newtxtext,newtxmath}
\usepackage{booktabs}
\usepackage{natbib}
\usepackage[margin=1cm]{caption}

\begin{document}
\begin{table}

\caption[xxx]{Example calculation for a two-product SSNIP test \citep{QuantTech}.}
\label{ExampleSSNIP}   

\centering

\begin{tabular*}{\textwidth}{
  @{\hspace{.1\textwidth}\extracolsep{\fill}}
  l c c
  @{\hspace{.1\textwidth}}
}
\toprule
                               & Product 1 & Product 2 \\
\midrule
Margin                         & 10\%      & 20\%      \\
Diversion ratio                & 0.29      & 0.5       \\
Own-price elasticity of demand & 2         & 4         \\
Ratio of prices $p_2 / p_1$    & 1         & 1         \\
\bottomrule
\end{tabular*}

\medskip

\raggedright
Profitability calculation:\\[\medskipamount]
$\begin{alignedat}{2}
\frac{p_1 - c_1}{p_1} &\overset{?}{\leqslant} 
  \frac{1}{\eta_{11}(p_1,p_2.\dots,p_J)} + \frac{p_2 - c_2}{p_2} \frac{p_2}{p_1} DR_{12},
  &\qquad& 0.1 \leqslant \frac{1}{2} + 0.2 \times 1 \times 0.29 = 0.56
\\
\frac{p_2 - c_2}{p_1} &\overset{?}{\leqslant} 
  \frac{1}{\eta_{22}(p_1,p_2.\dots,p_J)} + \frac{p_1 - c_1}{p_1} \frac{p_1}{p_2} DR_{21},
  &\qquad& 0.2 \leqslant \frac{1}{4} + 0.1 \times 1 \times 0.5 = 0.30
\end{alignedat}$

\end{table}

\end{document}

の代わりにboldrule私は を使用しましたbooktabs。最初の列の前と最後の列の後の間隔の量を調整します。しかし、私のアドバイスはない特に列数が少ない場合に、テーブルを人為的に拡張します。

\ldotsであることに注意してください\dots

ここに画像の説明を入力してください

答え2

flushleftここでは、 tablenotes のオプションと、環境をラップするfleqnからの環境を使用したソリューションを示します。これにより、1 つの方程式グループに対して、| fleqn amsmath` をローカルで使用する効果があります。nccmathalign*option from

timesまた、廃止されたパッケージをnewtx、Times クローン (TeX Gyre Termes) を使用するに置き換えました。

\documentclass[12pt]{article}
\usepackage{setspace,amsmath,graphicx,float}
\usepackage[english]{babel}
\usepackage{boldline}
\usepackage{array}
\usepackage[left=3cm,top=3.5cm,right=2.5cm,bottom=2.5cm]{geometry}
\usepackage{newtxtext, newtxmath}
\usepackage{threeparttable}
\usepackage[margin=1cm]{caption}
\usepackage{amssymb}
\usepackage{tabularx}
\usepackage{nccmath}


 \begin{document}

\begin{table}[H]
  \centering
  \small
  \caption[xxx]{Example calculation for a two-product SSNIP test.}% \citep{QuantTech}
  \begin{threeparttable}
    \begin{tabularx}{\textwidth}{p{20em} >{\centering\arraybackslash}p{8em} >{\centering\arraybackslash}p{7em}}
      \hlineB{3}
                                     & Product 1 & Product 2 \\ \hline
      Margin & 10\,\% & 20\,\% \\
      Diversion ratio & 0.29 & 0.5 \\
      Own-price elasticity of demand & 2 & 4 \\
      Ratio of prices $p_2/p_1 $ & 1 & 1 \\
      \hlineB{3}
    \end{tabularx}
    \begin{tablenotes}[flushleft]
      \setlength{\belowdisplayskip}{0pt} \setlength{\belowdisplayshortskip}{0pt}
      \setlength{\abovedisplayskip}{0pt} \setlength{\abovedisplayshortskip}{0pt}
      \item Profitability calculation:
      \begin{fleqn}[\fontdimen2\font]
        \begin{align*}
          \frac{p_1 - c_1}{p_1} & \overset{?}{\leqslant} \frac{1}{\eta_{11}(p_1,p_2.\ldots,p_J)} + \frac{p_2 - c_2}{p_2} \frac{p_2}{p_1} DR_{12}, & 0.1 & \leqslant \frac{1}{2} + 0.2 × 1 × 0.29 = 0.56 \\%
          \frac{p_2 - c_2}{p_1} & \overset{?}{\leqslant} \frac{1}{\eta_{22}(p_1,p_2.\ldots,p_J)} + \frac{p_1 - c_1}{p_1} \frac{p_1}{p_2} DR_{21}, & 0.2 & \leqslant \frac{1}{4} + 0.1 × 1 × 0.5 = 0.30
        \end{align*}
      \end{fleqn}
    \end{tablenotes}
  \end{threeparttable}
  \label{ExampleSSNIP}
\end{table}

\end{document} 

ここに画像の説明を入力してください

しかし、私は に基づいてtabulary、私の意見ではより良く見えるこのコードを提案します:

\documentclass[12pt]{article}
\usepackage{setspace,amsmath,graphicx,float}
\usepackage[english]{babel}
\usepackage{boldline}
\usepackage{array}
\usepackage[left=3cm,top=3.5cm,right=2.5cm,bottom=2.5cm]{geometry}
\usepackage{newtxtext, newtxmath}
\usepackage{threeparttable}
\usepackage[margin=1cm]{caption}
\usepackage{amssymb}
\usepackage{tabularx, tabulary}
\usepackage{nccmath}


 \begin{document}

\begin{table}[H]
  \centering
  \small\setlength\extrarowheight{2pt}
  \caption[xxx]{Example calculation for a two-product SSNIP test.}% \citep{QuantTech}
  \begin{threeparttable}
    \begin{tabulary}{\textwidth}{L>{\centering\arraybackslash}p{8em} >{\centering\arraybackslash}p{8em}@{}}%p{20em} \hlineB{3}
                                     & Product 1 & Product 2 \\ \hlineB{3}
      Margin & 10\,\% & 20\,\% \\
      Diversion ratio & 0.29 & 0.5 \\
      Own-price elasticity of demand & 2 & 4 \\
      Ratio of prices $p_2 / p_1$ & 1 & 1 \\
      \hlineB{3}
    \end{tabulary}
    \begin{tablenotes}[flushleft]\footnotesize
      \setlength{\belowdisplayskip}{0pt} \setlength{\belowdisplayshortskip}{0pt}
      \setlength{\abovedisplayskip}{0pt} \setlength{\abovedisplayshortskip}{0pt}
      \item Profitability calculation:
      \begin{fleqn}[\fontdimen2\font]
        \begin{align*}
          \frac{p_1 - c_1}{p_1} & \overset{?}{\leqslant} \frac{1}{\eta_{11}(p_1,p_2.\ldots,p_J)} + \frac{p_2 - c_2}{p_2} \frac{p_2}{p_1} DR_{12}, & 0.1 & \leqslant \frac{1}{2} + 0.2 \times 1 \times 0.29 = 0.56 \\%
          \frac{p_2 - c_2}{p_1} & \overset{?}{\leqslant} \frac{1}{\eta_{22}(p_1,p_2.\ldots,p_J)} + \frac{p_1 - c_1}{p_1} \frac{p_1}{p_2} DR_{21}, & 0.2 & \leqslant \frac{1}{4} + 0.1 \times 1 \times 0.5 = 0.30
        \end{align*}
      \end{fleqn}
    \end{tablenotes}
  \end{threeparttable}
  \label{ExampleSSNIP}
\end{table}

\end{document} 

ここに画像の説明を入力してください

関連情報