我希望这个表格适合 lateX 中的整个页面

我希望这个表格适合 lateX 中的整个页面

我希望此表格在横向模式下适合文档的整个页面。我不明白它如何在页面下方留下空白区域。

另外,如果有人可以建议我们如何将其放入 PPT 格式?

\documentclass[12pt]{article}
\usepackage[table, svgnames, dvipsnames]{xcolor}
\usepackage{longtable}
\usepackage[a4paper, landscape, margin=1cm,]{geometry}

\usepackage{makecell, cellspace, caption}
\setlength\cellspacetoplimit{2pt}
\setlength\cellspacebottomlimit{3pt}
\usepackage{array}
\newcolumntype{L}[1]{>{\RaggedRight\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\Centering\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\RaggedLeft\arraybackslash\hspace{0pt}}m{#1}}

\usepackage{enumitem,ragged2e}
\newlist{myenumerate}{enumerate}{1}
\setlist[myenumerate,1]{label=\alph*.,nosep,wide=0pt,
          before={\begin{minipage}{\hsize}\RaggedRight},
          after={\end{minipage}}}

\begin{document}
       
\begin{longtable}{| L{5cm} | L{4cm} | L{5cm} | L{2.5cm} | L{2cm} | L{2cm} |}
\hline
\rowcolor{Gainsboro!60}
\makecell{Source of \\ information \\ (reference) } & 
\makecell{Method of  \\ identification} & 
\makecell{The consumer’s strengths \\ to address these issues.} & 
\makecell{Consumer \\ and Nursing \\ Interventions} & 
\makecell{Person/s \\ Responsible} & 
\makecell{Timeframe}\\
\hline
\endhead

“A Novel Event Detection Method Using PMU Data with High Precision,” by Mingjian Cui, Jianhui Wang, Jin Tan, Anthony R. Florita, and Yingchen Zhang, published in IEEE Transactions on Power Systems, 2018

& This paper develops a new method of event detection using dynamic programming-based SDT (DPSDT) and compares it with the Wavelet-based event detection (WED) technique. It gives the complete algorithm of the DPSDT technique and compares various events it could detect with sufficient graphs and figures.

& \begin{myenumerate}
\item \strut To reduce dimensionality of original streaming PMU data, islanding detection,
\item compress critical disturbance info of PMU 
\item locate power system event, 
\item to select the best set of features of the disturbance types in the time-frequency domain, 
\item discrete samples of collected PMU data, 
\item assess the power system disturbance by using wide-area post disturbance records to identify events and characterize their features.\strut
\end{myenumerate}

 & 1.~PMU

   2.~PMU and smart meter,
   & 30--120 times per sec
 & 
\\
\hline
\end{longtable}

\end{document}

对于用例输出参考: 在此处输入图片描述

答案1

对于表格的编写,您可以考虑tabularray包和X列类型,这将强制表格的宽度等于横向页面方向上的文本宽度:

\documentclass{article}
\usepackage[a4paper, landscape, 
            margin=1cm, includefoot]{geometry}
\usepackage{ragged2e}
\usepackage[table, svgnames, dvipsnames]{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{varwidth}

\usepackage{enumitem} % create a bespoke list env.
\newlist{tabenum}{enumerate}{1}
\setlist[tabenum,1]{nosep=0pt, itemsep=2pt,
                    wide=0pt,
                    label=\textbf{\alph*.},
                    after=\end{minipage},
                    before={\begin{minipage}[t]{\hsize}\RaggedRight}
                  }

\begin{document}
    \begingroup
    \DefTblrTemplate{firsthead, middlehead,lasthead}{default}{} % <---
    \DefTblrTemplate{contfoot-text}{normal}{\scriptsize\textit{Continued on the next page}}
\begin{longtblr}[
                ]{hlines, vlines,
                  colspec = {*{2}{X[2,j]} X[3,l] *{3}{X[l]}},
                  rowhead = 1,
                  row{1}  = {bg=Gainsboro!60, c, m},
                  measure = vbox
                 }
Source of information (reference)
    & Method of identification
        & The consumer’s strengths to address these issues.
            & Consumer and Nursing Interventions
                & Person/s Responsible
                    & Timeframe             \\
“A Novel Event Detection Method Using PMU Data with High Precision,” by Mingjian Cui, Jianhui Wang, Jin Tan, Anthony R. Florita, and Yingchen Zhang, published in IEEE Transactions on Power Systems, 2018
    &   This paper develops a new method of event detection using dynamic programming-based SDT (DPSDT) and compares it with the Wavelet-based event detection (WED) technique. It gives the complete algorithm of the DPSDT technique and compares various events it could detect with sufficient graphs and figures.
        &   \begin{tabenum}
        \item   reduce dimensionality of original streaming PMU data, islanding detection,
        \item compress critical disturbance info of PMU
        \item locate power system event,
        \item select the best set of features of the disturbance types in the time-frequency domain,
        \item collect discrete samples of PMU data,
        \item assess the power system disturbance by using wide-area post disturbance records to identify events and characterize their features.
            \end{tabenum}
            &   \begin{tabenum}[label=\arabic*.]
            \item   PMU
            \item   PMU and smart meter,
                \end{tabenum}
                & 30--120 times per sec
                    &               \\
“A Novel Event Detection Method Using PMU Data with High Precision,” by Mingjian Cui, Jianhui Wang, Jin Tan, Anthony R. Florita, and Yingchen Zhang, published in IEEE Transactions on Power Systems, 2018
    &   This paper develops a new method of event detection using dynamic programming-based SDT (DPSDT) and compares it with the Wavelet-based event detection (WED) technique. It gives the complete algorithm of the DPSDT technique and compares various events it could detect with sufficient graphs and figures.
        &   \begin{tabenum}
        \item   reduce dimensionality of original streaming PMU data, islanding detection,
        \item compress critical disturbance info of PMU
        \item locate power system event,
        \item select the best set of features of the disturbance types in the time-frequency domain,
        \item collect discrete samples of PMU data,
        \item assess the power system disturbance by using wide-area post disturbance records to identify events and characterize their features.
            \end{tabenum}
            &   \begin{tabenum}[label=\arabic*.]
            \item   PMU
            \item   PMU and smart meter,
                \end{tabenum}
                & 30--120 times per sec
                    &               \\
“A Novel Event Detection Method Using PMU Data with High Precision,” by Mingjian Cui, Jianhui Wang, Jin Tan, Anthony R. Florita, and Yingchen Zhang, published in IEEE Transactions on Power Systems, 2018
    &   This paper develops a new method of event detection using dynamic programming-based SDT (DPSDT) and compares it with the Wavelet-based event detection (WED) technique. It gives the complete algorithm of the DPSDT technique and compares various events it could detect with sufficient graphs and figures.
        &   \begin{tabenum}
        \item   reduce dimensionality of original streaming PMU data, islanding detection,
        \item compress critical disturbance info of PMU
        \item locate power system event,
        \item select the best set of features of the disturbance types in the time-frequency domain,
        \item collect discrete samples of PMU data,
        \item assess the power system disturbance by using wide-area post disturbance records to identify events and characterize their features.
            \end{tabenum}
            &   \begin{tabenum}[label=\arabic*.]
            \item   PMU
            \item   PMU and smart meter,
                \end{tabenum}
                & 30--120 times per sec
                    &               \\
“A Novel Event Detection Method Using PMU Data with High Precision,” by Mingjian Cui, Jianhui Wang, Jin Tan, Anthony R. Florita, and Yingchen Zhang, published in IEEE Transactions on Power Systems, 2018
    &   This paper develops a new method of event detection using dynamic programming-based SDT (DPSDT) and compares it with the Wavelet-based event detection (WED) technique. It gives the complete algorithm of the DPSDT technique and compares various events it could detect with sufficient graphs and figures.
        &   \begin{tabenum}
        \item   reduce dimensionality of original streaming PMU data, islanding detection,
        \item compress critical disturbance info of PMU
        \item locate power system event,
        \item select the best set of features of the disturbance types in the time-frequency domain,
        \item collect discrete samples of PMU data,
        \item assess the power system disturbance by using wide-area post disturbance records to identify events and characterize their features.
            \end{tabenum}
            &   \begin{tabenum}[label=\arabic*.]
            \item   PMU
            \item   PMU and smart meter,
                \end{tabenum}
                & 30--120 times per sec
                    &               \\
\end{longtblr}
    \endgroup
\end{document}

在 MWE 中,表格主体重复,可以看到长表格是什么样子。在 MWE 中,该表格没有打印标题。但是,表格计数器仍然递增。

在此处输入图片描述

在这种情况下,将添加该标题,然后文档序言必须更改为:

\documentclass{article}
\usepackage[a4paper, landscape, 
            margin=1cm, includefoot]{geometry}
\usepackage{ragged2e}
\usepackage[table, svgnames, dvipsnames]{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{varwidth}

\usepackage{enumitem} % create a bespoke list env.
\newlist{tabenum}{enumerate}{1}
\setlist[tabenum,1]{nosep=0pt, itemsep=2pt,
                    wide=0pt,
                    label=\textbf{\alph*.},
                    after=\end{minipage},
                    before={\begin{minipage}[t]{\hsize}\RaggedRight}
                  }

\begin{longtblr}[
    caption={My long table ...},
      label={tab:???}
                ]{hlines, vlines,
                  colspec = {*{2}{X[2,j]} X[3,l] *{3}{X[l]}},
                  rowhead = 1,
                  row{1}  = {bg=Gainsboro!60, c, m},
                  measure = vbox
                 }

在这种情况下,下一个 ae 上的标题如下所示:

答案2

让我们先计算一下表格可用的水平空间量。您使用的是横向格式的 A4 纸,边距为 1.0 厘米。由于纸张宽度为 29.7 厘米,因此文本块的宽度为29.7cm-2.0cm=27.7cm。您的表格包含 6 列(\tabcolsep每侧有 (6pt) 的空白填充)和 7 条垂直线(宽度为\arrayrulesep(0.4pt));12*6.0pt+7*0.4pt=74.8pt=2.63cm。(旁注:1pt=0.035146cm。)可用的因此,所有 6 列的总宽度为27.7cm-2.63cm=25.07cm。现在让我们将其四舍五入为 25 厘米。

您的代码包含指令

\begin{longtable}{| L{5cm} | L{4cm} | L{5cm} | L{2.5cm} | L{2cm} | L{2cm} |}

将六个宽度相加得出 20.5 厘米;也就是 4.5 厘米较少的大于最大可用宽度25cm。

我认为你的目标是增加部分或全部列的宽度,以便总计 25 厘米。我建议您不要线性增加所有(可用)列宽。相反,我会将第三列加宽到最大,因为到目前为止,表格中包含的大部分信息似乎都位于该列。我还会将第二列和第五列加宽——只是稍微加宽,比如说加宽 0.5 厘米,因为它的标题目前有点被截断了。

我还将在列类型的定义中从 切换m到列类型。pL

总结一下,我会使用如下指令

\begin{longtable}{| L{5cm} | L{5cm} | L{8.07cm} | L{2.5cm} | L{2.5cm} | L{2cm} |}

(请注意,我已添加背面0.07cm并将其分配到第 3 列。)


在此处输入图片描述

\documentclass[12pt]{article}
\usepackage[table, svgnames, dvipsnames]{xcolor}
\usepackage{longtable}
\usepackage[a4paper, landscape, margin=1cm, includefoot]{geometry}

\usepackage{makecell, cellspace, caption}
\setlength\cellspacetoplimit{2pt}
\setlength\cellspacebottomlimit{3pt}

\usepackage{array} % for '\newcolumntype' and '\extrarowheight' macros
\newcolumntype{L}[1]{>{\RaggedRight\hspace{0pt}}p{#1}} % 'p', not 'm'
\setlength\extrarowheight{2pt}

\usepackage{enumitem,ragged2e} % create a bespoke list env.
\newlist{myenumerate}{enumerate}{1}
\setlist[myenumerate,1]{label=\alph*.,nosep,wide=0pt,
          before={\begin{minipage}[t]{\hsize}\RaggedRight},
          after={\end{minipage}}}

\begin{document}
       
\begin{longtable}{| L{5cm} | L{5cm} | L{8.07cm} | L{2.5cm} | L{2.5cm} | L{2cm} |}
\hline
\rowcolor{Gainsboro!60}
\makecell{Source of \\ information \\ (reference) } & 
\makecell{Method of  \\ identification} & 
\makecell{The consumer’s strengths \\ to address these issues.} & 
\makecell{Consumer \\ and Nursing \\ Interventions} & 
\makecell{Person/s \\ Responsible} & 
\makecell{Timeframe}\\
\hline
\endhead

\hline
\endlastfoot

“A Novel Event Detection Method Using PMU Data with High Precision,” by Mingjian Cui, Jianhui Wang, Jin Tan, Anthony R. Florita, and Yingchen Zhang, published in IEEE Transactions on Power Systems, 2018

& This paper develops a new method of event detection using dynamic programming-based SDT (DPSDT) and compares it with the Wavelet-based event detection (WED) technique. It gives the complete algorithm of the DPSDT technique and compares various events it could detect with sufficient graphs and figures.

& \begin{myenumerate}
\item \strut reduce dimensionality of original streaming PMU data, islanding detection,
\item compress critical disturbance info of PMU 
\item locate power system event, 
\item select the best set of features of the disturbance types in the time-frequency domain, 
\item collect discrete samples of PMU data, 
\item assess the power system disturbance by using wide-area post disturbance records to identify events and characterize their features.
\end{myenumerate}

 & 1.~PMU

   2.~PMU and smart meter,
 & 30--120 times per sec
 & 
\\

\end{longtable}

\end{document}

相关内容