\documentclass[12pt]{article}
%\documentclass[12pt,a4paper]{article}
%Size -- the best choice for university course
%slides seems landscape A5, 12pt letters.  Margins
%are made narrow, as much text on each page as possible.

%Could define size explicitly, but finally A5 was selected:



\usepackage[%paperwidth=600pt,paperheight=450pt,
a5paper,left=15pt,right=15pt,top=3pt,bottom=3pt,%
  %outer=25mm,\chi
  %inner=35mm,
  %vmargin=2mm,
  includehead,includefoot,headheight=15.4pt,headsep=5pt,%
  footskip=22pt,landscape]{ geometry }

\usepackage{tocloft}
%\usepackage{tocloft}% http://ctan.org/pkg/tocloft
\setlength{\cftsecnumwidth}{1.9em}
\setlength{\cftsubsecnumwidth}{2.95em}
\setlength{\cftsubsubsecnumwidth}{3.7em}
% Set length of number width in ToC
% so that the number has enough space and
% does not run into the subsection title.
\usepackage[hyphens]{url}
\usepackage[unicode,colorlinks=true,breaklinks]{hyperref}
%\usepackage[dvips]{hyperref}
%should display links, but it does not work with \H accent
%and formulas in section titles

\setlength\abovedisplayskip{0pt}
\setlength\belowdisplayskip{0pt}

\hypersetup{colorlinks,%
  linkcolor=blue,urlcolor=magenta,citecolor=green}
