\documentclass[12pt,a4paper,fleqn]{article}
\usepackage{mathptmx}
\usepackage[utf8]{inputenc}
\usepackage[finnish]{babel}
\usepackage{amsmath}
\usepackage{hyperref}
\urlstyle{same}
%\usepackage{xstring}

\date \mydate
\author \myauthor
\title \mytitle

\usepackage[hmargin=2.0cm,vmargin=2.5cm]{geometry}
%\linespread{1.4}
\usepackage{setspace}
\onehalfspacing

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[L]{\mytitle \quad \mydate}
\fancyhead[R]{\myauthor}

\usepackage{graphicx}
%\usepackage{caption}

\setlength \headsep {6ex}

\renewcommand \headrulewidth {0pt}
\renewcommand \footrulewidth {0pt}

\setlength \parindent {0pt}
\setlength \parskip {2ex}

\let \ta \tiny
\let \tb \scriptsize
\let \tc \footnotesize
\let \td \small
\let \te \normalsize
\let \tf \large
\let \tg \Large
\let \th \LARGE
\let \ti \huge
\let \tj \Huge

\let \ha \section
\let \hb \subsection
%\newcommand {\ha}[1] {\vspace{-3ex} \section{#1} \vspace{-1ex}}
%\newcommand {\hb}[1] {\vspace{-2ex} \subsection{#1} \vspace{-2ex}}
\let \hc \subsubsection
\let \hd \paragraph
\let \he \subparagraph

\let \b \textbf
\let \i \emph
\let \s \;
\let \v \medskip
\let \n \textnormal

\let \f \frac

\def \cd {\ensuremath{^\circ \text{C}}}
\def \cdd {$^\circ$}

\let \sups \textsuperscript
\newcommand{\subs}[1]{\ensuremath{_{\textrm{#1}}}}

\DeclareMathOperator{\M}{M}
\DeclareMathOperator{\g}{g}
\DeclareMathOperator{\ml}{ml}
\DeclareMathOperator{\kg}{kg}
\DeclareMathOperator{\mol}{mol}
\DeclareMathOperator{\J}{J}
\DeclareMathOperator{\kJ}{kJ}
\DeclareMathOperator{\K}{K}
\DeclareMathOperator{\C}{C}

\newcommand {\img}[2][] {
\begin{figure}[h!]
 \caption{#1}
 \centering
 \includegraphics[width=0.5\textwidth]{#2}
\end{figure}
}

\def \cp {\s \chemsign{+} \s}
\def \cs {\chemsign{+}}
\def \ca {\s \chemrel{->} \s}
\newcommand {\ap}[1][] { \ensuremath{^{#1 \oplus}} }
\newcommand {\am}[1][] { \ensuremath{^{#1 \ominus}} }
\newcommand {\ay}[1] { \ensuremath{^{#1}} }

\newcommand{\e}[1]{ \begin{align*}#1\end{align*} }
\newcommand{\cm}[1]{ \te{ \ce{#1} } }

\usepackage[titles]{tocloft}
\renewcommand \cftsecleader {\cftdotfill{\cftdotsep}}

\setcounter{secnumdepth}{0}
\setcounter{tocdepth}{1}

\newenvironment{ls}{
  \begin{itemize}
  \setlength{\itemsep}{1pt}
  \setlength{\parskip}{0pt}
  \setlength{\parsep}{0pt}
}{
  \end{itemize}
  \vspace{-3ex}
}
