Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rövarspråket tufte style #6

Merged
merged 10 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions rövarspråket/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ltxobj/
notes.pdf
rovarspraket.py
rövarspråket.py
rövarspråket.tex
rövarspråket
slides.pdf
__pycache__/


35 changes: 35 additions & 0 deletions rövarspråket/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.PHONY: all
all: slides.pdf notes.pdf

LATEXFLAGS+= -shell-escape

SRC+= rövarspråket.tex
SRC+= abstract.tex
SRC+= preamble.tex
SRC+= rovarspraket.py

notes.pdf: notes.tex ${SRC}
slides.pdf: slides.tex ${SRC}

rövarspråket.tex: rövarspråket.nw


.PHONY:
all: rövarspråket

rövarspråket.py: rövarspråket.nw
rövarspråket rovarspraket.py: rövarspråket.py
cp $^ $@
chmod +x $@


.PHONY: clean
clean:
${RM} rövarspråket rövarspråket.py rövarspråket.tex
${RM} notes.pdf slides.pdf



INCLUDE_MAKEFILES=../makefiles
include ${INCLUDE_MAKEFILES}/tex.mk
include ${INCLUDE_MAKEFILES}/noweb.mk
21 changes: 21 additions & 0 deletions rövarspråket/abstract.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
% What's the problem?
% Why is it a problem? Research gap left by other approaches?
% Why is it important? Why care?
% What's the approach? How to solve the problem?
% What's the findings? How was it evaluated, what are the results, limitations,
% what remains to be done?

I den här modulen skriver vi ett program som översätter till och från
rövarspråket.
Syftet är att illustrera enkla algoritmiska problem och alla grundläggande
programmeringstekniska konstruktioner; såsom funktioner och kontrollflöden.

\emph{Lärandemål:}
Efter att ha genomfört modulen ska den lärande kunna:
\begin{itemize}
\item läsa grundläggande programkod med enkla konstruktioner
och, mestadels korrekt, förklara vad koden gör;
\item konstruera enkla algoritmer (inte syntaktiskt korrekt programkod) på en
detaljnivå lämpad för programmering, exempelvis att man måste läsa bokstav
för bokstav och göra någonting för varje.
\end{itemize}
65 changes: 65 additions & 0 deletions rövarspråket/notes.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
\documentclass[a4paper,10pt,article,oneside,oldfontcommands]{memoir}
%%% Tufte %%%
\usepackage{marginfix}
%\setlength{\evensidemargin}{\oddsidemargin}
\marginparmargin{outer}
\setlrmarginsandblock{2.5cm}{8cm}{*}

\footnotesinmargin

\usepackage{ragged2e}
\renewcommand{\sidefootform}{\RaggedRight}
\renewcommand{\foottextfont}{\footnotesize\RaggedRight}

\setmpjustification{\RaggedRight}{\RaggedRight}

% margin figure and caption typeset ragged against text block
\setfloatadjustment{marginfigure}{\mpjustification}
\setmarginfloatcaptionadjustment{figure}{\captionstyle{\mpjustification}}

% From https://tex.stackexchange.com/a/324757/17418
% Palatino for main text and math
\usepackage[osf,sc]{mathpazo}

% Helvetica for sans serif
% (scaled to match size of Palatino)
\usepackage[scaled=0.90]{helvet}

% Bera Mono for monospaced
% (scaled to match size of Palatino)
\usepackage[scaled=0.85]{beramono}

\setlxvchars\setxlvchars
\checkandfixthelayout

\nouppercaseheads
%%% end tufte %%%
\let\subsubsection\subsection
\let\subsection\section
\let\section\chapter

\input{preamble.tex}
\noweboptions{longxref,breakcode}

\usepackage[noamsthm,notheorems]{beamerarticle}
\setjobnamebeamerversion{slides}

%\usepackage{authblk}
%\let\institute\affil

\declaretheorem[numbered=unless unique,style=example,
name=Exempel,refname=exempel,Refname=Exempel]{example}
%\declaretheorem[style=definition,numbered=unless unique,
% name=Example,refname={example,examples}]{example}
\declaretheorem[numbered=unless unique,style=remark,
name=Anmärkning,refname=anmärkning,Refname=Anmärkning]{remark}
\declaretheorem[numbered=unless unique,style=exercise,
name=Övning,refname=övning,Refname=Övning]{exercise}
\declaretheorem[numbered=unless unique,style=exercise,
name=Fråga,refname=fråga,Refname=Fråga]{question}
\declaretheorem[numbered=no,style=solution,
name=Lösning,refname=lösning,Refname=Lösning]{solution}

\begin{document}
\input{rövarspråket.tex}
\end{document}
Loading