diff --git a/exam_template/graphics/example3.tex b/exam_template/graphics/example3.tex deleted file mode 100644 index cf45372..0000000 --- a/exam_template/graphics/example3.tex +++ /dev/null @@ -1,14 +0,0 @@ - - \begin{truthtable} - {c|c|c|c|c|e|c} - {$p$ & $q$ & $s$ & $p \wedge q$ & $p \Rightarrow q$ & $ p \Leftrightarrow q$ & $p \Leftrightarrow (q \wedge s)$} - \T & \T & \T & \T & \T & \T & \T - \T & \T & \F & \T & \T & \T & \F - \T & \F & \T & \F & \F & \F & \F - \T & \F & \F & \F & \F & \F & \F - \F & \T & \T & \F & \T & \F & \F - \F & \T & \F & \F & \T & \F & \T - \F & \F & \T & \F & \T & \T & \T - \F & \F & \F & \F & \T & \T & \T - \end{truthtable} - \ No newline at end of file diff --git a/exam_template/python/tex_templates/Graph.tex b/exam_template/python/tex_templates/Graph.tex new file mode 100644 index 0000000..a10727b --- /dev/null +++ b/exam_template/python/tex_templates/Graph.tex @@ -0,0 +1,11 @@ +\newcommand{\arrow}[2]{\path [-{Latex[scale=1]}] (#1) edge (#2);} + +\begin{tikzpicture} + + \begin{scope}[every node/.style={shape=circle, fill=white, draw, inner sep=2pt}] + %NODES + \end{scope} + + %EDGES + +\end{tikzpicture} diff --git a/exam_template_graphics/Makefile b/exam_template_graphics/Makefile new file mode 100644 index 0000000..afa885c --- /dev/null +++ b/exam_template_graphics/Makefile @@ -0,0 +1,15 @@ +.DEFAULT_GOAL := default +.PHONY: default python + +default: python + pdflatex main.tex + +SRC_DIR := $(shell find graphics/src -type f -printf "%f\n" -name *.txt | cut -d '.' -f1) + +python: + @for f in $(SRC_DIR); \ + do \ + echo -e "\033[33mCOMPILING $$f.tex\033[0m"; \ + python ../exam_template/python/run.py graphics/src/$$f.txt graphics/$$f.tex; \ + echo ""; \ + done \ No newline at end of file diff --git a/exam_template/graphics/example2.tex b/exam_template_graphics/graphics/automata.tex similarity index 100% rename from exam_template/graphics/example2.tex rename to exam_template_graphics/graphics/automata.tex diff --git a/exam_template_graphics/graphics/complete6.tex b/exam_template_graphics/graphics/complete6.tex new file mode 100644 index 0000000..9ad313a --- /dev/null +++ b/exam_template_graphics/graphics/complete6.tex @@ -0,0 +1,30 @@ +\newcommand{\arrow}[2]{\path [-{Latex[scale=1]}] (#1) edge (#2);} + +\begin{tikzpicture} + + \begin{scope}[every node/.style={shape=circle, fill=white, draw, inner sep=2pt}] + \node (A) at (0,3.0) {$A$}; +\node (B) at (-2.59808,1.5) {$B$}; +\node (C) at (-2.59808,-1.5) {$C$}; +\node (D) at (-0.0,-3.0) {$D$}; +\node (E) at (2.59808,-1.5) {$E$}; +\node (F) at (2.59808,1.5) {$F$}; + \end{scope} + + \draw (A) -- (B); +\draw (A) -- (C); +\draw (A) -- (D); +\draw (A) -- (E); +\draw (A) -- (F); +\draw (B) -- (C); +\draw (B) -- (D); +\draw (B) -- (E); +\draw (B) -- (F); +\draw (C) -- (D); +\draw (C) -- (E); +\draw (C) -- (F); +\draw (D) -- (E); +\draw (D) -- (F); +\draw (E) -- (F); + +\end{tikzpicture} diff --git a/exam_template/graphics/example1.tex b/exam_template_graphics/graphics/hasse.tex similarity index 65% rename from exam_template/graphics/example1.tex rename to exam_template_graphics/graphics/hasse.tex index e17d0ea..add93b2 100644 --- a/exam_template/graphics/example1.tex +++ b/exam_template_graphics/graphics/hasse.tex @@ -2,14 +2,14 @@ \tikzset{every node/.style={shape=circle,draw,inner sep=2pt}} \node (a) at (-0.5, 0) {$a$}; -\node (e) at (-1.0, 1) {$e$}; -\node (b) at (0.0, 1) {$b$}; -\node (d) at (-1.0, 2) {$d$}; -\node (c) at (0.0, 2) {$c$}; +\node (b) at (-1.0, 1) {$b$}; +\node (e) at (0.0, 1) {$e$}; +\node (c) at (-1.0, 2) {$c$}; +\node (d) at (0.0, 2) {$d$}; +\draw (e) -- (d); \draw (a) -- (e); \draw (b) -- (c); -\draw (e) -- (d); \draw (a) -- (b); \draw (e) -- (c); diff --git a/exam_template/graphics/src/example2.txt b/exam_template_graphics/graphics/src/automata.txt similarity index 92% rename from exam_template/graphics/src/example2.txt rename to exam_template_graphics/graphics/src/automata.txt index d1c2613..e1873d2 100644 --- a/exam_template/graphics/src/example2.txt +++ b/exam_template_graphics/graphics/src/automata.txt @@ -1,3 +1,4 @@ +# FSA 0 s 1 r0 2 fr1 diff --git a/exam_template_graphics/graphics/src/complete6.txt b/exam_template_graphics/graphics/src/complete6.txt new file mode 100644 index 0000000..9f70f1a --- /dev/null +++ b/exam_template_graphics/graphics/src/complete6.txt @@ -0,0 +1,4 @@ +# Graph +complete + +6 \ No newline at end of file diff --git a/exam_template/graphics/src/example1.txt b/exam_template_graphics/graphics/src/hasse.txt similarity index 71% rename from exam_template/graphics/src/example1.txt rename to exam_template_graphics/graphics/src/hasse.txt index 4e053bb..2d7cea0 100644 --- a/exam_template/graphics/src/example1.txt +++ b/exam_template_graphics/graphics/src/hasse.txt @@ -1 +1,2 @@ +# Hasse ab ac ad ae bc ed ec \ No newline at end of file diff --git a/exam_template/graphics/src/example3.txt b/exam_template_graphics/graphics/src/truthtable.txt similarity index 81% rename from exam_template/graphics/src/example3.txt rename to exam_template_graphics/graphics/src/truthtable.txt index b18f1d4..cb6173e 100644 --- a/exam_template/graphics/src/example3.txt +++ b/exam_template_graphics/graphics/src/truthtable.txt @@ -1 +1,2 @@ +# Truthtable p, q, s, p and q, p implies q, E p iff q, p iff (q and s) \ No newline at end of file diff --git a/exam_template_graphics/graphics/src/undirectedGraph.txt b/exam_template_graphics/graphics/src/undirectedGraph.txt new file mode 100644 index 0000000..3975bfe --- /dev/null +++ b/exam_template_graphics/graphics/src/undirectedGraph.txt @@ -0,0 +1,9 @@ +# Graph +undirected + +A B C D E F G H + +AB +AC +CD +DE \ No newline at end of file diff --git a/exam_template_graphics/graphics/truthtable.tex b/exam_template_graphics/graphics/truthtable.tex new file mode 100644 index 0000000..f8e2d5c --- /dev/null +++ b/exam_template_graphics/graphics/truthtable.tex @@ -0,0 +1,14 @@ + + \begin{truthtable} + {c|c|c|c|c|e|c} + {$p$ & $q$ & $s$ & $p \wedge q$ & $p \Rightarrow q$ & $ p \Leftrightarrow q$ & $p \Leftrightarrow (q \wedge s)$} + \T & \T & \T & \T & \T & \T & \T \\ + \T & \T & \F & \T & \T & \T & \F \\ + \T & \F & \T & \F & \F & \F & \F \\ + \T & \F & \F & \F & \F & \F & \F \\ + \F & \T & \T & \F & \T & \F & \F \\ + \F & \T & \F & \F & \T & \F & \T \\ + \F & \F & \T & \F & \T & \T & \T \\ + \F & \F & \F & \F & \T & \T & \T \\ + \end{truthtable} + \ No newline at end of file diff --git a/exam_template_graphics/graphics/undirectedGraph.tex b/exam_template_graphics/graphics/undirectedGraph.tex new file mode 100644 index 0000000..3d34bbd --- /dev/null +++ b/exam_template_graphics/graphics/undirectedGraph.tex @@ -0,0 +1,21 @@ +\newcommand{\arrow}[2]{\path [-{Latex[scale=1]}] (#1) edge (#2);} + +\begin{tikzpicture} + + \begin{scope}[every node/.style={shape=circle, fill=white, draw, inner sep=2pt}] + \node (A) at (0,4.0) {$A$}; +\node (B) at (-2.82843,2.82843) {$B$}; +\node (C) at (-4.0,0.0) {$C$}; +\node (D) at (-2.82843,-2.82843) {$D$}; +\node (E) at (-0.0,-4.0) {$E$}; +\node (F) at (2.82843,-2.82843) {$F$}; +\node (G) at (4.0,-0.0) {$G$}; +\node (H) at (2.82843,2.82843) {$H$}; + \end{scope} + + \draw (A) -- (B); +\draw (A) -- (C); +\draw (C) -- (D); +\draw (D) -- (E); + +\end{tikzpicture} diff --git a/exam_template_graphics/main.tex b/exam_template_graphics/main.tex new file mode 100644 index 0000000..52e3697 --- /dev/null +++ b/exam_template_graphics/main.tex @@ -0,0 +1,43 @@ +\documentclass[12pt]{article} +\usepackage{ntnu} +\usepackage{ntnu-math} + +\author{TODO: STUDENTNUMMER} +\title{Exam v2021} + +\usetikzlibrary{automata, positioning, arrows.meta} + +\newcommand{\I}{Option 1 is correct} +\newcommand{\II}{Option 2 is correct} +\newcommand{\III}{Option 3 is correct} + +\renewcommand{\theenumi}{\arabic{enumi}} +\renewcommand{\theenumii}{(\arabic{enumii})} +\renewcommand{\theenumiii}{\alph{enumiii})} + +\begin{document} + + \ntnuTitle{} + \break{} + + \tableofcontents + + \begin{excs} + \exc{} + \includeDiagram{graphics/hasse.tex} + + \exc{} + \includeDiagram{graphics/automata.tex} + + \exc{} + \input{graphics/truthtable.tex} + + \exc{} + \includeDiagram{graphics/undirectedGraph.tex} + + \exc{} + \includeDiagram{graphics/complete6.tex} + + \end{excs} + +\end{document} \ No newline at end of file