1
\documentclass[a4paper, 12pt, twoside, openright]{book}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{fancyhdr}
\usepackage{float}
\usepackage{graphicx}
\usepackage{wrapfig}
%------------------------------ colors
\usepackage[usenames,dvipsnames,table]{xcolor} % use colors on table and more
\definecolor{333}{RGB}{51, 51, 51} % define custom color
%------------------------------ source code
\usepackage{listings}
\lstset{
  basicstyle=\footnotesize\sffamily,
  commentstyle=\itshape\color{gray},
  captionpos=b,
  frame=shadowbox,
  language=HTML,
  rulesepcolor=\color{333},
  tabsize=2
}
%------------------------------ define Abstract environment, missing in the 'book' class
\newenvironment{abstract}{\cleardoublepage \null \vfill \begin{center}\bfseries\abstractname \end{center}}{\vfill\null}
\addto\captionsenglish{\renewcommand*\abstractname{Sommario}} % change Abstract title
%------------------------------ active url
\usepackage{url}
\renewcommand{\UrlFont}{\color{black}\small\ttfamily}
\usepackage[colorlinks=true, linkcolor=black, citecolor=black, urlcolor=black]{hyperref} % active ref
\usepackage{showframe}
%------------------------------ macros
\newcommand{\sectionname}{Section} % define Section ref
\newcommand{\subsectionname}{Sub-section} % define Sub-section ref
\renewcommand*\arraystretch{1.4} % tables padding


\begin{document}
\frontmatter

\begin{titlepage} %------------------------------ TITLE PAGE
\begin{center}
\vbox to0pt{\vbox to\textheight{\vfill \includegraphics[width=11.5cm]{images/unipd-light} \vfill}\vss}

\hspace{0.0cm}
\begin{minipage}[t]{\textwidth}%{.20\textwidth}
  \centering
  \hspace{-0.005cm}\includegraphics[height=2.5cm]{images/logo_unipd}
\end{minipage}
\begin{minipage}{1\textwidth}
    \centering
  \begin{table}[H]
  \begin{tabular}{c}
  \hspace{-0.02cm}\scshape{\Large{\bfseries{Università degli Studi di Padova}}} \\
  %\hline \\
  \vspace{0.2cm}
  \hspace{-0.22cm}\noindent\makebox[\linewidth]{\rule{0.9\textwidth}{0.5pt}}\\
  \hspace{0.027cm}\hspace{-0.43cm}\scshape{\Large{Dipartimento di Ingegenria Industriale DII}} \\
  \end{tabular}
  \end{table}
\end{minipage}

\vspace{0.5cm}
\hspace{-0.09cm}\large{Corso di Laurea Magistrale in Ingegneria dell'Energia Elettrica} \\
\vspace{2.25cm}
\scshape{\Large{\bfseries{Analysis of an innovative distribution system through a novel optimal power flow algorithm}}} 
\end{center}

\vfill
\begin{normalsize}
\begin{flushleft}
  \hspace{57pt} \textit{Laureando} \hspace{167pt} \textit{Relatore}\\
  \vspace{5pt}
  \hspace{30pt} \large{\textbf{Tommaso Faedo}} \hspace{70pt} \large{\textbf{Prof. Roberto Turri}}\\
  \vspace{10pt}
  \hspace{275pt} \normalsize{\textit{Correlatore}}\\
  \vspace{5pt}
  \hspace{241pt} \large{\textbf{Prof. Paolo Tenti}}\\
  \vspace{5pt}
  \hspace{172pt} \large{\textbf{Ing. Tommaso Caldognetto}}\\
\end{flushleft}
\end{normalsize}

\vfill
\begin{center}
\hspace{-0.15cm}
\line(1, 0){360}

\hspace{0.01cm}\textsc{Anno Accademico 2017/2018}
\end{center}
\end{titlepage}


\end{document} 

Hi, this is my cover of the thesis. I don't know why the elements, such as the title or the red logo of the University, are not centered (vertically) into the main rectangle (the main rectangle shows the boundary of the paper). I add the \hspace but I want to know if there is a system that automatically put in the center (vertically) the object. I tried with \centering but every time every elements aren't perfectly in the center (vertically) of the main rectangle. Thanks

8
  • Just a comment: you might want to change \usepackage[latin1]{inputenc} to \usepackage[utf8]{inputenc} to correct the "Università". Jan 12, 2018 at 17:44
  • \usepackage[utf8]{inputenc} give wrong representation Jan 12, 2018 at 17:46
  • Weird... For me, with latin1 I get "UniversitÃ", and with utf8 I get "Università"... Anyway, just a comment :) Jan 12, 2018 at 17:50
  • @TommasoFaedo: Which editor do you use? Do you want these elements be centred w.r.t. the physical page or w.r.t. the printing area?
    – Bernard
    Jan 12, 2018 at 17:55
  • 2
    @PhelypeOleinik If the file is ISO encoded latin1 should be used.
    – Sigur
    Jan 12, 2018 at 18:03

2 Answers 2

0

If I understand your question correctly, you would like to center your text vertically. For this, you should add a \vspace*{\fill} right after the \begin{titlepage}, and a \vfill right before the \end{titlepage}. (Sorry, if this was not your question.) I also changed encoding to utf8.

