如何删除表格前的空格

如何删除表格前的空格

\vspace{}我有以下代码,但即使在使用之后也无法删除表格前的空白\subsection{Nomenclature}

\section{Mathematical Modeling}

In this section we present the mixed integer linear programming (MILP) models that form the basis of decision-making and the subsequent computational testing. We first present a listing of notation used, then we present the UC-SOC model that corresponds to current practice / state-of-the art benchmark, and finally we present the new model being proposed in this paper. 


\subsection{Nomenclature}\label{nom}
  \vspace{-6.17mm}
\begin{table}[H]
\begin{tabular}{>{$}l<{$} l}
\multicolumn{2}{l}{\textit{A. Indices and Sets}}\\
\\
t & Index of time period, with  $t \in T$, the set of time periods.\\
s &Index of supplier, with $s \in S$, the set of suppliers .\\
j &Index of customer, with $j \in J$, the set of customers.\\
k &Index of attribute,  with $k \in K$, the set of attributes, $k$ = 1 denotes fixed payment,\\
 & $k$ = 2 denotes variable payment, $k$ = 3 denotes interruption ceiling.\\
%k =1 denotes fixed payments to customers,\\
%k =2 denotes interruption ceiling.\\ %need to find out 5_12
\ell_k &Index of level of $k^{th}$ attribute, with $\ell_k$ $\in$ $L_k$, the set of levels for attribute $k$.\\%need to find out 5_12
SOC &Set of SOC customers\\
\\
\end{tabular}
\end{center}
\end{table}

答案1

一个常见的误解是,atabular必须放在table环境中。事实并非如此,它可以放在环境中。任何地方

在展示代码之前需要注意一些事项。

  1. 斜线周围没有空格
  2. 句号前没有空格
  3. 第一列中的大多数条目应位于$符号之间
  4. $k$ = 1应该$k=1$
  5. $k^{th}$应该是$k$\textsuperscript{th},或者更好的是,$k$th
  6. $\ell_k$ $\in$ $L_k$应该是一个单一的公式$\ell_k\in L_k$

这是代码,我只是猜测了第二列的宽度值。

\documentclass{article}

\begin{document}

\section{Mathematical Modeling}

In this section we present the mixed integer linear programming (MILP) 
models that form the basis of decision-making and the subsequent 
computational testing. We first present a listing of notation used, 
then we present the UC-SOC model that corresponds to current 
practice/state-of-the art benchmark, and finally we present the new 
model being proposed in this paper. 


\subsection{Nomenclature}\label{nom}
\begin{center}
\begin{tabular}{lp{.5\textwidth}}
\multicolumn{2}{l}{\textit{A. Indices and Sets}}\\
\\
$t$ & Index of time period, with  $t \in T$, the set of time periods.\\
$s$ & Index of supplier, with $s \in S$, the set of suppliers.\\
$j$ & Index of customer, with $j \in J$, the set of customers.\\
$k$ & Index of attribute,  with $k \in K$, the set of attributes,
      $k = 1$ denotes fixed payment, $k = 2$ denotes variable payment,
      $k = 3$ denotes interruption ceiling.\\
$\ell_k$ & Index of level of $k$\textsuperscript{th} attribute, 
           with $\ell_k\in L_k$, the set of levels for attribute $k$.\\
SOC & Set of SOC customers\\
\end{tabular}
\end{center}

\end{document}

在此处输入图片描述

答案2

感谢大家。以下解决方案有效。请注意,表格中的额外空白行 ( \\) 已被删除,并\centering用于代替中心。

\subsection{Nomenclature}\label{nom}

\begin{table}[H]
   \centering
\begin{tabular}{>{$}l<{$} l}%for math mode in table

\multicolumn{2}{l}{\textit{A. Indices and Sets}}\\
%\\
t & Index of time period, with  $t \in T$, the set of time periods.\\
s &Index of supplier, with $s \in S$, the set of suppliers .\\
j &Index of customer, with $j \in J$, the set of customers.\\
k &Index of attribute,  with $k \in K$, the set of attributes, $k= 1 $denotes fixed payment,\\
 & $k = 2$ denotes variable payment, $k = 3$ denotes interruption ceiling.\\
%k =1 denotes fixed payments to customers,\\
%k =2 denotes interruption ceiling.\\ %need to find out 5_12
\ell_k &Index of level of $k$\textsuperscript{th} attribute, with $\ell_k \in L_k$, the set of levels for attribute $k$.\\%need to find out 5_12
SOC &Set of SOC customers\\
\\
\end{tabular}
\end{table}

相关内容