0

I have a problem with the longtables, they are not in the same format as the tables. I don't fully understand the way it works.

The code is as follows:

\documentclass[
    12pt,               % tamanho da fonte
    a4paper,            % tamanho do papel. 
    english,            % idioma adicional para hifenização
    brazil              % o último idioma é o principal do documento
    ]{abntex2}
\usepackage{float}
\usepackage{listings}
\usepackage{longtable}

\begin{document}
\selectlanguage{brazil}
\frenchspacing 
\OnehalfSpacing
%%% Longtable
\begin{center}
    \ABNTEXfontereduzida
    \begin{longtable}{ p{.05\textwidth} p{.15\textwidth} p{.70\textwidth} } 
    \caption{I want this to go up and have a space from the table and to change this font size}\\
    \toprule
    \textbf{Bit}       &
    \textbf{Nome}         &
    \textbf{Descrição} \\
    \endfirsthead
    \toprule
    \textbf{Bit}       &
    \textbf{Nome}         &
    \textbf{Descrição} 
    \\
    \endhead
    \hline
    \multicolumn{3}{l}{Continua...}\\
    \endfoot
    \multicolumn{3}{c}{I want this to go down and have a space from the table}\\
    \endlastfoot
    \\
    15     & 
    NACKMOD           &
    The text seems to be different as well. I think the font size is bigger
    \\
     14     & 
     FREE           &
     Welcome to the website. If you're here, you're likely looking to find random words. Random Word Generator is the perfect tool to help you do this. While this tool isn't a word creator, it is a word generator that will generate random words for a variety of activities or uses.
    \\
    \\ 
    \bottomrule
    \end{longtable}
\end{center}

This is format I wanted the longtable to be.
%%%table
\begin{table}[H]
    \ABNTEXfontereduzida
    \caption{This is the font style and size I wanted}
    \begin{center}
    \begin{tabular}{@{}p{1cm}p{2cm}p{12cm}@{}}
        \toprule
        \textbf{Bit}       &
        \textbf{Nome}         &
        \textbf{Descrição} 
        \\
        15     & 
        NACKMOD           &
        The text seems to be different as well. I think the font size is smaller.
        \\
         14     & 
         FREE           &
         Welcome to the website. If you're here, you're likely looking to find random words. Random Word Generator is the perfect tool to help you do this. While this tool isn't a word creator, it is a word generator that will generate random words for a variety of activities or uses.
        \\
        \\ 
        \bottomrule
    \end{tabular}
    \end{center}
    \fonte{This is the distance I wanted}
\end{table}
\end{document}

The results are:

The last table is the one I want and the first is the longtable

I didn't find any example that had this spacing after the table and I don't know what to look for in \ABNTEXfontereduzida (which is the format I am looking for).

1 Answer 1

0

Using the class abntex2 abntex2.cls (based on memoir)

c

(\ABNTEXfontereduzida is defined as \footnotesize)

\documentclass[
12pt,               % tamanho da fonte
a4paper,            % tamanho do papel. 
english,            % idioma adicional para hifenização
brazil              % o último idioma é o principal do documento
]{abntex2}
\usepackage{float}
\usepackage{listings}
\usepackage{longtable}
    
\begin{document}
    \selectlanguage{brazil}
    \frenchspacing 
    \OnehalfSpacing
    %%% Longtable   

    \begin{center}
        \captionnamefont{\normalfont\normalsize} % added <<<<<<<<<<<<<<<<<<
        \captiontitlefont{\normalfont\normalsize} % added <<<<<<<<<<<<<<<<<<
        \setlength{\belowcaptionskip}{20pt}% added <<<<<<<<<<<<<<<<<<
        \renewcommand{\baselinestretch}{1}\selectfont% added <<<<<<<<<<<<<<<<<<
        \ABNTEXfontereduzida
        \begin{longtable}{@{} p{.05\textwidth} p{.15\textwidth} p{.70\textwidth}@{} }           
            \caption{I want this to go up and have a space from the  table}\\           
            \toprule
            \textbf{Bit}       &
            \textbf{Nome}         &
            \textbf{Descrição} \\
            \endfirsthead
            \toprule
            \textbf{Bit}       &
            \textbf{Nome}         &
            \textbf{Descrição} 
            \\
            \endhead
            \hline
            \multicolumn{3}{l}{Continua...}\\
            \endfoot%                   
            \multicolumn{3}{c}{I want this to go down and have a space from the table  \rule{0pt}{6ex}}\\% rule added <<<<<<<<<<<<<<<<<<
            \endlastfoot        
            15     & 
            NACKMOD           &
            The text seems to be different as well. I think the font size is bigger
            \\
            14     & 
            FREE           &
            Welcome to the website. If you're here, you're likely looking to find random words. Random Word Generator is the perfect tool to help you do this. While this tool isn't a word creator, it is a word generator that will generate random words for a variety of activities or uses.
            \\ \\       
            \bottomrule
        \end{longtable}
    \end{center}
    
    This is format I wanted the longtable to be.
    %%%table
    \begin{table}[H]
        \ABNTEXfontereduzida
        \caption{This is the font style and size I wanted}
        \begin{center}
            \begin{tabular}{@{}p{1cm}p{2cm}p{12cm}@{}}
                \toprule
                \textbf{Bit}       &
                \textbf{Nome}         &
                \textbf{Descrição} 
                \\
                15     & 
                NACKMOD           &
                The text seems to be different as well. I think the font size is smaller.
                \\
                14     & 
                FREE           &
                Welcome to the website. If you're here, you're likely looking to find random words. Random Word Generator is the perfect tool to help you do this. While this tool isn't a word creator, it is a word generator that will generate random words for a variety of activities or uses.
                \\
                \\ 
                \bottomrule
            \end{tabular}
        \end{center}
        \fonte{This is the distance I wanted}
    \end{table}
\end{document}

The \rule{0pt}{6ex} in the \endfoot allows to increase the vertical space.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .