I am new to using TeX. I am trying to call a table as a tex file that is created in Stata 14. I am using estwide command. But I am getting an error message " Not in outer par mode" . I checked the previously posted questions and answers about it, however the changes didn't correct the error. I am attaching my codes and the tex file. Note that I have tex codes for the table that Stata created in tex form. When I copy and paste that tex, there is no error. The table is compiled. However, I am trying to automize adding tables and figures in TeX file. I am using OS X El Capitan v.10.11.4. Any help would be appreciated! I couldn't upload the tex file that I want to add. But it is in the code "comment"ed. Thanks E. Watson


\usepackage[total={6in,9in}, top=1.0in, bottom=1.0in, left=1.25in, right=1.25in, includefoot]{geometry}


% Alter some LaTeX defaults for better treatment of figures:
    % See p.105 of "TeX Unbound" for suggested values.
    % See pp. 199-200 of Lamport's "LaTeX" book for details.
    %   General parameters, for ALL pages:
    \renewcommand{\topfraction}{0.9}    % max fraction of floats at top
    \renewcommand{\bottomfraction}{0.8} % max fraction of floats at bottom
    %   Parameters for TEXT pages (not float pages):
    \setcounter{totalnumber}{4}     % 2 may work better
    \setcounter{dbltopnumber}{2}    % for 2-column pages
    \renewcommand{\dbltopfraction}{0.9} % fit big float above 2-col. text
    \renewcommand{\textfraction}{0.07}  % allow minimal text w. figs
    %   Parameters for FLOAT pages (not text pages):
    \renewcommand{\floatpagefraction}{0.7}  % require fuller float pages
    % N.B.: floatpagefraction MUST be less than topfraction !!
    \renewcommand{\dblfloatpagefraction}{0.7}   % require fuller float pages


%%%%%% NEW PRE %%%%%
% Packages for tables
\usepackage{booktabs}% Pretty tables
\usepackage{threeparttablex}% For Notes below table

% *****************************************************************
% siunitx
% *****************************************************************
\newcommand{\sym}[1]{\rlap{#1}} % Thanks to Joseph Wright & David Carlisle

        group-digits            = false,
        input-symbols           = ( ) [ ] - +,
        table-align-text-post   = false,
        input-signs             = ,

% Character substitution that prints brackets and the minus symbol in text mode. Thanks to David Carlisle
  \mathcode\expandafter`\string-"8000 }

\mathcode\expandafter`\string#1"8000 }

\mathcode\expandafter`\string#1"8000 }


% *****************************************************************
% Estout related things
% *****************************************************************
\let\estinput=\input % define a new input command so that we can still flatten the document

            \textsymbols% Note the added command here

            \textsymbols% Note the added command here

% Allow line breaks with \\ in specialcells

% *****************************************************************
% Custom subcaptions
% *****************************************************************
% Note/Source/Text after Tables
% The new approach using threeparttables to generate notes that are the exact width of the table.
\newcommand{\Starnote}{\Figtext{* p < 0.1, ** p < 0.05, *** p < 0.01. Standard errors in parentheses.}}% Add significance note with \starnote


%%%%%% TABLES %%%%%


%%% This part pasted from tex file stata created. 
%%  It compiles without error.
%\caption{Regression table\label{tab1}}
%                    &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\
%                    &\multicolumn{1}{c}{Price}&\multicolumn{1}{c}{Price}\\
%Weight (lbs.)       &       1.747&       3.465\\
%                    &      (2.72)&      (5.49)\\
%Mileage (mpg)       &      -49.51&       21.85\\
%                    &     (-0.57)&      (0.29)\\
%Car type            &            &      3673.1\\
%                    &            &      (5.37)\\
%Constant            &      1946.1&     -5853.7\\
%                    &      (0.54)&     (-1.73)\\
%Observations        &          74&          74\\
%\multicolumn{3}{l}{\footnotesize \textit{t} statistics in parentheses}\\

  • really you should clean up your preamble! you load several packages multiple times (they don't load the second time but it makes the file hard to debug) at least these are loaded more than once: amsmath, geometry, natbib, rotating, cite , setspace – David Carlisle Mar 14 '17 at 11:06
  • 1
    unrelated to the error but \renewcommand{\floatpagefraction}{0.7} % require fuller float pages makes it highly likely that all floats go to the end of the document – David Carlisle Mar 14 '17 at 11:07
  • Thank you! Since I am new and I decided to type up my thesis with TeX, I rushed to copy and paste a thesis preample. I did clean them up, and I will do more after I figure out whether it affects the formatting of the thesis template. – E. Watson Mar 14 '17 at 11:19
  • It's a really bad idea to include packages that you don't use. I'd start out by removing them all and just put back ones that you are actually using. – David Carlisle Mar 14 '17 at 11:50

Not in outer par mode means you have a table environment nested inside something that doesn't allow tables. Here it is another table environment.

Your input file starts

\caption{Regression table\label{tab1}}

so it is already a complete table float with a caption, not just the table itself.

But you are trying to input it as


so putting a table inside a threeparttable inside a table. That can not work, just use


or (if that's possible) get your application to just write the inner tabular to the table1.tex file not wrap it in table and \caption

Your Answer

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

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