长表标题在表格列表中重复

长表标题在表格列表中重复

我的文件中有一个longtable跨越多页的。但是\caption在我的索引中出现了好几次。表格标题也出现在表格的所有页面上。我该如何修复它,使其只出现一次?

如何:

在此处输入图片描述

短代码:

{\tiny
\begin{longtable}{|L{2.4cm}|L{2.5cm}|L{3.2cm}|L{1.8cm}|L{1.8cm}|L{1.5cm}|L{2cm}|L{3.5cm}|}
\caption{Tabela de indicadores atualizada com os indicadores identificados}\\
\hline
\rowcolor[HTML]{44546A} 
\textbf{\textcolor{white}{Dimensão}} &  
\textbf{\textcolor{white}{Macroindicador}} &
\textbf{\textcolor{white}{Indicador}} &
\textbf{\textcolor{white}{Unidade}} & \textbf{\textcolor{white}{Abrangência}} &  \textbf{\textcolor{white}{Fonte}} & \textbf{\textcolor{white}{Disponibilidade}} & \textbf{\textcolor{white}{Link}} \\ \hline
\endhead
%
%

\cellcolor[HTML]{3FD0FF}Agroclimatologia & Temperatura & Temperatura máxima na hora anterior & $^{\circ}\mathrm{C}$ & BRASIL & INMET & disponível (planilha) & {\color[HTML]{0000EE} \url{ https://portal.inmet.gov.br/dadoshistoricos}} \\ \hline
\cellcolor[HTML]{3FD0FF}Agroclimatologia & Temperatura & Temperatura mínima na hora anterior & $^{\circ}\mathrm{C}$ & BRASIL & INMET & disponível (planilha) & {\color[HTML]{0000EE} \url{ https://portal.inmet.gov.br/dadoshistoricos}} \\ \hline

\caption*{Fonte: Autor (2021).}
\end{longtable}
}

答案1

目前,您有一个单一\endhead声明;因此,相同的信息(包括标题材料)将放置在 跨越的每一页上longtable

作为补救措施,我建议您使用单独的\endfirsthead\endhead指令。对于\endhead部分,不要使用\caption{...}但,而是使用类似

\multicolumn{8}{@{}l}{\tablename~\thetable, contínua}

一些示例代码:

\documentclass{article} % or some other suitable document class
\usepackage[a4paper,margin=1.5cm]{geometry} % choose suitable page parameters
%% (the remainder of this preamble is mostly guesswork)
\usepackage[portuguese]{babel}
\usepackage[T1]{fontenc}
\usepackage[table]{xcolor}

\usepackage{array}      % for \newcolumntype macro
\usepackage{ragged2e}   % for \RaggedRight macro
\newcolumntype{L}[1]{>{\RaggedRight\hspace{0pt}}p{#1}}

\usepackage{longtable}
\setlength{\LTcapwidth}{\textwidth}

\begin{document}

\listoftables

\clearpage
\addtocounter{table}{3} % just for this example

\begin{longtable}{|L{2.0cm}|L{2.5cm}|L{1.6cm}|L{1.8cm}| 
                   L{1.3cm}|L{1.5cm}|L{2.0cm}|L{1.5cm}|}

\caption{Indicadores atualizada com os indicadores identificados}\\
\hline
\rowcolor[HTML]{44546A} 
\textbf{\textcolor{white}{Dimensão}} &  
\textbf{\textcolor{white}{Macroindicador}} &
\textbf{\textcolor{white}{Indicador}} &
\textbf{\textcolor{white}{Unidade}} & 
\textbf{\textcolor{white}{Abrangência}} &  
\textbf{\textcolor{white}{Fonte}} & 
\textbf{\textcolor{white}{Disponibilidade}} & 
\textbf{\textcolor{white}{Link}} \\ 
\hline
\endfirsthead

\multicolumn{8}{@{}l}{\tablename~\thetable, contínua}\\[0.5ex]
\hline
\rowcolor[HTML]{44546A} 
\textbf{\textcolor{white}{Dimensão}} &  
\textbf{\textcolor{white}{Macroindicador}} &
\textbf{\textcolor{white}{Indicador}} &
\textbf{\textcolor{white}{Unidade}} & 
\textbf{\textcolor{white}{Abrangência}} &  
\textbf{\textcolor{white}{Fonte}} & 
\textbf{\textcolor{white}{Disponibilidade}} & 
\textbf{\textcolor{white}{Link}} \\ 
\hline
\endhead

\hline
\multicolumn{8}{r@{}}{\footnotesize(Continua na próxima página)}\\
\endfoot

\hline
\multicolumn{8}{c}{Fonte: Autor (2021).}
\endlastfoot

% body of 'longtable'

\end{longtable}

% remainder of paper

\end{document}

相关内容