- TeX added
This commit is contained in:
parent
13743a5681
commit
9282b818d2
170
report/progressbar.sty
Normal file
170
report/progressbar.sty
Normal file
@ -0,0 +1,170 @@
|
||||
% ProgressBar
|
||||
%
|
||||
% kindly supported by mrunix-forum: http://www.mrunix.de/
|
||||
%
|
||||
%% progressbar.sty
|
||||
%% Copyright 2010-2013 Marcel Jira
|
||||
%
|
||||
% This work may be distributed and/or modified under the
|
||||
% conditions of the LaTeX Project Public License, either version 1.3c
|
||||
% of this %license or (at your option) any later version.
|
||||
% The latest version of this license is in
|
||||
% http://www.latex-project.org/lppl.txt
|
||||
% and version 1.3c or later is part of all distributions of LaTeX
|
||||
% version 2005/12/01 or later.
|
||||
%
|
||||
% This work has the LPPL maintenance status `maintained'.
|
||||
%
|
||||
% The Current Maintainer of this work is Marcel Jira.
|
||||
%
|
||||
% This work consists of the files progressbar.sty and progressbar.tex.
|
||||
%
|
||||
\NeedsTeXFormat{LaTeX2e}%
|
||||
%
|
||||
\ProvidesPackage{progressbar}[2014/05/04 v1.0b~4: progressbar]%
|
||||
%
|
||||
\RequirePackage{calc}%
|
||||
\RequirePackage{tikz}%
|
||||
\RequirePackage{kvoptions}[2011/06/30]%
|
||||
\RequirePackage{kvsetkeys}%
|
||||
%
|
||||
% Define lengths for later use
|
||||
\newlength{\BarWidth}%
|
||||
\newlength{\BarWidthCenter}%
|
||||
\newlength{\BarHeight}%
|
||||
\newlength{\BarHeightCenter}%
|
||||
\newlength{\BarBorderWidth}%
|
||||
\newlength{\BarRoundedCorners}%
|
||||
% This length will be used for the realisation of the progressbars
|
||||
\newlength{\BarPartWidth}%
|
||||
% And the ticks
|
||||
\newlength{\BarSubDivisionsWidthANU}%
|
||||
\newlength{\BarSubDivisionsWidthBNU}%
|
||||
\newlength{\BarSubDivisionsWidthCNU}%
|
||||
%
|
||||
% All user-variables
|
||||
\def\progressbar@keylist{borderwidth,heighta,roundnessa,heightr,roundnessr,width,linecolor,emptycolor,filledcolor,tickswidth,ticksheight,tickscolor,subdivisions,labelcolor,label}%
|
||||
% Keys corresponding to the user-variables
|
||||
\def\progressbar@defaultvaluelist{0.8pt,0pt,0pt,1,0.15,6em,black,black!10,black!60,0.4pt,0.33,black,10,black!10,{}}%
|
||||
\newcounter{progressbar@counter}%
|
||||
%
|
||||
% KeyVal-Options
|
||||
% Define default-Keyval-Options for this package
|
||||
\setcounter{progressbar@counter}{0}%
|
||||
\@for\progressbar@value:=\progressbar@defaultvaluelist\do{%
|
||||
\stepcounter{progressbar@counter}%
|
||||
\expandafter\edef\csname progressbar@value\the\value{progressbar@counter}\endcsname{\progressbar@value}%
|
||||
}%
|
||||
\setcounter{progressbar@counter}{0}%
|
||||
\@for\progressbar@key:=\progressbar@keylist\do{%
|
||||
\stepcounter{progressbar@counter}%
|
||||
\expandafter\DeclareStringOption\expandafter[\csname progressbar@value\the\value{progressbar@counter}\endcsname]{\progressbar@key}%
|
||||
}%
|
||||
\ProcessKeyvalOptions*%
|
||||
% Change Keyval family and prefix
|
||||
\SetupKeyvalOptions{family=progressbarlocal,prefix=progressbarlocal@}%
|
||||
% Define Keyval-Options that are used in the macro
|
||||
\@for\progressbar@key:=\progressbar@keylist\do{%
|
||||
\DeclareStringOption{\progressbar@key}%
|
||||
}%
|
||||
\def\progressbar@lastheighta{false}%
|
||||
\def\progressbar@lastroundnessa{false}%
|
||||
\def\progressbarlocal@lastroundnessa{false}%
|
||||
\def\progressbar@true{true}%
|
||||
\AddToKeyvalOption{progressbar}{heightr}{%
|
||||
\def\progressbar@lastheighta{false}%
|
||||
}%
|
||||
\AddToKeyvalOption{progressbar}{heighta}{%
|
||||
\def\progressbar@lastheighta{true}%
|
||||
}%
|
||||
\AddToKeyvalOption{progressbar}{roundnessr}{%
|
||||
\def\progressbar@lastroundnessa{false}%
|
||||
}%
|
||||
\AddToKeyvalOption{progressbar}{roundnessa}{%
|
||||
\def\progressbar@lastroundnessa{true}%
|
||||
}%
|
||||
\AddToKeyvalOption{progressbar}{label}{%
|
||||
\def\progressbar@label{true}%
|
||||
}%
|
||||
\newcommand{\setBarHeightCenter}{\setlength{\BarHeightCenter}{\BarHeight - \BarBorderWidth}}%
|
||||
\newcommand{\setBarWidthCenter}{\setlength{\BarWidthCenter}{\BarWidth - \BarBorderWidth}}%
|
||||
\AddToKeyvalOption{progressbarlocal}{heightr}{%
|
||||
\setlength{\BarHeight}{\heightof{I} * \real{\progressbarlocal@heightr}}%
|
||||
\kvsetkeys{progressbarlocal}{heighta=\BarHeight}%
|
||||
}%
|
||||
\AddToKeyvalOption{progressbarlocal}{roundnessr}{%
|
||||
\def\progressbarlocal@lastroundnessa{false}%
|
||||
}%
|
||||
\AddToKeyvalOption{progressbarlocal}{heighta}{%
|
||||
\setlength{\BarHeight}{\progressbarlocal@heighta}%
|
||||
\setBarHeightCenter%
|
||||
}%
|
||||
\AddToKeyvalOption{progressbarlocal}{width}{%
|
||||
\setlength{\BarWidth}{\progressbarlocal@width}%
|
||||
\setBarWidthCenter%
|
||||
}%
|
||||
\AddToKeyvalOption{progressbarlocal}{roundnessa}{%
|
||||
\def\progressbarlocal@lastroundnessa{true}%
|
||||
\setlength{\BarRoundedCorners}{\progressbarlocal@roundnessa}%
|
||||
}%
|
||||
\AddToKeyvalOption{progressbarlocal}{borderwidth}{%
|
||||
\setlength{\BarBorderWidth}{\progressbarlocal@borderwidth}%
|
||||
\setBarHeightCenter%
|
||||
\setBarWidthCenter%
|
||||
}%
|
||||
% Macor to change Options
|
||||
\newcommand{\progressbarchange}[1]{%
|
||||
\kvsetkeys{progressbar}{#1}%
|
||||
}%
|
||||
%
|
||||
% The actual realisation of the progressbar
|
||||
\newcommand{\progressbar}[2][]{%
|
||||
% Get the global keys in the local keys
|
||||
\@for\progressbar@key:=\progressbar@keylist\do{%
|
||||
\@expandtwoargs\kvsetkeys{progressbarlocal}{\progressbar@key=\csname progressbar@\progressbar@key\endcsname}%
|
||||
}%
|
||||
\ifx\progressbar@lastheighta\progressbar@true%
|
||||
\kvsetkeys{progressbarlocal}{heighta=\progressbar@heighta}%
|
||||
\else%
|
||||
\kvsetkeys{progressbarlocal}{heightr=\progressbar@heightr}%
|
||||
\fi%
|
||||
\ifx\progressbar@lastroundnessa\progressbar@true%
|
||||
\kvsetkeys{progressbarlocal}{roundnessa=\progressbar@roundnessa}%
|
||||
\else%
|
||||
\kvsetkeys{progressbarlocal}{roundnessr=\progressbar@roundnessr}%
|
||||
\fi%
|
||||
% Now get the optional user input keys
|
||||
\kvsetkeys{progressbarlocal}{#1}%
|
||||
% Make a correct roundndess, if roundnessr was defined
|
||||
\ifx\progressbarlocal@lastroundnessa\progressbar@true%
|
||||
\else%
|
||||
\setlength{\BarRoundedCorners}{\BarHeightCenter * \real{\progressbarlocal@roundnessr}}%
|
||||
\fi%
|
||||
% BarSubDivision
|
||||
\setlength{\BarSubDivisionsWidthANU}{\BarWidthCenter / \progressbarlocal@subdivisions}%
|
||||
\setlength{\BarSubDivisionsWidthBNU}{\BarSubDivisionsWidthANU * 2}%
|
||||
\setlength{\BarSubDivisionsWidthCNU}{\BarWidthCenter - \BarSubDivisionsWidthANU}%
|
||||
% The filled part of the bar is calculated and set
|
||||
\setlength{\BarPartWidth}{\BarWidthCenter * \real{#2}}%
|
||||
% Now let's draw a bar ;)
|
||||
\begin{tikzpicture}%
|
||||
\coordinate (Begin) at (0,0);%
|
||||
\coordinate (End) at (\BarWidthCenter,\BarHeightCenter);%
|
||||
\coordinate (Part) at (\BarPartWidth,\BarHeightCenter);%
|
||||
% Rounded Corners
|
||||
\draw[rounded corners=\BarRoundedCorners,line width=\BarBorderWidth,color=\progressbarlocal@linecolor] (Begin) rectangle (End);%
|
||||
\clip[rounded corners=\BarRoundedCorners] (Begin) rectangle (End);%
|
||||
% Fill the bar
|
||||
\fill[fill=\progressbarlocal@emptycolor] (Begin) rectangle (End);%
|
||||
% the full part
|
||||
\fill[fill=\progressbarlocal@filledcolor] (Begin) rectangle (Part);%
|
||||
% Ticks
|
||||
\foreach \x in {\strip@pt\BarSubDivisionsWidthANU,\strip@pt\BarSubDivisionsWidthBNU,...,\strip@pt\BarSubDivisionsWidthCNU}%
|
||||
\draw[draw=\progressbarlocal@tickscolor,line width=\progressbarlocal@tickswidth] (\x pt,0) -- (\x pt,\BarHeightCenter*\progressbarlocal@ticksheight);%
|
||||
% Rounded Corners again
|
||||
\pgfmathtruncatemacro\percent{floor(100*(#2)+0.5)}
|
||||
\draw[rounded corners=\BarRoundedCorners,line
|
||||
width=\BarBorderWidth,color=\progressbarlocal@linecolor]
|
||||
(Begin) rectangle (End) node[pos = 0.5]{\color{\progressbarlocal@labelcolor}{\footnotesize \percent\%}};%
|
||||
\end{tikzpicture}%
|
||||
}%
|
121
report/report.tex
Normal file
121
report/report.tex
Normal file
@ -0,0 +1,121 @@
|
||||
\documentclass[10pt]{article}
|
||||
|
||||
|
||||
%% Importing packages
|
||||
% General things
|
||||
\usepackage[magyar]{babel}
|
||||
\usepackage[a4paper,margin=1in]{geometry}
|
||||
\usepackage{fontspec}
|
||||
\usepackage[fontsize=7pt]{fontsize}
|
||||
|
||||
% For frame layout and content
|
||||
\usepackage{xcolor}
|
||||
\usepackage[framemethod=tikz,xcolor]{mdframed}
|
||||
\usepackage{progressbar}
|
||||
|
||||
% For hyperlinks
|
||||
\usepackage[hidelinks]{hyperref}
|
||||
|
||||
|
||||
%% Setting up document
|
||||
% Setting up colors globally
|
||||
\definecolor{colbg}{HTML}{D3E5E5} % Background
|
||||
\definecolor{coltit}{HTML}{176767} % Question title
|
||||
\definecolor{coltxl}{HTML}{EFEFEF} % Light text
|
||||
\definecolor{coltxd}{HTML}{000000} % Dark text
|
||||
\definecolor{colpbm}{HTML}{176767} % Correct progressbar
|
||||
\definecolor{colpbs}{HTML}{75A6A6} % Incorrect progressbar
|
||||
\definecolor{colpbb}{HTML}{A0A0A0} % Progressbar background
|
||||
\definecolor{colanc}{HTML}{176767} % Correct answer background
|
||||
\definecolor{colani}{HTML}{D3E5E5} % Incorrect answer background
|
||||
|
||||
% Setting up outer frames
|
||||
\mdfsetup{
|
||||
nobreak,
|
||||
linewidth=0pt,
|
||||
roundcorner=0.3em,
|
||||
backgroundcolor=colbg,
|
||||
}
|
||||
|
||||
% Setting up progressbars
|
||||
\progressbarchange{
|
||||
heightr=1.25,
|
||||
roundnessa=0.2em,
|
||||
borderwidth=0pt,
|
||||
subdivisions=1,
|
||||
ticksheight=0pt,
|
||||
linecolor=colbg,
|
||||
emptycolor=colpbb,
|
||||
filledcolor=colpbm,
|
||||
labelcolor=coltxl
|
||||
}
|
||||
|
||||
% Replacing ToC text
|
||||
\addto\captionsmagyar{%
|
||||
\renewcommand{\contentsname}%
|
||||
{\huge Kurzusok}%
|
||||
}
|
||||
|
||||
% Add dotfill to ToC
|
||||
\makeatletter
|
||||
\patchcmd{\l@section}{\hfil}{%
|
||||
\leaders\hbox{$\m@th
|
||||
\mkern \@dotsep mu\hbox{.}\mkern \@dotsep
|
||||
mu$}\hfill}{}{}
|
||||
\makeatother
|
||||
|
||||
|
||||
% Set all font styles to the regular one (we don't have any other)
|
||||
\setmainfont{AutourOne}[
|
||||
UprightFont={*-Regular},
|
||||
BoldFont={*-Regular},
|
||||
ItalicFont={*-Regular},
|
||||
BoldItalicFont={*-Regular},
|
||||
SmallCapsFont ={*-Regular},
|
||||
SlantedFont ={*-Regular}
|
||||
]
|
||||
|
||||
%% Creating new environments and commands
|
||||
% Just as the command says
|
||||
\newcommand{\inputIfFileExists}[1]{\IfFileExists{#1}{\input{#1}}{}}
|
||||
|
||||
% A new command to add unnumbered sections which appear in ToC
|
||||
\newcommand{\unnumsec}[1]{\section*{#1}%
|
||||
\addcontentsline{toc}{section}{#1}}
|
||||
|
||||
% Macros for answers
|
||||
\newcommand{\answerCorrect}[2]{\progressbar{#1} & \begin{minipage}{0.8\columnwidth}\begin{mdframed}[backgroundcolor=colanc]\color{coltxl}{#2}\end{mdframed}\end{minipage}\\}
|
||||
\newcommand{\answerIncorrect}[2]{\progressbar[filledcolor=colpbs]{#1} & \begin{minipage}{0.8\columnwidth}\begin{mdframed}[backgroundcolor=colani]\color{coltxd}{#2}\end{mdframed}\end{minipage}\\}
|
||||
|
||||
% Environment for questions. The parameter is the question itself, the contents of the environment should consist of \answer*{}{} macros and nothing else
|
||||
\newenvironment{question}[1]{
|
||||
\begin{center}
|
||||
\begin{mdframed}
|
||||
{\color{coltit}\large #1\par}\medskip
|
||||
\begin{tabular}{c c}
|
||||
}{
|
||||
\end{tabular}
|
||||
\end{mdframed}
|
||||
\end{center}
|
||||
}
|
||||
|
||||
% An environment to create a quiz containing questions. The parameter is either the title of the quiz, or the name of the course
|
||||
\newenvironment{quiz}[1]{
|
||||
\unnumsec{#1}
|
||||
}{
|
||||
\clearpage
|
||||
}
|
||||
|
||||
\begin{document}
|
||||
\begin{center}
|
||||
\Huge \IfFileExists{stats/title.tex}{\input{stats/title.tex}}{Kvíz eredmények}
|
||||
\end{center}
|
||||
|
||||
\Large
|
||||
\tableofcontents
|
||||
\normalsize
|
||||
\clearpage
|
||||
|
||||
\inputIfFileExists{stats/content.tex}
|
||||
|
||||
\end{document}
|
1
report/stats/title.tex
Normal file
1
report/stats/title.tex
Normal file
@ -0,0 +1 @@
|
||||
Digit kvíz I-III eredmények kurzusonként
|
Loading…
x
Reference in New Issue
Block a user