Skip to content

Commit

Permalink
Feat: add template folder for LaTeX project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaiconstantin committed May 10, 2023
0 parents commit e15cd31
Show file tree
Hide file tree
Showing 14 changed files with 467 additions and 0 deletions.
19 changes: 19 additions & 0 deletions template/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Ignore `build` contents.
/build/**/*
!/build/.gitkeep

# Ignore `archive` contents.
/archive/**/*
!/archive/.gitkeep

# Miscellaneous.
.DS_Store

# Ignore notes.
notes.md

# Ignore temporary files.
**/tmp*

# Ignore editor files.
.vscode
27 changes: 27 additions & 0 deletions template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<h1 align="center">
Paper Title
</h1>

## Description

**Abstract:** This repository contains the manuscript files and the simulation
scripts for the project *Title*.

**Authors:** First M. Last

**Keywords:**

## Commit Convention

The commit convention below is inspired by the [`Angular`
convention](https://www.conventionalcommits.org/en/v1.0.0-beta.4/):

- `Build`: changes related to the build process (e.g., `LaTeX` preamble,
`.gitignore` etc.)
- `Cite`: changes to the citations and references list
- `Write`: additions and updates to the manuscript content
- `Code`: changes to the scripts for the manuscript (e.g., simulation scripts)
- `Spell`: changes due to spell-checking (incl. fixing typos)
- `Style`: changing related to line wrapping and white space
- `Fix`: fixes due to what can be considered an error
- `Jou`: additions and updates to journal files
Empty file added template/archive/.gitkeep
Empty file.
Empty file added template/build/.gitkeep
Empty file.
Empty file added template/graphics/.gitkeep
Empty file.
13 changes: 13 additions & 0 deletions template/library.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@book{hastieElementsStatisticalLearning2009,
title = {The {{Elements}} of {{Statistical Learning}}},
author = {Hastie, Trevor and Tibshirani, Robert and Friedman, Jerome},
date = {2009},
series = {Springer {{Series}} in {{Statistics}}},
publisher = {{Springer New York}},
location = {{New York, NY}},
doi = {10.1007/978-0-387-84858-7},
url = {http://link.springer.com/10.1007/978-0-387-84858-7},
urldate = {2022-05-13},
isbn = {978-0-387-84857-0 978-0-387-84858-7},
file = {Hastie et al. - 2009 - The Elements of Statistical Learning Data Mining,.pdf}
}
117 changes: 117 additions & 0 deletions template/manuscript.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{
"settings": {
"editor.rulers": [
{ "column": 80, "color": "#64646449" },
],
"editor.lineHeight": 33,
"workbench.colorTheme": "Default Dark+",
"cSpell.checkLimit": 1000,
"rewrap.autoWrap.enabled": false,
"latex-workshop.latex.autoBuild.run": "never",
"latex-workshop.latex.autoBuild.interval": 1000,
"latex-workshop.latex.outDir": "%WORKSPACE_FOLDER%/build",
"latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.view.pdf.tab.editorGroup": "current",
// "latex-workshop.view.pdf.scrollMode": 1,
// "latex-workshop.view.pdf.invert": 0.875,
// "latex-workshop.view.pdf.invertMode.grayscale": 0.3,
// "latex-workshop.view.pdf.invertMode.brightness": 2,
// "latex-workshop.view.pdf.invertMode.sepia": 1,
"latex-workshop.hover.preview.scale": 1.5,
"latex-workshop.synctex.afterBuild.enabled": true,
"latex-workshop.bibtex-format.tab": "4 spaces",
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"-shell-escape",
"-outdir=%OUTDIR%",
"%DOCFILE%"
],
"env": {}
},
{
"name": "lualatexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-lualatex",
"-outdir=%OUTDIR%",
"%DOC%"
],
"env": {}
},
{
"name": "latexmk_rconly",
"command": "latexmk",
"args": [
"%DOC%"
],
"env": {}
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
],
"env": {}
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
],
"env": {}
},
{
"name": "rnw2tex",
"command": "Rscript",
"args": [
"-e",
"knitr::opts_knit$set(concordance = TRUE); knitr::knit('%DOCFILE_EXT%')"
],
"env": {}
},
{
"name": "jnw2tex",
"command": "julia",
"args": [
"-e",
"using Weave; weave(\"%DOC_EXT%\", doctype=\"tex\")"
],
"env": {}
},
{
"name": "jnw2texmintex",
"command": "julia",
"args": [
"-e",
"using Weave; weave(\"%DOC_EXT%\", doctype=\"texminted\")"
],
"env": {}
},
{
"name": "tectonic",
"command": "tectonic",
"args": [
"--synctex",
"--keep-logs",
"%DOC%.tex"
],
"env": {}
}
],
}
}
137 changes: 137 additions & 0 deletions template/manuscript.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
\documentclass[man, a4paper, 10pt, donotrepeattitle]{apa7}
\usepackage[american]{babel}
\usepackage[style = apa, backend = biber]{biblatex}
\usepackage[american=nohyphenation]{hyphsubst}
\usepackage{amsmath}
\usepackage{sepfootnotes}
\usepackage{amssymb}
\usepackage{listings}
\usepackage{rotating}
\usepackage{mdframed}
\usepackage[outputdir=build]{minted}
\usepackage{csquotes}
\usepackage{hyperref}
\usepackage{soul}
\usepackage{datetime}
\usepackage{enumitem}
\usepackage{pifont}
\usepackage{gitinfo2}
\usepackage{environ}
\usepackage{lipsum}


% #region Custom commands or renewals.

