Skip to content

Commit

Permalink
footers now display revision and license
Browse files Browse the repository at this point in the history
  • Loading branch information
rzach committed Apr 23, 2015
1 parent 3d4d70f commit 9797b98
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 11 deletions.
2 changes: 2 additions & 0 deletions include/open-logic-chapter.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions include/open-logic-part.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions include/open-logic-section.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions open-logic-complete.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
8 changes: 4 additions & 4 deletions open-logic-debug.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -27,6 +27,8 @@
\nopartblankpage
\let\cleardoublepage\clearpage

\pagestyle{openlogic}

\begin{document}

\begin{titlingpage}
Expand All @@ -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*
Expand Down
4 changes: 3 additions & 1 deletion sty/open-logic-debug.sty
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
10 changes: 6 additions & 4 deletions sty/open-logic-tokenize.sty
Original file line number Diff line number Diff line change
Expand Up @@ -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 <replacement text>
% `\TOK@switch@token` to produce <replacement text>. `\definetokenuc`
% takes the first character an makes it uppercase.

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

Expand Down Expand Up @@ -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}}}}}
Expand All @@ -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}

Expand Down
16 changes: 16 additions & 0 deletions sty/open-logic.sty
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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

0 comments on commit 9797b98

Please sign in to comment.