%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% ADOreD report template. %%%
%%% Author: Bernardo Castro Valerio. %%%
%%% Date: July 2023.             %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper,11pt, titlepage, twoside]{article}
%
\usepackage{titling}
\title{ADOreD report template}
\author{Name Here }
\date{July 2023}
\usepackage{lipsum}
\usepackage[T1]{fontenc}
\usepackage{parskip}
\setlength{\parskip}{4mm}
\setlength{\footskip}{60pt}
\setlength{\headheight}{26pt}
%% Sets page size and margins
\usepackage[a4paper,top=3cm,bottom=4cm,left=2.5cm,right=2.5cm]{geometry}
%% Useful packages
\usepackage{graphicx} % Required for inserting images
\usepackage{float}
\usepackage{eurosym}
\usepackage{amsmath}
\usepackage{textgreek}
\usepackage{steinmetz}
\usepackage{systeme}
\usepackage{sectsty}
\usepackage{multirow}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{wrapfig}
\usepackage{listings}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}
\usepackage{color} %red, RoyalBlue, blue, yellow, cyan, magenta, black, white
\usepackage[dvipsnames]{xcolor}
\usepackage[section]{placeins} %Prevents figures jumping sections
\usepackage{longtable}
\usepackage{mathtools}
\usepackage{commath}
\usepackage{dtk-logos}
\usepackage{fancyhdr}
\usepackage{titlesec}
%\usepackage[firstpage]{draftwatermark}
\usepackage{transparent}
\usepackage{booktabs}
\usepackage{graphicx}
%% For uploading code Python 
\usepackage{listings}
%New colors defined below
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{light-gray}{gray}{0.95}
%Code listing style named "mystyle"
\lstdefinestyle{Python}{
  backgroundcolor=\color{light-gray}, 
  commentstyle=\color{codegreen},
  keywordstyle=\color{violet},
  numberstyle=\tiny\color{codegray},
  stringstyle=\color{codepurple},
  basicstyle=\ttfamily\footnotesize,
  emph={self,__init__},          
  emphstyle=\color{red},
  breakatwhitespace=false,         
  breaklines=true,                 
  captionpos=b,                    
  keepspaces=true,                 
  numbers=left,                    
  numbersep=5pt,                  
  showspaces=false,                
  showstringspaces=false,
  showtabs=false,                  
  tabsize=2
}
\lstdefinestyle{Matlab}{
    %basicstyle=\color{red},
    backgroundcolor=\color{light-gray}, 
    commentstyle=\color{codegreen},
    breaklines=true,%
    morekeywords={matlab2tikz},
    basicstyle=\ttfamily\footnotesize,%
    keywordstyle=\color{blue},%
    morekeywords=[2]{1}, keywordstyle=[2]{\color{black}},
    identifierstyle=\color{black},%
    stringstyle=\color{codepurple},
    showstringspaces=false,%without this there will be a symbol in the places where there is a space
    numbers=left,%
    numberstyle={\tiny \color{black}},% size of the numbers
    numbersep=5pt, % this defines how far the numbers are from the text
    emph=[1]{for,end,break},emphstyle=[1]\color{blue}, %some words to emphasise
    %emph=[2]{word1,word2}, emphstyle=[2]{style},    
}
%"mystyle" code listing set
%%Titles colors
\chapterfont{\color{Blue}}  % sets colour of chapters
\sectionfont{\color{Blue}}  % sets colour of sections
\subsectionfont{\color{RoyalBlue}}
\usepackage[sorting=none]{biblatex}
\addbibresource{sources.bib}
\newcommand{\sectionbreak}{\clearpage}
%% Header and footer 
%E/O (even/odd), L/C/R (left/center/right) y H/F (header/footer))
\fancyhf{}
\fancyhead[ER]{\includegraphics[scale=0.15]{ADOreD_logo_no subtext.png}}
\fancyhead[OL]{ ADOreD report template }
\fancyhf[ELH, ORH]{ \thepage}
\fancyfoot[L]{ \textcolor{gray}{This project has received funding from the European Union’s  Horizon Europe \\
Research and Innovation programme under the Marie Skłodowska-Curie grant \\
agreement No 101073554.}}
%\fancyfoot[R]{ \\
%\transparent{0.8}\includegraphics[scale=0.1]{eu_flag.png}}
\fancyfoot[R]{\raisebox{-0.8\height}{\transparent{0.8}\includegraphics[scale=0.1]{eu_flag.png}}}
\pagestyle{fancy}
\raggedbottom
\begin{document}
\begin{titlepage}
 \includegraphics[height=2 cm,keepaspectratio]{Uni_logo.png}   \includegraphics[height=2 cm,keepaspectratio]{YouWind_logo.png}\hfill\includegraphics[height=2 cm,keepaspectratio]{ADOreD_logo.png}
 
  \vspace{40mm}
    \hspace{2mm}
