ieeetran 中的表格存在问题

ieeetran 中的表格存在问题

我正在用 ieeetran 格式写一篇论文,其中一个表格太长了。我尝试使用 xtabular 将其拆分,但每个部分下面都有空隙,我无法用文本填充(如图所示)

这是我使用的代码

\captionof{table}{Indicative DPP content for Smart Grids}\label{tab2}
\begin{xtabular}{|m{2.5cm}|m{5.5cm}|}
\hline
\multicolumn{1}{|c|}{\textbf{DPP Data Types}} & \multicolumn{1}{c|}{\textbf{Description}}\\ 
\hline
Energy Generation & \begin{itemize}
\item Consumption of materials for energy generation, e.g, coal in tones (ton), oil in liters (lt), or natural gas in cubic meters (m\textsuperscript{3})
\item Amount of generated energy in kilowatts per hour (kWh) or megawatts per hour (MWh)
\item Efficiency and functionality of the utilized equipment for energy generation in percentage (\%)
\item Amount of Greenhouse Emissions generated in tonnes of carbon dioxide equivalent (tCO\textsubscript{2}e)
\end{itemize}\\ 
\hline
Renewable Energy Integration & \begin{itemize}
\item Type of renewable source, e.g., solar, wind, or hydroelectric
\item Amount of renewable energy generated in kilowatts per hour (kWh) or megawatts per hour (MWh)
\item Environmental conditions depending on the type of renewable energy source used, e.g., temperature in Celcius (\textdegree C), wind speed in meters per second (m/s), flow rate of water in cubic meters per second (m\textsuperscript{3}/s)
\item Amount of equipment used for each source, e.g., photovoltaic panels, wind turbines, and hydroelectric power plants, and their geolocation
\item Efficiency and functionality of the utilized equipment for renewable energy generation in percentage (\%)
\item Microgrid integration status with detailed data on the grid stability
\end{itemize}\\
\hline
Energy Transmission & \begin{itemize}
\item Type and amount of equipment used for transmission and distribution e.g., transformers, substations, transmission, and distribution lines, as well as their geolocation
\item Amount of energy being distributed through the transmission equipment in kilowatts (kW), megawatts (MW), or gigawatts (GW)
\item Efficiency and functionality of the utilized equipment for energy distribution in percentage (\%)
\item Amount of energy lost during energy distribution in kilowatts (kW), megawatts (MW), or gigawatts (GW)
\end{itemize}\\
\hline
Grid Management & \begin{itemize}
\item Status and functionality of the overall grid and its components in percentage (\%), including outage and fault detection
\item Amount of conventional and renewable energy being used within the grid in percentage (\%)
\item Forecasting of energy demands within the grid
\item Real-time updating of energy prices in euros per kilowatt per hour or megawatt per hour (€/kWh or €/MWh)
\end{itemize}\\
\hline
Smart Metering & \begin{itemize}
\item Amount of energy consumed in kilowatts per hour (kWh) or megawatts per hour (MWh)
\item Quality of distributed energy depending on fluctuations
\item Peak amount of energy demand and consumption, as well as timestamps of the corresponding moments
\item Amounts of renewable and conventional energy consumed.
\end{itemize}\\
\hline
Prosumer Processes & \begin{itemize}
\item Amount of energy stored for utilization in kilowatts per hour (kWh) or megawatts per hour (MWh)
\item Amount of energy exported to other consumers in kilowatts per hour (kWh) or megawatts per hour (MWh)
\item Amount of energy exported back to the grid in kilowatts per hour (kWh) or megawatts per hour (MWh)
\item Amount of consumers adopting prosumer roles, as well as the number of consumers purchasing energy from prosumers
\item Energy pricing from prosumer procedures in euro (€)
\end{itemize}\\
\hline
\end{xtabular}

