TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using a conditionalinput file inside my main file

%% Out2 doesn't exits %% Out exists

I don't want to get caption and table number at position where I don't have file.


    {\def\inputtestedfile{\@@input #1 }}

\captionof{table}{ my cation }
   L01&  \inputtestedfile

\captionof{table}{ my caption}
    L02&  \inputtestedfile

\captionof{table}{ my caption}
    L03&  \inputtestedfile


%%%Contents of out.tex

&\textbf{col 1}&\textbf{col 2}\\\hline
\textbf{row 1}&1.50&1.76\\\hline
\textbf{row 2}&3.52&0.20\\\hline
share|improve this question
up vote 1 down vote accepted

In this case don't use \testfileexists but use \IfFileExists{<filename>}{<yes>}{<no>} directly, i.e:

\captionof{table}{ my cation }
 L01&  \input{out} \\

If you use \captionof and not table it's best to wrap the whole thing in a center environment. No idea about your placement issues, though.

share|improve this answer
@ thanx. It works well – user31177 Jan 3 '13 at 15:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.