\centering
    {\Huge \textbf{ADOreD}}\\
    \vspace{5mm}
    {\Large \textbf{Accelerating the Deployment of Offshore wind using DC technology}}\\
    \Large \textbf{Grant Agreement number : 101073554}\\
    \vspace{20mm}
    \Huge \textcolor{Blue}{\textbf{\thetitle}}\\
    \vspace{10mm}
    \Large\textbf{Description of deliverable:}\\
    \vspace{10mm}
    \Large\today\\  %Si e lloc del dia de la darrera edició es vol una data fixa, elimineu \today i poseu la data
    
    \vspace{20mm}
    \hspace{2mm}
    \theauthor
\begin{table}[H]
\centering
\begin{tabular}{|l|l|}
\hline
Deliverable number     & D4.1               \\ \hline
Work Package           & WP6: Management    \\ \hline
Dissemination level    & Public             \\ \hline
Project period         & xxxxxx \\ \hline
Due date               & xxxxxx      \\ \hline
Actual submission date & xxxxxx  \\ \hline
\end{tabular}
\end{table}
    \end{titlepage}
%\maketitle
\tableofcontents
\listoffigures
\listoftables
\section*{Abstract}
\addcontentsline{toc}{section}{Abstract}
\section{Introduction}
\lipsum[3-5] \cite{ShortName}
\section{Development}
\lipsum[1-2]
 \begin{figure}[H]
      \centering
      \includegraphics[scale=0.5]{ADOreD_logo.png}
      \caption{ADOreD Logo}
      \label{fig:ADORD_logo}
  \end{figure}
\lipsum[1-2]
  
\subsection{Helpful Information}
\lipsum[1]
\begin{table}[H]
\caption{ADOreD Candidates starting date}
\centering
\begin{tabular}{clll}
\hline
\textbf{Fellow nr} & \textbf{Institution} & \textbf{Name}    & \textbf{Starting date - approximately} \\ \hline
1  & UPC      & Kriti Agrawal           & 1st of September \\
2  & UPC      & Bernardo Castro Valerio & 19th of June     \\
3  & UPC      & Luis Angel Garcia-Reyes & 1st of July      \\
4                                      & UPORTO                          & Re-advertisement & ? (not possible before October)        \\
5  & UPORTO   & Waseem Haider           & 1st of September \\
6  & Clille   & Anup Joshi              & 1st of September \\
7  & KULeuven & Manika Khadka           & 1st of September \\
8  & YUSO     & Re-advertisement        & ? Contact them   \\
9  & DTU      & Alexander Novikov       & 1st of September \\
10 & DTU      & Nicolae Darii           & 1st of July      \\
11 & DTU      & Germano Mugambe         & 1st of September \\
12 & DTU      & Zhengua Xu (Joshua)     & 1st of September \\
13 & UPC      & Mario Useche Arteaga    & 1st of July      \\
14 & KULeuven & Hanwei Li               & 1st of September \\
15 & UPORTO   & Ahmar Farooque          & 1st of September \\
16 & Cardiff  & Muhammad Fawad          & 1st of August    \\
17 & Cardiff  & Qingyuan Gong           & 1st of August    \\
18 & Cardiff  & Junaid Khalid           & 1st of August    \\
19 & Cardiff  & Muhammad Helal Uddin    & 1st of August    \\ \hline
\end{tabular}
\end{table}
% Please add the following required packages to your document preamble:
% \usepackage{graphicx}
\begin{table}[H]
\centering
\caption{Work Package List}
\label{tab:my-table}
\resizebox{\textwidth}{!}{%
\begin{tabular}{ccccccc}
\hline
\textbf{WP No.} & \textbf{WP Title} & \textbf{Lead (Short Name)} & \textbf{Start} & \textbf{End} & \textbf{Activity} & \textbf{Reasearchers} \\ \hline
1 & Offshore Wind & CU & 6 & 48 & Research & 3, 10, 11, 12, 17, 19 \\
2 & HVDC & UPC & 6 & 48 & Research & 1, 2, 6, 7, 14, 16 \\
3 & AC/DC interaction & KULeuven & 6 & 48 & Research & 4, 5, 8, 9, 13, 15, 18 \\
4 & Training & DTU & 6 & 48 & \begin{tabular}[c]{@{}c@{}}Training \\ Activity\end{tabular} & all \\
5 & \begin{tabular}[c]{@{}c@{}}Communication and\\  Dissemination\end{tabular} & UPC & 6 & 48 & Dissemination & all \\
6 & Management & DTU & 1 & 48+ & Management &  \\ \hline
\end{tabular}%
}
\end{table}
\begin{table}[H]
\caption{ADOreD projects}
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{cl}
\hline
\textbf{Fellow nr} & \textbf{Project title} \\ \hline
1  &  Autonomous operation of modern power systems including HVDC grids \\
2  &   Tools for the design and sizing of offshore transmission
systems using HVDC systems and grids  \\
3  &  Tools development for stability and interaction assessment of large modern power electronics dominated power systems. \\
4  & Hydrogen storage on offshore wind power plants  \\
5  & Digitalization of the offshore power substation secondary equipment in an AC/DC context \\
6  &  Stability of an islanded power system with a grid-forming VSC-HVDC link, an LCC-HVDC link and non-synchronous generation  \\
7  &  HVDC Cable Analytics: Using monitored data from contingency analysis to determine cable and accessory lifetime
 \\
