\documentclass[a4paper,12pt]{article}

%% Language and font encodings
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz} %%%%%%%%%%%%%%%%%%%%%%%%%% for tikz logos
\usetikzlibrary{svg.path}
\usetikzlibrary{backgrounds}
\usepackage{xcolor}

%% Sets page size and margins
\usepackage[a4paper,top=5mm,bottom=5mm,left=5mm,right=5mm,marginparwidth=1.75cm]{geometry}

%% Useful packages
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}
\usepackage{anyfontsize}
\definecolor{doorgray}{rgb}{0.9, 0.9, 0.9}

%Defining a command to write names easily.
%You can change the numbers here to adjust:
%% font size
%% horizontal position
%% vertical space

\newcommand{\roomnumber}[1]{
\noindent\fcolorbox{black}{doorgray}{%
\begin{minipage}{\dimexpr1\textwidth -2\fboxrule -2\fboxsep\relax}
\vspace{5mm}
\flushright
\textbf{\fontsize{70}{70}\selectfont #1  }
\vspace{5mm}
\end{minipage}}}

%For 1-4 people
\newcommand{\persona}[2]{
\hspace{7mm} \textbf{\fontsize{35}{50}\selectfont #1}\\

\hspace{7mm} {\fontsize{20}{30}\selectfont #2}

\vspace{7mm}
}

%For more than 4 people
\newcommand{\personb}[2]{
\hspace{7mm} \textbf{\fontsize{30}{50}\selectfont #1}\\

\hspace{7mm} {\fontsize{20}{30}\selectfont #2}

\vspace{3mm}
}

\makeatletter
\def\personc{\@ifnextchar[{\@with}{\@without}}
\def\@with[#1]#2{
\hspace{7mm} \textbf{\fontsize{30}{50}\selectfont #1}\\

\hspace{7mm} {\fontsize{20}{30}\selectfont #2}

\vspace{3mm}
}
\def\@without#1{
\hspace{7mm} \textbf{\fontsize{30}{50}\selectfont #1

\vspace{3mm}
}}
\makeatother

%Defining a command to draw the UEF logo in svg vector graphic.
\newcommand{\ueflogohorizontal}[3]
{
\begin{tikzpicture}
[scale=#1, show background rectangle, background rectangle/.style={fill=#3}]
\fill [fill=#2] svg{M 0 -35.5 V -62.3 S 5.1 -62.3 14.1 -65.6 C 27.4 -70.4 35.4 -83.5 35.4 -83.5 L 32.9 -61.7 C 32.3 -56.1 30.2 -47.1 22 -41.4 C 11.3 -33.9 0 -35.5 0 -35.5 Z M 8.9 -26.7 V -10.7 C 13.3 -11.7 20.1 -13.9 25.7 -19 C 34.2 -26.8 34.3 -46.4 34.3 -46.4 S 31.3 -39.6 25.9 -34.9 C 20.3 -30.1 13.4 -27.8 8.9 -26.7 Z M 37.7 -23.2 S 36.1 -17.3 33.2 -13.6 C 30.4 -10 28 -8.4 28 -8.4 L 37.7 0 L 47.4 -8.4 S 44.9 -10.1 42.2 -13.7 C 39.4 -17.4 37.7 -23.2 37.7 -23.2 Z M 49.8 -19 C 55.3 -14 62.2 -11.7 66.6 -10.7 V -26.8 C 62.1 -27.9 55.2 -30.2 49.6 -34.9 C 44 -39.6 41.2 -46.4 41.2 -46.4 S 41.3 -26.8 49.8 -19 Z M 75.4 -35.5 V -62.3 S 70.3 -62.3 61.3 -65.6 C 48 -70.4 40 -83.5 40 -83.5 L 42.5 -61.7 C 43.1 -56.1 45.2 -47.1 53.4 -41.4 C 64.1 -33.9 75.4 -35.5 75.4 -35.5 Z};
\draw [anchor=west, xshift=3.2cm, yshift=-1.3cm]
node [xscale=1.12*#1/1.5,yscale=#1/1.5]{\sffamily \fontsize{25}  
{0}\selectfont {}{\color{#2} UNIVERSITY OF}};
%
\draw [anchor=west, xshift=3.2cm, yshift=-2cm]
node [xscale=1.12*#1/1.5,yscale=#1/1.5]{\sffamily \fontsize{25}   
{0}\selectfont {}{\color{#2} EASTERN FINLAND}};
\end{tikzpicture}
}

\newcommand{\uefdepartment}[2]{
\begin{center}
\begin{minipage}[r]{0.35\textwidth}
\hspace{0.5cm}\ueflogohorizontal{0.5}{black}{none}
\end{minipage}
\begin{minipage}[c]{0.02\textwidth}
\begin{tikzpicture}
\tikz \draw (0,1.5) -- (0,0);
\end{tikzpicture}
\end{minipage}
\begin{minipage}[l]{0.55\textwidth}
\vspace{-2mm}
\textbf{#1\\ #2}
\end{minipage}
\end{center}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%
% Edit the document here %
%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

%Edit the box size
\fbox{
\begin{minipage}[t][154mm][t]{154mm} %1-4 people
%\begin{minipage}[t][200mm][t]{154mm} %5- people

\roomnumber{401}
\vspace{10mm}

%\persona{Name}{Title} % for 1-4 people
%\personb{Name}{Title} % for 5- people
%

%\personc[Name Surname]{} 						%if no title
%\personc[Name Surname]{Tutkija, Researcher}	%if there is a title

\persona{Juha-Matti Huusko}{IT-tukihenkilö, IT-support person}

\persona{Name Surname}{Tutkija, Researcher}

\persona{Nimi Sukunimi}{Jatko-opiskelija, PhD student}

\vspace{3mm} %%% Adjust this!
%1 person 5.5cm
%2 people 1.5cm
%6 people 3mm

\uefdepartment{Fysiikan ja matematiikan laitos}{Department of Physics and Mathematics}

\end{minipage}}

\end{document}