wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

wmii.tex (5097B)


      1 \documentclass[letterpaper,oneside]{scrbook}
      2 
      3 \usepackage{txfonts}
      4 
      5 \usepackage{fontspec}
      6 \usepackage{xunicode}
      7 \usepackage{xltxtra}
      8 
      9 \usepackage{fancyvrb}
     10 \usepackage[top=1in,bottom=1in]{geometry}
     11 \usepackage{graphicx}
     12 \usepackage{makeidx}
     13 \usepackage{xcolor}
     14 \usepackage[xetex,breaklinks,colorlinks,linkcolor=black]{hyperref}
     15 
     16 \let\EA=\expandafter
     17 
     18 \newif\ifexpandfragments
     19 \newif\ifdefinefragments
     20 
     21 %% Indexes
     22 \makeindex
     23 \let\primary=\textbf
     24 
     25 \ifx\mainfont\undefined
     26   \def\mainfont{Palatino LT Std}
     27 \fi
     28 
     29 \setmainfont[Mapping=tex-text, Numbers=OldStyle]\mainfont
     30 \def\lining{\addfontfeature{Numbers=Lining}}
     31 
     32 \let\primary=\textbf
     33 
     34 \def\titlebar#1{%
     35   \begin{center}\includegraphics[width=5.5in]{#1.png}\end{center}}
     36 
     37 \def\man#1#2{#2\textbf{(#1)}}
     38 
     39 \makeatletter
     40 
     41 %% Key specs
     42 \def\key#1{{\small$\langle$\lining#1\/$\rangle$}}
     43 \let\<=<
     44 \catcode`\<=\active
     45 \def<#1>{\key{#1}}
     46 
     47 %% Display ‹...› and «...» as text in left and right pointing
     48 %% angle brackets. I use «» and ‹› because my terminal doesn't
     49 %% display left and right pointing angle brackets properly, and
     50 %% Xorg's compose maps don't provide them, anyway.
     51 \def\«{«}\def\‹{‹}
     52 \catcode`\«=\active
     53 \catcode`\‹=\active
     54 \def‹#1›{$\langle${\itshape#1}$\rangle$}
     55 \def«#1»{$\langle\langle${\itshape#1}$\rangle\rangle$}
     56 
     57 \catcode`\∅=\active
     58 \def∅{\box0}
     59 \def«{%
     60   \let\dofragment@target=\hyperlink%
     61   \@ifnextchar*\dofragment@@\dofragment@}
     62 \def\dofragment@@*{%
     63   \let\dofragment@target=\hypertarget%
     64   \dofragment@}
     65 \def\dofragment@#1»{%
     66   \setbox0=\hbox{$\langle\langle${\itshape#1}$\rangle\rangle$}%
     67   \ifexpandfragments%
     68     \def\a{\sp\sp\comment \boxzero^^J}%
     69     \begingroup%
     70       \def\ { }\xdef\@frag@name{#1}%
     71     \endgroup%
     72     \UseFragment{∅}\@frag@name%
     73   \else%
     74     \dofragment@target{frag:#1}{\box0}%
     75   \fi}
     76 
     77 % Display |...| as verbatim, teletype text.
     78 \DefineShortVerb{\|}
     79 
     80 \def\macroname#1{%
     81   \expandafter\@macroname\string#1}
     82 \def\@macroname#1{}
     83 \def\defverb#1{%
     84   \EA\def\EA#1\EA{\EA\protect\EA\UseVerb\EA{\macroname#1}}%
     85   \EA\SaveVerb\EA{\macroname#1}}
     86 
     87 \let\idx@@heading\chapter
     88 
     89 %% Create a verbatim {code} environment which highlights strings
     90 %% and comments. Several unicode characters are hacked to replace
     91 %% the grabbed characters, since we can't escape them in the
     92 %% verbatim environment.
     93 \colorlet{comment}{gray}
     94 \colorlet{string}{red!100!black!90}
     95 \let\‘=‘
     96 \let\“=“
     97 \def\≔{≔}
     98 \catcode`#=\active
     99 \catcode`\≔=\active
    100 \def\docodes{%
    101   \catcode`\#=\active%
    102   \catcode`“=\active%
    103   \catcode`‘=\active}
    104 
    105 \def≔{\ensuremath{\Coloneqq}}
    106 \let#=\#
    107 \begingroup
    108   \docodes
    109   \catcode`\#=\active%
    110   \catcode`¶=6
    111   \gdef\comment{\itshape\color{comment}\let“=\“\let‘=\‘\#}
    112   \gdef\dodefineactive{%
    113     \let#=\comment%
    114     \gdef“¶¶1”{{\color{string}\“¶¶1”}}%
    115     \gdef‘¶¶1’{{\color{string}\‘¶¶1’}}}
    116 \endgroup
    117 
    118 \DefineVerbatimEnvironment{code}{Verbatim}{xleftmargin=2em,gobble=2,%
    119   codes={\docodes\catcode`\☺=0},%
    120   defineactive={\dodefineactive}}
    121 
    122 %% Save code fragments for piecing together later
    123 \begingroup
    124   \catcode`\@=0
    125   @catcode`\\=12
    126   @gdef@bcode{@detokenize{\begin{code}^^J}}
    127   @gdef@ecode{@detokenize{\end{code}^^J}}
    128   @catcode`@ =12@gdef@sp{ }
    129 @endgroup
    130 
    131 % Ripped from fancyverb
    132 % I'm currently rather unfond of it.
    133 \def\Fragment{\FV@Environment{}{Fragment}}
    134 \def\FVB@Fragment#1{%
    135   \@bsphack
    136   \begingroup
    137     \FV@UseKeyValues
    138     \gdef\Fragment@Name{#1}%
    139     \xdef\Fragment@Prefix{\«*#1» \≔^^J}
    140     \xdef\TheFragment{}
    141     \def\FV@ProcessLine##1{%
    142       \edef\frag{\detokenize{##1^^J}}%
    143       \xdef\TheFragment{\TheFragment\frag}}%
    144     \FV@Scan}
    145 \def\FVE@Fragment{%
    146   \EA\global\EA\let
    147   \csname SV@\Fragment@Name\endcsname\TheFragment%
    148   \endgroup%
    149   \EA\UseFragment\EA{\Fragment@Prefix}\Fragment@Name}
    150 \DefineVerbatimEnvironment{Fragment}{Fragment}{}
    151 
    152 \def\UseFragment#1#2{
    153   \begingroup
    154     \EA\let\EA\a\csname SV@#2\endcsname
    155     \ifx\a\undefined\def\a{\ldots}\fi
    156     \ifx\FV@EnvironName\relax%
    157       \edef\a{\bcode\detokenize{++#1}\a\ecode}\else%
    158       \edef\a{\detokenize{#1}\a}\fi%
    159     \newtoks\tokens
    160     \EA\tokens\EA{\a}
    161     \everyeof{\noexpand}%
    162     \scantokens\EA{\the\tokens}
    163   \endgroup
    164 }
    165 
    166 %% Convenience defs for the various wmii commands, and a few
    167 %% others.
    168 \defverb\wmii|wmii|
    169 \defverb\wiIXmenu|wimii9menu|
    170 \defverb\wimenu|wimenu|
    171 \defverb\wmiir|wmiir|
    172 \def\ninep{{\lining 9P}}
    173 \def\POSIX{\textsc{POSIX}}
    174 \def\plannine{{\lining Plan 9}}
    175 \def\ICCCM#1{%
    176   \@ICCCM#1@
    177   \href{http://www.tronche.com/gui/x/icccm/sec-\@ICCCM@chap.html\#s-#1}{%
    178     ICCCM \lining§#1}}
    179 \def\@ICCCM#1.#2@{\def\@ICCCM@chap{#1}}
    180 
    181 \makeatother
    182 
    183 \begin{document}
    184 \thispagestyle{empty}
    185 \leavevmode
    186 \vfill
    187 
    188 \begin{center}
    189   \centerline{\includegraphics[width=2in]{../img/wmii.pdf}}
    190 
    191   \vskip 1in
    192 
    193   \LARGE
    194   The \wmii\ User Guide
    195 
    196   \vskip .5in
    197 
    198   \Large
    199   Kris Maglione \\[1em]
    200   \lining
    201   13 October 2009
    202 
    203 \end{center}
    204 
    205 \vfill
    206 
    207 \newpage
    208 
    209 \frontmatter
    210 
    211 \tableofcontents
    212 
    213 \newpage
    214 
    215 \include{license}
    216 
    217 \mainmatter
    218 
    219 \include{introduction}
    220 \include{gettingstarted}
    221 \include{customizing}
    222 
    223 \backmatter
    224 
    225 \printindex
    226 
    227 \end{document}