Skip to content

Instantly share code, notes, and snippets.

@khardix
Last active October 4, 2016 12:34
Show Gist options
  • Save khardix/cad7975fc98d44a2b4ba6c350875dad7 to your computer and use it in GitHub Desktop.
Save khardix/cad7975fc98d44a2b4ba6c350875dad7 to your computer and use it in GitHub Desktop.
Template for TIN
#!/usr/bin/env perl
# Configuration file for latexmk, automation script for LaTeX builds
# Use xelatex by default
$pdf_mode = 1; $postscript_mode = $dvi_mode = 0;
$pdflatex = "lualatex %O %S";
.PHONY: all clean
all: tin.pdf
%.pdf: %.tex
latexmk $<
clean:
latexmk -C
%!TeX program = LuaLaTeX
%!TeX encoding = UTF-8
\documentclass[paper=A4,fontsize=11pt,pagesize=auto,DIV=12]{scrartcl}
\usepackage{polyglossia,fontspec,unicode-math,enumerate,exsheets,tikz}
\setdefaultlanguage{czech}
\defaultfontfeatures{Ligatures=TeX}
\setromanfont{Libertinus Serif}
\setsansfont{Libertinus Sans}
\setmonofont[Scale=MatchLowercase]{Inconsolata}
\setmathfont{Libertinus Math}
\setkomafont{disposition}{\rmfamily\scshape\bfseries}
% %%% Exsheet styling %%%
\DeclareInstance{exsheets-heading}{tin-question}{default}{
indent-first = false,
vscale = 1.5,
pre-code = \rule{\linewidth}{0.5pt},
post-code = \rule{\linewidth}{0.5pt},
title-format = \large\scshape ,
number-format = \large\bfseries ,
join = { number[r,B]title[l,B](.3em,0pt) },
attach = { main[hc,vc]number[hc,vc](0pt,0pt) },
}
\DeclareInstance{exsheets-heading}{tin-solution}{default}{
runin = true,
title-post-code = :\space,
title-format = \itshape,
join = { main[r,vc]title[r,vc](0pt,0pt) },
}
\SetupExSheets[question]{headings=tin-question,name=Úkol}
\SetupExSheets[solution]{headings=tin-solution,print=true,name=Řešení}
\usetikzlibrary{arrows.meta,automata,positioning}
\title{TIN Specimen}
\author{Bc.\,Jan Staněk -- \texttt{xstane32@stud.fit.vutbr.cz}}
\date{\today}
\begin{document}
\maketitle
\begin{question}
První TIN otázka, přepsaná.
\end{question}
\begin{solution}
Řešení první otázky, verbatim.
\begin{center}
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto,>=stealth]
\node[state,initial] (q0) {$q_0$};
\node[state] (q1) [above right=of q0] {$q_1$};
\node[state] (q2) [below right=of q0] {$q_2$};
\node[state,accepting] (q3) [below right=of q1] {$q_3$};
\path[->] (q0) edge node {0} (q1)
edge node [swap] {1} (q2)
(q1) edge node {1} (q3)
edge [loop above] node {0} ()
(q2) edge node [swap] {0} (q3)
edge [loop below] node {1} ();
\end{tikzpicture}
\end{center}
\end{solution}
\hrule
\end{document}
% vim:set spelllang=cs:set spell:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment