2

I'm trying to set a very basic front page for a document with the MWE below. I'd like to have a vertical stripe running along the left margin and have all the margins set to 0pt. The layout is based on the memoir class and the page layout resorts to the geometry package. My problems are (1) that I haven't been able to set the top margin effectively to 0pt -- not even with the commented memoir class commands in the MWE below --, and (2) that the page "overflows" to a verso page -- I believe this is related to setting the minipage environment to the text height and having that undesired non-zero top margin.

In the MWE I have loaded some packages that I do not really use here, but I don't think they have anything to do with the problem I'm facing. Any ideas on how to get a "real" 0pt top margin?

EDIT: This is just one of the approaches I've tried to this getting this layout done, but none of the other worked either (e.g., those that included using the adjustbox package).

\documentclass[a4paper,11pt,extrafontsizes,twoside]{memoir}

\usepackage{xkeyval,calc,etex,etoolbox}
\usepackage{graphicx}
\usepackage[dvipsnames,svgnames]{xcolor}
\usepackage[pagecolor={none}]{pagecolor}
\usepackage{ifthen,ifpdf,ifxetex}
\usepackage[utf8]{inputenx}
\usepackage{newunicodechar,adjustbox}

%\settrimmedsize{\stockheight}{\stockwidth}{*}% 
%\settrims{0pt}{0pt}
%\setulmargins{0pt}{*}{*}

\usepackage[margin=0pt]{geometry}

\begin{document}
\pagecolor{blue}%
\pagestyle{empty}%
\newlength{\spinelen}%
\setlength{\spinelen}{\paperwidth * 1/8}%
\vspace*{0pt}%
\hspace*{\spinelen}%
\colorbox{white}{%
\begin{minipage}[t][\textheight]{\linewidth - \spinelen}
\vspace*{0pt}%
\vspace*{\stretch{1}}\par\noindent%
\textcolor{blue}{\fontsize{36pt}{40pt}\selectfont Title}
\par\vskip\baselineskip\noindent
\textcolor{blue}{\fontsize{25pt}{28pt}\selectfont Subtitle}
\par\vspace*{\stretch{5}}\par\noindent%
\normalcolor\Large%
Author1%
\par\noindent%
Author2%
\par\vskip2\baselineskip%
\par\vspace*{\stretch{2}}\noindent\normalcolor
\end{minipage}}
\clearpage
\ifxetex\pagecolor{white}\else\nopagecolor\fi%
\end{document}
4
  • “I don't think they have anything to do with the problem I'm facing.” ⇒ This makes it not a real MWE, could you remove those to reduce the complexity of your example? And a picture of your output might be helpful. Also, why are you using \RequirePackage instead of \usepackage? The former is usually only used in package and document class files. Also see What's the difference between \RequirePackage and \usepackage? and Placing items before \documentclass.
    – doncherry
    May 9, 2013 at 21:19
  • I'm not sure it's a good idea to use memoir for such a thing: try article
    – egreg
    May 9, 2013 at 21:26
  • @doncherry: This comes from a broader scenario where I use my own class -- only it is based on the memoir class -- and custom packages. That's why I used \RequirePackage instead of \usepackage. I'm using the packages in that broader scenario and most of them are needed here too, plus I think they don't hurt.
    – Marcos
    May 9, 2013 at 21:28
  • @egreg: As I said in my answer to doncherry, I need the memoir class for a broader setting in which this page is embedded, and I'd like to understand why this is not working as I would expect.
    – Marcos
    May 9, 2013 at 21:30

1 Answer 1

2

You suffer from a combination of factors.

  1. \begin{minipage}[t][\textheight] creates a box that's slightly bigger than \textheight

  2. You have a non zero \parindent

  3. You have a non zero \fboxsep (this is used by \colorbox)

\documentclass[a4paper,11pt,extrafontsizes,twoside]{memoir}

\usepackage{xkeyval,calc,etex,etoolbox}
\usepackage{graphicx}
\usepackage[dvipsnames,svgnames]{xcolor}
\usepackage[pagecolor={none}]{pagecolor}
\usepackage{ifthen,ifpdf,ifxetex}
\usepackage[utf8]{inputenx}
\usepackage{newunicodechar,adjustbox}

%\settrimmedsize{\stockheight}{\stockwidth}{*}% 
%\settrims{0pt}{0pt}
%\setulmargins{0pt}{*}{*}
%\checkandfixthelayout

\usepackage[margin=0pt]{geometry}

\pagecolor{blue}
\pagestyle{empty}
\newlength{\spinelen}
\setlength{\spinelen}{\paperwidth * 1/8}

\begin{document}

\begingroup
\setlength{\parindent}{0pt}
\setlength{\fboxsep}{0pt}

\hspace*{\spinelen}%
\colorbox{white}{%
  \vbox to\textheight{
    \hsize=\dimexpr\linewidth-\spinelen\relax
    \leftskip=6pt %%% some padding

    \vspace*{\stretch{1}}

    {\color{blue}\fontsize{36pt}{40pt}\selectfont Title\par}

    \vspace{\baselineskip}

    {\color{blue}\fontsize{25pt}{28pt}\selectfont Subtitle\par}

    \vspace*{\stretch{5}}

    \Large Author1

    Author2

    \vspace{2\baselineskip}

    \vspace*{\stretch{2}}
  }% end \vbox
}% end \colorbox

\endgroup

\clearpage


\ifxetex\pagecolor{white}\else\nopagecolor\fi

\end{document}

Setting \parindent to zero avoids having to specify \noindent in the box. Some inner padding can be obtained by setting \leftskip.

You must log in to answer this question.

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