3

I have some supporting tables in an article that need to be submitted as a separate pdf file, however I need the cross-references and table numbers with captions (\listoftables) in the main document.

The separate pdf is not a problem, but how do I hide specific tables in the main document? Basically some tables should be processed for references and captions but removed from the final output.

Thanks!

edit: minimal working example

\documentclass[letterpaper,11pt]{article}
\usepackage[nolists,nomarkers,figuresfirst]{endfloat}
\newcommand{\beginsupplement}{\setcounter{table}{0}\renewcommand{\thetable}{S\arabic{table}}\setcounter{figure}{0}\renewcommand{\thefigure}{S\arabic{figure}}}

\begin{document}
Table~\ref{tab:S1} but not Table~\ref{tab:1} should be in a separate pdf file. The rest is fine.

\begin{table}[ht]
 \begin{tabular}{c}
  Content 1
 \end{tabular}
 \caption{Caption 1}
 \label{tab:1}
\end{table}  

\newpage
\listoftables
\newpage

\processdelayedfloats
\beginsupplement
\renewcommand{\tablename}{Supporting Table}

\begin{table}[ht]
 \begin{tabular}{c}
  Content S1
 \end{tabular}
 \caption{Caption S1}
 \label{tab:S1}
\end{table}  

\end{document}
newbie
  • 33
  • Welcome to TeX.SX! Where should the references point to, if the tables are hidden. Actually it is not very clear. Please provide a minimal document which is compilable and shows your set-up in the fewest lines possible. – LaRiFaRi Jan 13 '15 at 15:48
  • added working example – newbie Jan 13 '15 at 16:14

1 Answers1

2

You can use \include; your supplement should be in a separate file (here I use filecontents to make it into the main document nonetheless). In the preamble you'll have a line \includeonly{}.

To make the references known, comment \includeonly{}; compile until cross references are solved, then uncomment the line and compile again.

\documentclass[letterpaper,11pt]{article}
\usepackage[nolists,nomarkers,figuresfirst]{endfloat}
\usepackage{filecontents}

\newcommand{\beginsupplement}{%
  \setcounter{table}{0}%
  \renewcommand{\thetable}{S\arabic{table}}%
  \setcounter{figure}{0}%
  \renewcommand{\thefigure}{S\arabic{figure}}%
}
%\includeonly{} %%%%% Uncomment for removing the supplement table

\begin{document}
Table~\ref{tab:S1} but not Table~\ref{tab:1} should be in a separate pdf file. The rest is fine.

\begin{table}[ht]
 \begin{tabular}{c}
  Content 1
 \end{tabular}
 \caption{Caption 1}
 \label{tab:1}
\end{table}  

\newpage
\listoftables
\newpage

\processdelayedfloats

\begin{filecontents}{\jobname-support}
\beginsupplement
\renewcommand{\tablename}{Supporting Table}

\begin{table}[ht]
 \begin{tabular}{c}
  Content S1
 \end{tabular}
 \caption{Caption S1}
 \label{tab:S1}
\end{table}  
\processdelayedfloats
\end{filecontents}

\include{\jobname-support}
\end{document}
egreg
  • 1,121,712
  • I created a Makefile to automate the process of compiling the document with and without \includeonly{} commented out https://gist.github.com/jdblischak/e0204226ab8a2b262b392bdb0bd4bdc5 – John Blischak Feb 10 '17 at 22:03