To create the labels, I have enlisted the power of LaTeX (as one would probably expect). As I want the same headings on all samples, I wanted to create a command that includes all these details. However, I want more than 9 arguments, which is not allowed in general LaTeX commands. Searching for options to get around this problem, I found that it was a FAQ on the UK TeX list: How to break the 9-argument limit. Their helpful suggestion of using keyval wasn't backed up by an explicit example of how to implement it. The following code shows how to implement their example:
\usepackage{keyval}For more details regarding soil sampling which can be easily extended to other sorts of samples, see the Soil Description Handbook published by Manaaki Whenua Press.
\newcommand{\flowerinstance}[1]{\setkeys{flwr}{#1}}
\makeatletter
\define@key{flwr}{species}{\textbf{Species:} \emph{#1}\\}
\define@key{flwr}{family}{\textbf{Family:} #1\\}
\define@key{flwr}{location}{\textbf{Location:} #1\\}
\define@key{flwr}{locationtype}{\textbf{Location type:} #1\\}
\define@key{flwr}{date}{\textbf{Date:} #1\\}
\define@key{flwr}{numplants}{\textbf{Number of plants:} #1\\}
\define@key{flwr}{soiltype}{\textbf{Soil type:} #1\\}
\makeatother
\begin{document}
\flowerinstance{species=Primula veris,
family=Primulaceae,
location=Coldham's Common,
locationtype=Common grazing land,
date=1995/04/24,
numplants=50,
soiltype=alkaline
}
\end{document}
No comments:
Post a Comment