答案1

  • 您应该提供重现您问题的 MWE ...

  • 看来您需要使用某种长表。

  • 在长表中您应该知道,它只能在行之间分割,因此只能在列/页之间分割。

  • 通过使用longtblrtabularray可以获得:

在此处输入图片描述

\documentclass{ieeetran}
\usepackage{lipsum}

\usepackage{newtxtext, newtxmath}
\usepackage[version=4]{mhchem}
\usepackage{tabularray}
\UseTblrLibrary{siunitx, varwidth}

\DefTblrTemplate{contfoot-text}{default}{Continued on next column/page}
\SetTblrStyle{contfoot-text}{font=\footnotesize\itshape, fg=gray1}
%---------------------------------------------------------------%
\NewTblrTheme{captionof}%
{%
    \DefTblrTemplate{caption}{default}%
    {
         \addtocounter{table}{-1}%
         \captionof{table}{\InsertTblrText{caption}}
    }
    \DefTblrTemplate{middlehead,lasthead}{default}%
    {
        \addtocounter{table}{-1}%
        \captionof{table}[]{\InsertTblrText{caption} (Continued)}%
    }
}
\usepackage{enumitem}
\usepackage{etoolbox}
\AtBeginEnvironment{longtblr}{\setlist[itemize]{nosep, itemsep=3pt, leftmargin=*}}
\AtBeginEnvironment{table}{\setlist[itemize]{nosep, itemsep=3pt, leftmargin=*}}

\begin{document}
\lipsum[1-3]
    \begin{longtblr}[
caption = {Indicative DPP content for Smart Grids},
  label = {tab2}    ]{hlines, vlines, 
                      colspec = {Q[l, m, wd=4.4em] X[j, m]},
                      colsep  = 4pt,
                      row{1}  = {font=\bfseries},
                      stretch = -1, %<--- remove extra space above and below lists
                                    % with nosep option; doc p.51 tabularray
                      measure = vbox,
                      }
DPP Data Types  
    &   Description     \\
%
Energy Generation 
    &   \begin{itemize}
    \item Consumption of materials for energy generation, e.g, coal in tones (ton), oil in liters (lt), or natural gas in cubic meters (\unit{m^3})
    \item Amount of generated energy in kilowatts per hour (kWh) or megawatts per hour (MWh)
    \item Efficiency and functionality of the utilized equipment for energy generation in percentage (\%)
    \item Amount of Greenhouse Emissions generated in tonnes of carbon dioxide equivalent (t\ce{CO2}e)
        \end{itemize}   \\
Renewable Energy Integration 
    &   \begin{itemize}
    \item Type of renewable source, e.g., solar, wind, or hydroelectric
    \item Amount of renewable energy generated in kilowatts per hour (kWh) or megawatts per hour (MWh)
    \item Environmental conditions depending on the type of renewable energy source used, e.g., temperature in Celcius (\unit{belsius}), wind speed in meters per second (m/s), flow rate of water in cubic meters per second (m\textsuperscript{3}/s)
    \item Amount of equipment used for each source, e.g., photovoltaic panels, wind turbines, and hydroelectric power plants, and their geolocation
    \item Efficiency and functionality of the utilized equipment for renewable energy generation in percentage (\%)
    \item Microgrid integration status with detailed data on the grid stability
        \end{itemize}   \\
Energy Transmission 
    &   \begin{itemize}
    \item Type and amount of equipment used for transmission and distribution e.g., transformers, substations, transmission, and distribution lines, as well as their geolocation
    \item Amount of energy being distributed through the transmission equipment in kilowatts (kW), megawatts (MW), or gigawatts (GW)
    \item Efficiency and functionality of the utilized equipment for energy distribution in percentage (\%)
    \item Amount of energy lost during energy distribution in kilowatts (kW), megawatts (MW), or gigawatts (GW)
        \end{itemize}   \\
