0

I am currently implementing a dynamic PDF-creator. Therefore I need to be the last two columns of the paracol env. always at the end (bottom) of the page. Is there any way which achieves this?

It should look like this (gray blocks with black border are sensitive information): enter image description here

But the gray blocks should be at the end of the page and should „grow“ from bottom to top.

Current status (static content):

\documentclass[14pt,parskip=full,oneside,a4paper]{article}
\usepackage[
  left = 16mm,
  right = 16mm,
  textwidth = 178mm,
  top = 20mm,
  bottom=22mm,
  % headheight=17pt, % as per the warning by fancyhdr
  % includehead,
  includefoot,
  % heightrounded, % to avoid spurious underfull messages
]{geometry}

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{uarial}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[demo]{graphicx}
\usepackage{subfigure}
\usepackage{float}
\graphicspath{{images/}}
\usepackage[most]{tcolorbox}
\usepackage{xcolor}
\usepackage[export]{adjustbox}
\usepackage[document]{ragged2e}
\usepackage{ifthen}
\setlength{\parindent}{0em}
\setlength{\parskip}{0em}
\renewcommand{\baselinestretch}{0.0}

\usepackage{paracol}

% Custom Colors
\definecolor{customred}{HTML}{E10000}
\definecolor{customgray}{HTML}{878787}
\definecolor{customlightgray}{HTML}{DCDCDC}