8  &   Risk-based operational models for hybrid offshore interconnectors for ancillary service provision
\\
9  &  Wind turbine and wind power plant protection in a converter-based power system \\
10  &  Electrical Compatibility Study of a Converter based Offshore Energy System constituting diverse Control Strategies.  \\
11  &  Dynamic stability of multi-vendor large (offshore) wind power clusters
 \\
12  & Ancillary services from offshore wind power plants in HVDC grids
  \\
13  &  Tools development for stability and interaction assessment of large modern power electronics dominated power systems
 \\
14  & Protection schemes for HVDC cable systems in multi-vendor HVDC grids
  \\
15  &  Renewable Hydrogen on offshore wind power plants
 \\
16  &  Assessment and operation of DC technology based multi-purpose interconnectors (MPIs)
 \\
17  &Design and control of offshore wind farms with hybrid ac and dc technologies
   \\
18  &  Modelling and control of large wind turbines for fault ride-through and grid support
 \\
19  & Reliability-based design optimisation of large offshore wind turbine
  \\
 \hline
\end{tabular}
}
\end{table}
\subsection{How to add Lists}
You can make lists with automatic numbering \dots
\begin{enumerate}
\item Like this,
\item and like this.
\end{enumerate}
\dots or bullet points \dots
\begin{itemize}
\item Like this,
\item and like this.
\end{itemize}
\subsection{How to write Mathematics}
\LaTeX{} is great at typesetting mathematics. Let $X_1, X_2, \ldots, X_n$ be a sequence of independent and identically distributed random variables with $\text{E}[X_i] = \mu$ and $\text{Var}[X_i] = \sigma^2 < \infty$, and let
\begin{equation}
    S_n = \frac{X_1 + X_2 + \cdots + X_n}{n}
      = \frac{1}{n}\sum_{i}^{n} X_i\
\end{equation}
denote their mean. Then as $n$ approaches infinity, the random variables $\sqrt{n}(S_n - \mu)$ converge in distribution to a normal $\mathcal{N}(0, \sigma^2)$.
\subsection{Python program example}
\begin{lstlisting}[language=Python,style=Python]
def create_Ybus(self):
            # off diagonal elements
            for k in range(self.nl):
                line = self.lines[k]
                fromNode = line.fromNode.nodeNumber
                toNode = line.toNode.nodeNumber
               
                self.Ybus[fromNode, toNode] -= 1/line.Z
                self.Ybus[toNode, fromNode] = self.Ybus[fromNode, toNode]
                
                self.AdmitanceVec[fromNode] += line.Y/2
                self.AdmitanceVec[toNode] += line.Y/2
        
\end{lstlisting}
\subsection{Matlab program example}
\begin{lstlisting}[language=Matlab,style=Matlab]
function [Y_bus]= Ybus(Line_data_table_pu,total_nodes)
Y_bus=[zeros(total_nodes)];
admitance_vector=[zeros(total_nodes,1)];
for i=1:total_nodes-1
    Y_bus(k,m)=-1/(R+1j*X);
    Y_bus(m,k)=Y_bus(k,m);
    
    admitance_vector(k)=admitance_vector(k)+1j*B/2;
    admitance_vector(m)=admitance_vector(m)+1j*B/2;
end
for m=1:total_nodes
    sum_pa=-sum(Y_bus(:,m));
    Y_bus(m,m)=sum_pa+admitance_vector(m);
end
end
\end{lstlisting}
\section{Referencing}
To add references download the bibtex citation style, and copy and paste it to sources.bib such as:
@article\{ShortName, \\
  title={The Article},\\
  author={Shall Not be Named},\\
  journal={The Journal},\\
  volume={56},\\
  number={1},\\
  pages={99--111},\\
  year={3662},\\
  publisher={ADored Publisher}\\
\}
The ´ShortName´ is a personal tag for each citation. To cite on the text use command "\textbackslash cite\{ShortName\}"\cite{ShortName} 
\section*{Conclusion}
\addcontentsline{toc}{section}{Conclusion}
\lipsum[3-5]
\addcontentsline{toc}{section}{References}
 \printbibliography
\sectionbreak
\section*{Annex}
\addcontentsline{toc}{section}{Annex}
\sectionbreak
\end{document}