As I had issue with line breaks, How should I do manual line breaks?, I used \usepackage{parskip}
.
This worked fine.
But, when I have a tabular environment, there is a lot of vertical spacing before and after the enviroment.
Code:
\documentclass{article}
\usepackage{tabto}
\usepackage{parskip}
\newcommand{\inlinecode}[1]{\texttt{\small\color{blue}{#1}}}
\newcommand{\n}[0]{\\[3mm]}
\begin{document}
This is a line.
This a new paragraph.
\subsubsection{Closing Windows}
\begin{flushright}
\begin{tabular}{p{10mm}p{40mm}p{80mm}}
1 & dskhkdfahsk & khskdahfkhk\n
2 & two & three\n
\end{tabular}
\end{flushright}
Hello1
Hello2
\end{document}
Is there any way I can disable parskip
for tabular
alone?
Best Answer
The main problem with your example comes from the width of the tabular. For illustration consider the following sequence of
flushright
environments:producing
You'll see that there is extra vertical space before the line that is wider than text width.
In your example, the tabular has width
130mm
plus the intercolumn spacing and the log file tells you that the line is overfull by60.8858pt
. Reducing the dimension of say the last column, the anomolous spacing disappears:flushright
adds some extra vertical spacing (\topsep
, standard value8pt plus 2pt minus 4t
, but set to0pt
by theparskip
package), but this on its own is not as dramitic as what you were seeing, unless the contents are overwide.flushright
acts like this because it is defined aswhich creates something akin to
on the first line. LaTeX then finds an allowable break point at the
\hskip
, and when the line is overfull, can choose to break there.