Well, I think I have some sort of a solution now. Basically, since the spacing between rows/lines in Latex is apparently controlled by \baselineskip
, one essentially has to ensure that a section heading takes up a vertical space, which is integer multiple of \baselineskip
(i.e., it is quantized :)).
That would mean (I guess) is, either letting Latex typeset the section heading, and then trying to figure out the remaining height to add as vertical space, which seemed kind of tedious - or wrapping everything (related to the section heading) in a box with specified height, and letting Latex take care of the rest.
From the approaches I tried, the easiest (see code comments) seems to use a \parbox
preceeded by a \noindent
(or \parindent = 0pt
), with a specified height; in the question, the image shows the section heading (by default) takes a little more than three line heights - so the \parbox
here is specified to be 3\baselineskip
; the code shows simply the replacement that needs to be done around \section
...
%%% \@startsection {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE}
% parbox seemingly inserts parindent, even for a section; \noindent fails if inside \parbox; but works if first (and in group!) & matches OK int\baseline
% minipage kills beforeskip/afterskip of section
% vbox seems ok, but then needs to be less than int\baseline skip to match OK
{\noindent%
\parbox[t][3\baselineskip]{\linewidth}{
% \begin{minipage}[t][3\baselineskip]{\linewidth}
% \vbox to 3\baselineskip{
\section{Vivamus}
% }
% \end{minipage}
}%
}
% \lipsum[21-30]
...
... which results with following PDF rendering:
... and correspondingly, since subsequent rows/lines match now - also the bottom rows between the two columns are aligned.
In any case, if there is a different solution, I'd love to hear it ...
Cheers!
Coupla useful links:
It's probably easiest to make the final part part of the main paragraph so it naturally aligns with the last row. Exactly how to do that depends a bit on whether it needs to be multiple line or not, but for example
\documentclass[10pt,a4paper]{report}
\setlength\textwidth{16cm}
\begin{document}
\begin{tabular}{p{2cm}p{10cm}p{2cm}}
10. &
Some text or description here can has more than one line
Some text or description here can has more than one line
\hfill 300\hspace{-2cm}\mbox{}\\
\end{tabular}
\end{document}
Best Answer