From e9e1bb06aa8453680d5fbbaac0fb1c8b1b945b84 Mon Sep 17 00:00:00 2001 From: Arthur Poulet Date: Mon, 27 Feb 2017 22:24:39 +0000 Subject: [PATCH] Improve template (more clean and simple to configure) --- Makefile | 8 +++ README.md | 14 ++++ Logo.jpg => appendices/Logo.jpg | Bin body.tex | 34 ++++------ body/blablabla.tex | 1 + glossary.tex | 1 - header.tex | 14 +++- packages.tex | 89 +++++++++++++++++++++++++ report.bib | 1 - report.tex | 112 ++++---------------------------- titlepage.tex | 32 +++++---- 11 files changed, 171 insertions(+), 135 deletions(-) create mode 100644 README.md rename Logo.jpg => appendices/Logo.jpg (100%) create mode 100644 packages.tex diff --git a/Makefile b/Makefile index 0cb11f4..8254c87 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,12 @@ build: #build_one build_bib build_index build_two bibtex $(NAME).aux makeglossaries $(NAME) makeindex -s $(NAME).ist -t $(NAME).glg -o $(NAME).gls $(NAME).glo + + @echo + @echo + @echo "Glossaries finished. Rebuild latex." + @echo + pdflatex $(NAME).tex pdflatex $(NAME).tex @@ -21,9 +27,11 @@ build_index: makeindex -s $(NAME).ist -t $(NAME).glg -o $(NAME).gls $(NAME).glo clean: + @rm -vf output/* @rm -vf *.log *.out *.aux *.pdf @rm -vf *.bbl *.blg @rm -vf *.gls* *.glo *.glg *.ist *.acn *.acr *.alg @rm -vf *.toc + @rm -vf *.gz *.bak .PHONY: all build build_one clean diff --git a/README.md b/README.md new file mode 100644 index 0000000..b34c0b9 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# My LaTeX Template + +## Usage + +1. Copy the template +2. Change the headers in ``/headers.tex`` +3. Write accronyms in ``/report.tex`` +4. Write your abstract, body, etc. in ``/body.tex`` +5. Write the sources in ``/report.bib`` + +# About + +- Author: Arthur Poulet +- Licence: CC-0 diff --git a/Logo.jpg b/appendices/Logo.jpg similarity index 100% rename from Logo.jpg rename to appendices/Logo.jpg diff --git a/body.tex b/body.tex index 4595217..72ae4be 100644 --- a/body.tex +++ b/body.tex @@ -1,27 +1,19 @@ \begin{abstract} - \input{body/abstract.tex} + This document is about \gls{PCRE} and \gls{NIPS} and \gls{NIDS}... \end{abstract} -\vspace*{2cm} -% \pagebreak -\section{Introduction} -\input{body/introduction.tex} - -\pagebreak -%\vspace*{2cm} +% replace \medskip with \columnbreak before \section if needed -\setlength{\columnsep}{1cm} -\begin{multicols*}{2} - \raggedcolumns - \section{Blablabla} - \subsection{Blablabla} \input{body/blablabla.tex} \columnbreak - \subsection{Blablabla} \input{body/blablabla.tex} \columnbreak +\medskip +\section{Introduction} + \input{body/introduction.tex} - \section{Blablabla} - \subsection{Blablabla} \input{body/blablabla.tex} \columnbreak - \subsection{Blablabla} \input{body/blablabla.tex} \columnbreak -\end{multicols*} +\medskip +\section{First thing} + \subsection{Bla bla bla} + \input{body/blablabla.tex} -\pagebreak -%\vspace*{2cm} -\section{Conclusion} \input{body/conclusion.tex} +\medskip +\section{Conclusion} +\paragraph{} +This document shown that ... diff --git a/body/blablabla.tex b/body/blablabla.tex index e69de29..ccbb18f 100644 --- a/body/blablabla.tex +++ b/body/blablabla.tex @@ -0,0 +1 @@ +Blah blah blah \ No newline at end of file diff --git a/glossary.tex b/glossary.tex index a017c09..02b8f7b 100644 --- a/glossary.tex +++ b/glossary.tex @@ -1,2 +1 @@ \newacronym{NIDS}{NIDS}{Network based Intrusion Detection System} - diff --git a/header.tex b/header.tex index f22cadf..56fe441 100644 --- a/header.tex +++ b/header.tex @@ -1,5 +1,17 @@ -\newcommand{\mytitle}{Snort Intrusion Detection System} +\newcommand{\mytitle}{My LaTeX Template } \newcommand{\myauthor}{Arthur \textsc{Poulet} \\ agp8@kent.ac.uk, 16909734} +\newcommand{\mysypervisor}{Dr. Perez Delgado Carlos} +\newcommand{\myuniversity}{University of Kent} +\newcommand{\mymajorcoursename}{Msc Computer Security} +\newcommand{\myminorcoursename}{CO8XX - LaTex} \title{\mytitle} \author{\myauthor} + +%%%%%%%%%% METADATA %%%%%%%%%% +\loadglsentries[main]{glossary} +\makeglossaries +\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Horizontal rule + +% Configure abstract title +%\renewcommand{\abstractname}{} \ No newline at end of file diff --git a/packages.tex b/packages.tex new file mode 100644 index 0000000..e8ff2e1 --- /dev/null +++ b/packages.tex @@ -0,0 +1,89 @@ +%%%%%% PACKAGES %%%%% +\usepackage[T1]{fontenc} +\usepackage{fourier} +\usepackage[protrusion=true,expansion=true]{microtype} + +%%% Lang / Locale +\usepackage[english]{babel} +\usepackage[utf8]{inputenc} + +%%% Format +\usepackage{multicol} % multi colums +\usepackage[margin=2.6cm]{geometry} % margin +\usepackage{datetime} % dates formatted +\usepackage{abstract} % abstract + +%%% Glossary and references +\usepackage[acronym]{glossaries} % acronyms +\usepackage[hidelinks]{hyperref} % removes ugly colored border arround the links +\usepackage[super]{natbib} % makes the reference as word¹ +%\usepackage[comma]{natbib} % makes the reference as word¹ +\usepackage{natbib} % references +\usepackage{url} % \url + +%%% Code +\usepackage{listings} % embed code +\usepackage{xcolor} % colors with words + +%%% Images +\usepackage{graphicx} +\usepackage{tikz} +\usetikzlibrary{arrows,shapes,decorations.pathmorphing,backgrounds,positioning,fit,petri}\usepackage{caption} +\usepackage{xifthen} +\usepackage{capt-of} + +%%% Math packages +\usepackage{amsmath,amsfonts,amsthm} +\usepackage{graphicx} +\usepackage{url} + +%%% Custom sectioning +\usepackage{sectsty} +\allsectionsfont{\centering \normalfont\scshape} + +%%% Custom headers/footers (fancyhdr package) +\usepackage{lastpage} +\usepackage{fancyhdr} +\pagestyle{fancyplain} +\fancyhead{} % No page header +\fancyfoot[L]{} % Empty +\fancyfoot[C]{} % Empty +\fancyfoot[R]{\thepage\space of \pageref{LastPage}} % Pagenumbering +\renewcommand{\headrulewidth}{0pt} % Remove header underlines +\renewcommand{\footrulewidth}{0pt} % Remove footer underlines +\setlength{\headheight}{13.6pt} + + +%%% Equation and float numbering +\numberwithin{equation}{section} % Equation numbering: section.eq# +\numberwithin{figure}{section} % Figure numbering: section.fig# +\numberwithin{table}{section} % Table numbering: section.tab# + +%%% CONFIGURATION +% Configure code embed +\hypersetup{pdfborder={0 0 0}} +\lstdefinestyle{colored}{ +belowcaptionskip=1\baselineskip, +breaklines=true, +frame=L, +xleftmargin=\parindent, +language=Ruby, +showstringspaces=false, +basicstyle=\footnotesize\ttfamily, +numberstyle=\color{red}, +keywordstyle=\color{green}, +commentstyle=\itshape\color{purple}, +identifierstyle=\color{blue}, +stringstyle=\color{orange}, +} +\lstset{escapechar=@,style=colored} + +% ... +\usepackage{setspace} + +%%% NEW Commands +\newcommand{\inlinecode}{\texttt} +%\newcommand{\italic}[1]{{\em #1}} +%\newcommand{\italicpl}[1]{{\em #1}{\em s}} + +%\setcitestyle{authoryear,open={(},close={)}} diff --git a/report.bib b/report.bib index eb097a9..ce60a86 100644 --- a/report.bib +++ b/report.bib @@ -4,4 +4,3 @@ title = "RP Photonics Encyclopedia, Fibers", author = "Dr. Rüdiger Paschotta", year = 2006, } - diff --git a/report.tex b/report.tex index fb18907..230e33c 100644 --- a/report.tex +++ b/report.tex @@ -1,107 +1,16 @@ \documentclass[paper=a4, fontsize=11pt]{scrartcl} -%%%%%% PACKAGES %%%%% -\usepackage[T1]{fontenc} -\usepackage{fourier} -\usepackage[protrusion=true,expansion=true]{microtype} - -%%% Lang / Locale -\usepackage[english]{babel} -\usepackage[utf8]{inputenc} - -%%% Format -\usepackage{multicol} % multi colums -\usepackage[margin=2.6cm]{geometry} % margin -\usepackage{datetime} % dates formatted -\usepackage{abstract} % abstract - -%%% Glossary and references -\usepackage[acronym]{glossaries} % acronyms -\usepackage[hidelinks]{hyperref} % removes ugly colored border arround the links -\usepackage[super]{natbib} % makes the reference as word¹ -\usepackage{natbib} % references -\usepackage{url} % \url - -%%% Code -\usepackage{listings} % embed code -\usepackage{xcolor} % colors with words - -%%% Images -\usepackage{graphicx} -\usepackage{tikz} -\usetikzlibrary{arrows,shapes,decorations.pathmorphing,backgrounds,positioning,fit,petri}\usepackage{caption} -\usepackage{xifthen} -\usepackage{capt-of} - -%%% Math packages -\usepackage{amsmath,amsfonts,amsthm} -\usepackage{graphicx} -\usepackage{url} - -%%% Custom sectioning -\usepackage{sectsty} -\allsectionsfont{\centering \normalfont\scshape} - -%%% Custom headers/footers (fancyhdr package) -\usepackage{lastpage} -\usepackage{fancyhdr} -\pagestyle{fancyplain} -\fancyhead{} % No page header -\fancyfoot[L]{} % Empty -\fancyfoot[C]{} % Empty -\fancyfoot[R]{\thepage\space of \pageref{LastPage}} % Pagenumbering -\renewcommand{\headrulewidth}{0pt} % Remove header underlines -\renewcommand{\footrulewidth}{0pt} % Remove footer underlines -\setlength{\headheight}{13.6pt} - -%%% Equation and float numbering -\numberwithin{equation}{section} % Equationnumbering: section.eq# -\numberwithin{figure}{section} % Figurenumbering: section.fig# -\numberwithin{table}{section} % Tablenumbering: section.tab# - -%%% CONFIGURATION -% Configure code embed -\hypersetup{pdfborder={0 0 0}} -\lstdefinestyle{colored}{ -belowcaptionskip=1\baselineskip, -breaklines=true, -frame=L, -xleftmargin=\parindent, -language=Ruby, -showstringspaces=false, -basicstyle=\footnotesize\ttfamily, -numberstyle=\color{red}, -keywordstyle=\color{green}, -commentstyle=\itshape\color{purple}, -identifierstyle=\color{blue}, -stringstyle=\color{orange}, -} -\lstset{escapechar=@,style=colored} - -% Configure abstract title -%\renewcommand{\abstractname}{} - -% ... -\usepackage{setspace} - -% METADATA +\input{packages.tex} \input{header.tex} -\loadglsentries[main]{glossary} -\makeglossaries -\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Horizontal rule - -%%% NEW Commands -\newcommand{\inlinecode}{\texttt} -\newcommand{\italic}[1]{{\em #1}} -\newcommand{\italicpl}[1]{{\em #1}{\em s}} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DOCUMENT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DOCUMENT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} -%\input{glossary.tex} +\newacronym{NIDS}{NIDS}{Network based Intrusion Detection System} +\newacronym{NIPS}{NIPS}{Network based Intrusion Prevention System} +\newacronym{PCRE}{PCRE}{Perl Compatible Regular Expressions} \input{titlepage.tex} \newpage @@ -112,7 +21,11 @@ stringstyle=\color{orange}, \newpage { \onehalfspacing - \input{body.tex} + \setlength{\columnsep}{1cm} + \begin{multicols*}{2} + \raggedcolumns + \input{body.tex} + \end{multicols*} } \newpage @@ -120,7 +33,6 @@ stringstyle=\color{orange}, \bibliographystyle{agsm} \bibliography{report} -\newpage \medskip \printglossaries diff --git a/titlepage.tex b/titlepage.tex index b2a1eb1..f03b808 100644 --- a/titlepage.tex +++ b/titlepage.tex @@ -1,18 +1,26 @@ \begin{titlepage} \vspace*{2cm} - \newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % Defines a new command for the horizontal lines, change thickness here + % Defines a new command for the horizontal lines, change thickness here + \newcommand{\HRule}{\rule{\linewidth}{0.5mm}} - \center % Center everything on the page + \center % ---------------------------------------------------------------------------------------- % HEADING SECTIONS % ---------------------------------------------------------------------------------------- - % \textsc{\LARGE University of Kent}\\[1.5cm] % Name of your university/college - \includegraphics[width=4cm]{Logo}\\[1cm] % Include a department/university logo - this will - \textsc{\Large Msc Computer Security}\\[0.5cm] % Major heading such as course name - \textsc{\large CO876 - Network Security}\\[0.5cm] % Minor heading such as course title + % Name of your university/college + \textsc{\LARGE \myuniversity}\\[1.5cm] + + % Include a department/university logo + %\includegraphics[width=4cm]{appendices/Logo}\\[1cm] + + % Major heading such as course name + \textsc{\Large \mymajorcoursename}\\[0.5cm] + + % Minor heading such as course title + \textsc{\large \myminorcoursename}\\[0.5cm] % ---------------------------------------------------------------------------------------- % TITLE SECTION @@ -29,7 +37,7 @@ % \begin{minipage}{0.4\textwidth} % \begin{flushleft} \large % \emph{Author:}\\ - % Arthur \textsc{Poulet}\\ % Your name + % \myauthor\\ % Your name % agp8, 16909734 % \end{flushleft} % \end{minipage} @@ -37,25 +45,27 @@ % \begin{minipage}{0.4\textwidth} % \begin{flushright} \large % \emph{Supervisor:} \\ - % Dr. P. \textsc{Kenny} % Supervisor's Name + % \mysupervisor % Supervisor's Name % \end{flushright} % \end{minipage}\\[4cm] % If you don't want a supervisor, uncomment the two lines below and remove the section above \Large \emph{Author:}\\ - \myauthor \\[3cm] % Your name + \myauthor \\[3cm] % ---------------------------------------------------------------------------------------- % DATE SECTION % ---------------------------------------------------------------------------------------- - {\large \today}\\[3cm] % Date, change the \today to a set date if you want to be precise + % Date, change the \today to a set date if you want to be precise + {\large \today}\\[3cm] % ---------------------------------------------------------------------------------------- % LOGO SECTION % ---------------------------------------------------------------------------------------- - % \includegraphics[width=4cm]{Logo}\\[1cm] % Include a department/university logo - this will require the graphicx package + % Include a department/university logo + \includegraphics[width=4cm]{appendices/Logo}\\[1cm] % ----------------------------------------------------------------------------------------