aboutsummaryrefslogtreecommitdiff
path: root/tex/src/preamble-style.tex
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2020-01-18 04:03:13 +0000
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2020-01-18 04:30:24 +0000
commit5e830f5fb60c4bb186cbd4bd92908e187c037af4 (patch)
treeb727dc5653ec833f93efe29d80e806192563cfbe /tex/src/preamble-style.tex
parent4483a81c4254596dd2fa977e7a2faf6f28a7ac6f (diff)
Raw draft (until now as a separate repository) imported
Until now, I was writing the paper without the template. But we will soon be adding a tutorial to the template, and I thought it will be good to have an example demonstration here too. So I just brought the hole project into the template structure, allowing us to add the template analysis later when its ready, and also allowing us to easily reproduce this paper ofcourse (without having to worry about the host's TeXLive installation.
Diffstat (limited to 'tex/src/preamble-style.tex')
-rw-r--r--tex/src/preamble-style.tex257
1 files changed, 115 insertions, 142 deletions
diff --git a/tex/src/preamble-style.tex b/tex/src/preamble-style.tex
index 95fafc8..e843903 100644
--- a/tex/src/preamble-style.tex
+++ b/tex/src/preamble-style.tex
@@ -1,152 +1,125 @@
-%% General paper's style settings.
-%%
-%% This preamble can be completely ignored when including this TeX file in
-%% another style. This is done because this LaTeX build is meant to be an
-%% initial/internal phase or part of a larger effort, so it has a basic
-%% style defined here as a preamble. To ignore it, uncomment or delete the
-%% respective line in `paper.tex'.
-%%
-%% Copyright (C) 2019-2020 Mohammad Akhlaghi <mohammad@akhlaghi.org>
-%
-%% This template is free software: you can redistribute it and/or modify it
-%% under the terms of the GNU General Public License as published by the
-%% Free Software Foundation, either version 3 of the License, or (at your
-%% option) any later version.
-%
-%% This template is distributed in the hope that it will be useful, but
-%% WITHOUT ANY WARRANTY; without even the implied warranty of
-%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-%% General Public License for more details.
-%
-%% You should have received a copy of the GNU General Public License along
-%% with this template. If not, see <http://www.gnu.org/licenses/>.
-
-
-
-
-
-%% Font.
+%% Set the page margins (use `showframe' to see the sides).
+%% A4 is 210mm x 297mm
+\usepackage[a4paper]{geometry}
+
+%% Horizontal space of text: total is 210mm
+\setlength{\hoffset}{0mm} % remaining: 190mm
+\setlength{\textwidth}{155mm} % remaining: 160mm
+\setlength{\marginparsep}{0pt}
+\setlength{\marginparwidth}{0pt}
+\setlength{\oddsidemargin}{0pt}
+
+%% Vertical space of text: total is 297mm.
+\setlength{\voffset}{-15.4mm} % remaining: 287mm (== 10mm (1 inch + \hoffset).
+\setlength{\topmargin}{0mm} % remaining: 287mm.
+\setlength{\headheight}{10mm} % remaining: 277mm.
+\setlength{\headsep}{10mm} % remaining: 272mm.
+\setlength{\textheight}{245mm} % remaining: 22mm.
+\setlength{\footskip}{7mm} % remaining: 10mm.
+
+%% To see the layout, add a `\layout' right after `\begin{document}'.
+\usepackage{layout}
+
+%% To allow a prefix to the enumeration.
+\usepackage{enumitem}
+
+%% Horizontal line with spacing
+\newcommand{\horizontalline}{\vspace{3mm}\hrule\vspace{3mm}}
+
+%% Custom title format
+\usepackage{setspace}
+\makeatletter
+\renewcommand{\maketitle}{\bgroup\setlength{\parindent}{0pt}
+ \begin{flushleft}
+ {\mpbold RESEARCH PAPER}
+
+ \vspace{3mm}
+ {\LARGE\mpmedium \@title}
+
+ \vspace{2mm}
+ \@author
+ \end{flushleft}\egroup
+ \horizontalline
+}
+\makeatother
+
+%% For authors and affiliations
+\newcommand{\authoraffil}[2]{#1\textsuperscript{\mplight#2}}
+
+%% Spacing before and after section titles.
+%% Format: \titlespacing*{<command>}{<left>}{<before-sep>}{<after-sep>}
+\usepackage{titlesec}
+\titlespacing*{\section}{0pt}{10pt plus 0pt minus 0pt}{0pt plus 0pt minus 0pt}
+\titlespacing*{\subsection}{0pt}{10pt plus 0pt minus 0pt}{0pt plus 0pt minus 0pt}
+\titlespacing*{\subsubsection}{0pt}{10pt plus 0pt minus 0pt}{0pt plus 0pt minus 0pt}
+\titleformat{\section}{\large\scshape\bf}{\thesection.{ }}{0pt}{}
+\titleformat{\subsection}{\bfseries\itshape}{\thesubsection.{ }}{0pt}{}
+\titleformat{\subsubsection}{\bfseries\itshape}{\thesubsubsection.{ }}{0pt}{}
+
+%% Set the font.
+%% After downloading, put the font in `/usr/share/fonts/TTF'.
+%% https://www.fontspace.com/m-fonts/m-2p
+%% Also for M+: https://mplus-fonts.osdn.jp/about-en.html
+%% https://www.fontpalace.com/font-download/Memento/
+\usepackage{fontspec}
\usepackage[T1]{fontenc}
-\usepackage{newtxtext}
-\usepackage{newtxmath}
-
-
-
-
-
-%% Print size
-\usepackage[a4paper, includeheadfoot, body={18.7cm, 24.5cm}]{geometry}
-
-
-
-
-
-%% Set the distance between the columns if two columns:
-\setlength{\columnsep}{0.75cm}
-
-
-
-
-
-% To allow figures to take up more space on the top of the page:
-\renewcommand{\topfraction}{.99}
-\renewcommand{\bottomfraction}{.7}
-\renewcommand{\textfraction}{.05}
-\renewcommand{\floatpagefraction}{.99}
-\renewcommand{\dbltopfraction}{.99}
-\renewcommand{\dblfloatpagefraction}{.99}
-\setcounter{topnumber}{1}
-\setcounter{bottomnumber}{0}
-\setcounter{totalnumber}{2}
-\setcounter{dbltopnumber}{1}
-
-
-
-
-
-%% Color related settings:
-\usepackage{xcolor}
-\color{black} % Text color
-\definecolor{DarkBlue}{RGB}{0,0,90}
-
-
-
-
-
-
-% figure and figure* ordering correction:
-\usepackage{fixltx2e}
-
-
-
-
-
-%% For editing the caption appearence. The `setspace' package defines
-%% the `stretch' variable. `abovecaptionskip' is the distance between
-%% the figure and the caption.
-\usepackage{setspace, caption}
-\captionsetup{font=footnotesize, labelfont={color=DarkBlue,bf}, skip=1pt}
-\captionsetup[figure]{font={stretch=1, small}}
-\setlength{\abovecaptionskip}{3pt plus 1pt minus 1pt}
-\setlength{\belowcaptionskip}{-1.25em}
-
-
-
-
-
-
-%% To make the footnotes align:
-\usepackage[hang]{footmisc}
-\setlength\footnotemargin{10pt}
-
-
-
-
-
-%For including time in the title:
-\usepackage{datetime}
-
-
-
-
-
-%To make links to webpages and include document information in the
-%properties of the PDF
+\usepackage{Alegreya}
+\newfontfamily\mplight{AlegreyaSans-Light}
+\newfontfamily\mpbold{AlegreyaSans-Bold}
+\newfontfamily\mpmedium{AlegreyaSans-Medium}
+\newfontfamily\mpregular{AlegreyaSans-Regular}
+
+%% For highlighting updates. When this is set, text marked as \new
+%% will be colored in dark green and text that is marked wtih \tonote
+%% will be marked in dark red.
+\ifdefined\highlightchanges
+\newcommand{\new}[1]{\textcolor{green!60!black}{#1}}
+\newcommand{\tonote}[1]{\textcolor{red!60!black}{[#1]}}
+\else
+\newcommand{\new}[1]{\textcolor{black}{#1}}
+\newcommand{\tonote}[1]{{}}
+\fi
+
+%% To have links.
\usepackage[
colorlinks,
- urlcolor=blue,
- citecolor=blue,
- linkcolor=blue,
+ urlcolor=gray,
+ citecolor=gray,
+ linkcolor=gray,
linktocpage]{hyperref}
\renewcommand\UrlFont{\rmfamily}
+%% To include figures.
+\usepackage{graphicx}
+%% To manage captions.
+\usepackage[font={footnotesize}]{caption}
+%% To use colors.
+\usepackage{xcolor}
-
-%% Define the abstract environment
-\renewenvironment{abstract}
- {\vspace{-0.5cm}\small%
- \list{}{%
- \setlength{\leftmargin}{2cm}%
- \setlength{\rightmargin}{\leftmargin}%
- }%
- \item\relax}
- {\endlist}
-
-
-
-
-
-%% To keep the main page's code clean.
-\newcommand{\includeabstract}[1]{%
-\twocolumn[%
- \begin{@twocolumnfalse}%
- \maketitle%
- \begin{abstract}%
- #1%
- \end{abstract}%
- \vspace{1cm}%
- \end{@twocolumnfalse}%
- ]%
+%% Header and footer style.
+\usepackage{lastpage}
+\usepackage{fancyhdr}
+\pagestyle{fancy}
+\lhead{\mplight\footnotesize Art.XX, page {\thepage} of \pageref{LastPage}}
+\chead{}
+\rhead{\mplight\footnotesize Akhlaghi et al; Reproducible paper template}
+\lfoot{}
+\cfoot{}
+\rfoot{}
+\renewcommand\headrulewidth{0.0pt}
+\renewcommand\footrulewidth{0.0pt}
+\fancypagestyle{firstpage} {
+ \lhead{\includegraphics[width=3.5cm]{tex/img/codata.png}}
+ \chead{}
+ \rhead{\mplight\footnotesize
+ Akhlaghi, M, et al. 2019. Reproducible paper template\\
+ \emph{Data Science Journal}, VV, NN, pp.1-N,\\
+ DOI: https://doi.org/10.5334/dsj-XXXX-XXX}
+ \lfoot{}
+ \cfoot{}
+ \rfoot{}
+ \renewcommand\headrulewidth{0.1pt}
+ \renewcommand\footrulewidth{0.0pt}
}