diff --git a/include/open-logic-chapter.tex b/include/open-logic-chapter.tex index 55755ac3..e83f2b82 100644 --- a/include/open-logic-chapter.tex +++ b/include/open-logic-chapter.tex @@ -10,6 +10,8 @@ \def\thechapter{\theolchapter} +\pagestyle{openlogic} + \begin{document} This file should not be compiled on its own. It is merely a template to diff --git a/include/open-logic-part.tex b/include/open-logic-part.tex index d119c098..457af103 100644 --- a/include/open-logic-part.tex +++ b/include/open-logic-part.tex @@ -8,6 +8,8 @@ \input{\olpath/sty/open-logic.sty} \input{\olpath/sty/open-logic-debug.sty} +\pagestyle{openlogic} + \begin{document} This file should not be compiled on its own. It is merely a template to diff --git a/include/open-logic-section.tex b/include/open-logic-section.tex index 1b37ed42..268fd9ec 100644 --- a/include/open-logic-section.tex +++ b/include/open-logic-section.tex @@ -10,6 +10,8 @@ \def\thechapter{\theolchapter} +\pagestyle{openlogic} + \begin{document} This file should not be compiled on its own. It is merely a template to diff --git a/open-logic-complete.tex b/open-logic-complete.tex index 7d401ba7..4f5c2a2e 100644 --- a/open-logic-complete.tex +++ b/open-logic-complete.tex @@ -12,14 +12,15 @@ \usepackage{courier} \linespread{1.05} % Palatino looks better with this -\usepackage[footinfo]{gitinfo} - +\usepackage{gitinfo} \input{\olpath/sty/open-logic.sty} \input{\olpath/sty/open-logic-defer.sty} \let\cleardoublepage\clearpage +\pagestyle{openlogic} + \begin{document} \begin{titlingpage} diff --git a/open-logic-debug.tex b/open-logic-debug.tex index d4b4f081..424d1229 100644 --- a/open-logic-debug.tex +++ b/open-logic-debug.tex @@ -7,7 +7,7 @@ % Lives in main directory \newcommand*{\olpath}{.} -\usepackage[footinfo]{gitinfo} +\usepackage{gitinfo} \input{\olpath/sty/open-logic.sty} \input{\olpath/sty/open-logic-debug.sty} @@ -27,6 +27,8 @@ \nopartblankpage \let\cleardoublepage\clearpage +\pagestyle{openlogic} + \begin{document} \begin{titlingpage} @@ -52,10 +54,8 @@ \end{titlingpage} -% make links red, tokens green +% make links red green \hypersetup{urlcolor=[rgb]{0.5,0,0}} -\def\tokencolor{\color[rgb]{0,.5,0}} -\def\tokenformat#1{{\tokencolor #1}} \tableofcontents* diff --git a/sty/open-logic-debug.sty b/sty/open-logic-debug.sty index 8a58c69b..c1b0bcaa 100644 --- a/sty/open-logic-debug.sty +++ b/sty/open-logic-debug.sty @@ -23,4 +23,6 @@ \AtBeginEnvironment{intro}{\oldebugnote[blue]{intro}} \AtBeginEnvironment{pedantic}{\oldebugnote[blue]{pedantic}} -\def\printtexttoken#1#2{{\color{blue}#2}} +% print tokenized text in dark green +\def\tokencolor{\color[rgb]{0,.5,0}} +\def\tokenformat#1{{\tokencolor #1}} diff --git a/sty/open-logic-tokenize.sty b/sty/open-logic-tokenize.sty index 11661728..14f01d98 100644 --- a/sty/open-logic-tokenize.sty +++ b/sty/open-logic-tokenize.sty @@ -17,7 +17,8 @@ % Optional star indicates nouns that take "an" rather than "a" as article. % `\definetoken{switch}{token}{replacement text}` - defines a macro -% `\TOK@switch@token` to produce +% `\TOK@switch@token` to produce . `\definetokenuc` +% takes the first character an makes it uppercase. \newcommand*{\definetoken}[3]{\expandafter\edef\csname TOK@#1@#2\endcsname{#3}} @@ -54,14 +55,14 @@ \DeclareDocumentCommand \@printtoken { t^ ta m ts } {% \IfBooleanTF {#1} - {\IfBooleanTF {#2}{\printtoken{A}{#3} + {\IfBooleanTF {#2}{\printtoken{A}{#3}~% \IfBooleanTF {#4} {\printtoken{p}{#3}} {\printtoken{s}{#3}}}{% \IfBooleanTF {#4} {\printtoken{P}{#3}} {\printtoken{S}{#3}}}}{% - {\IfBooleanTF {#2}{\printtoken{a}{#3} }{}% + {\IfBooleanTF {#2}{\printtoken{a}{#3}~}{}% \IfBooleanTF {#4} {\printtoken{p}{#3}} {\printtoken{s}{#3}}}}} @@ -76,7 +77,8 @@ \PackageWarning{open-logic-tokenize}{Token #2 undefined}{\color{red}#2}\fi} % `\tokenformat` - wrapper to format token text; command can be -% redefined to eg print tokens in color +% redefined to eg print tokens in color. Warning: to work in headers +% it must be compatible with `\uppercase` \def\tokenformat#1{#1} diff --git a/sty/open-logic.sty b/sty/open-logic.sty index 718f1fa4..5c037567 100644 --- a/sty/open-logic.sty +++ b/sty/open-logic.sty @@ -131,6 +131,19 @@ \hfill \href{http://openlogicproject.org/}{\includegraphics[width=2.4cm]{\olpath/assets/logos/openlogic-logo-bw}}} +% - `\ifgitinfo`: produced Git revision information if `gitinfo` is used + +\newcommand*{\ifgitinfo}{\ifdefined\gitVtags\sffamily\footnotesize + rev\gitVtags: + \href{https://github.com/OpenLogicProject/OpenLogic/commits/master} + {\gitAbbrevHash} + (\gitAuthorDate)\else\relax\fi} + +\newcommand*{\shortollicense}{\sffamily\footnotesize + \textit{\href{https://github.com/OpenLogicProject/OpenLogic}{\jobname}} + \ifgitinfo\ by \href{http://openlogicproject.org/}{OLP} / + \href{http://creativecommons.org/licenses/by/4.0/}{CC--BY}} + \newcommand*{\oluselicense}[2]{% \begin{minipage}[b]{.9cm} @@ -153,5 +166,8 @@ \hfill \href{http://openlogicproject.org/}{\includegraphics[width=2.7cm]{\olpath/assets/logos/openlogic-logo-bw}}} +\copypagestyle{openlogic}{plain} +\makeevenfoot{openlogic}{\thepage}{}{\shortollicense} +\makeoddfoot{openlogic}{\shortollicense}{}{\thepage} \makeatother