summaryrefslogtreecommitdiffstats
path: root/tools/macros.tex
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2017-01-24 11:57:45 +0100
committerNao Pross <naopross@thearcway.org>2017-01-24 11:57:45 +0100
commitc4b6883fd42665f1796f6b94cda40202ceaaca7b (patch)
treed452fb776d5a79eb1b5e6434d7ca8eb4dbfd64ad /tools/macros.tex
parentcleaned up structure and finished renewables production (diff)
downloadPDI-c4b6883fd42665f1796f6b94cda40202ceaaca7b.tar.gz
PDI-c4b6883fd42665f1796f6b94cda40202ceaaca7b.zip
work done at school
Diffstat (limited to 'tools/macros.tex')
-rwxr-xr-xtools/macros.tex86
1 files changed, 86 insertions, 0 deletions
diff --git a/tools/macros.tex b/tools/macros.tex
new file mode 100755
index 0000000..a79e8f0
--- /dev/null
+++ b/tools/macros.tex
@@ -0,0 +1,86 @@
+%% LaTeX macros
+\usepackage{relsize}
+\usepackage[dvipsnames]{xcolor}
+
+% Define underscore to be a regular character in text mode
+\begingroup
+ \catcode`\_=\active
+ \gdef_#1{\ensuremath{\sb{#1}}}
+\endgroup
+\mathcode`\_=\string"8000
+\catcode`\_=12
+
+% Set version number
+\newcommand\version{$3.0$}
+
+\newcommand\copyrightfootnote{
+\footnotetext{Copyright (2008-2013) of Einar Andreas R{\o}dland, distributed
+under the \LaTeX{} Project Public License (LPPL).}
+}
+
+%TC:macroword \TeXcount 1
+\newcommand\TeXcount{{\TeX}count}
+
+% Text formats
+\newcommand\codestyle[1]{\textsf{\color{Blue}#1}}
+\newcommand\code[1]{{\smaller\codestyle{#1}}}
+\newcommand\bigcode[1]{\codestyle{#1}}
+\newcommand\codeline[1]{\begin{quote}\code{#1}\end{quote}}
+\newcommand\bs[1]{\textbackslash#1}
+\newcommand\URL[1]{\textsf{\small #1}}
+
+% Description items: options, parameters, optional parameters
+% These are also interpreted by dos2html.pl
+\def\option[#1]{\item[\bigcode{#1}]\hskip 0pt plus 10pt}
+\def\parm#1{\textit{\color{OliveGreen}#1}}
+\def\opt#1{\parm{[#1]}}
+\def\alt#1{[#1]}
+\def\optiontext#1{\textrm{\bfseries\color{black}#1}}
+
+% Mark off notification in contents for good visibility
+\newcommand\ContentsNote[1]{\addtocontents{toc}{\string\marginpar{\textsf{\color{red}\tiny #1}}}}
+
+% Notabene: margin note
+%TC:macro NB 1
+\newcommand\NB[1]{\ContentsNote{NB}\marginpar{\textsf{\tiny#1}}}
+
+% Mark text as a notification
+%TC:macro NOTE [text]
+\newcommand\NOTE[1]{\textit{\color{red}#1}}
+
+% Mark text for update
+%TC:macro UPDATE [text]
+\newcommand\UPDATE[1]{\ContentsNote{UPDATE}\textit{\textbf{\color{red}This needs to be updated:} {\color{blue}#1}}}
+
+% Mark text as a notification
+%TC:macro TODO [text]
+\newcommand\TODO[1]{\ContentsNote{TODO}\textit{\textbf{\color{red}#1}}}
+
+% BUG
+%TC:macro BUG [text]
+\newcommand\BUG[1]{{\color{red}#1}}
+
+\makeatletter
+
+\renewcommand\@maketitle{%
+\newpage\null\vskip 2em%
+\begin{center}%
+\let\footnote\thanks
+{\LARGE \@title \par}%
+\end{center}%
+\par
+\vskip 1.5em
+}
+
+\renewcommand\abstractname{Abstract}
+\renewenvironment{abstract}{%
+ \begin{center}%
+ {\slshape\bfseries\large\abstractname\vspace{-.5em}\vspace{\z@}}%
+ \end{center}%
+ \vskip 4pt
+ \slshape
+}{
+\vskip 0.5em
+}
+
+\makeatother