라텍스 오류: 정의되지 않은 제어 시퀀스, 외부 파 모드, 부족 및 과잉 hbox

라텍스 오류: 정의되지 않은 제어 시퀀스, 외부 파 모드, 부족 및 과잉 hbox

Latex에 Stata 회귀 테이블을 넣으려고 하는데 코드에서 다음 오류가 발생합니다.

Undefined control sequence \estwide{PEAssignment2tabl1.tex}{6}{c}
Not in outer par mode. \begin{table}[htbp]
Undefined control sequence \estwide{PEAssignment2tabl1.tex}{6}{c}
Undefined control sequence \estwide{PEAssignment2tabl1.tex}{6}{c}
Underfull \hbox (badness 10000) in paragraph
Underfull \hbox (badness 10000) in paragraph
Overfull \hbox (240.51797pt too wide) in paragraph

코드 시작:

\documentclass[10pt]{article}
\usepackage[left=0.5in, right=0.5in, top=0.5in, bottom=0.5in]{geometry}

\newcommand{\sym}[1]{\rlap{#1}}% Thanks to David Carlisle

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

\newcommand{\estwide}[3]{
    \vspace{.75ex}{
        \begin{tabular*}
        {\textwidth}{@{\hskip\tabcolsep\extracolsep\fill}l*{#2}{#3}}
        \toprule
        \estinput{#1}
        \bottomrule
        \addlinespace[.75ex]
        \end{tabular*}
        }
    }   

\newcommand{\estauto}[3]{
    \vspace{.75ex}{
        \begin{tabular}{l*{#2}{#3}}
        \toprule
        \estinput{#1}
        \bottomrule
        \addlinespace[.75ex]
        \end{tabular}
        }
    }

% Allow line breaks with \\ in specialcells
    \newcommand{\specialcell}[2][c]{%
\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}

% *****************************************************************
% Custom subcaptions
% *****************************************************************
% Note/Source/Text after Tables
\newcommand{\figtext}[1]{
\vspace{-1.9ex}
\captionsetup{justification=justified,font=footnotesize}
\caption*{\hspace{6pt}\hangindent=1.5em #1}
}
\newcommand{\fignote}[1]{\figtext{\emph{Note:~}~#1}}

\newcommand{\figsource}[1]{\figtext{\emph{Source:~}~#1}}

% Add significance note with \starnote
\newcommand{\starnote}{\figtext{* p < 0.1, ** p < 0.05, *** p < 0.01. Standard errors in parentheses.}}

% *****************************************************************
% siunitx
% *****************************************************************
\usepackage{siunitx} % centering in tables
\sisetup{
    detect-mode,
    tight-spacing       = true,
    group-digits        = false ,
    input-signs     = ,
    input-symbols       = ( ) [ ] - + *,
    input-open-uncertainty  = ,
    input-close-uncertainty = ,
    table-align-text-post   = false
    }

\begin{document}
\title{Assignment 2 \\ \vspace{0.001 mm} {\large Program Evaluation, Spring 2014} \\             \vspace{0.001 mm} {\large Sarah Armstrong}}
\maketitle

\begin{table}
\caption{Sample Characteristics by the Amount of Co-Holding (\pounds)}
\estwide{PEAssignment2tabl1.tex}{6}{c}
\label{table2}
\end{table}


\end{document}

서문 코드를 찾았습니다.http://www.jwe.cc/2012/03/stata-latex-tables-estout/

답변1

게시된 코드의 tex에서 발생한 (첫 번째) 오류는 귀하가 나열한 오류 중 하나가 아닙니다.

! Undefined control sequence.
\estwide ...tracolsep \fill }l*{#2}{#3}} \toprule 

\toprule로드하지 않은 booktabs 패키지에 의해 정의됩니다. 내가 추가하면

\usepackage{booktabs}

그리고 댓글을 달자

  %\estinput{#1}

파일이 없어서

귀하의 예제는 오류 없이 실행됩니다.

관련 정보