如何使用多列更改长表上的行距?

如何使用多列更改长表上的行距?

我希望我的文档是双倍行距的,但我的 longtable 中的单元格需要是单倍行距。我不知道如何在这种环境下做到这一点。到目前为止,我看到的所有示例都没有使用 longtable 或多列。任何帮助都非常感谢。

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[portuguese]{babel}
\usepackage[T1]{fontenc}
\usepackage[showframe=false,,left=2cm,right=2cm,top=2cm,bottom=4.5cm]{geometry}
\usepackage{makecell,multirow,tabularx,booktabs}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{lipsum}
\usepackage{setspace} 
\doublespacing

\begin{document}


\lipsum[1]


%%%%%%%%%%%%%%%%%%START TABLE%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{longtable}{|p{2.5cm}p{2.5cm}p{2.5cm}p{2.5cm}p{2.5cm}p{2.5cm}|}

    \endfirsthead

    \multicolumn{6}{r}{\makebox[17cm][r]{\textit{Continuação da página anterior}}}\\ \hline
    \endhead

    \hline
    \multicolumn{6}{r}{\makebox[17cm][r]{\textit{Continua na próxima página}}}\\
    \endfoot
    \endlastfoot

    \hline
    \multicolumn{6}{|l|}{\textbf{Atividade:}} \\
    \multicolumn{6}{|l|}{\parbox{17cm}{Verificar o \textit{deployment} dos ISEs e validar suas funções.}} \\
    \hline
    \multicolumn{6}{|l|}{\textbf{Tempo:}} \\
    \multicolumn{6}{|l|}{5 minutos} \\
    \hline
    \multicolumn{6}{|l|}{\textbf{Comando:}} \\
    \multicolumn{6}{|l|}{\parbox{15cm}{N/A}} \\
    \hline
    \multicolumn{6}{|l|}{\textbf{Resultado Esperado:}} \\
    \multicolumn{6}{|l|}{\parbox{15cm}{\lipsum[1]}} \\ %need to be singlespace
    \multicolumn{6}{|l|}{} \\
    \hline
\end{longtable}


\end{document}

答案1

附在longtable

\begin{singlespace}

... your long table ...

\end{singlespace}

在此处输入图片描述

答案2

我比我想象的要简单。请按照答案操作。

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[portuguese]{babel}
\usepackage[T1]{fontenc}
\usepackage[showframe=false,,left=2cm,right=2cm,top=2cm,bottom=4.5cm]{geometry}
\usepackage{makecell,multirow,tabularx,booktabs}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{lipsum}
\usepackage{setspace} 
\doublespacing

\begin{document}


\lipsum[1]


%%%%%%%%%%%%%%%%%%START TABLE%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{longtable}{|p{2.5cm}p{2.5cm}p{2.5cm}p{2.5cm}p{2.5cm}p{2.5cm}|}

    \endfirsthead

    \multicolumn{6}{r}{\makebox[17cm][r]{\textit{Continuação da página anterior}}}\\ \hline
    \endhead

    \hline
    \multicolumn{6}{r}{\makebox[17cm][r]{\textit{Continua na próxima página}}}\\
    \endfoot
    \endlastfoot

    \hline
    \multicolumn{6}{|l|}{\textbf{Atividade:}} \\
    \multicolumn{6}{|l|}{\parbox{17cm}{Verificar o \textit{deployment} dos ISEs e validar suas funções.}} \\
    \hline
    \multicolumn{6}{|l|}{\textbf{Tempo:}} \\
    \multicolumn{6}{|l|}{5 minutos} \\
    \hline
    \multicolumn{6}{|l|}{\textbf{Comando:}} \\
    \multicolumn{6}{|l|}{\parbox{15cm}{N/A}} \\
    \hline
    \multicolumn{6}{|l|}{\textbf{Resultado Esperado:}} \\
    \multicolumn{6}{|l|}{\parbox{15cm}{\singlespace \lipsum[1]}} \\
    \multicolumn{6}{|l|}{} \\
    \hline
\end{longtable}


\end{document}

相关内容