Skip to content

Commit

Permalink
Add solution to session #1
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoledoux committed Nov 13, 2023
1 parent ded1f2a commit b4598d9
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/introdays/session1/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
- exercise #1: [HTML page to replicate](md_result.html) (use PyCharm)
- exercise #2: convert your .md file to a PDF with [Pandoc](https://pandoc.org/)

[SOLUTION TO #1](md_result.md)

- - -

## LaTeX
Expand All @@ -34,6 +36,7 @@
1. check this [demo template](https://github.com/tudelft3d/latex-getting-started/tree/main/template) to know the best way to make complex things (tables, code, etc.)
1. when all this works, try to replicate [this PDF](latex_result.pdf)

[SOLUTION](latex_result.md)

### A better starting template for simple LaTeX

Expand Down
116 changes: 116 additions & 0 deletions docs/introdays/session1/latex_result.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
\documentclass[a4paper,11pt]{scrartcl}

\usepackage{graphicx}
\usepackage[utf8]{inputenc} %-- pour utiliser des accents en français
\usepackage{amsmath,amssymb,amsthm}
\usepackage[round]{natbib}
\usepackage{url}
\usepackage{xspace}
\usepackage[left=20mm,top=20mm]{geometry}
\usepackage{algorithmic}
\usepackage{subcaption}
\usepackage{mathpazo}
\usepackage{booktabs}
\usepackage{hyperref}
\usepackage{listings}
% \usepackage{draftwatermark}

\newcommand{\ie}{ie}
\newcommand{\eg}{eg}
\newcommand{\reffig}[1]{Figure~\ref{#1}}
\newcommand{\refsec}[1]{Section~\ref{#1}}

\setcapindent{1em} %-- for captions of Figures

\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}


\title{My MSc Geomatics assignment}
\author{Céline Dion\\\#12345\\\url{[email protected]} \and Roger van Delft\\\#56789\\url{[email protected]}}
\date{13 November 2023}


\begin{document}

\maketitle

%%%
%
\section{Introduction}

Try to reproduce as closely as possible this document. Some tips:

\begin{enumerate}
\item the template used is KOMA-script: \verb|\documentclass[a4paper,11pt]{scrartcl}|
\item the font used is Palatino
\end{enumerate}

\subsection{References}

We can see this in the work of \citet{Schiefer20} and others~\citep{Lan22}.


\subsection{Figures}

Then download locally the TUDelft logo on the front page of \url{https://tudelft3d.github.
io/geogeeks}, and add it as in a Figure~\ref{fig:logo}.
\begin{figure}
\centering
\includegraphics[angle=180,width=0.5\linewidth]{tud.png}
\caption{The TUDelft logo upside-down.}%
\label{fig:logo}
\end{figure}

Then pick a software to draw vectorial and draw a circle and a square, and save it to a PDF\@.
And add it to a figure as in Figure~\ref{fig:circle}.
\begin{figure}
\centering
\includegraphics[width=0.2\linewidth]{circle.pdf}
\caption{A circle and a square.}%
\label{fig:circle}
\end{figure}

\subsection{Tables}
And finally replicate the Table~\ref{tab:example}.

\begin{table}
\centering
\begin{tabular}{@{}lrrcrr@{}} \toprule
&&&& \multicolumn{2}{c}{\# of things} \\
\cmidrule{5-6}
& this & that && left & right \\
\toprule
\textbf{A} & 30 & 48 && 5970 & 3976 \\
\textbf{B} & 63 & 69 && 15711 & 44 \\
\bottomrule
\end{tabular}
\caption{Details concerning the datasets used for the experiments.}%
\label{tab:example}
\end{table}

\subsection{Code}

And the code is shown in Figure~\ref{fig:code}.
\begin{figure}
\begin{lstlisting}
import sys
print("Hello world!")
\end{lstlisting}
\caption{I am a Python hero!}%
\label{fig:code}
\end{figure}


%%%
%
\section{Conclusions}

I am now the best at \LaTeX!

Lemongrass frosted gingerbread bites banana bread orange crumbled lentils sweet potato black bean burrito green pepper springtime strawberry ginger lemongrass agave green tea smoky maple tempeh glaze enchiladas couscous. Cranberry spritzer Malaysian cinnamon pineapple salsa apples spring cherry bomb bananas blueberry pops scotch bonnet pepper spiced pumpkin chili lime eating together kale blood orange smash arugula salad. Bento box roasted peanuts pasta Sicilian pistachio pesto lavender lemonade elderberry Southern Italian citrusy mint lime taco salsa lentils walnut pesto tart quinoa flatbread sweet potato grenadillo.


\bibliographystyle{abbrvnat}
\bibliography{references}
\end{document}
53 changes: 53 additions & 0 deletions docs/introdays/session1/md_result.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

# My first Markdown file

![](640px-Markdown-mark.svg.png)

Hello everyone, I took that image from [there](https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/640px-Markdown-mark.svg.png).

Lemongrass frosted __gingerbread__ bites banana bread orange crumbled lentils sweet potato black bean burrito green pepper springtime strawberry ginger lemongrass agave green tea smoky maple tempeh glaze enchiladas *couscous*.
Cranberry spritzer Malaysian cinnamon pineapple salsa apples spring cherry bomb bananas blueberry pops scotch bonnet pepper spiced pumpkin chili lime eating together kale blood orange smash arugula salad. Bento box roasted peanuts pasta Sicilian pistachio pesto lavender lemonade elderberry Southern Italian citrusy mint lime taco salsa lentils walnut pesto tart quinoa flatbread sweet potato grenadillo.

## Lists are great

1. make lists
2. make sub-lists
1. which include emojis 🙌
2. or **anything** really
3. and that's it


## Some code

The most important function is `do_something()`:

```python
import sys

def do_something(b):
return b + 0.01
a = 1.0
while a < 2.0:
a = do_something(a)
sys.exit()
```

## A great table

| Markdown editor | URL | price |
| --------------- | --- | -----:|
| PyCharm | https://www.jetbrains.com/pycharm/ | **€0**.00 |
| SublimeText | https://www.sublimetext.com | **€99**.00 |
| vim | https://www.vim.org | **€0**.00 |

## Some specific things to be done

- [x] add the figure above
- [ ] add the table below
- [ ] figure out how to add tables

## And to finish, a quote

As [Linus Torvald](https://en.wikipedia.org/wiki/Linus_Torvalds) said:

> Talk is cheap, show me the code

0 comments on commit b4598d9

Please sign in to comment.