\usepackage{booktabs} dando un error

\usepackage{booktabs} dando un error
\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}

Pido disculpas por mi publicación anterior. Soy muy nuevo en el foro y en el látex y publico por primera vez. Tengo un archivo llamado xyz.tex en el proyecto que se ve así:

            &\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\\

Recibo un error al compilar el pdf en overlead pero cuando elimino \usepackage{booktabs}, el pdf se procesa pero la tabla no tiene líneas, etc. No estoy seguro de cómo pegar el error. No estoy seguro de por qué está sucediendo eso. Se agradece cualquier ayuda.

Respuesta1

Intentar

\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}

En comparación con su MWE hay diferencias en:

  • cómo está puesta la mesa
  • cómo se inserta el cuento en el documento

El resultado de la compilación es:

ingrese la descripción de la imagen aquí

información relacionada