Permalink
Browse files

Add doc/mkfile for building wmii.pdf with an optional MAINFONT variab…

…le for building on systems without LinoType's Palatino font.
  • Loading branch information...
1 parent 9cdc795 commit a655693bc2a93924d0e32af2a531edb63991903d Kris Maglione committed Sep 27, 2011
Showing with 39 additions and 2 deletions.
  1. +1 −1 alternative_wmiircs/python/wmiirc.py
  2. +33 −0 doc/mkfile
  3. +5 −1 doc/wmii.tex
@@ -45,7 +45,7 @@
wmii['border'] = 2
def setbackground(color):
- call('xsetroot', '-solid', color)
+ call('xsetroot', '-solid', color, background=True)
setbackground(background)
terminal = 'wmiir', 'setsid', '@TERMINAL@'
View
@@ -0,0 +1,33 @@
+MKSHELL=rc
+
+TARG = wmii.pdf
+SRC = ${TARG:%.pdf=%.tex}
+TEX = xelatex
+
+default:V: all
+all:V: $TARG
+
+# mk doesn't recognize nested `{}
+deps = `{ ash -c 'dep() { echo $1; for f in $(9 sed -n "s/.*\\include{([^}]+)}.*/\1.tex/p; s/.*\\input (.*)/\1.tex/p" $1); do dep $f; done; }; dep $SRC' }
+# `
+$TARG: $deps
+
+junk = aux idx ilg ind log toc out
+CLEAN = ${TARG:%.pdf=%}
+CLEAN = ${junk:%=$CLEAN.%} ${deps:%.tex=%.aux}
+clean:V:
+ rm -f $CLEAN
+
+%.pdf: %.tex mkfile
+ flag x +
+ if (~ $MAINFONT '')
+ fn tex { builtin $TEX $stem.tex }
+ if not
+ fn tex { builtin $TEX '\def\mainfont{'$"MAINFONT'}\input{'$stem.tex'}' }
+
+ tex
+ makeindex $stem
+ tex
+ rm -f $stem.out 2>/dev/null
+
+# vim:se ft=make:
View
@@ -22,7 +22,11 @@
\makeindex
\let\primary=\textbf
-\setmainfont[Mapping=tex-text, Numbers=OldStyle]{Palatino LT Std}
+\ifx\mainfont\undefined
+ \def\mainfont{Palatino LT Std}
+\fi
+
+\setmainfont[Mapping=tex-text, Numbers=OldStyle]\mainfont
\def\lining{\addfontfeature{Numbers=Lining}}
\let\primary=\textbf

0 comments on commit a655693

Please sign in to comment.