Skip to content

Commit

Permalink
Merge pull request #2 from corvus-ch/titlepage
Browse files Browse the repository at this point in the history
Add titlepage
  • Loading branch information
corvus-ch authored Jan 6, 2022
2 parents f309196 + ce9415a commit 4019ac9
Show file tree
Hide file tree
Showing 10 changed files with 142 additions and 66 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,30 @@ jobs:
name:
- dotted
- gridded

steps:
- name: Set up Git repository
uses: actions/checkout@v2
with:
fetch-depth: "0"

- name: Update git info
run: ./update-git-info.sh

- name: Compile LaTeX documents
- name: Compile inlay
uses: xu-cheng/latex-action@v2
with:
root_file: ${{ matrix.name }}.tex
root_file: ${{ matrix.name }}-inlay.tex
latexmk_use_xelatex: true
post_compile: pdfjam --vanilla --noautoscale true --angle 90 --nup 2x1 --suffix 'booklet' --booklet true ${{ matrix.name }}.pdf
- name: Append licence

- name: Compile main document
uses: xu-cheng/latex-action@v2
with:
root_file: license.tex
root_file: ${{ matrix.name }}.tex
latexmk_use_xelatex: true
post_compile: pdfjam --vanilla --noautoscale true --outfile ${{ matrix.name }}.pdf ${{ matrix.name }}-booklet.pdf license.pdf

- uses: actions/upload-artifact@v2
- name: Upload PDF
uses: actions/upload-artifact@v2
with:
path: ${{ matrix.name }}.pdf

Expand Down
16 changes: 6 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,19 @@ SHELL := bash
.SUFFIXES:

# Internal variables
build_cmd := latexmk -pdf -pdflatex="xelatex -interaction=nonstopmode" -use-make
build_cmd := latexmk -pdf -pdflatex="xelatex -shell-escape -interaction=nonstopmode" -use-make
clean_cmd := latexmk -c

# Rules and targets
.PHONY: all
all: dotted-template.pdf gridded-template.pdf
all: dotted.pdf gridded.pdf

.SUFFIXES: -template.pdf
%-template.pdf: %-2x1.pdf license.pdf
pdfjam --vanilla --noautoscale true --outfile $*-template.pdf $^

.SUFFIXES: -2x1.pdf
%-2x1.pdf: %.pdf
pdfjam --vanilla --noautoscale true --angle 90 --nup 2x1 --suffix '2x1' --booklet true $<
.SUFFIXES: -inlay.pdf
%-inlay.pdf: %-inlay.tex
$(build_cmd) $<

.SUFFIXES: .pdf
%.pdf: %.tex freitag-inlay.sty
%.pdf: %.tex %-inlay.pdf inlay.sty
$(build_cmd) $<

.PHONY: clean
Expand Down
23 changes: 23 additions & 0 deletions dotted-inlay.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
\documentclass[twoside]{scrartcl}

\usepackage{freitag}
\usepackage{tikz}
\usepackage{color}

\newcommand{\griddim}{5mm}

\newcommand{\dottedpage}{%
\begin{tikzpicture}[gray, ultra thin]
\draw [step=\griddim, line cap=round, dash pattern=on 0pt off \griddim, thin] (0,0) grid (\width-\margin-\margininner,\height-\margin-\margin);
\draw [dashed] (5mm,0) -- (5mm,\height-\margin-\margin);
\end{tikzpicture}
}

\begin{document}
\pagestyle{empty}
\enlargethispage{\margin}
\dottedpage
\dottedpage
\dottedpage
\dottedpage
\end{document}
22 changes: 3 additions & 19 deletions dotted.tex
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
\documentclass[9pt,twoside]{scrartcl}
\documentclass{scrartcl}

\usepackage{freitag-inlay}
\usepackage{tikz}
\usepackage{color}

\newcommand{\griddim}{5mm}

\newcommand{\dottedpage}{%
\begin{tikzpicture}[gray, ultra thin]
\draw [step=\griddim, line cap=round, dash pattern=on 0pt off \griddim, thin] (0,0) grid (\width-\margin-\margininner,\height-\margin-\margin);
\draw [dashed] (5mm,0) -- (5mm,\height-\margin-\margin);
\end{tikzpicture}
}
\usepackage{inlay}

