1

This is the code for the cover of my thesis:

\documentclass[a4paper]{report}
\usepackage[top=3cm, bottom=3.5cm, outer=4cm, inner=4cm, marginparsep=0.7cm, marginparwidth=1.5cm]{geometry}
\usepackage{changepage,xparse}
\NewDocumentEnvironment{indented}{mo}
    {\IfValueTF{#2}
        {\begin{adjustwidth}{#1}{#2}}
        {\begin{adjustwidth}{#1}{#1}}
    }
    {\end{adjustwidth}}
\begin{document}
{\makeatletter\def\Gm@Dvratio{1:1}\makeatother
\begin{center}
\rule{2.5cm}{2cm} \\
{\fontsize{16pt}{2em}\selectfont
Università degli Studi di Milano-Bicocca \\[-.5em]
\hrulefill\par\noindent
Corso di Laurea in Matematica \\
}
\vskip0pt plus .75fil
{\fontsize{16pt}{2em}\selectfont Tesi di Laurea} \\
\vskip0pt plus 2fil
{\fontsize{30pt}{1em}\selectfont
Orbite periodiche \\[.5em]
di flussi Hamiltoniani \\[.5em]
su ipersuperfici convesse
}
\end{center}
\vskip0pt plus 2fil
{\fontsize{16pt}{1.5em}\selectfont
Candidato \\
MickG \\
Number \\
\setbox3\vbox{\fontsize{16pt}{1em}\selectfont A}
\setbox1\vbox{\fontsize{16pt}{1.5em}\selectfont Candidato \\
MickG \\
Number \\[-2.5\ht3]}
\vspace{-\ht1}
\dimen3=\textwidth
\advance\dimen3-5cm
\begin{indented}{\dimen3}[0cm]
Relatore \\
Prof. RP
\end{indented}
\vfil
\begin{center}
\hrulefill\par\noindent
\fontsize{12pt}{1em}\selectfont
Anno Accademico 2014-2015
\end{center}
\thispagestyle{empty}
} \hspace{0cm}\\\clearpage
}
\addtocounter{page}{-1}
\hspace{0cm}\\\clearpage
\end{document}

OK, the alignment of Relatore with Candidato could be done better with a tabular, but it works fine in the actual thesis and I don't really want to change the code. Anyway it's not the point here. What I cannot do is get the bottom margin to be the same as the top one. As you can see, there is far more whitespace on the bottom than on the top. How do I get Anno Accademico further down? Thinking it was due to geometry, I opened the code, and I found \Gm@Dvratio, so I tried setting it to 1:1 on the cover and leaving it 2:3 as normal on the other pages. But to no avail, as you can see here. So what is the right way to do this?

Edit

Whoops! Here is the image of the typeset code:

enter image description here

Update

It seems that parameter is completely useless: Tried making that \def global (i.e. removing the braces around it and the page) and no result.

MickG
  • 5,426

2 Answers2

1

Assuming you can't change the parameters to geometry, you can simply add

\enlargethispage{<length>}

before the page is shipped out. The picture has been produced with 6cm instead of <dimen>:

\begin{center}
\rule{2.5cm}{2cm} \\
{\fontsize{16pt}{2em}\selectfont
Universit\`a degli Studi di Milano-Bicocca \\[-.5em]

[...]

Anno Accademico 2014-2015
\end{center}
\thispagestyle{empty}
\enlargethispage{6cm}
} \hspace{0cm}\\\clearpage
\addtocounter{page}{-1}
\hspace{0cm}\\\clearpage

enter image description here

Experiment on the values, maybe pairing this with some \vspace*{-2cm} or what you think best just after \begin{center}.

Remove all attempts to modify geometry internals.

Of course I skip over analyzing the code, which I find hilariously horrible. Can you see that the title has different spacing between the lines? I know why. Since I wrote an easy to use package that produces an output similar to the one you seem to want, but without the errors, I won't go into the details.

Here's an example with frontespizio:

% arara: frontespizio

\documentclass[a4paper]{report}
\usepackage[top=3cm, bottom=3.5cm, outer=4cm, inner=4cm, marginparsep=0.7cm, marginparwidth=1.5cm]{geometry}

\usepackage{frontespizio}

\begin{document}

\begin{frontespizio}
\Margini{4cm}{2cm}{4cm}{2cm}
\Logo[2.5cm]{duck}
\Universita{Milano-Bicocca}
\Divisione{\mbox{}}
\Corso[Laurea]{Matematica}
\Titoletto{Tesi di Laurea}
\Titolo{Orbite periodiche \\ di flussi Hamiltoniani \\ su ipersuperfici convesse}
\Candidato[numero]{MickG}
\Relatore{Prof. RP}
\Annoaccademico{2014-2015}
\end{frontespizio}

% il resto della tesi

\end{document}

enter image description here

egreg
  • 1,121,712
  • Worked like a charm. Yes I did notice the spacing, and I was wondering why that happened. – MickG Sep 20 '15 at 21:44
  • @MickG Hint: when \fontsize is changed, \par should be *before* the closing brace bounding the scope of the size change. – egreg Sep 20 '15 at 21:46
  • I changed the \\s in 30pt to \par\noindents and the line spacing issue seems to have vanished. I think I'll ask a separate question about this tomorrow. Goodnight :). – MickG Sep 20 '15 at 21:51
  • Two questions though: the parameters are entirely at my disposal, what would you change? And what is "hilariously horrible" save for the terrible way of aligning that part where the other answer wisely used a tabular, and perhaps the consisten use of forced linebreaks? – MickG Sep 20 '15 at 21:58
  • PS to the previous comment: I also added a \par just before the brace, as you said. – MickG Sep 20 '15 at 21:59
0
\documentclass[a4paper]{report}
\usepackage{lmodern}
\usepackage[top=3cm, bottom=3.5cm, outer=4cm, inner=4cm, marginparsep=0.7cm, marginparwidth=1.5cm]{geometry}
\usepackage{changepage,xparse}
\NewDocumentEnvironment{indented}{mo}
    {\IfValueTF{#2}
        {\begin{adjustwidth}{#1}{#2}}
        {\begin{adjustwidth}{#1}{#1}}
    }
    {\end{adjustwidth}}
\begin{document}

\thispagestyle{empty}

\begin{center}
\rule{2.5cm}{2cm} \par
{\fontsize{16pt}{2em}\selectfont
Università degli Studi di Milano-Bicocca \\[-.5em]
\hrulefill\par\noindent
Corso di Laurea in Matematica \par
}

\vspace{2\baselineskip}

{\fontsize{16pt}{2em}\selectfont Tesi di Laurea\par} 

\vfill

{\fontsize{30pt}{1em}\selectfont
Orbite periodiche \\[.5em]
di flussi Hamiltoniani \\[.5em]
su ipersuperfici convesse
}
\end{center}

\vfill

{\fontsize{16pt}{1.5em}\selectfont
\begin{tabular}{@{}l@{\rule{5.5cm}{0pt}}l}
Candidato   & \\
MickG       & Relatore\\
Number      & Prof. RP
\end{tabular}
}

\vspace{2\baselineskip}

\hrule
\begin{center}
\fontsize{12pt}{1em}\selectfont
Anno Accademico 2014-2015
\end{center}    
\clearpage

\addtocounter{page}{-1}
\clearpage
\end{document}

enter image description here

Well, if this is a template, I'm sorry to say that it is too messy. I don't have time to go into details, but the above is what you currently need. I have added two \vfills at the appropriate places and replaced some of the too-many \\s with \pars besides adding a tabular for the last part.

The main problem, though, was using spacing expressions like \vskip0pt plus .75fil which will of course interfere with the \vfill that you want. I replaced these with normal \vspace expressions.

AboAmmar
  • 46,352
  • 4
  • 58
  • 127
  • Hm, this solves the problem. THough to make it compile I have to substitute the \rule with a \hspace{5.5cm}. But what is the change that solved the problem? – MickG Sep 20 '15 at 21:22
  • @MickG Please see my second paragraph in the answer. – AboAmmar Sep 20 '15 at 21:33
  • Indeed, just realized the \vfills were the key edit. Why do you think that happened? – MickG Sep 20 '15 at 21:33
  • Just turned the fils to fills and the result is the same as yours, more or less. What do you mean by «the \vfill that you want»? – MickG Sep 20 '15 at 21:38