Grid Management 
    &   \begin{itemize}
    \item Status and functionality of the overall grid and its components in percentage (\%), including outage and fault detection
    \item Amount of conventional and renewable energy being used within the grid in percentage (\%)
    \item Forecasting of energy demands within the grid
    \item Real-time updating of energy prices in euros per kilowatt per hour or megawatt per hour (€/kWh or €/MWh)
        \end{itemize}   \\
Smart Metering 
    &   \begin{itemize}
    \item Amount of energy consumed in kilowatts per hour (kWh) or megawatts per hour (MWh)
    \item Quality of distributed energy depending on fluctuations
    \item Peak amount of energy demand and consumption, as well as timestamps of the corresponding moments
    \item Amounts of renewable and conventional energy consumed.
        \end{itemize}   \\
Prosumer Processes 
    &   \begin{itemize}
    \item Amount of energy stored for utilization in kilowatts per hour (kWh) or megawatts per hour (MWh)
    \item Amount of energy exported to other consumers in kilowatts per hour (kWh) or megawatts per hour (MWh)
    \item Amount of energy exported back to the grid in kilowatts per hour (kWh) or megawatts per hour (MWh)
    \item Amount of consumers adopting prosumer roles, as well as the number of consumers purchasing energy from prosumers
    \item Energy pricing from prosumer procedures in euro (€)
        \end{itemize}   \\
\end{longtblr}
\lipsum[4-9]
\end{document}

附录:
软件包ieeetran 有自己的表格标题机制,但在标题中不起作用longtblr。要模仿它,您需要使用软件包启用标题格式caption

\documentclass{ieeetran}
\usepackage{lipsum}

\usepackage{newtxtext, newtxmath}
\usepackage[version=4]{mhchem}
\usepackage{caption}
\captionsetup[table]{skip=0ex, width=\linewidth,
                     justification={centerfirst},
                     font = {small, sc},
                     labelsep = newline}
\usepackage{tabularray}
\UseTblrLibrary{siunitx, varwidth}
\sisetup{per-mode=symbol}

\DefTblrTemplate{contfoot-text}{default}{Continued on next column/page}
\SetTblrStyle{contfoot-text}{font=\footnotesize\itshape, fg=gray1}
%---------------------------------------------------------------%
\NewTblrTheme{captionof}%
{%
    \DefTblrTemplate{caption}{default}%
    { 
         \addtocounter{table}{-1}%
         \captionof{table}{\InsertTblrText{caption}}
    }
    \DefTblrTemplate{middlehead,lasthead}{default}%
    {
        \addtocounter{table}{-1}%
        \captionof{table}[]{\InsertTblrText{caption} (Continued)}%
    }
}
\usepackage{enumitem}
\usepackage{etoolbox}
\AtBeginEnvironment{longtblr}{\setlist[itemize]{nosep, itemsep=3pt, leftmargin=*}}
\AtBeginEnvironment{table}{\setlist[itemize]{nosep, itemsep=3pt, leftmargin=*}}

\begin{document}
\lipsum[1-3]
    \begin{longtblr}[
  theme = captionof,
caption = {Indicative DPP content for Smart Grids},
  label = {tab2}    ]{hlines, vlines,
                      colspec = {Q[l, m, wd=4.4em] X[j, m]},
                      colsep  = 4pt,
                      row{1}  = {font=\small\bfseries, c},
                      stretch = -1,
                      measure = vbox,
                      rowhead = 1
                      }
DPP Data Types
    &   Description     \\
%
Energy Generation
    &   \begin{itemize}
    \item Consumption of materials for energy generation, e.g, coal in tones (ton), oil in liters (\unit{\litre}), or natural gas in cubic meters (\unit{\cubic\metre})
    \item Amount of generated energy in kilowatts per hour (kWh) or megawatts per hour (MWh)
    \item Efficiency and functionality of the utilized equipment for energy generation in percentage (\%)
    \item Amount of Greenhouse Emissions generated in tonnes of carbon dioxide equivalent (t\ce{CO2}e)
        \end{itemize}   \\