\begin{document}
\pagestyle{empty}
\enlargethispage{\margin}
\dottedpage
\dottedpage
\dottedpage
\dottedpage
\inlay{Dotted}{dotted-inlay.pdf}
\end{document}
2 changes: 1 addition & 1 deletion freitag-inlay.sty → freitag.sty
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%!TEX encoding = UTF-8 Unicode
\ProvidesPackage{freitag-inlay}
\ProvidesPackage{freitag}

% ==========
% Dimensions
Expand Down
21 changes: 21 additions & 0 deletions gridded-inlay.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
\documentclass[twoside]{scrartcl}

\usepackage{freitag}
\usepackage{tikz}
\usepackage{color}

\newcommand{\griddedpage}{%
\begin{tikzpicture}[gray, very thin]
\draw [xstep=10mm,ystep=4mm] (0,0) grid (\width-\margin-\margininner,\height-\margin-\margin);
\draw [dashed] (\margintext,0) -- (\margintext,\height-\margin-\margin);
\end{tikzpicture}
}

\begin{document}
\pagestyle{empty}
\enlargethispage{\margin}
\griddedpage
\griddedpage
\griddedpage
\griddedpage
\end{document}
20 changes: 3 additions & 17 deletions gridded.tex
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
\documentclass[9pt,twoside]{scrartcl}
\documentclass{scrartcl}

\usepackage{freitag-inlay}
\usepackage{tikz}
\usepackage{color}

\newcommand{\griddedpage}{%
\begin{tikzpicture}[gray, very thin]
\draw [xstep=10mm,ystep=4mm] (0,0) grid (\width-\margin-\margininner,\height-\margin-\margin);
\draw [dashed] (\margintext,0) -- (\margintext,\height-\margin-\margin);
\end{tikzpicture}
}
\usepackage{inlay}

\begin{document}
\pagestyle{empty}
\enlargethispage{\margin}
\griddedpage
\griddedpage
\griddedpage
\griddedpage
\inlay{Gridded}{gridded-inlay.pdf}
\end{document}
41 changes: 41 additions & 0 deletions inlay.sty
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
%!TEX encoding = UTF-8 Unicode
\ProvidesPackage{inlay}

% Fonts
% -----
\RequirePackage{ifxetex}

\ifxetex
\RequirePackage{fontspec}
\RequirePackage{xltxtra}
\RequirePackage{xunicode}
\else
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\fi

% Titlepage
% ---------
\RequirePackage{pdfpages}
\RequirePackage{gitinfo2}
\RequirePackage[
type={CC},
modifier={by-sa},
version={4.0},
]{doclicense}

\newcommand{\inlay}[2]{%
\begin{titlepage}
\subject{Freitag Agenda Inlay}
\title{#1}
\author{Christian Häusler}
\date{\gitFirstTagDescribe~\gitAuthorIsoDate}
\publishers{https://github.com/corvus-ch/freitag-inlay}
\clearpage
\maketitle
\thispagestyle{empty}
\vfill
\doclicenseThis
\end{titlepage}
\includepdf[angle=90,nup=2x1,booklet=true,pages=-]{#2}
}
12 changes: 0 additions & 12 deletions license.tex

This file was deleted.

31 changes: 31 additions & 0 deletions update-git-info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh
# Copyright 2015 Brent Longborough
# Part of gitinfo2 package Version 2
# Release 2.0.7 2015-11-22
# Please read gitinfo2.pdf for licencing and other details
# -----------------------------------------------------
# Post-{commit,checkout,merge} hook for the gitinfo2 package
#
# Get the first tag found in the history from the current HEAD
FIRSTTAG=$(git describe --tags --always --dirty='-*' 2>/dev/null)
# Get the first tag in history that looks like a Release
RELTAG=$(git describe --tags --long --always --dirty='-*' --match 'v*' 2>/dev/null)
# Hoover up the metadata
git --no-pager log -1 --date=short --decorate=short \
--pretty=format:"\usepackage[%
shash={%h},
lhash={%H},
authname={%an},
authemail={%ae},
authsdate={%ad},
authidate={%ai},
authudate={%at},
commname={%cn},
commemail={%ce},
commsdate={%cd},
commidate={%ci},
commudate={%ct},
refnames={%d},
firsttagdescribe={$FIRSTTAG},
reltag={$RELTAG}
]{gitexinfo}" HEAD > .git/gitHeadInfo.gin

0 comments on commit 4019ac9

Please sign in to comment.