Skip to content

Commit

Permalink
Ready for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Strauman committed Apr 4, 2018
1 parent f8e5a9d commit 98e0f84
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 52 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ packaging
handinCTAN.zip
handin/
docs/handin.tex
README.md.bak
src/_minted-manual/
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
<!---
DO NOT EDIT THIS FILE
EDITS SHOULD BE DONE IN src/README.template.md
-->
# Handin/submission LaTeX template
Light weight template for handing in school submissions using LaTeX. Suitable for math, physics, statistics and the like.
Here is the [handin-doc.pdf](https://raw.githubusercontent.com/Strauman/Handin-LaTeX/master/docs/handin-doc.pdf)
## Super quick start
## Versions
The current latest version available on GitHub is v0.0.2 (2018/04/04) build 40

The current latest version available on CTAN is 0.0.2 (2018-04-01) build 2

*Be aware that it can take at least 24-48 hours from the CTAN date above until the package is updated on CTAN, TeXLive and MiKTeX are updated*

## Super quick start
### Texlive (MacOS and Linux): Only if you have texlive 2018
1. Install the package from [CTAN](https://ctan.org/pkg/handin). With `texlive`: `tlmgr install handin`
if you dont have texlive 2018, you can pretest it [here](https://www.tug.org/texlive/pretest.html): https://www.tug.org/texlive/pretest.html
Expand Down
9 changes: 6 additions & 3 deletions docs/changelog.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
% Use , 2018/04/01
\begin{tabular}{lll}
\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
\end{tabular}
v0.0.2b34&2018/04/02&Updated documentation syntax\\
@@VERSIONB&@@DATE&\begin{itemize}
\item German language added
\end{itemize}\\
\end{tabularx}
Binary file modified docs/handin-doc.pdf
Binary file not shown.
17 changes: 10 additions & 7 deletions docs/handin-doc.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%% handin v0.0.2b40 - 2018/04/02
%% The LaTeX package handin - version v0.0.2 (2018/04/02) build 40
%% handin.sty
%% handin v0.0.2b40 - 2018/04/04
%% The LaTeX package handin - version v0.0.2 (2018/04/04) build 40
%% #PACKAGE.sty
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2018 by Andreas Storvik Strauman
%% -------------------------------------------------------------------------------------------
Expand All @@ -13,10 +13,10 @@
%% 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,
Expand Down Expand Up @@ -133,9 +133,12 @@ \subsection{General reference}

\section{Changelog}
% Use , 2018/04/01
\begin{tabular}{lll}
\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
\end{tabular}
v0.0.2b34&2018/04/02&Updated documentation syntax\\
v0.0.2b40&2018/04/04&\begin{itemize}
\item German language added
\end{itemize}\\
\end{tabularx}
\end{document}
Binary file added handin-doc.pdf
Binary file not shown.
54 changes: 54 additions & 0 deletions src/README.template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Handin/submission LaTeX template
Light weight template for handing in school submissions using LaTeX. Suitable for math, physics, statistics and the like.
Here is the [handin-doc.pdf](https://raw.githubusercontent.com/Strauman/Handin-LaTeX/master/docs/handin-doc.pdf)
## Versions
The current latest version available on GitHub is @@VERSION (@@DATE) build @@BUILD

The current latest version available on CTAN is 0.0.2 (2018-04-01) build 2

*Be aware that it can take at least 24-48 hours from the CTAN date above until the package is updated on CTAN, TeXLive and MiKTeX are updated*

## Super quick start
### Texlive (MacOS and Linux): Only if you have texlive 2018
1. Install the package from [CTAN](https://ctan.org/pkg/handin). With `texlive`: `tlmgr install handin`
if you dont have texlive 2018, you can pretest it [here](https://www.tug.org/texlive/pretest.html): https://www.tug.org/texlive/pretest.html
2. Add `\usepackage{handin}` to your preamble (that is any place before `\begin{document}`

### MikTeX (Windows):
It's already a part of MikTeX, so just do `\usepackage{handin}`

### And then
use the [docs](http://mirrors.ctan.org/macros/latex/contrib/handin/handin-doc.pdf).

Since this package is in early stages, the CTAN-version is probably not the latest version though. There will be multiple builds pushed here first. Current CTAN-version is `0.0.2 build 30`.

## Quickstart
`\usepackage{handin}`. However I reccomend checking out the example.tex in the quickstart:

Download the [example.zip](https://github.com/Strauman/Handin-LaTeX-template/blob/master/example.zip?raw=true). It contains two files: [example.tex](https://raw.githubusercontent.com/Strauman/Handin-LaTeX-template/master/example.tex) and [handin.sty](https://raw.githubusercontent.com/Strauman/Handin-LaTeX-template/master/handin.sty). Build example.tex and you're all good to go.

## Example files
Look at the [example.pdf](https://raw.githubusercontent.com/Strauman/Handin-LaTeX-template/master/example.pdf) generated by [example.tex](https://raw.githubusercontent.com/Strauman/Handin-LaTeX-template/master/example.tex) for an example that could be used at UiT - The Arctic University of Norway.

## Dependencies
`inputenc,graphicx,lastpage,scrextend,fancyhdr,geometry,amsmath,mathtools,bm,esint,iflang`

## Internationalization
Currently using `iflang` to decide betwen norwegian and english.

## Quick docs:
### Commands
`\problem{1}` would create a *Problem 1* headline and `\pproblem{a}` would then print *1a)* subheadline (with some margin magic and other snacks). More functionality will be made, also feel free to request functionality.

### Front page (`\maketitle`)
[layout.pdf](https://raw.githubusercontent.com/Strauman/Handin-LaTeX-template/master/layout.pdf?raw=true) is an overview of what commands writes out what where. They are all used as commands to be set:
- `\title{Assignment title}`
- `\author{Author(s)}`
- `\coursename{TST-101}`
- `\coursetitle{Test course}`
- `\institute{Institute of Physics and Technology}`
- `\logo{path/to/logo/or/image}`
- `\pagetext{Page \thepage~of \pageref{LastPage}}`
- `\containspages{Contains \pageref{LastPage} pages, front page included}`

`pagetext` and `containspages` are set to the values you see above.
6 changes: 3 additions & 3 deletions src/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ Files:
Author: Storvik Strauman, Andreas

For bug report, inquires, contributed or anything else:
#GITHUB
@@GITHUB

Licence:

The LaTeX package #PACKAGE - version @@VERSION (@@DATE) build @@BUILD
#PACKAGE.sty
The LaTeX package @@PACKAGE - version @@VERSION (@@DATE) build @@BUILD
@@PACKAGE.sty
-------------------------------------------------------------------------------------------
Copyright (c) 2018 by Andreas Storvik Strauman
-------------------------------------------------------------------------------------------
Expand Down
74 changes: 37 additions & 37 deletions src/aftercompile.sh
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
cd $sourceDir;
cp $tmpDir/handin.sty ./


# cp bin/example.pdf ./
cp example.tex ./handin
cp img/universityTromsoLogo.pdf ./handin

cp layout.tex handin/

cd handin/
outHandle "Error in latexmk example" latexmk -pdf "example.tex" -outdir="./bin" --shell-escape -interaction=nonstopmode -f
outHandle "Error in latexmk layout" latexmk -pdf "layout.tex" -outdir="./bin" --shell-escape -interaction=nonstopmode -f
cp bin/example.pdf ./
cp bin/layout.pdf ./
rm -rf bin
rm layout.tex
echo "$mainDir";
function tex_compile(){
pushd . >/dev/null;
cd "$CTANDir"
outHandle "Error in latexmk $1" latexmk -pdf "$1.tex" -outdir="./bin" --shell-escape -interaction=nonstopmode -f
cp "bin/$1.pdf" ./
rm -rf bin/
popd >/dev/null;
}

# ---
# - handin.sty : The handin package
# - handin-doc.pdf : Description of how the package works
# - handin-doc.tex : Source of handin-doc.tex
# ^^ AUTO
# - example.tex : Contains example code
# - universityTromsoLogo.pdf : An image to be used in the example
add_to_CTANDir layout.tex example.tex img/universityTromsoLogo.pdf

# - example.pdf : Output of example.tex
tex_compile "example"
# - layout.pdf : Contains an overview on which macro goes where in the new \maketitle
tex_compile "layout"
# layout.tex is not going to CTAN
rm $CTANDir/layout.tex

# Get github README ready
mv ../README.md ../README.md.bak
echo -e "<!---\n DO NOT EDIT THIS FILE \n EDITS SHOULD BE DONE IN src/README.template.md \n-->" > ../README.md
cat README.template.md >> ../README.md
cd ../
# rm example.zip
# zip example.zip example.tex example.pdf img/universityTromso.pdf

# cp example.zip ../
# cp example.zip handin/

rm ../example.tex
cp example.tex ../

rm ../handin.sty
cp handin.sty ../

rm -rf ../img
cp -r ./img ../
outHandle "Error when inserting package-variables to README.md-file" $perlDir/vars.pl -v $version -p $packagename -g $github -b $build README.md

rm ../layout.pdf
cp layout.pdf ../
# Zip CTAN file
zip handinCTAN.zip -r $CTANDir/
rm $mainDir/haninCTAN.zip
rm -rf $mainDir/handin
mv $sourceDir/handinCTAN.zip $mainDir/
mv $CTANDir/ $mainDir/$packagename

zip handinCTAN.zip -r handin/
mv handinCTAN.zip ../
rm -rf ../handin
mv handin ../
# unzip example.zip -d example
echo "Tag as v${version}b$build"
2 changes: 1 addition & 1 deletion src/example.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}
\usepackage[english]{babel}
% ^ Supports [english] and [norsk] (norwegian)
% ^ Supports [english], [german] and [norsk] (norwegian)
\usepackage{handin}

\title{Assignment 1}
Expand Down
Binary file modified src/layout.pdf
Binary file not shown.

0 comments on commit 98e0f84

Please sign in to comment.