I'm trying make my own command for a requirements document. I'm now looking for a way to reference my requirements. This should be possible by using \ref and the later on with the hyerref package.
The returned string of the \ref command shall be the Requirement-ID (#1).
But I have no idea how to make this happen. Could anyone please help?
Thanks & bye, aronadaal
\documentclass[a4paper]{article}
\usepackage[left=2cm,right=2cm,top=2.5cm,bottom=2cm]{geometry}
\setlength\parindent{0pt}
\newcommand{\req}[2]{ %
\begingroup%
\textbf{#1}\label{req:#1}~#2\newline %
\endgroup%
} %
\begin{document}
\req{MY.REQ.ID.42}{a lot of text... and so on}
Please have a look at \ref{req:MY.REQ.ID.42}
\end{document}
\ref
in the same way that your\req
command wraps\label
?