명령은 환경보다 먼저 적용됩니다.

명령은 환경보다 먼저 적용됩니다.

환경이 시작되기 전에 내부(예: longtable(또는 다른 환경)) 를 추가하여 적용할 수 있습니까 \vspace{-\baselineskip}? MWE는 효과가 없습니다.

\documentclass{article}
\usepackage{longtable}
\usepackage{blindtext}

\begin{document}

\blindtext

\begin{longtable}{ll}
\vspace{-\baselineskip} \\ % this has no effect
                           % why \\ are really needed since caption has them?
\caption{testing table} \\
\hline
aaaa & bbbb \\
cccc & dddd \\
\hline
\end{longtable}

\end{document}

LOT에 잘못된 참조가 있는 문제가 있는 MWE가 있습니다.

\documentclass[captions=tableheading]{scrartcl}

\usepackage{blindtext}

\usepackage{hyperref}
\usepackage{tabu,longtable}
%\usepackage{threeparttable} % the package below already loads it
\usepackage[referable]{threeparttablex}
\usepackage{booktabs}
\usepackage{caption}


\usepackage{etoolbox}
\makeatletter
\chardef\TPT@@@asteriskcatcode=\catcode`*
\catcode`*=11
\expandafter\patchcmd\csname\string\threeparttable\endcsname
    {\TPT@hookin{tabular}}
    {\TPT@hookin{tabular}\TPT@hookin{tabu}} % allow threeparttable with tabu
    {}{}
\catcode`*=\TPT@@@asteriskcatcode
\makeatother

\makeatletter % fix referencing of LOT while using longtabu
    \newcounter{dummy}
    \newcommand{\setdummy}{\refstepcounter{dummy} \\}
    \let\oldlongtabu\longtabu\def\dummytabu{\vspace{-\baselineskip}\oldlongtabu} % correct the \\ in \setdummy
    \def\enddummytabu{\endlongtabu}
    \def\dummycap{\setdummy\caption}
\makeatother



\begin{document}

\listoftables

\bigskip

\blindtext

% LOT reference does not work
\begin{ThreePartTable}
\begin{TableNotes}
\footnotesize
\item[a] \label{tn:aa} A note
\item[b] Another note
\end{TableNotes}
\begin{longtabu}{ll}
\caption{A long table 1}
\label{tab:test1} \\
\toprule
Column 1 & Column 2 \\
\midrule
\endfirsthead
\toprule
Column 1 & Column 2 \\
\midrule
\endhead
\cmidrule{2-2}
\multicolumn{2}{r}{\textit{continued}}
\endfoot
\bottomrule
\insertTableNotes
\endlastfoot
% the contents of the table
A& B\tnotex{tn:aa} \\
\midrule
%\newpage % just testing page break
C\tnote{b} & D \\
\end{longtabu}
\end{ThreePartTable}

\blindtext

% LOT reference works fine
\begin{ThreePartTable}
\begin{TableNotes}
\footnotesize
\item[a] \label{tn:bb} A note
\item[b] Another note
\end{TableNotes}
\begin{longtable}{ll}
\caption{A long table 2}
\label{tab:test2} \\
\toprule
Column 1 & Column 2 \\
\midrule
\endfirsthead
\toprule
Column 1 & Column 2 \\
\midrule
\endhead
\cmidrule{2-2}
\multicolumn{2}{r}{\textit{continued}}
\endfoot
\bottomrule
\insertTableNotes
\endlastfoot
% the contents of the table
A& B\tnotex{tn:bb} \\
\midrule
%\newpage % just testing page break
C\tnote{b} & D \\
\end{longtable}
\end{ThreePartTable}

\blindtext

% LOT reference works fine (with vskip correction)
\begin{ThreePartTable}
\begin{TableNotes}
\footnotesize
\item[a] \label{tn:cc} A note
\item[b] Another note
\end{TableNotes}
\begin{dummytabu}{ll}
\dummycap{A long table 3}
\label{tab:test3} \\
\toprule
Column 1 & Column 2 \\
\midrule
\endfirsthead
\toprule
Column 1 & Column 2 \\
\midrule
\endhead
\cmidrule{2-2}
\multicolumn{2}{r}{\textit{continued}}
\endfoot
\bottomrule
\insertTableNotes
\endlastfoot
% the contents of the table
A& B\tnotex{tn:cc} \\
\midrule
%\newpage % just testing page break
C\tnote{b} & D \\
\end{dummytabu}
\end{ThreePartTable}

\blindtext

\end{document}

답변1

그냥 사용

\begin{ThreePartTable}
\begin{TableNotes}
\footnotesize
\item[a] \label{tn:aa} A note
\item[b] Another note
\end{TableNotes}
\begin{longtabu}{ll}
\noalign{\phantomsection}
\caption{A long table 1}
\label{tab:test1} \\
\toprule
...

링크가 작동하는 것 같고 추가 공간이 추가되지 않습니다.

답변2

longtable테이블 앞에 수직 공간을 변경하려면 또는 를 사용하여 이 길이를 변경하기 위해 테이블 ​​앞에 길이의 vskip \LTpre(기본값은 )을 삽입합니다 . 표시된 위치에서 사용하면 항목인 첫 번째 행의 첫 번째 셀에 입력되므로 수직 건너뛰기가 아무 작업도 수행하지 않는 수평 상자가 됩니다. 그래서 효과는 바로\bigskipammount\setlength\addtolength\vspacel추가하다명목상 음수 건너뛰기를 지정했음에도 불구하고 테이블 앞에 빈 줄이 있습니다.

관련 정보