Renewable Energy Integration
    &   \begin{itemize}
    \item Type of renewable source, e.g., solar, wind, or hydroelectric
    \item Amount of renewable energy generated in kilowatts per hour (kWh) or megawatts per hour (MWh)
    \item Environmental conditions depending on the type of renewable energy source used, e.g., temperature in Celsius (\unit{\celsius}), wind speed in meters per second (\unit{\metre\per\second}), flow rate of water in cubic meters per second (\unit{\cubic\metre\per\second})
    \item Amount of equipment used for each source, e.g., photovoltaic panels, wind turbines, and hydroelectric power plants, and their geolocation
    \item Efficiency and functionality of the utilized equipment for renewable energy generation in percentage (\%)
    \item Microgrid integration status with detailed data on the grid stability
        \end{itemize}   \\
Energy Transmission
    &   \begin{itemize}
    \item Type and amount of equipment used for transmission and distribution e.g., transformers, substations, transmission, and distribution lines, as well as their geolocation
    \item Amount of energy being distributed through the transmission equipment in kilowatts (kW), megawatts (MW), or gigawatts (GW)
    \item Efficiency and functionality of the utilized equipment for energy distribution in percentage (\%)
    \item Amount of energy lost during energy distribution in kilowatts (kW), megawatts (MW), or gigawatts (GW)
        \end{itemize}   \\
Grid Management
    &   \begin{itemize}
    \item Status and functionality of the overall grid and its components in percentage (\%), including outage and fault detection
    \item Amount of conventional and renewable energy being used within the grid in percentage (\%)
    \item Forecasting of energy demands within the grid
    \item Real-time updating of energy prices in euros per kilowatt per hour or megawatt per hour (€/kWh or €/MWh)
        \end{itemize}   \\
Smart Metering
    &   \begin{itemize}
    \item Amount of energy consumed in kilowatts per hour (kWh) or megawatts per hour (MWh)
    \item Quality of distributed energy depending on fluctuations
    \item Peak amount of energy demand and consumption, as well as timestamps of the corresponding moments
    \item Amounts of renewable and conventional energy consumed.
        \end{itemize}   \\
Prosumer Processes
    &   \begin{itemize}
    \item Amount of energy stored for utilization in kilowatts per hour (kWh) or megawatts per hour (MWh)
    \item Amount of energy exported to other consumers in kilowatts per hour (kWh) or megawatts per hour (MWh)
    \item Amount of energy exported back to the grid in kilowatts per hour (kWh) or megawatts per hour (MWh)
    \item Amount of consumers adopting prosumer roles, as well as the number of consumers purchasing energy from prosumers
    \item Energy pricing from prosumer procedures in euro (€)
        \end{itemize}   \\
\end{longtblr}
\lipsum[4-7]
    \begin{table}[ht]
    \caption{Indicative DPP content for Smart Grids}
    \label{tab:tblr}
\begin{tblr}{hlines, vlines,
             colspec = {Q[l, m, wd=4.4em] X[j, m]},
             colsep  = 4pt,
             row{1}  = {font=\small\bfseries, c},
             stretch = -1,
             measure = vbox,
              }
DPP Data Types
    &   Description     \\
%
Energy Generation
    &   \begin{itemize}
    \item Consumption of materials for energy generation, e.g, coal in tones (ton), oil in liters (lt), or natural gas in cubic meters (\unit{m^3})
    \item Amount of generated energy in kilowatts per hour (kWh) or megawatts per hour (MWh)
    \item Efficiency and functionality of the utilized equipment for energy generation in percentage (\%)
    \item Amount of Greenhouse Emissions generated in tonnes of carbon dioxide equivalent (t\ce{CO2}e)
        \end{itemize}   \\
\end{tblr}
    \end{table}
\end{document}

在此处输入图片描述

相关内容