使用 longtable 包使脚注适合表格边框

使用 longtable 包使脚注适合表格边框

问题:

使用该包使脚注适合表格的宽度longtable

问题:

  • 怎样才能修改 MWE 中的脚注以适应表格的宽度?

最小工作示例(MWE):

\documentclass[12pt]{article}
\usepackage{tabularx,longtable,booktabs}

\begin{document}

\setlength\extrarowheight{4pt}

\begin{longtable}{@{\extracolsep{\fill}}ccccccccccccc}
\caption{Table caption here}\label{chap1:tab1}
\endfirsthead
\multicolumn{13}{c}{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
\endhead
\hline \multicolumn{13}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot

\toprule
 &  \multicolumn{12}{c}{\textbf{Criteria}} \\
\midrule
   \textbf{Solutions} & A & B & C & D & E & F & G & H & I & J & K & L \\
\midrule
%------------------------------------------------------------------------------------
Testing & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$
%------------------------------------------------------------------------------------
\\
\end{longtable}

\begin{longtable}{@{\extracolsep{\fill}}ccc}

    \fontsize{8}{11}\selectfont \textbf{A:} Text text text & 
    \fontsize{8}{11}\selectfont \textbf{F:} Text text text text text & 
    \fontsize{8}{11}\selectfont \textbf{J:} Text text text text text \\

    \fontsize{8}{11}\selectfont \textbf{B:} Text text text text text & 
    \fontsize{8}{11}\selectfont \textbf{G:} Text text text text text text & 
    \fontsize{8}{11}\selectfont \textbf{K:} Text text text text textText text text text \\

    \fontsize{8}{11}\selectfont \textbf{C:} Text text text text text & 
    \fontsize{8}{11}\selectfont \textbf{H:} Text text & 
    \fontsize{8}{11}\selectfont \textbf{L:} Text text text text textText text text text \\

    \fontsize{8}{11}\selectfont \textbf{D:} Text text text text text & 
    \fontsize{8}{11}\selectfont \textbf{I:} Text text text \\

    \fontsize{8}{11}\selectfont \textbf{E:} Text text text text text

\end{longtable}

\end{document}

答案1

您已经使用了\extracolumnsep{\fill},因此确定表格边框的问题变得非常简单:预先知道表格的\textwidth宽度。因此,您需要做的就是将您的笔记排成三列,占据整个宽度。

在此处输入图片描述

\documentclass[12pt]{article}
\usepackage{tabularx,longtable,booktabs,multicol}

\begin{document}

\setlength\extrarowheight{4pt}

\setlength\LTleft{0pt}
\setlength\LTright{0pt}


\begin{longtable}{@{\extracolsep{\fill}}ccccccccccccc@{}}
\caption{Table caption here}\label{chap1:tab1}
\endfirsthead
\multicolumn{13}{c}{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
\endhead
\hline \multicolumn{13}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot

\toprule
 &  \multicolumn{12}{c}{\textbf{Criteria}} \\
\midrule
   \textbf{Solutions} & A & B & C & D & E & F & G & H & I & J & K & L \\
\midrule
%------------------------------------------------------------------------------------
Testing & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$
%------------------------------------------------------------------------------------
\end{longtable}

\begin{multicols}{3}\footnotesize\everypar{\hangindent=20pt}\parindent=0pt

   \textbf{A:} Text text text 

   \textbf{B:} Text text text text text 

   \textbf{C:} Text text text text text 

   \textbf{D:} Text text text text text 

   \textbf{E:} Text text text text text

   \textbf{F:} Text text text text text 

   \textbf{G:} Text text text text text text 

   \textbf{H:} Text text 

   \textbf{I:} Text text text 

   \textbf{J:} Text text text text text 


   \textbf{K:} Text text text text textText text text text 


   \textbf{L:} Text text text text textText text text text 

\end{multicols}

\end{document}

相关内容