add makefile
3
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
.DS_Store
|
||||
*~
|
||||
*.swp
|
||||
out/
|
||||
build
|
||||
.tmp
|
||||
|
@ -1,8 +0,0 @@
|
||||
image: quay.io/thallian/calendar-builder:latest
|
||||
|
||||
build:
|
||||
script:
|
||||
- su -c "lualatex --output-directory=. ./calendar.tex" builder
|
||||
artifacts:
|
||||
paths:
|
||||
- calendar.pdf
|
31
Makefile
Normal file
@ -0,0 +1,31 @@
|
||||
BUILD_DIR=build
|
||||
TMP_DIR=.tmp
|
||||
SRC_DIR=src
|
||||
CALENDAR_DIR=calendars
|
||||
|
||||
CALENDAR_YEARS=$(wildcard ${CALENDAR_DIR}/*)
|
||||
CALENDARS=$(patsubst %,${BUILD_DIR}/calendar-%.pdf,$(notdir ${CALENDAR_YEARS}))
|
||||
|
||||
.PHONY: directories calendars all
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
directories: ${BUILD_DIR} ${TMP_DIR}
|
||||
|
||||
${BUILD_DIR}:
|
||||
mkdir -p ${BUILD_DIR}
|
||||
|
||||
${TMP_DIR}:
|
||||
mkdir -p ${TMP_DIR}
|
||||
|
||||
${BUILD_DIR}/calendar-%.pdf: directories ${CALENDAR_DIR}/%/images/* ${SRC_DIR}/*.tex ${SRC_DIR}/*.sty
|
||||
cd ${SRC_DIR} && lualatex --jobname="calendar-$*" --output-directory="../${TMP_DIR}" "\def\calyear{$*} \def\caltitle{"$(file < ${CALENDAR_DIR}/$*/title)"} \input{calendar.tex}"
|
||||
cp "${TMP_DIR}/calendar-$*.pdf" "${BUILD_DIR}/calendar-$*.pdf"
|
||||
|
||||
calendars: directories ${CALENDARS}
|
||||
all: calendars
|
||||
|
||||
clean:
|
||||
rm -rf ${BUILD_DIR}
|
||||
rm -rf ${TMP_DIR}
|
||||
|
||||
%: ${BUILD_DIR}/calendar-%.pdf ;
|
33
README.md
@ -1,22 +1,33 @@
|
||||
# Calendar 2015
|
||||
A calendar for the year 2015, built in LaTeX. The main work is done by the `calpage` command which is based on the [birthday calendar example](www.texample.net/tikz/examples/birthday-calendar/) by Hakon Malmedal.
|
||||
# Calendar Generator
|
||||
A calendar generator, built in LaTeX. The main work is done by the `calpage`
|
||||
command which is based on the [birthday calendar example](www.texample.net/tikz/examples/birthday-calendar/)
|
||||
by Hakon Malmedal.
|
||||
|
||||
Of course the command is usable for years to come, not only 2015 ;)
|
||||
|
||||
The images are licensed as [cc-by 4.0](ihttp://creativecommons.org/licenses/by/4.0/) as is calpage.sty.
|
||||
The images are licensed as [cc-by 4.0](ihttp://creativecommons.org/licenses/by/4.0/)
|
||||
as is calpage.sty.
|
||||
|
||||
# Prerequisites
|
||||
- [LuaTeX](http://www.luatex.org/)
|
||||
- some kind of shell if you want to use the build script (which does nothing fancy, it is mainly a memory hook)
|
||||
- make
|
||||
|
||||
# Usage
|
||||
```
|
||||
./build
|
||||
```
|
||||
Generate the following folder structure: `calendars/{year}/images`.
|
||||
|
||||
Months and weekdays are in german, if you want to change that take a look at the `pgfcalendarmonthname` definition in `calendar.tex` and the `day letter headings` in `calpage.sty`. For holiday definitions, take a look at the end of `calpage.sty`.
|
||||
It is assumed that the images are named after the months of the year (in English)
|
||||
and that there is one image called `title`.
|
||||
|
||||
Make a file `calendars/{year}/title` and write the calendar title into.
|
||||
|
||||
To build all run `make`.
|
||||
|
||||
To build only a specific year run for example `make 2015`.
|
||||
|
||||
# Configuration
|
||||
Months and weekdays are in german, if you want to change that take a look at the
|
||||
`pgfcalendarmonthname` definition in `calendar.tex` and the `day letter headings`
|
||||
in `calpage.sty`. For holiday definitions, take a look at the end of `calpage.sty`.
|
||||
I will make that easier to configure in a future version.
|
||||
|
||||
You'll find the generated pdf in a folder called `out`
|
||||
You'll find the generated pdfs in the `build` folder.
|
||||
|
||||
![a screenshot of december](screenshot.png)
|
||||
|
5
build
@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
mkdir -p ./out
|
||||
|
||||
lualatex --output-directory=out calendar.tex
|
41
calendar.tex
@ -1,41 +0,0 @@
|
||||
% !Mode:: "TeX:UTF-8"
|
||||
|
||||
\documentclass[fontsize=15pt]{scrartcl}
|
||||
\usepackage{lmodern}
|
||||
%\usepackage{fontspec}
|
||||
\usepackage[unicode]{hyperref}
|
||||
\usepackage[margin=5mm,a4paper,portrait]{geometry}
|
||||
\PassOptionsToPackage{cmyk}{xcolor}
|
||||
\usepackage[cmyk]{xcolor}
|
||||
\usepackage{calpage}
|
||||
|
||||
\pagestyle{empty}
|
||||
|
||||
\definecolor{backcolour}{cmyk}{0.012, 0.012, 0.000, 0.020}
|
||||
\pagecolor{backcolour}
|
||||
|
||||
\renewcommand\familydefault{\ttdefault}
|
||||
|
||||
\def\pgfcalendarmonthname#1{
|
||||
\translate{\ifcase#1\or Januar\or Februar\or März\or April\or
|
||||
Mai\or Juni\or Juli\or August\or September\or Oktober\or
|
||||
November\or Dezember\fi}
|
||||
}
|
||||
|
||||
\begin{document}
|
||||
\input{title}
|
||||
|
||||
\calpage{images/january}{2015-01-01}{2015-01-last}
|
||||
\calpage{images/february}{2015-02-01}{2015-02-last}
|
||||
\calpage{images/march}{2015-03-01}{2015-03-last}
|
||||
\calpage{images/april}{2015-04-01}{2015-04-last}
|
||||
\calpage{images/may}{2015-05-01}{2015-05-last}
|
||||
\calpage{images/june}{2015-06-01}{2015-06-last}
|
||||
\calpage{images/july}{2015-07-01}{2015-07-last}
|
||||
\calpage{images/august}{2015-08-01}{2015-08-last}
|
||||
\calpage{images/september}{2015-09-01}{2015-09-last}
|
||||
\calpage{images/october}{2015-10-01}{2015-10-last}
|
||||
\calpage{images/november}{2015-11-01}{2015-11-last}
|
||||
\calpage{images/december}{2015-12-01}{2015-12-last}
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 2.8 MiB |
Before Width: | Height: | Size: 5.2 MiB After Width: | Height: | Size: 5.2 MiB |
Before Width: | Height: | Size: 652 KiB After Width: | Height: | Size: 652 KiB |
Before Width: | Height: | Size: 636 KiB After Width: | Height: | Size: 636 KiB |
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 868 KiB After Width: | Height: | Size: 868 KiB |
Before Width: | Height: | Size: 5.9 MiB After Width: | Height: | Size: 5.9 MiB |
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 2.7 MiB |
Before Width: | Height: | Size: 4.4 MiB After Width: | Height: | Size: 4.4 MiB |
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 2.7 MiB |
Before Width: | Height: | Size: 3.5 MiB After Width: | Height: | Size: 3.5 MiB |
Before Width: | Height: | Size: 813 KiB After Width: | Height: | Size: 813 KiB |
1
calendars/2015/title
Normal file
@ -0,0 +1 @@
|
||||
Traumlicht
|
43
src/calendar.tex
Normal file
@ -0,0 +1,43 @@
|
||||
% !Mode:: "TeX:UTF-8"
|
||||
|
||||
\documentclass[fontsize=15pt]{scrartcl}
|
||||
\usepackage{lmodern}
|
||||
%\usepackage{fontspec}
|
||||
\usepackage[unicode]{hyperref}
|
||||
\usepackage[margin=5mm,a4paper,portrait]{geometry}
|
||||
\PassOptionsToPackage{cmyk}{xcolor}
|
||||
\usepackage[cmyk]{xcolor}
|
||||
\usepackage{luatex85}
|
||||
\def\pgfsysdriver{pgfsys-pdftex.def}
|
||||
\usepackage{calpage}
|
||||
|
||||
\pagestyle{empty}
|
||||
|
||||
\definecolor{backcolour}{cmyk}{0.012, 0.012, 0.000, 0.020}
|
||||
\pagecolor{backcolour}
|
||||
|
||||
\renewcommand\familydefault{\ttdefault}
|
||||
|
||||
\def\pgfcalendarmonthname#1{
|
||||
\translate{\ifcase#1\or Januar\or Februar\or März\or April\or
|
||||
Mai\or Juni\or Juli\or August\or September\or Oktober\or
|
||||
November\or Dezember\fi}
|
||||
}
|
||||
|
||||
\begin{document}
|
||||
\input{title}
|
||||
|
||||
\calpage{../calendars/\calyear/images/january}{\calyear-01-01}{\calyear-01-last}
|
||||
\calpage{../calendars/\calyear/images/february}{\calyear-02-01}{\calyear-02-last}
|
||||
\calpage{../calendars/\calyear/images/march}{\calyear-03-01}{\calyear-03-last}
|
||||
\calpage{../calendars/\calyear/images/april}{\calyear-04-01}{\calyear-04-last}
|
||||
\calpage{../calendars/\calyear/images/may}{\calyear-05-01}{\calyear-05-last}
|
||||
\calpage{../calendars/\calyear/images/june}{\calyear-06-01}{\calyear-06-last}
|
||||
\calpage{../calendars/\calyear/images/july}{\calyear-07-01}{\calyear-07-last}
|
||||
\calpage{../calendars/\calyear/images/august}{\calyear-08-01}{\calyear-08-last}
|
||||
\calpage{../calendars/\calyear/images/september}{\calyear-09-01}{\calyear-09-last}
|
||||
\calpage{../calendars/\calyear/images/october}{\calyear-10-01}{\calyear-10-last}
|
||||
\calpage{../calendars/\calyear/images/november}{\calyear-11-01}{\calyear-11-last}
|
||||
\calpage{../calendars/\calyear/images/december}{\calyear-12-01}{\calyear-12-last}
|
||||
|
||||
\end{document}
|
@ -1,15 +1,15 @@
|
||||
\begin{titlepage}
|
||||
\begin{center}
|
||||
|
||||
\boxincludegraphics{width=\textwidth,height=1.1\textwidth}{images/title.jpg}
|
||||
\boxincludegraphics{width=\textwidth,height=1.1\textwidth}{../calendars/\calyear/images/title.jpg}
|
||||
\vspace{4mm}
|
||||
\rule{\linewidth}{0.5mm} \\[0.4cm]
|
||||
{ \Huge \bfseries 2015}\\
|
||||
{ \Huge \bfseries \calyear}\\
|
||||
\vspace{4mm}
|
||||
\rule{\linewidth}{0.5mm} \\[1.5cm]
|
||||
\vspace{2mm}
|
||||
|
||||
{ \large Traumlicht }
|
||||
{ \large \caltitle }
|
||||
|
||||
\end{center}
|
||||
\end{titlepage}
|