5

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: enter image description here

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:

Example: I have a template:enter image description here

And i'v got such resulting PDF (the text is not valigned, and it has big paragraph space, so begins not from top): enter image description here

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}
10
  • @DavidCarlisle. i'm creating automatic generation of the latex doc. there is some UI, where user creates template for the data. I take the template, take the data from DB, and put data in template ) . So if user makes a layout 120 pt height, and i've got data only to fill 20 pt. Layout still must be 120 pt, and data should be aligned vertically. Layout may have 2-3columns. Layout can be placed in header or document body. Apr 28, 2017 at 7:48
  • I need the same decision for the page content also, for the header i already have, now need foe the page content Apr 28, 2017 at 7:49
  • Part of the page, layout is placed one after another Apr 28, 2017 at 7:50
  • @DavidCarlisle see the question update Apr 28, 2017 at 8:06
  • 1
    Possibly use coffins? If you are putting things precisely on the page. But I don't understand how page breaking is supposed to come into it. Can you post an example?
    – cfr
    May 2, 2017 at 1:51

0

You must log in to answer this question.

Browse other questions tagged .