2

Need help with a cls class file. I need a table to stretch from its natural starting position (in this case after an image) to the bottom of the page.

All rows apart from the "Abstract" row should act normally (expand with their contents). The "Abstract" row should vertically expand so that the "Keywords" row is at the very bottom of the page (additionally I'd like some kind of error/warning if the abstract contents are too large for the table to fit into one page).

I would prefer a solution where the other rows don't have to be fixed in height.

Below is the page of the docx template that I'm attempting to convert to LaTeX.

Abstract Template

Edit: My solution:

LaTeX Abstract Template

And its code:

% Using parksip and tcolorbox together is a PITA
\newenvironment{tcbrow}{\setlength{\parskip}{0.5\baselineskip}}{\setlength{\parskip}{0pc}}
% Render the thesis abstract
\newcommand*\makethesisabstract{
    \thesisabstractgeometry % Set page geometry
    \begin{singlespace}
    \thispagestyle{empty}
    \begin{tikzpicture}[remember picture,overlay,x=0.33pt,y=0.33pt]
        \xamkdrawlogo % TikZ code for the XAMK logo
    \end{tikzpicture}
    \begin{tcolorbox}[
    enhanced, space to upper,
    height fill, sharp corners,
    segmentation style=solid,
    colback=white,
    middle=0.5pc, boxsep=0.1pc]
        \noindent\begin{tabularx}{\textwidth}
        {@{} >{\hsize=1.15\hsize}X >{\hsize=1.15\hsize}X >{\hsize=.7\hsize}X @{}}
            \textbf{Author}
            \vspace*{0.5pc}

            \@xamkstudentname
            &
            \textbf{Degree}
            \vspace*{0.5pc}

            \@xamkdegreeprogramme
            &
            \textbf{Time}
            \vspace*{0.5pc}

            \@xamkpaperdate
        \end{tabularx}
    \tcbline
        \noindent\begin{tabularx}{\textwidth}
        {@{} >{\hsize=1.45\hsize}X >{\hsize=0.55\hsize}X @{}}
        \textbf{Thesis title}
        \vspace*{0.5pc}

        \@xamkpapertitle
        \ifdef{\@xamkpapersubtitle}{\par\@xamkpapersubtitle}{}
        &
        \@xamkpagecount\ pages

        \@xamkappendixpagecount\ pages of appendices
        \end{tabularx}
    \tcbline
        \textbf{Commissioned by}
        \vspace*{0.5pc}

        \@xamkthesiscommissioner
    \tcbline
        \textbf{Supervisor}
        \vspace*{0.5pc}

        \@xamkthesissupervisor
    \tcbline
        \textbf{Abstract}

        \begin{tcbrow}
        \ifdef{\@xamkcustomabstract}{\@xamkcustomabstract}{\input{thesis-abstract.tex}}
        \end{tcbrow}
    \tcblower
        \textbf{Keywords}
        \vspace*{0.5pc}

        \@xamkthesiskeywords
    \end{tcolorbox}
    \end{singlespace}
    \restoregeometry
}
  • 1
    There is not enough information to help you here. There are many ways the table could have been constructed. Different approaches would require different "fixes." By the way, welcome to the site. – Steven B. Segletes Mar 12 '18 at 13:38
  • I didn't consider what I currently have worth showing, as I don't even know where to start, but I've added it to the post. – TakingItCasual Mar 12 '18 at 13:50
  • I think an approach like https://tex.stackexchange.com/questions/108374/how-can-i-construct-a-page-layout-with-framed-boxes would make more sense...essentially overlaying your text upon an image of the blank form. – Steven B. Segletes Mar 12 '18 at 14:00
  • When I make stuff like this, I don't even use a table. I start by writing a good user interface for specifying the data, some a re natural to give via macros, like the title, others like the abstract, are more naturally written in an environment and stored (using the environ package). Then we can call, say, \makeform what generates this image, generate error if the abstract is too large etc. I would simply add this data to the page as a page filling tikz image with a lot of good placed minipages that just houses the gathered up data from ealier. – daleif Mar 12 '18 at 14:08

1 Answers1

5

You can create this type of boxes with tcolorbox:

\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}


\begin{document}
LOGO

\begin{tcolorbox}[
 height fill,
 space to upper,
 title=Box which fills the rest of the page]

some text

\tcbline
more text

\tcbline
\lipsum[1]

\tcblower

some text at the bottom
\end{tcolorbox}
\end{document}

enter image description here

Ulrike Fischer
  • 327,261
  • It's being pushed into the next page because of the image at the top of the page. Is there a way to get rid of the fancy stuff and have it look like a normal table? – TakingItCasual Mar 12 '18 at 14:16
  • I would put such a logo in the header and then it wouldn't interfere. But if it is in the textbody you can use the key height fill, I edited the answer. And yes tcolorbox can be customized. It has a very good documentation, so check it. – Ulrike Fischer Mar 12 '18 at 14:20