TransWikia.com

Position of tables

TeX - LaTeX Asked by Dario on April 20, 2021

I have the following file containing my tables. The preamble is the one given by the journal I am going to send my paper:

documentclass[twoside]{article}
makeatletterif@twocolumnPassOptionsToPackage{switch}{lineno}elsefimakeatother

usepackage{amsmath,amsfonts,amsbsy,amssymb,tabulary,graphicx,times,caption,fancyhdr}
usepackage[utf8]{inputenc}
usepackage[paperheight=10in,paperwidth=6.5in,margin=2cm,headsep=.5cm,top=2.5cm]{geometry}
renewenvironment{abstract} {vspace*{-1pc}trivlistitem[]leftskipoupIndenthrulefillparvskip4ptnoindenttextbf{abstractname}mbox{null}}{parnoindenthrulefillendtrivlist} 
linespread{1.13} date{}
captionsetup[figure]{labelfont=sc,skip=1.4pt,aboveskip=1pc}
captionsetup[table]{labelfont=sc,skip=1.4pt,labelsep=newline}

makeatletterdefoupIndent{1pt}
defauthor#1{gdef@author{hskip-dimexpr(tabcolsep)hskipoupIndentparbox{dimexprtextwidth-oupIndent}{centeringbfseries#1}}}
deftitle#1{gdef@title{centeringbfseriesifx@articleType@emptyelse@articleTypefi#1}}
let@articleType@empty defarticletype#1{gdef@articleType{{normalitshape#1}}}

makeatother

tolerance=400
usepackage{url,multirow,morefloats,floatflt,cancel,tfrupee}
makeatletter

AtBeginDocument{@ifpackageloaded{textcomp}{}{usepackage{textcomp}}}
makeatother
usepackage{colortbl}
usepackage{xcolor}
usepackage{pifont}
usepackage[nointegrals]{wasysym}
usepackage{adjustbox}
urlstyle{rm}
makeatletter

%%%For Table column width calculation.
defmcWidth#1{csname TY@F#1endcsname+tabcolsep}

%%Hacking center and right align for table
defcAlignHack{rightskip@flushglueleftskip@flushglueparindentz@parfillskipz@skip}
defrAlignHack{rightskipz@skipleftskip@flushglue parindentz@parfillskipz@skip}

%Etal definition in references
@ifundefined{etal}{defetal{textit{et~al}}}{}

%if@twocolumnusepackage{dblfloatfix}fi
usepackage{ifxetex}
ifxetexelseif@twocolumn@ifpackageloaded{stfloats}{}{usepackage{dblfloatfix}}fifi

