El título en LyX aparece debajo de un "subtítulo"

El título en LyX aparece debajo de un "subtítulo"

Estoy usando el siguiente código TeX en LyX para crear una tabla doble. Al verlo en .pdf, no sé por qué aparece el título "Título principal" debajo del texto Panel A: Efecto. Definitivamente debería ser lo contrario. ¿Sabes por qué y cómo debería solucionar este problema? ¡Gracias!

%%%%%%%%%%%%%%%%%%%%%%
%% LyX 2.0.7 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[10pt,spanish]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{setspace}
\onehalfspacing

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
% 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

\usepackage{siunitx}
\sisetup{
detect-mode,
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
\def\yyy{%
\bgroup\uccode`\~\expandafter`\string-%
\uppercase{\egroup\edef~{\noexpand\text{\llap{\textendash}\relax}}}%
\mathcode\expandafter`\string-"8000 }

\def\xxxl#1{%
\bgroup\uccode`\~\expandafter`\string#1%
\uppercase{\egroup\edef~{\noexpand\text{\noexpand\llap{\string#1}}}}%
\mathcode\expandafter`\string#1"8000 }

\def\xxxr#1{%
\bgroup\uccode`\~\expandafter`\string#1%
\uppercase{\egroup\edef~{\noexpand\text{\noexpand\rlap{\string#1}}}}%
\mathcode\expandafter`\string#1"8000 }

\def\textsymbols{\xxxl[\xxxr]\xxxl(\xxxr)\yyy}


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

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

\newcommand{\estauto}[3]{
\vspace{.75ex}{
\textsymbols% Note the added command here
\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
% The new approach using threeparttables to generate notes that are the exact width of the table.
\newcommand{\Figtext}[1]{%
\begin{tablenotes}[para,flushleft]
\hspace{6pt}
\hangindent=1.75em
#1
\end{tablenotes}
}
\newcommand{\Fignote}[1]{\Figtext{\emph{Note:~}~#1}}
\newcommand{\Figsource}[1]{\Figtext{\emph{Source:~}~#1}}
\newcommand{\Starnote}{\Figtext{\textit{* p < 0.1, ** p < 0.05, *** p < 0.01.}\\ Errores est\'andares corregidos por correlaci\'on y heteroskedasticidad a nivel de escuela entre par\'entesis.}}% Add significance note with \starnote

\makeatother

\usepackage{babel}
\addto\shorthandsspanish{\spanishdeactivate{~<>}}

\begin{document}
$ $ %esto evita el error 
\begin{table}[htbp]
\begin{threeparttable} 
\caption{My Title}
\label{efectos_generales}
\Figtext{\textbf{Panel A: Efecto estudiante en corto plazo}}        \estwide{output/raw_tables/regressions_general2.tex}{3}{c}  
\Figtext{\textbf{Panel B: Efecto estudiante en mediano plazo}}  \estwide{output/raw_tables/regressions_general2_1.tex}{3}{c}       
\Figtext{\footnotesize{Panel A - Controles: (2)}}  
\Figtext{\footnotesize{Panel B - Controles: (3)}}  
\Figtext{\footnotesize{Errores est\'andares corregidos por correlaci\'on y heteroskedasticidad a nivel de escuela entre par\'entesis.\\ \textit{* p < 0.1, ** p < 0.05, *** p < 0.01.}}} 
\end{threeparttable}
\end{table}
\end{document}

Respuesta1

La razón es que creo que "así es como threeparttablefunciona".

La forma más sencilla de solucionar este problema es colocar el títuloantesel threeparttablemedio ambiente, por lo que tienes

\begin{table}[htbp]
\caption{My Title}
\label{efectos_generales}
\begin{threeparttable}
...
\end{threeparttable}
\end{table}

información relacionada