0

How to skip the table counter for table 1 in ThreePartTable and ltabulary, like we use \begin{table*}?

Below is my Code

\documentclass[oneside]{scrbook}
\usepackage{showframe}

\usepackage{longtable}
\usepackage{tabulary}
\usepackage{booktabs}
\usepackage[referable]{threeparttablex}
\usepackage{caption}

% define ltabulary environment
\makeatletter
\newcommand*\TY@cap@gobble[2][]{\\}% from ltxtable (adjusted)
\def\ltabulary{%
    \def\caption{% from ltxtable (adjusted)
        \@ifstar\TY@cap@gobble\TY@cap@gobble}
    \def\endfirsthead{\\}%
    \def\endhead{\\}%
    \def\endfoot{\\}%
    \def\endlastfoot{\\}%
    \def\tabulary{%
        \def\TY@final{%
    \def\endfirsthead{\LT@end@hd@ft\LT@firsthead}%
    \def\endhead{\LT@end@hd@ft\LT@head}%
    \def\endfoot{\LT@end@hd@ft\LT@foot}%
    \def\endlastfoot{\LT@end@hd@ft\LT@lastfoot}%
    \longtable}%
        \let\endTY@final\endlongtable
        \TY@tabular}%
    \dimen@\columnwidth
    \advance\dimen@-\LTleft
    \advance\dimen@-\LTright
    \tabulary\dimen@}
\def\endltabulary{\endtabulary}
\makeatother

\begin{document}


\begin{ThreePartTable}
  \begin{ltabulary}{L L L L }
  \caption*{Short table (with long columns 1)}\\
    \toprule
    H1 & H2 & H3 & H4\\
    \midrule
    \endfirsthead
    \toprule
    H1 & H2 & H3 & H4\\
    \midrule
    \endhead
    \endfoot
    \bottomrule
    \endlastfoot
    A & B & C & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin eu lorem et massa interdum commodo a et nisi. Suspendisse mauris velit, molestie et iaculis at, posuere vel dui. Aenean at ante lorem. Nullam porttitor vestibulum scelerisque. Maecenas et posuere nisi\\
  \end{ltabulary}
\end{ThreePartTable}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin eu lorem et massa interdum commodo a et nisi. Suspendisse mauris velit, molestie et iaculis at, posuere vel dui. Aenean at ante lorem. Nullam porttitor vestibulum scelerisque. Maecenas et posuere nisi, id finibus metus. Vivamus vehicula viverra vestibulum. Morbi sed tellus at mi mollis rutrum quis ut est. Vivamus consequat consectetur purus, id pellentesque elit pretium et. Fusce luctus, nibh sit amet mollis volutpat, ex enim pretium ipsum, at pharetra justo erat ut dui. Interdum et malesuada fames ac ante table \ref{tab1} ipsum primis in faucibus.

\begin{ThreePartTable}
  \begin{ltabulary}{L L L L }
  \caption{Short table (with long columns 1)}\label{tab1}\\
    \toprule
    H1 & H2 & H3 & H4\\
    \midrule
    \endfirsthead
    \toprule
    H1 & H2 & H3 & H4\\
    \midrule
    \endhead
    \endfoot
    \bottomrule
    \endlastfoot
    A & B & C & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin eu lorem et massa interdum commodo a et nisi. Suspendisse mauris velit, molestie et iaculis at, posuere vel dui. Aenean at ante lorem. Nullam porttitor vestibulum scelerisque. Maecenas et posuere nisi\\
  \end{ltabulary}
\end{ThreePartTable}

\end{document}

enter image description here

  • Just add \addtocounter{table}{-1} between the two ThreePartTables. – John Kormylo Mar 24 '17 at 16:18
  • @JohnKormylo, but is there a option like table* in threeparttable?? – user52124 Mar 25 '17 at 6:42
  • Normally \caption is where the table counter is incremented, but obviously not with ThreePartTable. – John Kormylo Mar 25 '17 at 13:04

Your Answer

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

Browse other questions tagged or ask your own question.