自動行折り返し機能付き2列表

自動行折り返し機能付き2列表

2 列の表を作成しようとしています (これは、ドキュメント全体で 2 列の唯一のセクションです)。一部の行が長すぎるため、折り返したいと思います (この部分は機能します)。ただし、これにより、行に空白行が発生し、テキストが短くなります (例: 最初の行 - 左側の列は 1 行のみですが、右側の列は 2 行です)。これを折り返して空白をなくすようにエレガントに編集するにはどうすればよいでしょうか。最悪の場合、行を手動で分割して、別の行に配置することになります。下の画像は、上に移動したい行の例を示しています。

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

\documentclass[12pt, notitlepage]{article}
\usepackage[letterpaper, portrait, margin=1in]{geometry}
\usepackage{amsmath}


\begin{document}
\begin{tabular}{p{0.05\textwidth}  p{0.4\textwidth} p{0.05\textwidth} p{0.05\textwidth}  p{0.4\textwidth}}
\underline{\textbf{Sets}} &&& \underline{\textbf{Parameters}}\\
$\mathcal{V}$ & set of customers && $\delta_{trc}$ & Penalty for flow from scenario $t$ to scenario $r$ for cluster $c$\\
$\mathcal{S}_v$ & set of schedules for customer $v$ && $Q$ & Maximum capacity of vehicle\\
$\mathcal{T}_c$ & set of target demand scenarios for cluster $c$ && $\underline{q}{}_v$ & Minimum delivery quantity for customer $v$\\
$\mathcal{R}_c$ & set of demand scenarios for cluster $c$ && $D_v$ & Total demand of customer $v$ over all periods\\
$\mathcal{C}$ & set of clusters && $D^{CMI}$ & Total average daily CMI demand\\
$\mathcal{K}_c$ & set of customers in cluster $c$ && $\xi$ & Proportion of total average daily CMI demand to set aside in fleet\\
\underline{\textbf{Variables}} &&&$\underline{q}{}_{crv}$ & Lower bound of demand for customer $v$ in scenario $r$ of cluster $c$\\
$d_{vs}\in\{0,1\}$ & Customer $v$ served using schedule $s$ && $\overline{q}_{crv}$ & Upper bound of demand for customer $v$ in scenario $r$ of cluster $c$\\
$q_{vp}\in\{0,1\}$ & Delivered amount to customer $v$ on period $p$ && $\pi_{tc}$ & Target fraction of days of scenario $t$ for cluster $c$\\
$x_{vpk}\in\{0,1\}$ & Customer $v$ delivered in period $p$ using vehicle $k$\\
$y_{crp}\in\{0,1\}$ & Scenario $r$ of cluster $c$ occurs in period $p$\\
$f_{trc}\in\mathbb{R}$ & Optimal \emph{flow} from scenario $t$ to scenario $r$ for cluster $c$\\
$\Pi_{rc}\in\mathbb{R}$ & Fraction of days of serving scenario $s$ for cluster $c$\\
\\
\end{tabular}

\end{document}

答え1

tabularx幅がそれぞれ と の2 つの 2 列の環境を並べて配置することをお勧めします。左側の環境を右側の環境よりも広くすることで、環境全体の長さをほぼ同じにする0.57\linewidthことができます。0.43\linewidthtabularxtabularx

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

\documentclass[12pt]{article}
\usepackage[letterpaper,margin=1in]{geometry}
\usepackage{amsmath,amssymb}
\usepackage{tabularx,ragged2e}
\newcolumntype{L}{>{\RaggedRight}X} % suspend full justification

\begin{document}

\begingroup % localize scope of next three instructions
\small      % 10% linear reduction in font size
\setlength\tabcolsep{4pt}      % default: 6pt
\setlength\extrarowheight{2pt} % default: 0pt
\noindent
\begin{tabularx}{0.57\linewidth}[t]{@{} >{$}l<{$} L }
\multicolumn{2}{@{}l}{\textbf{Sets}} \\
\mathcal{V}   & set of customers \\ 
\mathcal{S}_v & set of schedules for customer $v$ \\ 
\mathcal{T}_c & set of target demand scenarios for cluster $c$ \\ 
\mathcal{R}_c & set of demand scenarios for cluster $c$ \\ 
\mathcal{C}   & set of clusters \\ 
\mathcal{K}_c & set of customers in cluster $c$ \\[1ex]
\multicolumn{2}{@{}l}{\textbf{Variables}} \\ 
d_{vs}{\in}\{0,1\}     & Customer $v$ served using schedule $s$ \\ 
q_{vp}{\in}\{0,1\}     & Delivered amount to customer $v$ in period $p$ \\ 
x_{vpk}{\in}\{0,1\}    & Customer $v$ delivered in period $p$ using vehicle $k$\\
y_{crp}{\in}\{0,1\}    & Scenario $r$ of cluster $c$ occurs in period $p$\\
f_{trc}{\in}\mathbb{R} & Optimal \emph{flow} from scenario $t$ to scenario $r$ for cluster $c$\\
\Pi_{rc}{\in}\mathbb{R}& Fraction of days of serving scenario $s$ for cluster $c$\\
\end{tabularx}%
\begin{tabularx}{0.43\linewidth}[t]{ >{$}l<{$} L @{}}
\multicolumn{2}{l}{\textbf{Parameters}} \\
\delta_{trc}       & Penalty for flow from scenario $t$ to scenario $r$ for cluster $c$\\
Q                  & Maximum capacity of vehicle\\
\underline{q}_v    & Minimum delivery quantity for customer $v$\\
D_v                & Total demand of customer $v$ over all periods\\
D^{\mathrm{CMI}}   & Total average daily CMI demand\\
\xi                & Proportion of total average daily CMI demand to set aside in fleet\\
\underline{q}_{crv}& Lower bound of demand for customer $v$ in scenario $r$ of cluster $c$\\
\overline{q}_{crv} & Upper bound of demand for customer $v$ in scenario $r$ of cluster $c$\\
\pi_{tc}           & Target fraction of days of scenario $t$ for cluster $c$\\
\end{tabularx}
\endgroup

\end{document}

関連情報