% Development notice.
\newcommand{\notice}[1]{
\parbox{0.8\linewidth}{\darkred\centering\small\vspace*{50px}#1}
}

% Add command to print latest commit hash and date.
\newcommand{\commitInfo}{\textbf{Version}\\{\footnotesize commit \code{\gitAbbrevHash} on \gitAuthorDate}}

% Conditional independence.
\newcommand{\ci}{\mathrel{\text{\scalebox{1.07}{$\perp\mkern-10mu\perp$}}}}

% Matrix and vectors command.
\newcommand{\mat}[1]{\bm{#1}}
\renewcommand{\vec}[1]{\bm{#1}}

% Command for inline code.
\newcommand{\code}[1]{\textbf{\texttt{#1}}}

% Command for citation placeholder.
\renewcommand{\cite}{\textcolor{lightgray}{\textit{cite}}}

% Command for a todo item.
\newcommand{\todo}[1]{{\darkred \textit{#1}}}

% Command for true models.
\newcommand{\m}[1]{$P_{#1}$}
\newcommand{\mv}[2]{$P^{(#2)}_{#1}$}

% Command for referencing paragraphs.
\newcommand{\pr}[2][]{\textcolor{gray}{$(\bm{P_{#2}^{#1}})$}}

% Define color commands.
\newcommand{\darkred}{\color[HTML]{990000}}
\newcommand{\darkgreen}{\color[HTML]{008000}}
\newcommand{\darkorange}{\color[HTML]{b35900}}
\newcommand{\darkyellow}{\color[HTML]{cca300}}
\newcommand{\fadegray}{\color[HTML]{6e7577}}

% Command for outline symbols.
\newcommand{\done}{{\darkgreen\ding{52}}}
\newcommand{\drop}{{\darkred\ding{56}}}
\newcommand{\look}{{\darkorange\ding{42}}}
\newcommand{\idea}{{\darkyellow\ding{162}}}
\newcommand{\head}{{\ding{229}}}

% Decrease font size for bibliography items.
\renewcommand*{\bibfont}{\normalfont\small}

% #endregion


% #region Package configuration.

% Library settings.
\DeclareLanguageMapping{american}{american-apa}

% Load the library.
\addbibresource{library.bib}

% Minted settings.
\setminted{fontsize=\small, baselinestretch=1.5}

% Define date and time format.
\shortdate
\settimeformat{hhmmsstime}

% Link colors.
\hypersetup{
colorlinks,
linkcolor={red!50!black},
citecolor={blue!50!black},
urlcolor={blue!80!black}
}

% Set the depth of 'enumitem' nested lists.
\setlistdepth{9}

% List configuration for outline items that indicate paragraphs to be written.
\newlist{paragraphs}{itemize}{9}
\setlist[paragraphs]{label=$\square$}

% List configuration for outline items that represent paragraph notes.
\newlist{notelist}{itemize}{9}
\setlist[notelist]{
label=,
itemsep=0pt,
parsep=0pt,
before=\footnotesize \fadegray
}

% Define boolean for outline notes visibility.
\newbool{shownotes}

% Set default outline notes to be displayed.
\booltrue{shownotes}

% Disable outline notes.
% \boolfalse{shownotes}

% Define conditional environment for outline notes.
\NewEnviron{notes}{
\ifbool{shownotes}{
\begin{notelist}
\BODY
\end{notelist}
}{}
}

% #endregion


% Include the document structure.
\input{sections/_sections}
4 changes: 4 additions & 0 deletions template/sections/_footnotes.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
% This file contains all footnotes for the paper.

% FN1.
\sepfootnotecontent{foot-one}{\lipsum[1][1-4]}
64 changes: 64 additions & 0 deletions template/sections/_outline.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
% Decrease font size.
\small

% Section title.
\section{Outline}

% Legend.
\subsection{Symbol Legend}

% Symbol meaning.
\begin{paragraphs}
\item Not started or in rough form (i.e., to write).
\item[\done] Ready for review or in final form.
\item[\drop] Will not be written or to be dropped.
\item[\look] Needs attention or input (i.e., something is not clear).
\item[\head] Grouping heading (e.g., section, subsection etc.).
\end{paragraphs}

% Structure.
\subsection{Paper Structure}

% Outline items.
\begin{paragraphs}
% Introduction section.
\item[\head] \textbf{Introduction}
\begin{paragraphs}
\item[\done] \pr{1} the topic sentence for paragraph one
\item[\done] \pr{2} the topic sentence for paragraph two
\end{paragraphs}

% Background section.
\item[\head] \textbf{Background}
\begin{paragraphs}
\item[\look] \pr{3} the topic sentence for paragraph three

% Subsection one.
\item[\head] \textbf{Subsection One}
\begin{paragraphs}
\item[\done] \pr{4} the topic sentence for paragraph four
\item \pr{5} the topic sentence for paragraph five
\begin{notes}
\item Some notes about what should be included in this
paragraph. Their visibility can be toggled via the
\code{shownotes} boolean as \code{boolfalse\{shownotes\}}.
\lipsum[7][1-5]
\end{notes}
\end{paragraphs}

% Subsection two.
\item[\head] \textbf{Subsection Two}
\begin{paragraphs}
\item[\done] \pr{6} the topic sentence for paragraph six
\end{paragraphs}
\end{paragraphs}

% Another section.
\item[\head] \textbf{\dots}
\begin{paragraphs}
\item ...
\end{paragraphs}
\end{paragraphs}

% Reset font size.
\normalsize
Loading

0 comments on commit e15cd31

Please sign in to comment.