Commit 61302ef2 authored by Benoit Rat's avatar Benoit Rat

doc: fixing bugs (longtable), and improve colors, templates, etc..

doc: pandoc: by default figure "fit here if possible" (H)
doc: new line after paragraph (4th level of markdown title)
doc: change link color so that link color is more highlighted
doc: improve color scheme with hostname
doc: add alternate color for longtable in pandoc.latex
doc: fix a bug with longtable when using pandoc 1.12.2.1
parent 34fe006e
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Pandoc Template used by Seven Solution to generate pdf from markdown
%% files.
%%
%% Authors:
%% - Benoit Rat (Seven Solutions, www.sevensols.com)
%%
%% GNU Lesser General Public License Usage
%% This file may be used under the terms of the GNU Lesser
%% General Public License version 2.1 as published by the Free Software
%% Foundation and appearing in the file LICENSE.LGPL included in the
%% packaging of this file. Please review the following information to
%% ensure the GNU Lesser General Public License version 2.1 requirements
%% will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper,oneside,$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$]{$documentclass$}
\usepackage{amssymb,amsmath}
\usepackage[left=2.2cm,right=2.2cm,top=3cm,bottom=3cm]{geometry}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Xetex.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{ifxetex,ifluatex}
\ifxetex
\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\else
\ifluatex
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\else
\usepackage[utf8]{inputenc}
\fi
\fi
\ifxetex
\usepackage[setpagesize=false, % page size defined by xetex
unicode=false, % unicode breaks when used with xetex
xetex,
colorlinks=true,
urlcolor=blue,
anchorcolor=blue,
linkcolor=blue]{hyperref}
\else
\usepackage[unicode=true,
colorlinks=true,
linkcolor=blue]{hyperref}
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Generic
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$if(url)$
\usepackage{url}
$endif$
\usepackage{calc}
\hypersetup{breaklinks=true, pdfborder={0 0 0}}
\usepackage{pbox}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Environment for code formatting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Define the background (shade) color
\usepackage{color}
\definecolor{shadecolor}{RGB}{$bg-color$}
\definecolor{darkgreen}{RGB}{0,125,0}
\definecolor{darkred}{RGB}{170,0,0}
\definecolor{turquoise}{RGB}{20,100,100}
$if(listings)$
\usepackage{fancyvrb, listings, color}
\lstset{%
basicstyle=\small\ttfamily,
breaklines=true,
fancyvrb=true,
tabsize=2,
columns=fullflexible,
keywordstyle=\color{blue}\textbf,
identifierstyle=,
commentstyle=\color{darkgreen}\textit,
stringstyle=\color{red},
backgroundcolor=\color{shadecolor},
}
\lstdefinelanguage{sh}
{
sensitive=true,
keywords={sudo},
alsoletter={\#,:,>},%
emph={>:\# ,>:$$},
moreemph={wrc\# ,wrc1\# ,wrc2\# , >spusa:\# ,>tornado:\# },
emphstyle=\color{darkred},
comment=[l]{\#\#},%
morestring=[s]{\{}{\}},
keywordstyle=\color{blue}\textbf,
commentstyle=\color{darkgreen}\textit,
stringstyle=\color{turquoise},
backgroundcolor=\color{shadecolor},
}
$endif$
$if(lhs)$
\lstnewenvironment{code}
{}
{}
$endif$
$if(bg-color)$
% redefine env verbatim to be used to hold the code of any language.
\usepackage{framed}
\let\oldverbatim=\verbatim
\renewenvironment{verbatim}
{
\begin{snugshade}
\begin{oldverbatim}
}
{
\end{oldverbatim}
\end{snugshade}
}
% Redefined \textttt to add it background color
\usepackage{soul, color, url}
\sethlcolor{shadecolor}
\let\OldTexttt\texttt
\renewcommand{\texttt}[1]{\OldTexttt{\hl{#1}}}
% Add highlighting environment (when background color)
$if(highlighting-macros)$
$highlighting-macros$
\renewenvironment{Shaded}{
\begingroup
\fontsize{10pt}{12pt}\selectfont
\begin{snugshade}
}
{
\end{snugshade}
\endgroup
}
$endif$
$else$
$if(highlighting-macros)$
% Add highlighting environment (without background color)
$highlighting-macros$
$endif$
$endif$
\usepackage{alltt}
\let\oldquote=\quote
\renewenvironment{quote}
{
\begingroup
\sffamily %sans-serif font
\slshape %slated (almost italic)
\fontsize{10pt}{12pt}\selectfont
}
{
\endgroup
}
$if(verbatim-in-note)$
%\usepackage{fancyvrb}
$endif$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Graphics & Tables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{float} % provides the H option for float placement
%% Tables
$if(tables)$
\usepackage{ctable}
$endif$
%% Images
\usepackage{graphicx}
% We will generate all images so they have a width \maxwidth. This means
% that they will get their normal width if they fit onto the page, but
% are scaled down if they would overflow the margins.
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth
\else\Gin@nat@width\fi}
\makeatother
\makeatletter
\def\maxheight{\ifdim\Gin@nat@height>10cm10cm
\else\Gin@nat@height\fi}
\makeatother
\let\Oldincludegraphics\includegraphics
\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth, height=\maxheight, keepaspectratio]{#1}}
$if(subscript)$
\newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}
$endif$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Lang (TODO: clean this, without breaking)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$if(lang)$
\ifxetex
\usepackage{polyglossia}
\newcommand{\euro}{€}
\setmainlanguage{$lang$}
\else
\usepackage{babel}
\usepackage{eurosym}
\fi
$endif$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% List
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\usepackage{enumitem}
$if(fancy-enums)$
% Redefine labelwidth for lists; otherwise, the enumerate package will
% cause markers to extend beyond the left margin.
\makeatletter\AtBeginDocument{%
\renewcommand{\@listi}
{
\setlength{\labelwidth}{4em}
\leftmargin=25pt
\rightmargin=0pt
\labelsep=7pt
\labelwidth=20pt
\itemindent=0pt
\listparindent=0pt
\topsep=2pt plus 2pt minus 2pt
\partopsep=0pt plus 1pt minus 10pt
\parsep=2pt plus 1pt
\itemsep=\parsep
}
}\makeatother
\usepackage{enumerate}
$endif$
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
\setlength{\emergencystretch}{3em} % prevent overfull lines
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Chapters & Section
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% chapters
\usepackage{titlesec}
\titleformat{\chapter}[block]
{\normalfont\HUGE\bfseries}{\LARGE\thechapter.}{1ex}{}
\titlespacing*{\chapter}{0pt}{-19pt}{0pt}
% Sections
$if(numbersections)$
\setcounter{secnumdepth}{2}
$else$
\setcounter{secnumdepth}{0}
$endif$
\let\oldsection\section
\renewcommand{\section}{\clearpage\oldsection}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Footer & Header
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$if(verbatim-in-note)$
% allows verbatim text in footnotes
$endif$
\usepackage{fancyhdr}
\fancyhf{}
\fancyhead[R]{\nouppercase{\leftmark}}
\fancyfoot[L]{ www.sevensols.com/whiterabbitsolution}% empty left
\fancyfoot[L]{\raisebox{-25pt}{\includegraphics{logo.png}}}
\fancyfoot[C]{\raisebox{-15pt}{\small \url{www.sevensols.com/whiterabbitsolution}}}
\fancyfoot[R]{\raisebox{-15pt}{\thepage}}
\pagestyle{fancy} % Sets fancy header and footer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Bibliography
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$if(natbib)$
\usepackage{natbib}
\bibliographystyle{plainnat}
$endif$
$if(biblatex)$
\usepackage{biblatex}
$if(biblio-files)$
\bibliography{$biblio-files$}
$endif$
$endif$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Title page (like texinfo)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$if(title)$
\title{$title$}
$endif$
$if(author)$
\author{$for(author)$$author$$sep$ \and $endfor$}
$endif$
$if(date)$
\date{$date$}
$endif$
\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1pt\hfill \kern \z@}
\renewcommand{\maketitle}{\begin{titlepage}%
\let\footnotesize\small
\let\footnoterule\relax
\parindent \z@
\reset@font
\null\vfil
\begin{flushleft}
\Huge \textbf{\@title}
\end{flushleft}
\par
\hrule height 4pt
\par
\begin{flushright}
\large \@date \par
\end{flushright}
\vskip 500\p@
\vfil\null
\begin{flushleft}
\Large \textbf{\@author}
\end{flushleft}
\hrule height 2pt
\end{titlepage}%
\setcounter{footnote}{0}%
}
\makeatother
%======================================================================%
%======================================================================%
\begin{document}
$if(title)$
\maketitle
$endif$
$for(include-before)$
$include-before$
$endfor$
$if(toc)$
\setcounter{tocdepth}{2}
\tableofcontents
\clearpage
$endif$
$body$
$if(natbib)$
$if(biblio-files)$
$if(biblio-title)$
$if(book-class)$
\renewcommand\bibname{$biblio-title$}
$else$
\renewcommand\refname{$biblio-title$}
$endif$
$endif$
\bibliography{$biblio-files$}
$endif$
$endif$
$if(biblatex)$
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
$endif$
$for(include-after)$
$include-after$
$endfor$
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Pandoc Template used by Seven Solution to generate pdf from markdown
%% files.
%%
%% Authors:
%% - Benoit Rat (Seven Solutions, www.sevensols.com)
%%
%% GNU Lesser General Public License Usage
%% This file may be used under the terms of the GNU Lesser
%% General Public License version 2.1 as published by the Free Software
%% Foundation and appearing in the file LICENSE.LGPL included in the
%% packaging of this file. Please review the following information to
%% ensure the GNU Lesser General Public License version 2.1 requirements
%% will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper,oneside,table,$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$]{$documentclass$}
\usepackage{amssymb,amsmath}
\usepackage[left=2.2cm,right=2.2cm,top=2cm,bottom=2cm]{geometry}
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Xetex.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{ifxetex,ifluatex}
\ifxetex
\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\else
\ifluatex
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\else
\usepackage[utf8]{inputenc}
\fi
\fi
\ifxetex
\usepackage[setpagesize=false, % page size defined by xetex
unicode=false, % unicode breaks when used with xetex
xetex,
colorlinks=true,
urlcolor=darksevenblue,
anchorcolor=darksevenblue,
linkcolor=darksevenblue]{hyperref}
\else
\usepackage[unicode=true,
colorlinks=true,
linkcolor=darksevenblue]{hyperref}
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Generic
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$if(url)$
\usepackage{url}
$endif$
\usepackage{calc}
\hypersetup{breaklinks=true, pdfborder={0 0 0}}
\usepackage{pbox}
\usepackage{wallpaper}
%% Define common color
\usepackage{color}
\definecolor{darksevenblue}{RGB}{10,100,130}
\definecolor{sevensolsblue}{RGB}{15,130,175}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Environment for code formatting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Define the background (shade) color
\usepackage{color}
\definecolor{darkblue}{RGB}{8,40,80}
\definecolor{shadecolor}{RGB}{$bg-color$}
\definecolor{darkgreen}{RGB}{0,125,0}
\definecolor{darkred}{RGB}{170,0,0}
\definecolor{turquoise}{RGB}{20,100,100}
$if(listings)$
\usepackage{fancyvrb, listings, color}
\lstset{%
basicstyle=\small\ttfamily,
breaklines=true,
fancyvrb=true,
tabsize=2,
columns=fullflexible,
keywordstyle=\color{blue}\textbf,
identifierstyle=,
commentstyle=\color{darkgreen}\textit,
stringstyle=\color{red},
backgroundcolor=\color{shadecolor},
}
\lstdefinelanguage{sh}
{
sensitive=true,
keywords={sudo},
alsoletter={\#,:,>},%
emph={>:\# ,>:$$},
moreemph={wrc\# ,wrc1\# ,wrc2\# ,root@wrztp,\/\#},
emphstyle=\color{darkred},
comment=[l]{\#\#},%
morestring=[s]{\{}{\}},
keywordstyle=\color{blue}\textbf,
commentstyle=\color{darkgreen}\textit,
stringstyle=\color{turquoise},
backgroundcolor=\color{shadecolor},
}
$endif$
$if(lhs)$
\lstnewenvironment{code}
{}
{}
$endif$
$if(bg-color)$
% redefine env verbatim to be used to hold the code of any language.
\usepackage{framed}
\let\oldverbatim=\verbatim
\renewenvironment{verbatim}
{
\begin{snugshade}
\begin{oldverbatim}
}
{
\end{oldverbatim}
\end{snugshade}
}
% Redefined \textttt to add it background color
\usepackage{soul, color, url}
\sethlcolor{shadecolor}
\let\OldTexttt\texttt
\renewcommand{\texttt}[1]{\OldTexttt{\hl{#1}}}
% Add highlighting environment (when background color)
$if(highlighting-macros)$
$highlighting-macros$
\renewenvironment{Shaded}{
\begingroup
\fontsize{10pt}{12pt}\selectfont
\begin{snugshade}
}
{
\end{snugshade}
\endgroup
}
$endif$
$else$
$if(highlighting-macros)$
% Add highlighting environment (without background color)
$highlighting-macros$
$endif$
$endif$
\usepackage{alltt}
\let\oldquote=\quote
\renewenvironment{quote}
{
\begingroup
\sffamily %sans-serif font
\slshape %slated (almost italic)
\fontsize{10pt}{12pt}\selectfont
}
{
\endgroup
}
$if(verbatim-in-note)$
%\usepackage{fancyvrb}
$endif$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Graphics & Tables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{float} % provides the H option for float placement
\floatplacement{figure}{H}
%% Tables
$if(tables)$
\usepackage{ctable}
\usepackage{longtable}
% alternate rowcolors for all long-tables
\let\oldlongtable\longtable
\let\endoldlongtable\endlongtable
\renewenvironment{longtable}{\rowcolors{2}{white}{shadecolor}\small\oldlongtable}{\endoldlongtable\normalsize}
% Change style for first row
\let\oldtoprule\toprule
\renewcommand{\toprule}{\oldtoprule\rowcolor{white}}
$endif$
%% Images
\usepackage{caption,subcaption}
% Redefine \includegraphics so that, unless explicit options are
% given, the image width will not exceed the width or the height of the page.
% Images get their normal width if they fit onto the page, but
% are scaled down if they would overflow the margins.
\makeatletter
\def\ScaleWidthIfNeeded{%
\ifdim\Gin@nat@width>\linewidth
0.8\linewidth
\else
\Gin@nat@width
\fi
}
\def\ScaleHeightIfNeeded{%
\ifdim\Gin@nat@height>0.9\textheight
0.7\textheight
\else
\Gin@nat@width
\fi
}
\makeatother
\setkeys{Gin}{width=\ScaleWidthIfNeeded,height=\ScaleHeightIfNeeded,keepaspectratio}
$if(subscript)$
\newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}
$endif$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Lang (TODO: clean this, without breaking)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$if(lang)$
\ifxetex
\usepackage{polyglossia}
\newcommand{\euro}{€}
\setmainlanguage{$lang$}
\else
\usepackage{babel}
\usepackage{eurosym}
\fi
$endif$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% List
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\usepackage{enumitem}
$if(fancy-enums)$
% Redefine labelwidth for lists; otherwise, the enumerate package will
% cause markers to extend beyond the left margin.
\makeatletter\AtBeginDocument{%
\renewcommand{\@listi}
{
\setlength{\labelwidth}{4em}
\leftmargin=25pt
\rightmargin=0pt
\labelsep=7pt
\labelwidth=20pt
\itemindent=0pt
\listparindent=0pt
\topsep=2pt plus 2pt minus 2pt
\partopsep=0pt plus 1pt minus 10pt
\parsep=1pt plus 1pt
\itemsep=\parsep
}
}\makeatother
\usepackage{enumerate}
$endif$
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
\setlength{\emergencystretch}{3em} % prevent overfull lines
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Chapters & Section
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Use by with \autoref
\AtBeginDocument{%
\renewcommand{\chapterautorefname}{Chapter\negthinspace}
\renewcommand{\sectionautorefname}{\S\negthinspace}
\renewcommand{\subsectionautorefname}{\S\negthinspace}
\renewcommand{\subsubsectionautorefname}{\S\negthinspace}
\renewcommand{\figureautorefname}{Fig.\negthinspace}
\renewcommand{\subfigureautorefname}{Fig.\negthinspace}
\renewcommand{\tableautorefname}{Tab.\negthinspace}
}
% chapters
\usepackage{titlesec}
\titleformat{\chapter}[block]
{\normalfont\HUGE\bfseries}{\LARGE\thechapter.}{1ex}{}
\titlespacing*{\chapter}{0pt}{-19pt}{0pt}
% Sections
$if(numbersections)$
$else$
\newpage
\setcounter{secnumdepth}{0}
$endif$
\usepackage{titlesec}
\newcommand{\sectionbreak}{\clearpage}
\let\oldthesection=\thesection
%% Paragraph (adding new line)
\titleformat{\paragraph}[hang]{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}{0pt}{3.25ex plus 1ex minus .2ex}{0.5em}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Footer & Header
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$if(verbatim-in-note)$
% allows verbatim text in footnotes
$endif$
$if(weburl)$
\newcommand{\weburl}{\url{$weburl$}}
$else$
\newcommand{\weburl}{\url{www.sevensols.com}}
$endif$
\usepackage{fancyhdr}
\fancyhf{}
%% Header
\fancyhead[L]{\raisebox{0pt}{\includegraphics[height=7mm]{logo.png}}}
\fancyhead[R]{\small \nouppercase{\leftmark}}
\renewcommand{\headrulewidth}{1pt}
%% Footer
\renewcommand{\footrulewidth}{1pt}
\fancyfoot[L]{{\scriptsize \bfseries $title$ - $title-prefix$} \\ \raisebox{5pt}{\tiny $date$}}
\fancyfoot[C]{\raisebox{0pt}{\small \weburl }}
\fancyfoot[R]{\raisebox{0pt}{\scriptsize \thepage}}
\usepackage{etoolbox}
\makeatletter
%\patchcmd{\@fancyhead}{\rlap}{\color{sevensolsblue}\rlap}{}{} %%text
%\patchcmd{\@fancyfoot}{\rlap}{\color{sevensolsblue}\rlap}{}{} %%text
\patchcmd{\headrule}{\hrule}{\color{sevensolsblue}\hrule}{}{} %%line
\patchcmd{\footrule}{\hrule}{\color{sevensolsblue}\hrule}{}{} %%line
\makeatother
\pagestyle{fancy} % Sets fancy header and footer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Bibliography
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$if(natbib)$
\usepackage{natbib}
\bibliographystyle{plainnat}
$endif$
$if(biblatex)$
\usepackage{biblatex}
$if(biblio-files)$
\bibliography{$biblio-files$}
$endif$
$endif$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Title page (like texinfo)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareFixedFont{\bigsf}{T1}{phv}{b}{n}{1.5cm}
$if(title)$
\title{$if(title-prefix)$\huge{$title-prefix$}\\\vspace{5mm}$endif${\bigsf $title$}}
$endif$
$if(author)$
\author{$for(author)$$author$$sep$, $endfor$}
$endif$
$if(date)$
$if(version)$
\date{v$version$: $date$}
$else$
\date{$date$}
$endif$
$endif$
\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1pt\hfill \kern \z@}
\renewcommand{\maketitle}{\begin{titlepage}%
$if(imgcover)$
\ThisLRCornerWallPaper{1}{$imgcover$}
$endif$
\vspace{5mm}
\begin{minipage}{\textwidth}
\vspace{4.5cm}
\begin{flushright}
\fontsize{10pt}{8pt}\selectfont
{\@date}
\end{flushright}
\end{minipage}
\begin{minipage}{\textwidth}
\vspace{5.8cm}
\noindent
\begin{center}
\textsc{\textbf{\@title}}
\end{center}
\vspace{7cm}
\begin{flushleft}
{\Large \textbf{\@author}}\\
\vspace{2cm}
{\large \OldTexttt{Seven Solutions S.L}}\\
{\url{www.sevensols.com}}
\end{flushleft}
\end{minipage}
\end{titlepage}%
\setcounter{footnote}{0}%
}
\makeatother
%======================================================================%
%======================================================================%
\begin{document}
\renewcommand{\familydefault}{\sfdefault}
$if(title)$
\maketitle
$endif$
$for(include-before)$
$include-before$
$endfor$
$if(toc)$
\setcounter{tocdepth}{2}
\tableofcontents
\clearpage
$endif$
$body$
$if(natbib)$
$if(biblio-files)$
$if(biblio-title)$
$if(book-class)$
\renewcommand\bibname{$biblio-title$}
$else$
\renewcommand\refname{$biblio-title$}
$endif$
$endif$
\bibliography{$biblio-files$}
$endif$
$endif$
$if(biblatex)$
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
$endif$
$for(include-after)$
$include-after$
$endfor$
\end{document}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment