\usepackage{booktabs} dando um erro

\usepackage{booktabs} dando um erro
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage[margin=1in]{geometry} % full-width
    \topskip        =   20pt
    \parskip        =   10pt
    \parindent      =   0 pt
    \baselineskip   =   15pt
\usepackage{pdflscape}
\usepackage{amssymb, amsfonts, amsmath}
\usepackage{bm}
\usepackage{booktabs}
\usepackage{setspace}  % line spacing
\onehalfspacing
\usepackage{graphicx}
\usepackage{adjustbox}
\usepackage{rotating}  % for sidewaystable

\usepackage{threeparttable}    
\usepackage{dcolumn}    % aligning decimals
    \newcolumntype{d}[1]{D{.}{.}{#1}}

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

\newcommand{\estauto}[3]{
        \vspace{.75ex}{
            %\textsymbols% Note the added command here
            \begin{tabular}{l*{#2}{#3}}
            \toprule
            \estinput{#1}
            \bottomrule
            \addlinespace[.75ex]
            \end{tabular}
            }
        }

\newcommand{\sym}[1]{\rlap{#1}}
\usepackage{hyperref}
\usepackage{tabulary}

\title{Project Name}
\author{X Y Z}
\date{September 2021}

\begin{document}
\maketitle


\section*{Summary Statistics (Tables)}
\subsection*{Consent}
\begin{table}[!htbp]
    \centering
    \caption{caption}
    \label{tab:meetattend}
    \estauto{xyz.tex}{8}{c}\\
    \small{\textit{Notes:}}
\end{table}
\end{document}

Peço desculpas pela minha postagem anterior. Sou muito novo no fórum e no látex e estou postando pela primeira vez. Eu tenho um arquivo chamado xyz.tex no projeto que se parece com isto:

            &\multicolumn{8}{c}{var name}                                                               \\
            &           N&        Mean&          SD&         Min&     10th p.&      Median&     90th p.&         Max\\
\midrule
x     &         a&       b&       c&           0&           1&           1&           1&           1\\
y &         120&       0.825&       0.382&           0&           0&           1&           1&           1\\
z     &         243&       0.778&       0.417&           0&           0&           1&           1&           1\\

Recebo um erro ao compilar o pdf no overlead, mas quando removo \usepackage{booktabs}, o pdf é renderizado, mas a tabela não tem linhas, etc. Não sei por que isso está acontecendo. Qualquer ajuda é apreciada.

Responder1

Tentar

\RequirePackage{filecontents}
    \begin{filecontents}{xyz.txt}
    & \multicolumn{8}{c}{var name} \\
    \cmidrule(l){2-9}
    & N     & Mean  & SD    & Min   & 10th p.   & Median & 90th p.  & Max   \\
    \midrule
x   & a     & b     & c     & 0     & 1         & 1      & 1        & 1     \\
y   & 120   & 0.825 & 0.382 & 0     & 0         & 1      & 1        & 1     \\
z   & 243   & 0.778 & 0.417 & 0     & 0         & 1      & 1        & 1     
    \end{filecontents}
    
\documentclass{article}
\usepackage[margin=1in]{geometry} 
\usepackage{pdflscape}
\usepackage{amsmath, amssymb}
\usepackage{bm}
\usepackage{setspace}  % line spacing
\onehalfspacing
\usepackage{graphicx}
\usepackage{adjustbox}
\usepackage{rotating}  % for sidewaystable

\usepackage{booktabs}
\usepackage{dcolumn}    % aligning decimals
    \newcolumntype{d}[1]{D{.}{.}{#1}}
\usepackage{threeparttable}

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

\newcommand{\estauto}[3]{
    \begin{tabular}{l*{#2}{#3}}
    \toprule
    \estinput{#1}  \\
    \bottomrule
    \end{tabular}
                        }

\newcommand{\sym}[1]{\rlap{#1}}
\usepackage{tabulary}
\usepackage{hyperref}

\title{Project Name}
\author{X Y Z}
\date{September 2021}

\begin{document}
\maketitle

\section*{Summary Statistics (Tables)}
\subsection*{Consent}
\begin{table}[!htbp]
    \centering
    \caption{caption}
    \label{tab:meetattend}
\estauto{xyz.txt}{8}{c}     \\ % <--- added \\

    \small{\textit{Notes:}}
\end{table}
\end{document}

Em comparação com o seu MWE existem diferenças em:

  • como a mesa está posta
  • como o conto é inserido no documento

O resultado da compilação é:

insira a descrição da imagem aqui

informação relacionada