0

I'm trying to make a title page with a background and a changelog (subsection with longtable) *(company policy)

The changelog should start in the title page, and extend to the next page if necessary.

I renewed the \maketitle command to make easier later on for the design team (guy) to make a title page accordingly.

But I'm having a problem with the \vfill.

If I have the title with the wallpaper, all good, but if I uncomment the changelog part, all \vfill stop working.

\documentclass[a4paper,oneside]{memoir}

\usepackage{longtable}
\usepackage{wallpaper}

% Column type so changelog can strech the whole page
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}

\renewcommand{\maketitle}{%
    \thispagestyle{empty}
    \vspace*{\fill}
    \begin{center}
        {\Huge\textbf{System}}\par
        {\LARGE\textbf{Sub-title}}\par
        \vspace*{\fill}
        {\Large author}\par
    \end{center}
    \vspace*{\fill}
}

%-------------------------------------------------
\begin{document}
    \ThisCenterWallPaper{0.5}{cover_placeholder.png}
    \maketitle
    %-------------------------------------------------
    %   CHANGELOG
    %-------------------------------------------------
    % \vspace*{\fill}
    % \subsubsection*{Changelog}
    % \begin{longtable}{@{} L{0.05\textwidth} L{0.15\textwidth} L{0.7\textwidth} @{}}
    %     \toprule
    %     v0.1 & 2022-10-02 & First Draft \\
    %     v0.2 & 2022-11-20 & Last Draft \\
    %     \bottomrule
    % \end{longtable}
\end{document}

I'm using pdflatex to compile

P.S.: All the preamble is in a different file, but the changelog would be placed in the document (because I even tried placing the table inside the \maketitle)

2
  • Is the problem with the title page containing Changelog, which is supposed to be on the next page? Does it work If you add \clearpage after \vspace*{\fill}, inside the \maketitle?
    – Celdor
    Nov 21, 2022 at 11:05
  • using \clearpage solve the\vfill part, as well as a \newpage after the \maketitle would, but the changelog should start in the title page Nov 21, 2022 at 12:50

1 Answer 1

0

I think the easiest approach is to use tikz because you can put different nodes on top of each other, which can contain text or images. Additionally, tikz offer to set an opacity of its nodes.

If you put tikzpicture inside minipage of fixed height and the middle alignment [c], you will have the same effect of uniform spacing before and after an image because. Even if I am not exactly to the point, I believe this approach will give you more flexibility, anyway.

Note, I have used \vspace{\stretch{n}} between elements of the title (inside the second node and parbox). This adds variate stretching instead of uniformed \fill; in fact, the latter is equivalent of using \stretch{1} everywhere. It requires either minipage or \parbox with the third option inner-pos set to [s].

\documentclass[a4paper,oneside]{memoir} 
\usepackage{longtable}
\usepackage{graphicx}
\usepackage{tikz}

% Column type so changelog can strech the whole page
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}

\renewcommand{\maketitle}{%
    \thispagestyle{empty}
    \noindent
    \begin{minipage}[c][\dimexpr\textheight-4cm]{\textwidth}
        \centering
        \begin{tikzpicture}
            \node (I) [opacity=0.3] {\includegraphics[width=11cm,height=11cm]{example-image-duck}};
            \node (T) {\parbox[c][9cm][s]{11cm}{\mytitle}};
        \end{tikzpicture}
    \end{minipage}}

\newcommand\mytitle{%    
    \centering
    {\Huge\textbf{System}}\par
    \vspace{\stretch{1}}   % use \fill for uniform spacing
    {\LARGE\textbf{Sub-title}}\par
    \vspace{\stretch{2}}
    {\Large author}}
    

%-------------------------------------------------
\begin{document}
\maketitle
%-------------------------------------------------
%   CHANGELOG
%-------------------------------------------------
\subsubsection*{Changelog}
\begin{longtable}{@{} L{0.05\textwidth} L{0.15\textwidth} L{0.7\textwidth} @{}}
    \toprule
    v0.1 & 2022-10-02 & First Draft \\
    v0.2 & 2022-11-20 & Last Draft \\
    v0.2 & 2022-11-20 & Last Draft \\
    v0.2 & 2022-11-20 & Last Draft \\
    v0.2 & 2022-11-20 & Last Draft \\
    v0.2 & 2022-11-20 & Last Draft \\
    v0.2 & 2022-11-20 & Last Draft \\
    v0.2 & 2022-11-20 & Last Draft \\
    v0.2 & 2022-11-20 & Last Draft \\
    \bottomrule
\end{longtable}
\end{document}

enter image description here

6
  • That is exactly what I needed, can I ask why my approach didn't work though? Nov 22, 2022 at 7:23
  • I'll try. You mixed a fixed picture at the centre with a flexible title arrangement (\vspace{\fill}). There, longtable grows upward first consuming all infinite glue (\fill) before it starts the next page. A fixed spacing like \vspace{3cm} would work but only if used before and after a box with the title. It would still need some tuning by try and error and the title itself would still need to be in a minipage with stretchable space and [s] option.
    – Celdor
    Nov 22, 2022 at 9:57
  • ... The exact same effect was accomplished by placing a tall minipage with the middle alignment by default, which is simply an equivalent of adding \vspace{\fill} by hand. A fixed height needs to be set. Otherwise, minipage would take the height of the tikzpicture. As a side note, tikz is very helpful in many ways.
    – Celdor
    Nov 22, 2022 at 10:05
  • So, by adding a longtable all the glue is squished together. I would need to first need to create a fixed box (unsquishable) so that longtable couldn't take the space? Nov 22, 2022 at 11:04
  • Yes and no! Yes, that's what \fill does: adds spacing between 0 and maximum. If you wanted to keep everything in one page with the longtable, your example would almost be correct. You would just need to get rid of wallpaper and substitute it with tikzpicture with an image and text in one element.
    – Celdor
    Nov 22, 2022 at 13:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .