summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/handin/handin-doc.tex
blob: 557a5d290d03b21868fb60caa6c1737aa4105697 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
%% handin v0.0.3b41 - 2018/04/04
%% The LaTeX package handin - version v0.0.3 (2018/04/04) build 41
%% #PACKAGE.sty
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2018 by Andreas Storvik Strauman
%% -------------------------------------------------------------------------------------------
%% 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 2008/05/04 or later.
%% This work has the LPPL maintenance status `author-maintained'.
%% This work consists of all files listed in README.txt
\documentclass{article}
\usepackage[all]{tcolorbox}
\usepackage{needspace}
\usepackage{tabularx}
\makeatletter
\lstdefinestyle{mydocumentation}{style=tcbdocumentation,
  classoffset=0,
  texcsstyle=*\color{blue},
  moretexcs={arrayrulecolor,draw,includegraphics,ifthenelse,isodd,lipsum,path,pgfkeysalso},
  classoffset=1,
  moretexcs={% core
    problem,pproblem,title,author,logo,coursename,coursetitle,institute,containspages,pagetext,settable
  },
  texcsstyle=*\color{Definition}\bfseries,
  classoffset=0,% restore default
  }
\newtcolorbox{marker}[1][]{enhanced,
    before skip=2mm,after skip=3mm,
    boxrule=0.4pt,left=5mm,right=2mm,top=1mm,bottom=1mm,
    colback=yellow!50,
    colframe=yellow!20!black,
    sharp corners,rounded corners=southeast,arc is angular,arc=3mm,
    underlay={%
      \path[fill=tcbcol@back!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
      \path[draw=tcbcol@frame,shorten <=-0.05mm,shorten >=-0.05mm] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
      \path[fill=yellow!50!black,draw=none] (interior.south west) rectangle node[white]{\Huge\bfseries !} ([xshift=4mm]interior.north west);
      },
    drop fuzzy shadow,#1}
  \makeatother
\let\dac\docAuxCommand
\tcbset{documentation listing style=mydocumentation}
% Magenta HREF style
\let\oldhref\href
\gdef\href#1#2{{\color{magenta}\oldhref{#1}{#2}}}
% Give section some space
\let\oldsection\section
\gdef\section{\needspace{0.3\paperheight}\oldsection}
\let\oldsubsection\subsection
\gdef\subsection{\needspace{0.2\paperheight}\oldsubsection}


\setlength{\parindent}{0pt}
\title{{Handin - manual\\ v0.0.3{\\[-0.5em]\footnotesize(build 41)}}}
\author{Andreas Strauman}
\begin{document}
\maketitle
\section*{2 Problem}
I remember when I first started out with LaTeX, as a student, it was very new and challenging just to make a simple nicely typeset document. We've all seen documents that has problem numbering using sections, like I did here. (The header says \textbf{2 Problem}.)\\

This is a package that makes it easy for student to hand in a formatted document in LaTeX. It just creates a couple of commands that typesets the document with nice headers (problem numbers and part problem numbers e.g. \textbf{(1a)} ).\\

If you are a teacher, this package works just as well for creating exercises!\\
 
If you found any bugs or want new functionality, to contribute, view the commented source, get latest version of this package or get in touch with me, you can do all of that at \url{https://github.com/Strauman/Handin-LaTeX-template/}
\tableofcontents
\clearpage
 \section{Reference}
\subsection{Page formatting commands}
This package redefines \dac{maketitle}.
Here are some front-page commands. See layout.pdf for where they will appear.
These commands all have to be executed in the preamble (that is after \dac{documentclass} and before \dac{begin}\{document\})\\
The \dac{title} and \dac{author} commands are as per usual:
\begin{docCommand}{title}{\marg{title}}
\end{docCommand}
\begin{docCommand}{author}{\marg{your name}}
\end{docCommand}
\begin{docCommand}{logo}{\marg{path/to/image}}
 If you want an image below the title, you provide the path to the image here
\end{docCommand}
\begin{docCommand}{coursename}{\marg{text}}
\end{docCommand}
\begin{docCommand}{coursetitle}{\marg{text}}
The front page will show coursename - coursetitle on a "subtitle" format
\end{docCommand}
\begin{docCommand}{institute}{\marg{text}}
 Shows as text on bottom
\end{docCommand}
\begin{docCommand}{containspages}{\marg{text}}
 Here you can set a string that shows on bottom. Default is\\
 \dac{containspages}\{Contains \dac{pageref}\brackets{LastPage\} pages, front page included}
\end{docCommand}
\begin{docCommand}{pagetext}{\marg{string}}
 This is the text that is on the bottom right corner reading "Page x of y". Default is
 \dac{pagetext}\{Page \dac{thepage}~of \dac{pageref}{LastPage\}}
\end{docCommand}
\subsection{Languages}
This package supports.
\begin{itemize}
\item English
\item Norwegian
\item German (by \href{https://github.com/africola}{africola})


\end{itemize}
Translations are welcome at \url{https://github.com/Strauman/Handin-LaTeX-template/tree/master/src/languages}.
The current language is set by the \texttt{iflang} package, so you can use e.g. babel:
\begin{dispListing}
\usepackage[german]{babel}
\end{dispListing}
\subsection{General reference}
\begin{docCommand}{problem}{\marg{text}}
 This command will print out a problem header. For example \dac{problem}\{1\}
 prints a nice big header \textbf{Problem 1} You can do a star (*) after \dac{problem} to
 prevent it from showing in the table of contents
\end{docCommand}
\begin{docCommand}{problem}{}
 Does the same as \dac{problem}, but does not add the problem to the table of contents
\end{docCommand}
\begin{docCommand}{pproblem}{\marg{text}}
 This command will print out a part problem header based on what problem you are on.
 For example if you already have done \dac{problem}\{1\}, then \dac{pproblem}\{a\}
 prints a nice big header \textbf{(1a)}. You can do a star (*) after \dac{pproblem} to
 prevent it from showing in the table of contents
\end{docCommand}
\begin{docCommand}{pproblem}{}
 Does the same as \dac{pproblem}, but does not add the part problem to the table of contents
\end{docCommand}
\begin{docCommand}{settable}{\marg{text}}
\begin{dispListing}
 \settable{hello}
\end{dispListing}
 if now \dac{@hello} is called,
  a warning is displayed with
  the text "\dac{hello} not set"
\begin{dispListing}
 \hello{world}
\end{dispListing}
 if now \dac{@hello} is called, it prints "world"
 \dac{@hello@noerror} gives the returning
 content and empty without error if no content set.
\begin{dispListing}
 \ifset@hello{true}{false}
\end{dispListing}
\end{docCommand}

\section{Changelog}
% Use , 2018/04/01
\begin{tabularx}{\textwidth}{llX}
  Version&Date&Changes\\
  v0.0.2&2018/04/01&Problems are now added to the table of contents by default\\
  v0.0.2b34&2018/04/02&Updated documentation syntax\\
  v0.0.3b41&2018/04/04&\begin{itemize}
    \item German language added by africola \newline (\url{https://github.com/africola})
  \end{itemize}\\
\end{tabularx}
 \end{document}