I have got so much help on this site in my particular tasks, and now i realize i'm using something wrong for my purpose.
I need a decision (component, or a set of the components), that provides few columns, page-breakable, valign/halign, minimun height, and no paragraph spacing between components.
here How to make a box with the minimal height and vertical alignment inside the box? I've got a good answer, for the header. But it doesn't work with longtable
, so doesn't supports page breaking.
May be i need to use not table - but some combination of boxes for this purpose?
Example, user makes a template like this:
I take the template, take the text from DB and put in in the same order as user wants.
So i don't know how much text it will be in the layout.
Now i have a working version using longtables
. Minimum height i provide with \parbox
(if data is short and layout is high). But then i have a problem with valign - how to valign table in parbox?
If the text in layout is bigger - layout should be stretched for sure and breaked to pages.
I use such constuction now (each row in the teplate - one parbox with longtable), it doesn't provides page breaking and not valigned:
And i'v got such resulting PDF (the text is not valigned, and it has big paragraph space, so begins not from top):
Code that i use is following:
\documentclass{book}
\usepackage{fancybox,fancyhdr}
\usepackage[T1]{fontenc}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{fixltx2e}
\usepackage[normalem]{ulem}
\usepackage[left=72pt,right=72pt,
headheight=72pt,
top=\dimexpr72pt+\headsep\relax,
textheight =592pt
]{geometry}
\usepackage{array}
\usepackage{longtable}
\usepackage[export]{adjustbox}
\newcolumntype{R}[2]{>{\raggedleft \arraybackslash \hspace{0pt}}{#2}{#1}}
\newcolumntype{L}[2]{>{\raggedright\arraybackslash}{#2}{#1}}
\newcolumntype{C}[2]{>{\center\arraybackslash}{#2}{#1}}
\fancyhf{} \fancyhead[C]{\raisebox{\dimexpr\headheight-\height}[\headheight][0pt] {\begin{tabular}{L{\textwidth}{p}}Non-disclosure agreement (NDA)\end{tabular}}}\begin{document}
\pagestyle{fancy}
\noindent\sbox{0}{\parbox{\textwidth}{\noindent\begin{longtable}{C{\textwidth}{m}}Text\end{longtable}}}
\ifdim\dimexpr\ht0+\dp0<517pt
\dp0\dimexpr517pt-\ht0\fi
\makebox{\usebox{0}}\\ \noindent\sbox{0}{\parbox{\textwidth}{\noindent\begin{longtable}{L{\textwidth}{p}}Text\end{longtable}}}
\ifdim\dimexpr\ht0+\dp0<27pt
\dp0\dimexpr27pt-\ht0\fi
\makebox{\usebox{0}}
\end{document}