1

I'm writing a project relation and have pretty much achieved what I wanted. There is something that is bugging me and hav been trying to fix it but no luck. On the first page there are details of the university, the project name and other data; Unfortunatly it's not horizontaly alligned to the middle but slightly to the left, see the image below. I'm using the titling package.

The code:

% !Tex spellcheck = it_IT
\documentclass[12pt,a4paper]{scrbook}%{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[greek,english,italian]{babel}
\usepackage{lmodern}
\usepackage{url}
\usepackage{color}
\usepackage{titling}
\usepackage{graphicx}
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{algpseudocode}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{mathrsfs}
\usepackage{BOONDOX-cal}
\usepackage{eucal}
\usepackage{float}
\usepackage[11pt]{moresize}
\usepackage{quoting, caption}
\usepackage[backend=biber]{biblatex}
\usepackage[autostyle,italian=guillemets]{csquotes}
\addbibresource{bibliography.bib}
\usepackage[
n,
operators,
advantage,
sets,
adversary,
landau,
probability,
notions,    
logic,
ff,
mm,
primitives,
events,
complexity,
asymptotics,
keys]{cryptocode}
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linktoc=all,
    linkcolor=black
}

\quotingsetup{font=Large}

\theoremstyle{plain}
\newtheorem{teorema}{Teorema}
\theoremstyle{definition}
\newtheorem{defn}{Definizione}
\newtheorem{corollario}{Corollario}
\newtheorem{lemma}{Lemma}

\setcounter{section}{1}

\setlength{\parindent}{0em}
\setlength{\parskip}{1em}

