TransWikia.com

Parskip seems to reset after tabular environment

TeX - LaTeX Asked on November 6, 2021

I am working on a document in which I include some tables. However, when I include the tables, the parskip length seems to reset to 0 afterwards. Why is that and how can I circumvent that?

The code I use with a small example is given in the following. Please note that I included every package I use for the sake of completeness. I do not know where the issue stems from exactly, so better include everything. So some packages are not required to display the following code per se.

The parskip option works fine before the table and is reset after it.

documentclass[a4paper, bibtotocnumbered,liststotoc,12pt]{scrartcl}
makeatletter
usepackage{apacite}
usepackage{hyperref}
renewcommandparagraph{@startsection{paragraph}{4}{z@}%
            {-2.5ex@plus -1ex @minus -.25ex}%
            {1.25ex @plus .25ex}%
            {normalfontnormalsizebfseries}}
makeatother
setcounter{secnumdepth}{4}
setcounter{tocdepth}{4} 
usepackage{xfakebold}

usepackage{natbib}

usepackage[T1]{fontenc}
usepackage[latin1]{inputenc} 
usepackage[english]{babel}

usepackage{setspace}
linespread{1.25}
setlength{parindent}{0pt}
setlength{parskip}{8pt}

usepackage{amsmath}
usepackage{amssymb}
usepackage{amsthm}
usepackage{xfrac}
usepackage{calrsfs}
DeclareMathAlphabet{pazocal}{OMS}{zplm}{m}{n}

usepackage[paper=a4paper,left=40mm,right=20mm,top=20mm,bottom=20mm]{geometry} 
geometry{a4paper} 
usepackage{lmodern}
usepackage{verbatim}
setkomafont{sectioning}{rmfamilybfseriesboldmath}
usepackage[usenames,dvipsnames]{color}

usepackage{caption}
captionsetup{labelfont=bf}
captionsetup[figure]{aboveskip=10pt} 
captionsetup{justification=justified,singlelinecheck=false,font=small}
   
usepackage{booktabs}
usepackage{tabularx}
usepackage{array}
usepackage{graphicx}
usepackage{rotating}
usepackage{xtab}
usepackage{float}
usepackage{tikz}
usetikzlibrary{positioning, shapes, arrows.meta}
usetikzlibrary{decorations.pathreplacing, calc}
tikzset{
    answer/.style={rectangle, draw, text width=15em, text badly centered, inner sep=0pt, minimum height=4em},
    inout/.style={rectangle, draw, text width=#1, text centered, rounded corners, minimum height=4em},
    line/.style={-{Stealth}}
}

usepackage{booktabs}

begin{document}

On insensible possession oh particular attachment at excellence in. The books arose but miles happy she. It building contempt or interest children mistress of unlocked no. Offending she contained mrs led listening resembled. Delicate marianne absolute men dashwood landlord and offended. Suppose cottage between and way. Minuter him own clothes but observe country. Agreement far boy otherwise rapturous incommode favourite. 

Cause dried no solid no an small so still widen. Ten weather evident smiling bed against she examine its. Rendered far opinions two yet moderate sex striking. Sufficient motionless compliment by stimulated assistance at. Convinced resolving extensive agreeable in it on as remainder. Cordially say affection met who propriety him. Are man she towards private weather pleased. In more part he lose need so want rank no. At bringing or he sensible pleasure. Prevent he parlors do waiting be females an message society. 

smallskip
captionof{table}{Hypothesis 3} 
begin{scriptsize}
begin{tabular*}{columnwidth}{@{extracolsep{stretch{1}}}*{5}{r}@{}}
  toprule
  & $Estimation$ & $Standard  Error$ & $ttext{-}Value$ & $Pr > |t|$  \
  midrule
  x. I & 0 & 80 & 80   \
  x. II & 0 & 1 & 80   \
  x.  & 0 & 0.39 & 0.02   \
  x. I & 0 & 0.00 & 0.00 \
  x. II & 0 & 0.00 & 0.13   \
  x I & (-)** & 0.39 & 0.02   \
  x II & 0 & 0.08 & 0.00   \
  x I & 0 & 0.39 & 0.02   \
  x II & 0 & 0.08 & 0.00   \
  x & 0 & 0.00 & 0.13  \
  x & 0 & 0.39 & 0.02   \
  x & 0 & 0.39 & 0.02  \
  x & 0 & 0.39 & 0.02  \
  bottomrule                             
end{tabular*}
caption*{textit{Notes}: TBD}
end{scriptsize}
bigskip

On insensible possession oh particular attachment at excellence in. The books arose but miles happy she. It building contempt or interest children mistress of unlocked no. Offending she contained mrs led listening resembled. Delicate marianne absolute men dashwood landlord and offended. Suppose cottage between and way. Minuter him own clothes but observe country. Agreement far boy otherwise rapturous incommode favourite. 

Cause dried no solid no an small so still widen. Ten weather evident smiling bed against she examine its. Rendered far opinions two yet moderate sex striking. Sufficient motionless compliment by stimulated assistance at. Convinced resolving extensive agreeable in it on as remainder. Cordially say affection met who propriety him. Are man she towards private weather pleased. In more part he lose need so want rank no. At bringing or he sensible pleasure. Prevent he parlors do waiting be females an message society. 

end{document}

One Answer

You could simplify your example to

documentclass[a4paper, bibtotocnumbered,liststotoc,12pt]{scrartcl}

usepackage{caption}


begin{document}

[theparskip]

captionof{table}{Hypothesis 3} 
begin{scriptsize}
caption*{textit{Notes}: TBD}
end{scriptsize}
bigskip

[theparskip]

end{document}

showing the changed value of parskip. Note that you are using caption package that documents that caption should not be used at teh top level and the terminal and log file warn:

Package caption Warning: captionsetup{type*=...} or captionof
(caption)                outside box or environment on input line 10.
See the caption package documentation for explanation.

Placing the code inside any environment or even a simple {...} group will restore all the local settings after the group.

Answered by David Carlisle on November 6, 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