1

I want my document to be doublespaced but the cells in my longtable I need them to be singlespaced. I don't know how to do this in this enviroment. All the examples I have seen so far are not using longtable neither multicolumn. Any help is appreciated.

\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
  • Hello @DavidCarlisle. The table has other lines that I cut off to shorten the example. These other lines use up to 6 columns and when they`re not needed, I go with multicolumn. Jul 3 '17 at 21:25
3

Enclose longtablein

\begin{singlespace}

... your long table ...

\end{singlespace}

enter image description here

1
  • That's also correct. Thank you @Zarko. I will let your answer to be the corrected one. Jul 3 '17 at 21:12
1

I was simples than I thought. Follow the answer.

\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}
1
  • 1
    you have single space only in one cell ... which contain command \singlespace. If you like to have whole table single spaced, than you should use my answer, or search for solution for similar question on site. Your question is for sure duplicate.
    – Zarko
    Jul 3 '17 at 21:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.