From 85effb35e1cad964004684a9ae63d4a3d78fcc83 Mon Sep 17 00:00:00 2001 From: Christian Haeusler <794584+corvus-ch@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:35:29 +0100 Subject: [PATCH 1/2] Add titlepage Prepended a title page to each inlay. Used the title page to provide contextual information. --- .github/workflows/build.yaml | 15 ++++++------ Makefile | 16 +++++-------- dotted-inlay.tex | 23 ++++++++++++++++++ dotted.tex | 22 +++-------------- freitag-inlay.sty => freitag.sty | 2 +- gridded-inlay.tex | 21 ++++++++++++++++ gridded.tex | 20 +++------------- inlay.sty | 41 ++++++++++++++++++++++++++++++++ license.tex | 12 ---------- 9 files changed, 106 insertions(+), 66 deletions(-) create mode 100644 dotted-inlay.tex rename freitag-inlay.sty => freitag.sty (98%) create mode 100644 gridded-inlay.tex create mode 100644 inlay.sty delete mode 100644 license.tex diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 94aa34c..e9bf166 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,24 +16,25 @@ jobs: name: - dotted - gridded + steps: - name: Set up Git repository uses: actions/checkout@v2 - - 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 diff --git a/Makefile b/Makefile index b4f13f7..657c42a 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/dotted-inlay.tex b/dotted-inlay.tex new file mode 100644 index 0000000..ce23c28 --- /dev/null +++ b/dotted-inlay.tex @@ -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} diff --git a/dotted.tex b/dotted.tex index e995abb..e476aa3 100644 --- a/dotted.tex +++ b/dotted.tex @@ -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} diff --git a/freitag-inlay.sty b/freitag.sty similarity index 98% rename from freitag-inlay.sty rename to freitag.sty index 2e5e96b..71613ae 100644 --- a/freitag-inlay.sty +++ b/freitag.sty @@ -1,5 +1,5 @@ %!TEX encoding = UTF-8 Unicode -\ProvidesPackage{freitag-inlay} +\ProvidesPackage{freitag} % ========== % Dimensions diff --git a/gridded-inlay.tex b/gridded-inlay.tex new file mode 100644 index 0000000..f4160d3 --- /dev/null +++ b/gridded-inlay.tex @@ -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} diff --git a/gridded.tex b/gridded.tex index ad34169..0953807 100644 --- a/gridded.tex +++ b/gridded.tex @@ -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} diff --git a/inlay.sty b/inlay.sty new file mode 100644 index 0000000..ce71340 --- /dev/null +++ b/inlay.sty @@ -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{\gitDescribe~\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} +} diff --git a/license.tex b/license.tex deleted file mode 100644 index 46ab616..0000000 --- a/license.tex +++ /dev/null @@ -1,12 +0,0 @@ -\documentclass[9pt,twoside]{scrartcl} - -\usepackage[ - type={CC}, - modifier={by-sa}, - version={4.0}, -]{doclicense} - -\begin{document} -\pagestyle{empty} -\doclicenseThis -\end{document} From ce9415a0a5d919ce7e94fccf3cc8d6410e88b932 Mon Sep 17 00:00:00 2001 From: Christian Haeusler <794584+corvus-ch@users.noreply.github.com> Date: Thu, 6 Jan 2022 19:08:48 +0100 Subject: [PATCH 2/2] Update git info --- .github/workflows/build.yaml | 5 +++++ inlay.sty | 2 +- update-git-info.sh | 31 +++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 update-git-info.sh diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e9bf166..48997c3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,6 +20,11 @@ jobs: 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 inlay uses: xu-cheng/latex-action@v2 diff --git a/inlay.sty b/inlay.sty index ce71340..f0fdcdf 100644 --- a/inlay.sty +++ b/inlay.sty @@ -29,7 +29,7 @@ \subject{Freitag Agenda Inlay} \title{#1} \author{Christian Häusler} - \date{\gitDescribe~\gitAuthorIsoDate} + \date{\gitFirstTagDescribe~\gitAuthorIsoDate} \publishers{https://github.com/corvus-ch/freitag-inlay} \clearpage \maketitle diff --git a/update-git-info.sh b/update-git-info.sh new file mode 100755 index 0000000..fe08ee8 --- /dev/null +++ b/update-git-info.sh @@ -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