\documentclass[a4paper, 12pt, twoside, openright]{book}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{float}
\usepackage{graphicx}
\usepackage{wrapfig}
%------------------------------ colors
\usepackage[usenames,dvipsnames,table]{xcolor} % use colors on table and more
\definecolor{333}{RGB}{51, 51, 51} % define custom color
%------------------------------ source code
\usepackage{listings}
\lstset{
    basicstyle=\footnotesize\sffamily,
    commentstyle=\itshape\color{gray},
    captionpos=b,
    frame=shadowbox,
    language=HTML,
    rulesepcolor=\color{333},
    tabsize=2
}
%------------------------------ define Abstract environment, missing in the 'book' class
\newenvironment{abstract}{\cleardoublepage \null \vfill \begin{center}\bfseries\abstractname \end{center}}{\vfill\null}
\addto\captionsenglish{\renewcommand*\abstractname{Sommario}} % change Abstract title
%------------------------------ active url
\usepackage{url}
\renewcommand{\UrlFont}{\color{black}\small\ttfamily}
\usepackage[colorlinks=true, linkcolor=black, citecolor=black, urlcolor=black]{hyperref} % active ref
\usepackage{showframe}
%------------------------------ macros
\newcommand{\sectionname}{Section} % define Section ref
\newcommand{\subsectionname}{Sub-section} % define Sub-section ref
\renewcommand*\arraystretch{1.4} % tables padding


\begin{document}
    \frontmatter

    \begin{titlepage} %------------------------------ TITLE PAGE
\vspace*{\fill}

        \begin{center}
            \vbox to0pt{\vbox to\textheight{\vfill \includegraphics[width=11.5cm]{images/unipd-light} \vfill}\vss}

            \hspace{0.0cm}
            \begin{minipage}[t]{\textwidth}%{.20\textwidth}
                \centering
                \hspace{-0.005cm}\includegraphics[height=2.5cm]{images/logo_unipd}
            \end{minipage}
            \begin{minipage}{1\textwidth}
                \centering
                \begin{table}[H]
                    \begin{tabular}{c}
                        \hspace{-0.02cm}\scshape{\Large{\bfseries{Università degli Studi di Padova}}} \\
                        %\hline \\
                        \vspace{0.2cm}
                        \hspace{-0.22cm}\noindent\makebox[\linewidth]{\rule{0.9\textwidth}{0.5pt}}\\
                        \hspace{0.027cm}\hspace{-0.43cm}\scshape{\Large{Dipartimento di Ingegenria Industriale DII}} \\
                    \end{tabular}
                \end{table}
            \end{minipage}

            \vspace{0.5cm}
            \hspace{-0.09cm}\large{Corso di Laurea Magistrale in Ingegneria dell'Energia Elettrica} \\
            \vspace{2.25cm}
            \scshape{\Large{\bfseries{Analysis of an innovative distribution system through a novel optimal power flow algorithm}}} 
        \end{center}

        \vfill
        \begin{normalsize}
            \begin{flushleft}
                \hspace{57pt} \textit{Laureando} \hspace{167pt} \textit{Relatore}\\
                \vspace{5pt}
                \hspace{30pt} \large{\textbf{Tommaso Faedo}} \hspace{70pt} \large{\textbf{Prof. Roberto Turri}}\\
                \vspace{10pt}
                \hspace{275pt} \normalsize{\textit{Correlatore}}\\
                \vspace{5pt}
                \hspace{241pt} \large{\textbf{Prof. Paolo Tenti}}\\
                \vspace{5pt}
                \hspace{172pt} \large{\textbf{Ing. Tommaso Caldognetto}}\\
            \end{flushleft}
        \end{normalsize}

        \vfill
        \begin{center}
            \hspace{-0.15cm}
            \line(1, 0){360}

            \hspace{0.01cm}\textsc{Anno Accademico 2017/2018}
        \end{center}
\vfill
    \end{titlepage}


\end{document} 
1
  • perfect....that was exactly what I wanted...thanks man. Before I used \hspace{length} to center the elements of the cover of the thesis but it wasn't perfect. With your method is centered verticallyperfectly and automatically (for example if I change some word it change position automatically to go to the center vertically) Jan 13, 2018 at 7:40
0

Not a direct answer to your questions, but a simpler solution:

% arara: frontespizio

\documentclass[a4paper]{book}
\usepackage{frontespizio}

\begin{document}

\begin{frontespizio}
\begin{Preambolo*}
\usepackage[T1]{fontenc}
\renewcommand{\frontinstitutionfont}{\fontsize{14}{17}\bfseries\scshape}
\renewcommand{\fronttitlefont}{\fontsize{17}{21}\bfseries\scshape}
\renewcommand{\frontfootfont}{\fontsize{12}{14}\scshape}
\end{Preambolo*}
\Margini{3cm}{3cm}{3cm}{2cm}
%
\Logo[2.5cm]{../duck}
\Filigrana[height=11.5cm]{../duck}
\Universita{Padova}
\Dipartimento{Ingegneria Industriale DII}
\Corso{Ingegneria dell'Energia Elettrica}
\Titolo{Analysis of an innovative distribution system
        through a novel optimal power flow algorithm}
\NCandidato{Laureando}
\Candidato{Tommaso Faedo}
\Relatore{Prof.\ Roberto Turri}
\Correlatore{Prof.\ Paolo Tenti}
\Correlatore{Ing.\ Tommaso Caldognetto}
\Annoaccademico{2017/2018}
\end{frontespizio}

\end{document}

enter image description here

4
  • I copy the code but Latex creates only a white paper. Jan 16, 2018 at 9:19
  • @TommasoFaedo Did you read the manual? You have to run LaTeX on the <filename>-frn.tex file that's generated.
    – egreg
    Jan 16, 2018 at 9:41
  • no, sorry. What I have to do? Jan 16, 2018 at 9:56
  • done..I solve the problem...now I see the info Jan 16, 2018 at 10:03

You must log in to answer this question.

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