\newcommand{\greco}[1]{
\begin{otherlanguage*}{greek}#1\end{otherlanguage*}}

\nocite{*}
\begin{document}
\pretitle{
    \begin{center}
    \vspace*{-8\baselineskip}
    \Huge{Università degli studi di Brescia} \\
    \huge{Facoltà di Ingegneria} \\
    \LARGE{Dipartimento di Ingegneria dell'Informazione} \\
    %\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
    \vspace*{2\baselineskip}
    \LARGE
    \includegraphics[height=200px]{unibs.png} \\ [\bigskipamount]
    \vspace*{\baselineskip}
}

\posttitle{
    \end{center}
}

\preauthor{
\vspace*{5\baselineskip}
\begin{flushright}
\large
Docente:\\
Luca Giuzzi
\end{flushright}
\vspace*{-5\baselineskip}
\begin{flushleft}
\large
}
\postauthor{
\end{flushleft}
}
\title {CRYPTO RANSOMWARE \\ Analisi dei sistemi crypto ransomware}
\author{Sukhdev Mohan \\ matr. 86141}
\date{}

\begin{titlingpage}
    \maketitle
\end{titlingpage}

\newpage %\thispagestyle{empty}\mbox{} %void page for separation purpose
\vspace*{\fill}
\thispagestyle{empty}
\begin{quoting}
\em{``Mathematical reasoning may be regarded rather schematically as the exercise of a combination of two facilities, which we may call intuition and ingenuity.''}
\medskip
\raggedleft
{\rightline{---Alan Turing}}
\end{quoting}
\vspace*{\fill}

\newpage
\tableofcontents

\newpage
\chapter{Introduzione} 
\input{intro}

\chapter{La matematica per cifrare Informazioni}
\input{cryptomath}
\section{Basi di Crittografia}
\input{basi-crypto}
\subsection{RSA}
\input{rsa}
\subsection{AES}
\input{aes}
\chapter{Prospettiva dell'attaccante}
\section{Impiego della Crittografia nella costruzione di applicazioni Malevole}
\input{applicazioni-malevole}
\section{Approfondimento: Crypto Ransomware}
\input{crypto-ransomware}
\section{Caso di Studio: Locky Crypto Ransoware}
\subsection{Dissezione}
\subsection{Diffusione}
\subsection{Infezione}
\subsection{Recupero}
\subsection{Pagamento: Bitcoin}
\subsection{Prevenzione}

\chapter{Conclusione}
\cleardoublepage
\phantomsection

\printbibliography
\newpage

\end{document}

The result is:

enter image description here How can I get into the middle of the page? thank you.

  • Welcome to TeX SX! Could you post a full compilable code (including document class, preamble, &c.)? – Bernard Jul 18 '18 at 21:51
  • @Bernard thank you, I've editted the code and given the full one. I'm using scrbook as document class, there are included files that I've omitted please comment the \input. Thank you for the quick reply – Sukhdev Mohan Jul 18 '18 at 21:55
2

You can use the \newgeometry command at the very beginning of the titlingpage environment:

\documentclass[12pt,a4paper]{scrbook}%{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[greek,english,italian]{babel}
\usepackage{lmodern}
\usepackage{url}
\usepackage{color}
\usepackage{titling}
\usepackage{graphicx}
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{algpseudocode}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{mathrsfs}
\usepackage{BOONDOX-cal}
\usepackage{eucal}
\usepackage{float}
\usepackage[11pt]{moresize}
\usepackage{quoting, caption}
\usepackage[backend=biber]{biblatex}
\usepackage[autostyle,italian=guillemets]{csquotes}
\addbibresource{bibliography.bib}
%\usepackage[
%n,
%operators,
%advantage,
%sets,
%adversary,
%landau,
%probability,
%notions,
%logic,
%ff,
%mm,
%primitives,
%events,
%complexity,
%asymptotics,
%keys]{cryptocode}
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linktoc=all,
    linkcolor=black
}

\quotingsetup{font=Large}

\theoremstyle{plain}
\newtheorem{teorema}{Teorema}
\theoremstyle{definition}
\newtheorem{defn}{Definizione}
\newtheorem{corollario}{Corollario}
\newtheorem{lemma}{Lemma}

\setcounter{section}{1}

\setlength{\parindent}{0em}
\setlength{\parskip}{1em}

\newcommand{\greco}[1]{
\begin{otherlanguage*}{greek}#1\end{otherlanguage*}}
\usepackage{geometry}

\nocite{*}
\begin{document}
\pretitle{
    \begin{center}
    \vspace*{-8\baselineskip}
    \Huge{Università degli studi di Brescia} \\
    \huge{Facoltà di Ingegneria} \\
    \LARGE{Dipartimento di Ingegneria dell'Informazione} \\
    %\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
    \vspace*{2\baselineskip}
    \LARGE
    \includegraphics[height=200px]{unibs.png} \\ [\bigskipamount]
    \vspace*{\baselineskip}
}

\posttitle{
    \end{center}
}

\preauthor{
\vspace*{5\baselineskip}
\begin{flushright}
\large
Docente:\\
Luca Giuzzi
\end{flushright}
\vspace*{-5\baselineskip}
\begin{flushleft}
\large
}
\postauthor{
\end{flushleft}
}
\title {CRYPTO RANSOMWARE \\ Analisi dei sistemi crypto ransomware}
\author{Sukhdev Mohan \\ matr. 86141}
\date{}

\begin{titlingpage}
\newgeometry{hmargin = 3cm}
    \maketitle
\end{titlingpage}
\newpage %\thispagestyle{empty}\mbox{} %void page for separation purpose
\vspace*{\fill}
\thispagestyle{empty}
\begin{quoting}
\em{``Mathematical reasoning may be regarded rather schematically as the exercise of a combination of two facilities, which we may call intuition and ingenuity.''}
\medskip
\raggedleft
{\rightline{---Alan Turing}}
\end{quoting}
\vspace*{\fill}

\newpage
\tableofcontents

\newpage
\chapter{Introduzione}
\input{intro}

\chapter{La matematica per cifrare Informazioni}
\input{cryptomath}
\section{Basi di Crittografia}
\input{basi-crypto}
\subsection{RSA}
\input{rsa}
\subsection{AES}
\input{aes}
\chapter{Prospettiva dell'attaccante}
\section{Impiego della Crittografia nella costruzione di applicazioni Malevole}
\input{applicazioni-malevole}
\section{Approfondimento: Crypto Ransomware}
\input{crypto-ransomware}
\section{Caso di Studio: Locky Crypto Ransoware}
\subsection{Dissezione}
\subsection{Diffusione}
\subsection{Infezione}
\subsection{Recupero}
\subsection{Pagamento: Bitcoin}
\subsection{Prevenzione}

\chapter{Conclusione}
\cleardoublepage
\phantomsection

\printbibliography
\newpage

\end{document} 

enter image description here

  • I'll try tomorrow and will let you know. Thank you – Sukhdev Mohan Jul 18 '18 at 22:30
  • Sorry I'm answering just now, but had a busy day, I tried and this is it! Thank you very much. Just a little question: what was the issue? – Sukhdev Mohan Jul 19 '18 at 19:21
  • The problem seemed to come from left margin being smaller than right margin, as is traditional in good typography. So for the titling page I used package geometry, to have both margins equal to 3cmn so that the mid point of the text area is also the midpoint of the physical sheet of paper. – Bernard Jul 19 '18 at 19:29
  • Oh That's why. Does that in any way affect the other pages? just a concern – Sukhdev Mohan Jul 19 '18 at 19:53
  • I don't think so, because it's limited to the titlingpage environment – unless the simple loading of geometry has an impact on typearea. I checked that in the following pages, the left and right margins were unequal again. – Bernard Jul 19 '18 at 19:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.