Compare commits

..

2 commits

Author SHA1 Message Date
Wolfgang 393ed36daf fix trainee detection 2024-11-30 18:42:52 +01:00
Wolfgang 262baee0a3 more config options and descriptions 2024-11-30 13:38:31 +01:00
2 changed files with 73 additions and 44 deletions

View file

@ -11,8 +11,9 @@ enumerated with the number as watermark.
See [sample pdf](../../../raw/branch/main/sample/logsheet.DL1XXXX.pdf)
Your callsign can be a watermark across the background. If the sheet is for
trainee logging, there will be "Location+OP" in the heading.
Your callsign can be a watermark across the background. Font size is calculated
automatically. If the sheet is for trainee logging, there will be "Location+OP"
in the heading.
## Setup
@ -33,7 +34,9 @@ Of course you can use your own method of using LaTeX.
heading (for new (2024) german trainee callsign)
* Configuration in the first section of logsheet.tex possible:
* paper format
* number of logging blocks on each page
* number of blocks on each page
* number of pages
* page layout
## Build
With the build system: **make pdf**

View file

@ -3,6 +3,9 @@
% can do whatever you want with this stuff. If we meet some day, and you think
% this stuff is worth it, you can buy me a beer in return.
% needed because pgf also loads xcolor with different options
\PassOptionsToPackage{svgnames}{xcolor}
\documentclass[12pt]{article}
%
@ -13,17 +16,26 @@
\newlength{\rowheight}
% configure height of lines
\setlength{\rowheight}{9mm}
% configure number of tables on each page
% configure number of table blocks on each page
\def\numtables{2}
% margins of paper defined above
\usepackage[\paper, hmargin=0.7cm, vmargin=0.9cm]{geometry}
% layout of pages (with pgfmorepages)
% valid settings e. g. 2 on 1, 4 on 1, 6 on 1, 8 on 1, 16 on 1
\usepackage{pgfmorepages}
\pgfpagesuselayout{2 on 1}[\paper, landscape]
% how many pages (duplex printing with \pgflayout 2 on 1 can fit 4 pages
% but maybe more numerated pages are needed
% you may run out of memory for latex, maybe try lualatex
\def\numpages{4}
% define callsign here or with filename
% e. g. \def\callsign{AB1CD}
% if you define it here, callsign will not be taken from filename
\def\callsign{}
% is this for trainee logging?
% set \trainee to trainee for trainee callsign
% or to traineestroke to get \callsign/T
% or to stroketrainee to get \callsign/T
% if you define it here, trainee will not be taken from filename
\def\trainee{}
@ -60,16 +72,37 @@
}{
\StrCut{\strB}{.}\strTemp\strC
}
\newif\ifistrainee
% default is false
\istraineefalse
% add /t to callsign if filename is logsheet.CALLSIGN.stroketrainee.tex
% set istrainee to true if applicable
% strange things with detokenize needed with latex
\StrLen{\trainee}[\lenTemp]
\IfEq{\lenTemp}{0}{
\StrCut{\strC}{.}\trainee\strD
}{}
%add /t to callsign if filename is logbool.CALLSIGN.traineestroke.tex
\IfStrEq{\trainee}{\detokenize{traineestroke}}{
\def\trainee{trainee}
\IfStrEq{\trainee}{\detokenize{trainee}}{
\istraineetrue
}{
\IfStrEq{\trainee}{\detokenize{stroketrainee}}{
\istraineetrue
\edef\callsign{\callsign/T}
}{}
}
}{
\IfStrEq{\trainee}{trainee}{
\istraineetrue
}{
\IfStrEq{\trainee}{stroketrainee}{
\istraineetrue
\edef\callsign{\callsign/T}
}{}
}
}
% default scale if there is no callsign (\wmfontscale\paperwidth)
\FPset\wmfontscale{0.25}
@ -90,7 +123,7 @@
% pagenumber as watermark
\FPeval\wmfontscalepagenumber{0.75*wmfontscale}
\usepackage[svgnames]{xcolor}
\usepackage{xcolor}
\usepackage{eso-pic}
\usepackage{tikz}
\usetikzlibrary{calc}
@ -113,10 +146,6 @@
}
}
% Duplicate page: e. g. two a5 on one a4
\usepackage{pgfmorepages}
\pgfpagesuselayout{2 on 1}[\paper,landscape]
\pagestyle{empty}
\setlength\parindent{0pt}
@ -129,11 +158,11 @@
\FPeval\tablelinesPlusFour{round(tablelines + 4, 0)}
% add +OP on trainee sheet
\IfStrEq{\trainee}{\detokenize{trainee}}{
\ifistrainee
\def\locationOp{Location+OP}
}{
\else
\def\locationOp{Location}
}
\fi
% add content of table, create #2 times #1/#2 rows, #1/#2 including two header rows
\prgNewFunction \makerows{mm} {
@ -166,12 +195,10 @@
\ttfamily
\SetTblrInner{rowsep=0pt,rulesep=0pt}
% two sides (front/back)
\foreach \i in {1,2}
\foreach \i in {1,...,\numpages}
{
% two pages (left/right)
\foreach \j in {1,2}
{
% watermark on every side
\message{page \i}
% watermark on every page
\wmpagenumber
\begin{center}
% fix centering
@ -190,5 +217,4 @@
\end{center}
\newpage
}
}
\end{document}