I am fighting with a very horrible master thesis template. Some smart _ss designed some features which couldn't be done in MS Word without manual correction so I'm trying to make it works in LaTeX to hack it.
I stuck on headers and footers. They should consist a horizontal line aligned with the chapter lines on and text. The header should have the capitalized chapter name. The footer should have a static text: "page" on the first line of text block and odd/even corner numbering on the second page. All with Verdana font.
See attached pictures.
I've tried to mess around with fandyhdr but my LaTeX skill is not good enough.
Could somebody help me? Thank you.
Here is my template code:
\documentclass[a4paper,twoside]{report}% http://ctan.org/pkg/amsproc
\usepackage[top=3.00cm, bottom=3.00cm, inner=3cm, outer=3.5cm]{geometry}
\usepackage{hyperref}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[x11names,table]{xcolor}
\usepackage{fourier}
\usepackage{microtype}
\SetTracking[no ligatures={f}]{encoding=*}{80}
\usepackage[strict]{changepage}%
\usepackage{graphicx}
\usepackage[explicit]{titlesec}%
\usepackage[export]{adjustbox}
\usepackage{biblatex}
\usepackage{fancyhdr}
\usepackage{lipsum}
% BARVY
\definecolor{ukred}{RGB}{160,0,0}
\definecolor{ukgray}{RGB}{128,128,128}
\definecolor{ukredlight}{RGB}{160,0,0}
\definecolor{ukgraylight}{RGB}{192,192,192}
% TABULKY A OBRÁZKY
\usepackage{chngcntr}
\counterwithout{figure}{chapter}
\usepackage[font={color=ukgray},figurename=Obr.,tablename=Tab.,labelfont={color=ukgray,bf}]{caption}
\captionsetup{justification = raggedright,singlelinecheck = false}
\counterwithout{table}{chapter}
\rowcolors{1}{ukgraylight}{white}
\renewcommand{\contentsname}{Obsah}
% NUMBERS AND LINES AT CAPTIONS
\titleformat{\chapter}[hang]
{\bfseries\fontsize{14pt}{14pt}\selectfont\color{ukred}\lsstyle}
{\checkoddpage\ifoddpage\llap{\makebox[\dimexpr\marginparsep+\marginparwidth\relax][l]{\rule[-1.25ex]{\marginparwidth}{0.5ex}\llap{}}}\thechapter\enspace\else\thechapter\enspace \fi}
{0pt}
{\MakeUppercase{#1}\checkoddpage\ifoddpage\else\hfill\rlap{\makebox[\dimexpr\textwidth + \marginparsep][l]{\hspace{\marginparsep}\rlap{\rule[-1.25ex]{\marginparwidth}{0.5ex}}\thechapter}}\fi}%\titlerule[1.5pt]
\titlespacing*{\chapter}{0pt}{2ex}{1ex}
%
\titleformat{\section}
{\bfseries\large}
{\checkoddpage\ifoddpage\llap{\makebox[\dimexpr\marginparsep+\marginparwidth\relax][l]{\rule[-1.25ex]{\marginparwidth}{0.5ex}\llap{}}}\thesection\enspace\else\thesection\enspace \fi}
{0pt}
{#1\checkoddpage\ifoddpage\else\hfill\rlap{\makebox[\dimexpr\textwidth + \marginparsep][l]{\hspace{\marginparsep}\rlap{\smash{\rule[-1.25ex]{\marginparwidth}{0.5ex}}}\thesection}}\fi}%\titlerule[1.5pt]
\titlespacing*{\section}{0pt}{1ex}{0.5ex}
\titleformat{\subsection}
{\bfseries}
{\checkoddpage\ifoddpage\llap{\makebox[\dimexpr\marginparsep+\marginparwidth\relax][l]{\rule[-1.25ex]{\marginparwidth}{0.5ex}\llap{}}}\thesubsection\enspace\else\thesubsection\enspace \fi}
{0pt}
{#1\checkoddpage\ifoddpage\else\hfill\rlap{\makebox[\dimexpr\textwidth + \marginparsep][l]{\hspace{\marginparsep}\rlap{\smash{\rule[-1.25ex]{\marginparwidth}{0.5ex}}}\thesubsection}}\fi} \titlespacing*{\subsection}{0pt}{1ex}{0.5ex}
%%%%%%%%%
% HEADER
% FOOTER
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[LE,RO]{\color{ukgraylight}\hrule height 2.84pt \vspace{0.1cm} \textsf{\small{strana}\\ \vspace{0.15cm} \textbf{\Large{\thepage}}}}
% CITACE
\addbibresource{citace.bib}
\begin{document}
\tableofcontents
\chapter{Nadpis 1. úrovně}
\lipsum[1]
\section{Nadpis 2. úrovně}
\lipsum[2]
\subsection{Nadpis 3. úrovně}
\lipsum[3]
\chapter{První kapitola dizertace}
\lipsum[1]\par
Tady odcitujeme nějaký zdroj, ať víš, jak se vkládají. K tomu si budeš bohužel muset přečíst : \href{https://en.wikibooks.org/wiki/LaTeX/Bibliography_Management}{tento článek:}, ale na druhou stranu, věř mi, že s přibývajícím zdroji se Ti to automatické generování stylu bude hodit. Citace pro \LaTeX Ti totiž umožní kde jaká slušná databáze, takže se Ti to ve výsledku všechno zjednoduší. Takže nějaké citace% \cite{einstein}. Nebo další \cite{dirac}.
\begin{figure}[ht!]
\centering
\includegraphics[width=110mm, cfbox = ukgray 1mm 0pt]{Auticko.png}
\caption{Autíčko s tlustým popiskem bez názvu kapitoly, netlustým textem a pojebkaným rámečkem okolo...\label{overflow}}
\end{figure}
Tady bude zase nějaká tabulka...\par
\begin{table}[htb]
\centering
\caption{Nějaká tabulka}
% \cfbox ukgray 1mm 0pt{
\begin{tabular}{r|r|r|r}
N & R & C & T \\ \hline % odd -- lightblue (wrong)
8 & 8 & 4 & 444 \\ % even
9 & 8 & 4 & 124 \\ % odd -- lightblue (wrong)
10 & 8 & 4 & 672 \\ % even
\end{tabular}
\end{table}
\section{Nadpis 2. úrovně}
\lipsum[2]
\lipsum
\section{Nadpis 2. úrovně}
\lipsum
\lipsum
\chapter{Seznam použitých zkratek a symbolů}
\chapter{Seznam použitých zdrojů}
\printbibliography
\end{document}


captionmore than once? And why ishyperrefnot the last package to be loaded? – Feb 25 '17 at 11:30\fancyhead[LE]{Here is the text you want to see on Left head, Even pages}. There are alsoLO,RE,RO,CE,COoptions – Michael Fraiman Feb 25 '17 at 11:33\usepackage{polyglossia}and\newfontfamily\HEADINGS{Verdana}in the preamble. To switch to Verdana simply type \HEADINGS where you want to.\titleformat{\chapter}[hang] {\bfseries\fontsize{14pt}{14pt}\HEADINGS\lsstyle}– Michael Fraiman Feb 25 '17 at 11:38\renewcommand\headrule{some code}and\renewcommand\footrule{some code}. The line itself is produced with\hrule. You can specify its width with\hrule height 2pt– Michael Fraiman Feb 25 '17 at 11:42captionmore than once. The Verdana font is the last thing which is worring me. The lines and the numbers at corners are problem for me. The font is the last thing to do for me. – KUTlime Feb 25 '17 at 12:16\fancyhead[]buttwosidestag in\documentclassis ignored and\fancyhead[]does just left side numbering instead of odd/even|left/right positioning. :-( – KUTlime Feb 25 '17 at 16:59\thispagestyle{plain}, when you start a chapter. It can be easily fixed with overriding theemptystyle by:\fancypagestyle{plain}{% \fancyhf{}% \fancyhead[RO,LE]{add your code here} }Give me a sec, and I will try smth with the line
– Michael Fraiman Feb 25 '17 at 20:17empty != plain. – cfr Feb 25 '17 at 20:24\setlength\FHleft{1cm} \setlength\FHright{0cm}. But this doesn't give you an option to make the rules wider than the body depending on the even/odd pages. BUT! You can put it inside the\fancyhead[the page type]command, so the command will be redifined every time you go to the next page. You can set different lengths for even and odd pages. – Michael Fraiman Feb 25 '17 at 20:46fancyhdrprovides specialised commands for this. Better to use those. – cfr Feb 25 '17 at 20:48\hboxcommand and tell it to be\paperwidth, so you will get a box with the width of a paper, so you can do whatever you want in it – Michael Fraiman Feb 25 '17 at 20:49\textwidthis rarely going to be sensible unless you have very wide margins and a very narrow text block. – cfr Feb 26 '17 at 01:53