Skip to content

Commit 9797b98

Browse files
committed
footers now display revision and license
1 parent 3d4d70f commit 9797b98

8 files changed

Lines changed: 38 additions & 11 deletions

include/open-logic-chapter.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
\def\thechapter{\theolchapter}
1212

13+
\pagestyle{openlogic}
14+
1315
\begin{document}
1416

1517
This file should not be compiled on its own. It is merely a template to

include/open-logic-part.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
\input{\olpath/sty/open-logic.sty}
99
\input{\olpath/sty/open-logic-debug.sty}
1010

11+
\pagestyle{openlogic}
12+
1113
\begin{document}
1214

1315
This file should not be compiled on its own. It is merely a template to

include/open-logic-section.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
\def\thechapter{\theolchapter}
1212

13+
\pagestyle{openlogic}
14+
1315
\begin{document}
1416

1517
This file should not be compiled on its own. It is merely a template to

open-logic-complete.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
\usepackage{courier}
1313
\linespread{1.05} % Palatino looks better with this
1414

15-
\usepackage[footinfo]{gitinfo}
16-
15+
\usepackage{gitinfo}
1716

1817
\input{\olpath/sty/open-logic.sty}
1918
\input{\olpath/sty/open-logic-defer.sty}
2019

2120
\let\cleardoublepage\clearpage
2221

22+
\pagestyle{openlogic}
23+
2324
\begin{document}
2425

2526
\begin{titlingpage}

open-logic-debug.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
% Lives in main directory
88
\newcommand*{\olpath}{.}
99

10-
\usepackage[footinfo]{gitinfo}
10+
\usepackage{gitinfo}
1111

1212
\input{\olpath/sty/open-logic.sty}
1313
\input{\olpath/sty/open-logic-debug.sty}
@@ -27,6 +27,8 @@
2727
\nopartblankpage
2828
\let\cleardoublepage\clearpage
2929

30+
\pagestyle{openlogic}
31+
3032
\begin{document}
3133

3234
\begin{titlingpage}
@@ -52,10 +54,8 @@
5254

5355
\end{titlingpage}
5456

55-
% make links red, tokens green
57+
% make links red green
5658
\hypersetup{urlcolor=[rgb]{0.5,0,0}}
57-
\def\tokencolor{\color[rgb]{0,.5,0}}
58-
\def\tokenformat#1{{\tokencolor #1}}
5959

6060

6161
\tableofcontents*

sty/open-logic-debug.sty

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@
2323
\AtBeginEnvironment{intro}{\oldebugnote[blue]{intro}}
2424
\AtBeginEnvironment{pedantic}{\oldebugnote[blue]{pedantic}}
2525

26-
\def\printtexttoken#1#2{{\color{blue}#2}}
26+
% print tokenized text in dark green
27+
\def\tokencolor{\color[rgb]{0,.5,0}}
28+
\def\tokenformat#1{{\tokencolor #1}}

sty/open-logic-tokenize.sty

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
% Optional star indicates nouns that take "an" rather than "a" as article.
1818

1919
% `\definetoken{switch}{token}{replacement text}` - defines a macro
20-
% `\TOK@switch@token` to produce <replacement text>
20+
% `\TOK@switch@token` to produce <replacement text>. `\definetokenuc`
21+
% takes the first character an makes it uppercase.
2122

2223
\newcommand*{\definetoken}[3]{\expandafter\edef\csname TOK@#1@#2\endcsname{#3}}
2324

@@ -54,14 +55,14 @@
5455

5556
\DeclareDocumentCommand \@printtoken { t^ ta m ts } {%
5657
\IfBooleanTF {#1}
57-
{\IfBooleanTF {#2}{\printtoken{A}{#3}
58+
{\IfBooleanTF {#2}{\printtoken{A}{#3}~%
5859
\IfBooleanTF {#4}
5960
{\printtoken{p}{#3}}
6061
{\printtoken{s}{#3}}}{%
6162
\IfBooleanTF {#4}
6263
{\printtoken{P}{#3}}
6364
{\printtoken{S}{#3}}}}{%
64-
{\IfBooleanTF {#2}{\printtoken{a}{#3} }{}%
65+
{\IfBooleanTF {#2}{\printtoken{a}{#3}~}{}%
6566
\IfBooleanTF {#4}
6667
{\printtoken{p}{#3}}
6768
{\printtoken{s}{#3}}}}}
@@ -76,7 +77,8 @@
7677
\PackageWarning{open-logic-tokenize}{Token #2 undefined}{\color{red}#2}\fi}
7778

7879
% `\tokenformat` - wrapper to format token text; command can be
79-
% redefined to eg print tokens in color
80+
% redefined to eg print tokens in color. Warning: to work in headers
81+
% it must be compatible with `\uppercase`
8082

8183
\def\tokenformat#1{#1}
8284

sty/open-logic.sty

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,19 @@
131131
\hfill
132132
\href{http://openlogicproject.org/}{\includegraphics[width=2.4cm]{\olpath/assets/logos/openlogic-logo-bw}}}
133133

134+
% - `\ifgitinfo`: produced Git revision information if `gitinfo` is used
135+
136+
\newcommand*{\ifgitinfo}{\ifdefined\gitVtags\sffamily\footnotesize
137+
rev\gitVtags:
138+
\href{https://github.com/OpenLogicProject/OpenLogic/commits/master}
139+
{\gitAbbrevHash}
140+
(\gitAuthorDate)\else\relax\fi}
141+
142+
\newcommand*{\shortollicense}{\sffamily\footnotesize
143+
\textit{\href{https://github.com/OpenLogicProject/OpenLogic}{\jobname}}
144+
\ifgitinfo\ by \href{http://openlogicproject.org/}{OLP} /
145+
\href{http://creativecommons.org/licenses/by/4.0/}{CC--BY}}
146+
134147

135148
\newcommand*{\oluselicense}[2]{%
136149
\begin{minipage}[b]{.9cm}
@@ -153,5 +166,8 @@
153166
\hfill
154167
\href{http://openlogicproject.org/}{\includegraphics[width=2.7cm]{\olpath/assets/logos/openlogic-logo-bw}}}
155168

169+
\copypagestyle{openlogic}{plain}
170+
\makeevenfoot{openlogic}{\thepage}{}{\shortollicense}
171+
\makeoddfoot{openlogic}{\shortollicense}{}{\thepage}
156172

157173
\makeatother

0 commit comments

Comments
 (0)