% Custom Commands
\newcommand{\ct}[2]{
  \textcolor{#1}{#2}
}
\newcommand{\productHeader}[2]{
  \begin{paracol}{2} % this is what I want
    \includegraphics[width=37mm,height=11mm]{}
  \switchcolumn
    \begin{flushright}
      \textbf{\ct{customred}{\fontsize{18}{22}\selectfont #1}}\\
      \ct{customgray}{\fontsize{9.5}{14}\selectfont #2}
    \end{flushright}
  \end{paracol}
}

\newcommand{\productTitle}[2]{
  \textbf{\ct{customred}{\fontsize{12,5}{16}\selectfont #1}}\\
  \vspace{8,8mm}
  \textbf{\ct{customgray}{\fontsize{9.5}{14}\selectfont #2}}\\
  \vspace{4mm}
  {\color{customred}\rule{23mm}{1mm}\hfill}\\
  \vspace{12mm}
}
\newcommand{\productDescription}[2]{
  \vspace{12mm}
  \textbf{\ct{black}{\fontsize{9,5}{14}\selectfont #1}}\\
  {\fontsize{9,5}{14}\selectfont #2}
}

\newcommand{\productBottom}[2]{
  \textbf{\ct{customred}{\fontsize{9,5}{14}\selectfont #1}}\\
  \begin{tcolorbox}[boxsep=0pt,top=3mm,left=3mm,right=3mm,bottom=3mm,arc=0pt,auto outer arc,colback=customlightgray,colframe=customlightgray]
    % \begin{minipage}[b]{80mm}
      \textbf{\fontsize{9,5}{14}\selectfont #2}
      % \vfill
    % \end{minipage}
  \end{tcolorbox}
}
\newcommand{\productIcon}[2]{
  \centering
  \ifthenelse{\equal{#2}{true}}{
    \includegraphics[width=13mm,height=13mm]{images/icons/#1.png}
  }{\includegraphics[width=13mm,height=13mm]{images/icons/#1_grau.png}}

}
\newcommand{\productIcons}[4]{
  \begin{figure}[H]
    \centering
    \hfill
      \subfigure{{\productIcon{Quality}{#1}}}%
    \hfill
      \subfigure{{\productIcon{Availability}{#2}}}%
    \hfill
      \subfigure{{\productIcon{Obsolescence}{#3}}}%
    \hfill
      \subfigure{{\productIcon{Performance}{#4}}}%
    \hfill
  \end{figure}
}
\newcommand{\productImage}[1]{
  \includegraphics[width=86mm,height=55mm]{#1}
}

\usepackage{fancyhdr}
\setlength{\headheight}{0pt}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.25mm}
\renewcommand{\footrule}{\hbox to\headwidth{\color{customgray}\leaders\hrule height \footrulewidth\hfill}}
\pagestyle{fancy}
\fancyhf{} % clear all fields
%  Custom Footer
\fancyfoot[L]{\vspace{7mm}
  \textbf{\ct{customgray}{\fontsize{9}{14}\selectfont FUTURE - MADE BY EXAMPLE}}
}
\fancyfoot[R]{\vspace{7mm}
  \ct{black}{\fontsize{9}{14}\selectfont Contact: c@test.com \hspace{30mm}www.test.com}
}

\usepackage{blindtext}
\begin{document}
\setcolumnwidth{86mm,86mm} % this should only affect the 3 column
\setlength{\columnsep}{6mm}
\productHeader
{ARIAL BOLD 18/22PT\\
LOREM IPSUM}
{Arial Regular 9,5/14 PT 878787\\
    Lorem Ipsim\\
    Lorem\\
Ipsum}

\begin{paracol}{2}
    \productTitle{LOREM IPSUM ARIAL BOLD 12,5/16PT}{IPSUM Arial Bold 9,5/14PT 878787}
    \productDescription{DESCRIPTION ARIAL BOLD 9,5/14 PT 000000}
    {Arial Regular 9,5/14 \blindtext[1]}
    \switchcolumn
    \productImage{test.png}
    \productIcons{false}{true}{false}{false}
    \switchcolumn*
    \productDescription{BENEFITS}
    {\blindtext[1]}
    \switchcolumn
    \productDescription{FEATURES}{
        \begin{itemize}
            \item 1232
        \end{itemize}
        }\null\vfill\null
    \switchcolumn*
\end{paracol}


\par\vbox{}\null\vfill\nopagebreak
\begin{paracol}{2} %End of Site (gray blocks)
    \productBottom{OPTIONAL EQUIPMENT 9,5 PT E10000}
    {Arial Bold 9,5/14 PT  Loraerro volor sequisto omnihil iandundae corio estrum apictas et labore rem reped enda nonsequ idicitia aut utectate eaquos sum ilique etum, alit explibus.\\ Lum ut ame peritas et lame voluptibus.}
    \switchcolumn
    \productBottom{REQUIREMENTS}
    {Loraerro volor sequisto omnihil iandundae corio estrum apictas et labore rem reped enda nonsequ idicitia aut utectate eaquos sum ilique etum, alit explibus.\\ Lum ut ame peritas et lame voluptibus. Represtores excestem. Accusa voluptae con coribus, qui dis nonem et quia dolut dit illuptat mo quam, que doloris citatam am, offictis veniet}
\end{paracol}

\end{document}

Do you have any ideas how to solve this with paracols?

EDIT Main question: How can fill the area between the text (after "Benefits") and the gray boxes dynamically. So that, the gray boxes are always at the bottom of the page. \vfill and all similiar solutions do not work.

  • I don't understand the problem. You want these four boxes at the bottom of last page. Their size is not defined because their contents could make them grow from bottom. There are some undefined text in previous pages and on last page above these boxes. What should happen if remaining text on last page is large enough to avoid fitting those boxes below it? I think we need a better description for this problem. – Ignasi Apr 4 at 10:24
  • @Ignasi Please look at my static MWE. The scope is only the two gray boxes (without black border and below the red text - Updated the picture). To clarify: The content creator states sure that there is enough place. It is a one-pager. I updated the censored image to prevent misunderstanding. – Marius Herget Apr 4 at 10:55
1

In the end I used the following solution instead of paracol:

\newtcbox{\bottomBox}[1][]{%
  width=85mm,
  boxsep=0pt,
  top=3mm,left=3mm,right=3mm,bottom=3mm,
  arc=0pt,auto outer arc,
  colback=lightgray,colframe=lightgray,
  boxrule=0mm,box align=base,on line,
  #1, enhanced,attach boxed title to top left={xshift=-2mm},
  boxed title style={size=small,colframe=white!0,colback=white!0,},
  coltitle=red,fonttitle=\bfseries
}

\newcommand{\productBottom}[4]{
  \par\vbox{}\null\vfill\nopagebreak

  \begin{tcbraster}[raster columns=2,raster equal height,
                    nobeforeafter,raster column skip=6mm]
    \bottomBox[title={\fontsize{9,5}{14}\selectfont #1}]{
        \textbf{\fontsize{9,5}{14}\selectfont #2}
    }
    \bottomBox[title={\fontsize{9,5}{14}\selectfont #3}]{
        \textbf{\fontsize{9,5}{14}\selectfont #4}
    }
  \end{tcbraster}
}

And used it in the document like this:

\productBottom
  {Test Title Left}
    {Test Text Left}
  {Test Title Right}
    {Test Text Right}
  • If you are using tcolorbox and tcbraster for lower boxes, I think you could consider to use a tcbposter for the whole page. This way you can place every paragraph/section where you want. You can also force bottom boxes to have same height with equal height group, you can force their position and growing from bottom to top with above=bottom posterbox option, ... Take a look at poster library in tcolorbox documentation or here – Ignasi Apr 4 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.