%Breaks long url`s in text, while keeping it one link:

\newcommand{\nc}{\newcommand} % a newcommand rövidítése
\newcommand{\rc}{\renewcommand} % a renewcommand rövidítése


%Creates header and footer w time, section titles, etc. 
%Here the stripes are made narrow. 
\usepackage{fancyhdr}
\usepackage[yyyymmdd,hhmmss]{datetime}
\pagestyle{fancy}
\rc{\headrulewidth}{0.3pt}
\rc{\footrulewidth}{0.3pt}
\lfoot{\today\, \currenttime}
\cfoot{}
\rfoot{\thepage}

\sloppy %To prefer larger spaces between 
%words rather than overflow a line. 
\frenchspacing %No wide space after period, this is the
%French and also the Hungarian rule. 

\usepackage{bookmark}
\usepackage[medium,compact,toctitles]{titlesec}
\usepackage[active]{srcltx}
%\usepackage{savetrees} 
% others: 
\usepackage{t1enc}
\usepackage{amsmath, amssymb, amsfonts, amsbsy, amsthm}
\let\equation\gather
\let\endequation\endgather

\usepackage[magyar]{babel}
\usepackage[utf8]{inputenc} 
%\usepackage[pdftex]{graphicx}
\usepackage{graphicx}
\graphicspath{{./}{kepek/}}
\usepackage{epstopdf}
\epstopdfsetup{update}
% only regenerate pdf files when eps file is newer

\usepackage[margin=0.8cm]{caption}
\captionsetup[wrapfigure]{margin=0.5cm}
\usepackage{lmodern}%Avoid rastering for letters.  
 
% Alább definiáljuk a magyar névelőhöz illeszkedő egyenlet hivatkozást.
% A magyar csomag része \az{..} az argumentumbeli számnévhez 
% illeszkedő névelő, \Az ugyanez % nagybetűvel, ezeket használjuk 
% alább.  
\nc{\Aeqref}[1]{\Az{\eqref{#1}}}
\nc{\aeqref}[1]{\az{\eqref{#1}}}

\usepackage{bbold}
\usepackage{ulem}
\usepackage[caption=false]{subfig} 
%\usepackage{epsfig}
%\usepackage[dvips]{color}
\usepackage{accents}
\usepackage{textcomp}
\usepackage{nicefrac}%\nicefrac{}{} makes frac with slash for text
\usepackage[section]{placeins} %have \FloatBarrier,
%issued automatically at section titles 

\usepackage{wrapfig} %for wrapping text around floats 
\usepackage{indentfirst}
%for indenting the first para after section title, customary in 
%Hungarian but not so in English.  
\usepackage[integrals]{wasysym} %symbols for planets 
\usepackage{upgreek}
\usepackage{bm}\usepackage{bbm}
%I experimented with those:
%\usepackage[utopia]{mathdesign}
%\usepackage[OMLmathrm,OMLmathbf]{isomath}
%\usepackage{movie15}
%\usepackage[thinlines]{easytable} % DOES NOT WORK!
%comfortable table creation
%\begin{TAB}(r,1cm,2cm)[5pt]{|l|}{|c|c|}
%(rows,min,max)[tabcolsep]{columns}{rows}
%\end{TAB}


\rc*\familydefault{\sfdefault}
%entire doc in sanserif for better reading from projection

%redefine paragraph to enumerate them
\setcounter{secnumdepth}{6}
\rc\theparagraph{{\it\bf\alph{paragraph}}}
\rc\thesubparagraph{{\it\bf\roman{subparagraph}}}

\makeatletter
\rc\paragraph{\@startsection{paragraph}{4}{\z@}
{-3.25ex\@plus -1ex \@minus -.2ex}%
{5pt \@plus .2ex}%
{\normalfont\normalsize\bfseries\itshape}}
\rc\subparagraph{\@startsecton{paragraph}{5}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{5pt \@plus .2ex}%
{\normalfont\normalsize\itshape}}
\rc*\itemize{%
  \ifnum \@itemdepth >\thr@@\@toodeep\else
    \advance\@itemdepth\@ne
    \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
    \expandafter
    \list
      \csname\@itemitem\endcsname
      {\def\makelabel##1{\hss\llap{##1}}%
       \setlength{\itemsep}{2pt}%
       \setlength{\parsep}{2pt}%
       \setlength{\parindent}{7pt}}%
  \fi}
\makeatother

\rc{\labelitemi}{$\to$}
\rc{\labelitemii}{$\star$}


\nc{\td}{\mathrm{d}}%Upright d for derivative.

\nc{\ra}{ \ \ \cya{\Rightarrow} \ \ }
%Az "innen következik" jel formulában 
% \nc{\ra}{ \ \ \leadsto \ \ } %Ezen kicsi a nyíl.


\nc{\Thetait}{\mathit{\Theta}}

\nc{\el}{\mathcal{E}}

%Vektorok
\nc{\elb}{\bm{\mathcal{E}}}
\nc{\mv}[1]{\mbox{\boldmath $#1$}}
\nc{\ad}{\mbox{\boldmath $a$}}
\nc{\bbd}{\mbox{\boldmath $b$}}
\nc{\vd}{\mbox{\boldmath $v$}}
\nc{\Fd}{\mbox{\boldmath $F$}}
\nc{\Ad}{\mbox{\boldmath $A$}}
\nc{\Pd}{\mbox{\boldmath $P$}}
\nc{\fd}{\mbox{\boldmath $f$}}
\nc{\rd}{\mbox{\boldmath $r$}}
\nc{\jd}{\mbox{\boldmath $j$}}
\nc{\rdt}{\mbox{\scriptsize \boldmath $r$}}
\nc{\kdt}{\mbox{\scriptsize \boldmath $k$}}
\nc{\ydt}{\mbox{\scriptsize \boldmath $y$}}
\nc{\ud}{\mbox{\boldmath $u$}}
\nc{\kd}{\mbox{\boldmath $k$}}
\nc{\bd}{\mbox{\boldmath $\beta$}}
\nc{\od}{\mbox{\boldmath $\omega$}}
\nc{\ald}{\mbox{\boldmath $\alpha$}}
\nc{\sig}{\mbox{\boldmath $\sigma$}}
\nc{\bdt}{\mbox{\scriptsize \boldmath $\beta$}}
\nc{\aldt}{\mbox{\scriptsize \boldmath $\alpha$}}
\nc{\nd}{\mbox{\bf \textit{0}}}
\nc{\nnd}{\mbox{\boldmath $n$}}
\nc{\fid}{\mbox{\boldmath $\varphi$}}
\nc{\ed}{\mbox{\boldmath $e$}}
\nc{\Ed}{\mbox{\boldmath $E$}}
\nc{\Nd}{\mbox{\boldmath $J$}}
%Az impulzusmomentumot korábban N-nel jelöltük, ezt J-re váltottuk,
%de a vektor \Nd jele itt megmaradt.
\nc{\Md}{\mbox{\boldmath $M$}}
\nc{\Ld}{\mbox{\boldmath $L$}}
\nc{\Vd}{\mbox{\boldmath $V$}}
\nc{\Rd}{\mbox{\boldmath $R$}}
\nc{\Xd}{\mbox{\boldmath $X$}}
\nc{\sd}{\mbox{\boldmath $s$}}
\nc{\pd}{\mbox{\boldmath $p$}}
\nc{\qd}{\mbox{\boldmath $q$}}
\nc{\xd}{\mbox{\boldmath $x$}}
\nc{\tdd}{\mbox{\boldmath $t$}}
\nc{\yd}{\mbox{\boldmath $y$}}
\nc{\nab}{\boldsymbol{\nabla}}

%Mátrixok
\nc{\MD}{\mathbf{M}}
\nc{\Kt}{\mathbf{K}}
\nc{\At}{\mathbf{A}}
\nc{\Bt}{\mathbf{B}}
\nc{\Ct}{\mathbf{C}}
\nc{\Ht}{\mathbf{H}}
\nc{\It}{\mathbf{I}}
\nc{\Pt}{\mathbf{P}}
\nc{\Et}{\mathbbm{1}} %Kettős vonallal írt 1-es.
\nc{\Od}{\mathbf{O}} 
\nc{\nt}{\mathbb{0}} %Nullmátrix
\nc{\et}{\boldsymbol{\upvarepsilon}}
\nc{\ft}{\boldsymbol{\upsigma}}

%Operációk, függvények
\nc{\Div}{\mathrm{\,div\,}}
\nc{\Rot}{\mathrm{\,rot\,}}
\nc{\Grad}{\mathrm{\,grad\,}}
\nc{\Def}{\mathrm{\,def\,}}
\nc{\Tr}{\mathrm{\,Tr\,}}
\nc{\ord}{\ensuremath{\mathcal{O}}}

\nc{\dt}{\partial_t}
\nc{\dx}{\partial_x}
\nc{\dy}{\partial_y}
\nc{\dd}{\delta}

\nc{\tg}{\mathrm{\,tg\,}}
\nc{\ctg}{\mathrm{\,ctg\,}}
\nc{\atg}{\mathrm{\,arctg\,}}
\nc{\sh}{\mathrm{\,sh\,}}
\nc{\ch}{\mathrm{\,ch\,}}
\nc{\cth}{\mathrm{\,cth\,}}

%Better visible dots for time derivatives
\nc{\sbt}{%
\,\begin{picture}(-1,1)(-1,-1.3)\circle*{2}\end{picture}\ }
\nc{\ssbt}{%
\,\begin{picture}(-1,1)(-1,-1.3)\circle*{1}\end{picture}\ }
\rc{\dot}[1]{\accentset{\sbt}{#1}}
\nc{\sdot}[1]{\accentset{\ssbt}{#1}}
\rc{\ddot}[1]{\accentset{\sbt\!\sbt}{#1}}

%\rc{\perp}{{\!\perp}}
\nc{\perpcl}{{\!\perp}}

%előregyártott deriváltak (álló törtek külön írt képletekhez:
\nc{\DER}[2]{\frac{\td #1}{\td #2}} %derivált
\nc{\PAR}[2]{\frac{\partial #1}{\partial #2}} %parciális derivált

%színek
\usepackage{color}
\nc{\tc}{\textcolor}
\nc{\dc}{\definecolor}
\dc{MB}{rgb}{0.1,0.21,0.44}
\dc{gold}{rgb}{0.75,.56,0}
\dc{dgreen}{rgb}{0,0.60,0}
\dc{dyellow}{rgb}{0.65,0.65,0}
\dc{dcyan}{rgb}{0,0.5,0.5}
\dc{dred}{rgb}{0.6,0,0}
\dc{figgreen}{rgb}{0.21,0.5,0.22}
\dc{navy}{rgb}{0,0,0.128}
\nc{\blu}[1]{\tc{blue}{#1}}
\nc{\gre}[1]{\tc{dgreen}{#1}}
\nc{\red}[1]{\tc{red}{#1}}
\nc{\cya}[1]{\tc{dcyan}{#1}}
\nc{\mgn}[1]{\tc{magenta}{#1}}
\nc{\yel}[1]{\tc{dyellow}{#1}}
\nc{\nav}[1]{\tc{navy}{#1}}


%számozott műfajok 
%\newtheorem{hf}{\text{\it Házi feladat}}[section]
%\nc{\HF}[1]{{\hf \tc{MB}{#1}}}
% \newtheoremstyle{mystyle}
% {headspec} \thmnumber{ #1} \thmname{#2} \thmnote{#3}
\newtheorem{gf}{\text{\it{\cya{Gyakorló feladat}}}}[section]
\nc{\GF}[1]{{\gf #1}}
\nc{\GFL}[2]{{\begin{gf}\label{gf:#2} #1\end{gf}}}
\nc{\GFN}[1]{{\vspace{-0.5\baselineskip}\gf #1}}
\newtheorem{pl}{\text{\it{{Példa}}}}[subsection]
% \usepackage{xpatch}
% \makeatletter
% \xpatchcmd{\@thm}{\thm@headpunct{.}}{\thm@headpunct{}}{}{}
% \makeatother

\nc{\PL}[1]{{\pl \gre{#1}}}
\nc{\PLL}[2]{{\vbn{0.5}\begin{pl}\label{pl:#2} \gre{#1}\end{pl}}}
\nc{\dl}[2]{\hfill\gre{$2016.#1  \ \blacktriangleleft \ %
\mid \ \blacktriangleright \ 2016.#2$}}%az előadások dátumai
\nc{\dln}[2]{\hfill\gre{$2017.#1  \ \blacktriangleleft \ %
\mid \ \blacktriangleright \ 2017.#2$}}%az előadások dátumai
\nc{\dlna}[2]{\hfill\yel{A: $2018.#1  \ \blacktriangleleft \ %
\mid \ \blacktriangleright \ 2018.#2$}}%az előadások dátumai
\nc{\dlne}[2]{\hfill\yel{E: $2018.#1  \ \blacktriangleleft \ %
\mid \ \blacktriangleright \ 2018.#2$}}%az előadások dátumai
\nc{\dla}[2]{\hfill\yel{A: $2019.#1  \ \blacktriangleleft \ %
		\mid \ \blacktriangleright \ 2019.#2$}}%az előadások dátumai
\nc{\dle}[2]{\hfill\yel{E: $2019.#1  \ \blacktriangleleft \ %
		\mid \ \blacktriangleright \ 2019.#2$}}%az előadások dátumai
\nc{\dlhusze}[2]{\hfill\yel{Sz: $2020.#1  \ \blacktriangleleft \ %
		\mid \ \blacktriangleright \ 2020.#2$}}%az előadások dátumai
\nc{\dlhusza}[2]{\hfill\yel{N: $2020.#1  \ \blacktriangleleft \ %
		\mid \ \blacktriangleright \ 2020.#2$}}%az előadások dátumai
\nc{\dlhee}[2]{\hfill\yel{Sz: $2021.#1  \ \blacktriangleleft \ %
		\mid \ \blacktriangleright \ 2021.#2$}}%az előadások dátumai
\nc{\dlhea}[2]{\hfill\yel{N: $2021.#1  \ \blacktriangleleft \ %
		\mid \ \blacktriangleright \ 2021.#2$}}%az előadások dátumai


%praktikus: vb soremelés, vbn állítható, nn egyenlet végére
\nc{\vb}{\vspace{\baselineskip}}
\nc{\vbn}[1]{\vspace{#1\baselineskip}}
\nc{\nn}{\nonumber}

%\numberwithin{equation}{subsection}
\numberwithin{equation}{section}
\usepackage{cleveref}

\setlength{\parskip}{0.3\baselineskip}
%\setlength{\itemsep}{-0.3\baselineskip} --- does not work
%\setlength{\itemsep}{2pt plus2pt minus2pt} --- does not work
\AtBeginDocument{\addtocontents{toc}{\protect\setlength{\parskip}{0pt}}}
%do not loosen toc by possibly large parskip
\linespread{0.93} %compactify

%compactify
\setcounter{topnumber}{2}
\setcounter{bottomnumber}{2}
\setcounter{totalnumber}{4}
\rc{\topfraction}{0.85}
\rc{\bottomfraction}{0.85}
\rc{\textfraction}{0.15}
\rc{\floatpagefraction}{0.7}
\rc{\theHequation}{\theHsection\arabic{equation}}
%needed for hyperref


%\usepackage{movie15} % to include movies
%\usepackage{hyperref} % prerequisite for movie15 -- these do not seem 
%to work includeonly{em0.1,em1.8} % selects from include list below, 
% but uses the other aux files and keeps eq. and sec. numberings mostly 
% correct; omitting includeonly results in including all items -- then 
% \include is equivalent to \clearpage\input{file}\clearpage.
% each included file gets its own .aux file by include
% \include{em0.1} etc.

%Below we use \input, very simple.

\begin{document}

% \setlength{\cftsecnumwidth}{4em}% Set numwidth of section
% \setlength{\cftsubsecnumwidth}{\cftsecnumwidth}
% % Make subsection numwidth the same as section
% \setlength{\cftsubsecindent}{\cftsecindent}
% % Make subsection indent the same as section
%

\input{em0.1}
\input{em1a}
\input{em1b}
\input{em1.1}
\input{em1.5}
\input{em1.6}
\input{em1.7}
\input{em1.75}
\input{em1.76}
\input{em1.8}
\input{em1.85}
\input{em2}
\input{em4}
\input{em5}
\input{em6}
\input{em7}
\input{em8}
\input{em9}
\input{em10}
\input{em11}
\input{em12}
\input{kont1}
\input{kont11}
\input{kont2}
\input{kont3}
\input{hasonlosag}
\input{laminaris}
\input{utolso}
\input{fugg}
%\input{kont20}
%\input{kont21}

\end{document}