AtBeginDocument{
expandafterifxcsname eqalignendcsnamerelax
defeqalign#1{nullvcenter{def{cr}openupjotm@th
  ialign{strut$displaystyle{##}$hfil&$displaystyle{{}##}$hfil
      crcr#1crcr}},}
fi
}

%For fixing hardfail when unicode letters appear inside table with endfloat
AtBeginDocument{%
  @ifpackageloaded{endfloat}%
   {renewcommandefloat@iwrite[1]{immediateexpandafterprotected@writecsname efloat@post#1endcsname{}}}{newififefloat@tables}%
}%

defBreakURLText#1{@tforbrk@tempa:=#1do{brk@tempahskip0pt}}
letlt=<
letgt=>
defprocessVert{ifmmode|elsetextbarfi}
letprocessvertprocessVert

@ifundefined{subparagraph}{
defsubparagraph{@startsection{paragraph}{5}{2parindent}{0ex plus 0.1ex minus 0.1ex}%
{0ex}{normalfontsmallitshape}}%
}{}

% These are now gobbled, so won't appear in the PDF.
newcommandrole[1]{unskip}
newcommandaucollab[1]{unskip}
  
@ifundefined{tsGraphicsScaleX}{gdeftsGraphicsScaleX{1}}{}
@ifundefined{tsGraphicsScaleY}{gdeftsGraphicsScaleY{.9}}{}
% To automatically resize figures to fit inside the text area
defcheckGraphicsWidth{ifdimGin@nat@width>linewidth
    tsGraphicsScaleXlinewidthelseGin@nat@widthfi}

defcheckGraphicsHeight{ifdimGin@nat@height>.9textheight
    tsGraphicsScaleYtextheightelseGin@nat@heightfi}

deffixFloatSize#1{}%@ifundefined{processdelayedfloats}{setbox0=hbox{includegraphics{#1}}ifnumwd0<columnwidthrelaxrenewenvironment{figure*}{begin{figure}}{end{figure}}fi}{}}
letts@includegraphicsincludegraphics

definlinegraphic[#1]#2{{edef@tempa{#1}edefbaseline@shift{ifx@tempa@empty0else#1fi}edeftempZ{thenumexpr(numexpr(baseline@shift*f@size/100))}protectraisebox{tempZ pt}{ts@includegraphics{#2}}}}

%renewcommand{includegraphics}[1]{ts@includegraphics[width=checkGraphicsWidth]{#1}}
AtBeginDocument{defincludegraphics{@ifnextchar[{ts@includegraphics}{ts@includegraphics[width=checkGraphicsWidth,height=checkGraphicsHeight,keepaspectratio]}}}

DeclareMathAlphabet{mathpzc}{OT1}{pzc}{m}{it}

defURL#1#2{@ifundefined{href}{#2}{href{#1}{#2}}}

%%For url break
defUrlOrds{do*do-do~do'do"do-}%
g@addto@macro{UrlBreaks}{UrlOrds}

edeffntEncoding{f@encoding}
defEUoneEnc{EU1}
makeatother
deffloatpagefraction{0.8} 
defdblfloatpagefraction{0.8}
defstyle#1#2{#2}
defxxxguillemotleft{fontencoding{T1}selectfontguillemotleft}
defxxxguillemotright{fontencoding{T1}selectfontguillemotright}

newififmultipleabstractmultipleabstractfalse%
newenvironment{typesetAbstractGroup}{}{}%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
usepackage[authoryear]{natbib}
setcitestyle{aysep={,}} 
usepackage[T1]{fontenc}

%%%%%
% Tables
%%%%%

usepackage{rotating}
usepackage{longtable}
usepackage{adjustbox}
usepackage{graphicx}
usepackage{booktabs, makecell, siunitx}
usepackage{eqparbox}
usepackage[referable,para]{threeparttablex}
usepackage{multirow}
usepackage{pdflscape}
usepackage{stackengine}
usepackage{interval}
usepackage{amsmath,ragged2e} % <-- new
usepackage{interval,pbox}
usepackage{float}

sisetup{group-separator={,}, table-format=1.3, table-space-text-post=***, 
table-number-alignment =center}
newcommand*{MyIndent}
{hspace*{1.5cm}}
usepackage{dcolumn}
newcolumntype{d}[1]{D..{#1}}
newcommandmc[1]{multicolumn{1}{c}{#1}} % handy shortcut macro

newcommandmytab[1]{%
   smash[b]{begin{tabular}[t]{@{}c@{}}#1end{tabular}}}
hyphenation{bur-kina}

usepackage{pgffor}
newcommandQuad[1][1]{foreach Quaddy in {1,...,#1}{quad}ignorespaces}
captionsetup[table]{labelfont=sc,skip=1.4pt,labelsep=newline}

begin{document}

begin{table}[H]
setlength{tabcolsep}{1.5pt}
centering
normalsize
defsym#1{ifmmode^{#1}else(^{#1})fi}
begin{threeparttable}
caption{Replication of Table 2 in Tabellini (2010) label{tabellini}}
begin{tabular}{l*{7}{d{2.5}}}
toprule toprule
                                            &mc{(1)}                   &mc{(2)}                       &mc{(3)}                   &mc{(4)}                   &mc{(5)}                   &mc{(6)}                   &mc{(7)}
midrule
school                              &0.491sym{***} &0.785sym{***}     &0.374sym{*}       &0.769sym{***} &0.510sym{***} &0.376sym{*}       &0.523sym{**} 
                                        &(0.146)                    &(0.172)                        &(0.200)                    &(0.233)                    &(0.170)                    &(0.198)                    &0.244         
urb_rate1850               &0.616sym{***} &0.712sym{***}     &0.615sym{***} &0.708sym{***} &0.805sym{***} &0.616sym{***} &0.741sym{***}
                                        &(0.174)                    &(0.168)                        &(0.160)                    &(0.198)                    &(0.206)                    &(0.205)                    &0.151         
pc_culture                     &0.578sym{***} &                               &                           &                           &                           &                           &                     
                                        &(0.119)                    &                               &                           &                           &                           &                           &                     
pc_culture_pos                &                           &0.707sym{***}     &                           &                           &                           &                           &                     
                                        &                           &(0.150)                        &                           &                           &                           &                           &                     
pc_children                    &                               &                               &0.572sym{***} &                           &                           &                           &                     
                                        &                           &                               &(0.186)                    &                           &                           &                           &                     
control                             &                           &                               &                           &1.359                  &                           &                           &                     
                                        &                           &                               &                           &(0.828)                    &                           &                           &                     
trust                                   &                           &                               &                           &                           &0.925sym{**}      &                           &                     
                                        &                           &                               &                           &                           &(0.384)                    &                            &                     
obedience                       &                           &                               &                           &                           &                           &-0.929sym{**}     &                     
                                        &                           &                               &                           &                           &                           &(0.456)                    &                     
respect                             &                           &                               &                           &                           &                           &                           &1.643sym{***}
                                        &                               &                               &                           &                           &                           &                           &(0.512)         
midrule
(N)                               &mc{69}                &mc{69}                    &mc{69}                &mc{69}                &mc{69}                &mc{69}                &mc{69}         [1ex]
Moran p--value              &mc{[0.001]}           &mc{[0.000]}               &mc{[0.004]}           &mc{[0.015]}           &mc{[0.001]}           &mc{[0.028]}           &mc{[0.001]} 
bottomrule bottomrule
end{tabular}
begin{tablenotes}
small
      item[]{{it{Notes}:} The table replicates the estimation contained in Table 2 of Tabellini (2010). Robust standard errors are in the brackets. At the bottom of the table the p--values associtated to the Moran's I tests are reported in []. The null hypothesis of the test is the absence of a spatial dependence in the residuals. The tests are based on the on the usage of a spatial matrix, $mathbf{W}$, which elements are the inverse of the distance between region $i$ and $j$, $frac{1}{w_{ij}}$.
      *** $p<0.01$
      **{phantom{*}} $p<0.05$ 
      *{phantom{**}} $p<0.10$ }
end{tablenotes}
end{threeparttable}
end{table}

pagebreak

begin{table}[H]
setlength{tabcolsep}{1.5pt}
centering
normalsize
defsym#1{ifmmode^{#1}else(^{#1})fi}
begin{threeparttable}
caption{Estimation of the SARAR (1,1) model label{sarardW}}
begin{tabular}{l*{7}{d{2.5}}}
toprule toprule
                                        &mc{(1)}                   &mc{(2)}                   &mc{(3)}                   &mc{(4)}                   &mc{(5)}                           &mc{(6)}                   &mc{(7)}
midrule         
school                          &0.424sym{**}      &0.680sym{***} &0.306sym{*}       &0.617sym{**}      &0.361                              &0.322                  &0.405sym{**}
                                    &(0.185)                    &(0.210)                    &(0.182)                    &(0.245)                    &(0.242)                            &(0.212)                    &(0.180)              
urb_rate1850           &0.563sym{***} &0.650sym{***} &0.524sym{***} &0.582sym{***} &0.700sym{***}         &0.565sym{***} &0.619sym{***}
                                    &(0.141)                    &(0.126)                    &(0.139)                    &(0.161)                    &(0.171)                            &(0.184)                    &(0.123)                 
pc_culture                 &0.497sym{***} &                           &                           &                           &                                   &                           &                     
                                    &(0.108)                    &                           &                           &                           &                                   &                           &                     
pc_culture_pos        &                           &0.658sym{***} &                           &                           &                                   &                           &                     
                                    &                           &(0.118)                    &                           &                           &                                   &                           &                     
pc_children                &                           &                           &0.494sym{***} &                           &                                   &                           &                     
                                    &                           &                           &(0.171)                    &                           &                                   &                           &                     
control                         &                           &                           &                           &1.381sym{**}      &                                   &                           &                     
                                    &                           &                           &                           &(0.688)                    &                                   &                           &                     
trust                               &                           &                           &                           &                           &0.969sym{***}         &                           &                     
                                    &                           &                           &                           &                           &(0.313)                            &                           &                     
obedience                   &                           &                           &                           &                           &                                   &-0.505                     &                     
                                &                           &                           &                           &                           &                                   &(0.448)                    &                     
respect                         &                           &                           &                           &                           &                                   &                           &1.663sym{***}
                                    &                           &                           &                           &                           &                                   &                           &(0.390)         
midrule
(N)                           &mc{69}                &mc{69}                &mc{69}                &mc{69}                &mc{69}                        &mc{69}                &mc{69}     
$zeta$                         &mc{0.314}             &mc{0.323}             &mc{0.396}             &mc{0.516}             &mc{0.430}                     &mc{0.469}             &   mc{0.431}  
                                        &mc{[0.040]}           &mc{[0.021]}           &mc{[0.010]}           &mc{[0.001]}           &mc{[0.006]}                   &mc{[0.006]}           &mc{[0.002]}
$rho$                          &mc{-1.924}            &mc{-2.158}            &mc{-1.865}            &mc{-1.655}            &mc{-1.820}                    &mc{-1.506}            &mc{-2.209}
                                        &mc{[0.001]}           &mc{[0.000]}           &mc{[0.000]}           &mc{[0.003]}           &mc{[0.000]}                   &mc{[0.009]}           &mc{[0.000]}   
Wald test                       &mc{[0.000]}           &mc{[0.000]}           &mc{[0.001]}           &mc{[0.000]}           &mc{[0.001]}                &mc{[0.003]}          &mc{ [0.000]}      
bottomrule bottomrule
end{tabular}
begin{tablenotes}
small
      item[]{{it{Notes}:} The Table reports the estimations of the SARAR model in Eqs. (2) and (3). Analysis is performed using the spatial matrix, $mathbf{W}$, which elements are the inverse of the distance between region $i$ and $j$, $frac{1}{w_{ij}}$. Standard errors, reported in ( ), are robust to heteroskedasticity. P--values of the significance of the tests on $zeta$ and $rho$ and their joint significance are in [ ].   
      *** $p<0.01$
      **{phantom{*}} $p<0.05$ 
      *{phantom{**}} $p<0.10$ }
end{tablenotes}
end{threeparttable}
end{table}


pagebreak

begin{sidewaystable}
setlength{tabcolsep}{10pt}
centering
normalsize
defsym#1{ifmmode^{#1}else(^{#1})fi}
begin{threeparttable}
caption{Direct, indirect and total impact of culture on economic development  label{DIT}}
begin{tabular}{l*{8}{d{2.5}}}
toprule toprule
                                                        Quad[6] &mc{pc_culture}  &mc{pc_culture_pos}  &mc{pc_children}  &mc{control}       &mc{trust}             &mc{obedience}     &mc{respect}
midrule
Direct                                                                  &0.498sym{***} &0.661sym{***}             &0.497sym{***}     &1.397sym{**}  &0.976sym{***} &-0.509                         &1.676sym{***}             
                                                                            &(0.107)                        &(0.118)                                    &(0.171)                            &(0.693)                    &(0.315)                        &(0.450)                            &(0.388)                                    
Indirect                                                                &   0.198                           &0.274sym{*}                       &0.282sym{**}          &1.265                      &0.633                          &-0.385                         &1.090sym{**}                  
                                                                            &(0.125)                        &(0.161)                                    &(0.161)                            &(0.889)                    &(0.439)                        &(0.354)                            &(0.518)                                          
Total                                                                   &0.697sym{***} &0.934sym{***}             &0.779sym{***}     &2.662sym{*}       &1.609sym{**}      &-0.895                         &2.765sym{***}             
                                                                            &(0.154)                        &0.193                                      &(0.250)                            &(1.381)                    &(0.642)                        &(0.750)                            &(0.613)                                                                                                          
bottomrule bottomrule
end{tabular}
begin{tablenotes}
small
      item[]{The Table decomposes the total effect of culture on economic development. The direct effect coincides with the coefficients reported in Table 2. 
       *** $p<0.01$
      **{phantom{*}} $p<0.05$ 
      *{phantom{**}} $p<0.10$ }
end{tablenotes}
end{threeparttable}
end{sidewaystable}

pagebreak

begin{table}[H]
setlength{tabcolsep}{1.5pt}
centering
normalsize
defsym#1{ifmmode^{#1}else(^{#1})fi}
begin{threeparttable}
caption{Estimation of the SARAR (1,1) model label{sarardW}}
begin{tabular}{l*{8}{d{2.5}}}
toprule toprule
                                        &mc{(1)}                   &mc{(2)}                   &mc{(3)}                   &mc{(4)}                   &mc{(5)}                           &mc{(6)}                   &mc{(7)}
&mc{(8)}
midrule         
school                          &0.433sym{**}      &0.495sym{***} &0.821sym{***} &0.350sym{*}       &0.646sym{**}              &0.401sym{*}       &0.366sym{*}           &0.493sym{***}
                                    &(0.188)                    &(0.185)                    &(0.225)                    &(0.185)                    &(0.287)                            &(0.230)                    &(0.209)                        &(0.185)                
urb_rate1850           &0.548sym{***} &0.602sym{***} &0.720sym{***} &0.512sym{***} &0.600sym{***}         &0.733sym{***} &0.608sym{***}     &0.648sym{***}
                                    &(0.142)                    &(0.141)                    &(0.124)                    &(0.134)                    &(0.161)                            &(0.175)                    &(0.203)                        &(0.116)                
pc_culture                 &0.612sym{***} &                           &                           &                           &                                   &                           &                               &                     
                                    &(0.121)                    &                           &                           &                           &                                   &                           &                               &                     
pc_cultcond                &                           &0.538sym{***} &                           &                           &                                   &                           &                               &                     
                                &                           &(0.144)                    &                           &                           &                                   &                           &                               &                     
pc_culposcon           &                           &                           &0.739sym{***} &                           &                                   &                           &                               &                     
                                    &                           &                           &(0.143)                    &                           &                                   &                           &                               &                     
pc_childcond               &                           &                           &                           &0.538sym{***} &                                   &                           &                               &                     
                                    &                           &                           &                           &(0.183)                    &                                   &                           &                               &                     
control_cond               &                           &                           &                           &                           &1.342                          &                           &                               &                     
                                    &                           &                           &                           &                           &(1.015)                            &                           &                               &                     
trust_cond                 &                           &                           &                           &                           &                                   &0.901sym{**}      &                               &                     
                                    &                           &                           &                           &                           &                                   &(0.378)                    &                               &                     
obcond                          &                           &                           &                           &                           &                                   &                           &-0.186                         &                     
                                    &                           &                           &                           &                           &                                   &                           &(0.555)                        &                     
respect_cond           &                           &                           &                           &                           &                                   &                           &                               &1.981sym{***}
                                    &                           &                           &                           &                           &                                   &                           &                               &(0.339)         
midrule
(N)                           &mc{69}                &mc{69}                &mc{69}                &mc{69}                &mc{69}                        &mc{69}                &mc{69}     
$zeta$                         &mc{0.314}             &mc{0.323}             &mc{0.396}             &mc{0.516}             &mc{0.430}                     &mc{0.469}             &   mc{0.431}  
                                        &mc{[0.040]}           &mc{[0.021]}           &mc{[0.010]}           &mc{[0.001]}           &mc{[0.006]}                   &mc{[0.006]}           &mc{[0.002]}
$rho$                          &mc{-1.924}            &mc{-2.158}            &mc{-1.865}            &mc{-1.655}            &mc{-1.820}                    &mc{-1.506}            &mc{-2.209}
                                        &mc{[0.001]}           &mc{[0.000]}           &mc{[0.000]}           &mc{[0.003]}           &mc{[0.000]}                   &mc{[0.009]}           &mc{[0.000]}   
Wald test                       &mc{[0.000]}           &mc{[0.000]}           &mc{[0.001]}           &mc{[0.000]}           &mc{[0.001]}                &mc{[0.003]}          &mc{ [0.000]}      
bottomrule bottomrule
end{tabular}
begin{tablenotes}
small
      item[]{{it{Notes}:} The Table reports the estimations of the SARAR model in Eqs. (2) and (3). Analysis is performed using the spatial matrix, $mathbf{W}$, which elements are the inverse of the distance between region $i$ and $j$, $frac{1}{w_{ij}}$. Standard errors, reported in ( ), are robust to heteroskedasticity. P--values of the significance of the tests on $zeta$ and $rho$ and their joint significance are in [ ].   
      *** $p<0.01$
      **{phantom{*}} $p<0.05$ 
      *{phantom{**}} $p<0.10$ }
end{tablenotes}
end{threeparttable}
end{table}
end{document}

I cannot figure out why table 3 is reported after table 4. Any hint on this?

One Answer

First you can use [!htbp] instead of [H] to make the table appear where it is in the document [here,top,bottom,page]. Furthermore your table 3 has not such an argument. So write begin{sidewaystable}[!htbp]. Then it should work.

Here you have a short overview about table and figure enviroments.

Here you can find an explanation between the difference of [h] and [H].

Correct answer by Roland on April 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP