Cleanup WPS tags appendix a bit and add macro for wps tag tables.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9587 a1c6a512-1295-4272-9138-f99709370657
diff --git a/manual/preamble.tex b/manual/preamble.tex
index 7598e02..81013ea 100644
--- a/manual/preamble.tex
+++ b/manual/preamble.tex
@@ -175,3 +175,29 @@
   \endtabularx
 }
 
+% command to set the default table heading for button lists
+\newcommand{\taghead}{\textbf{Tag} & \textbf{Description} \\\midrule}
+
+% environment intended to be used with tag maps (for wps)
+% usage: \begin{tagmap}{caption}{label} Tag & Description \\ \end{btnmap}
+% Note: this automatically sets the table lines.
+% Note: you *need* to terminate the last line with a linebreak \\
+% Note: you still need to enclose this with \begin{table} / \end{table}
+% Cheers for the usenet helping me building this up :)
+\newenvironment{tagmap}[2]{%
+  \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
+  \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
+    \bottomrule
+    \SavedEndTab%
+    \if\given{#1}\caption{#1}\fi%
+    \if\given{#2}\label{#2}\fi%
+    \endcenter%
+  }
+  \center
+\tabularx{\textwidth}{lX}\toprule % here is the table width defined
+  \taghead
+}{%
+  \endtabularx
+}
+
+