The main problem with your example comes from the width of the tabular. For illustration consider the following sequence of flushright
environments:
\documentclass{article}
\begin{document}
\begin{flushright}
\rule{2cm}{0.4pt}
\end{flushright}
\begin{flushright}
\rule{5cm}{0.4pt}
\end{flushright}
\begin{flushright}
\rule{10cm}{0.4pt}
\end{flushright}
\begin{flushright}
\rule{15cm}{0.4pt}
\end{flushright}
\begin{flushright}
\rule{2cm}{0.4pt}
\end{flushright}
\end{document}
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 by 60.8858pt
. Reducing the dimension of say the last column, the anomolous spacing disappears:
\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{30mm}}
1 & dskhkdfahsk & khskdahfkhk\n
2 & two & three\n
\end{tabular}
\end{flushright}
Hello1
Hello2
\end{document}
flushright
adds some extra vertical spacing (\topsep
, standard value 8pt plus 2pt minus 4t
, but set to 0pt
by the parskip
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 as
\trivlist \raggedleft\item\relax
which creates something akin to
\hfill\strut\hskip 0pt
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.
\documentclass{article}
\usepackage{parskip}
\begin{document}
foo\par bar\par baz
{\parskip=0pt
foo\par bar\par baz\par}
foo\par bar\par baz
\end{document}
Or as a command:
\documentclass{article}
\usepackage{parskip}
\newcommand\foo[1]{\par#1\par\vspace{-\parskip}}
\begin{document}
bar\par bar
\foo{some nonsense}
bar\par bar
\foo{some nonsense}
bar
\end{document}
Best Answer
Actually,
minipage
and\parbox
reset\parskip
to 0pt, so you will have to reset it inside. While in this case we know\parskip=8pt
, in general that will not be true.