3

I'm working on a Design document that is based on a Requirements document that is subject to change. The Design document must reference Requirements in an enumerated list from the Requirements Document.

My requirements document has something like this:

\documentclass{article}
\usepackage{graphicx}
\usepackage{mathtools}
\begin{document}
\begin{enumerate}
    \item Requirement 1  \label{Req1}
    \item Requirement 2:
    \begin{enumerate}
        \item Requirement 2a \label{Req2a}
        \item Requirement 2b \label{Req2b}
    \end{enumerate}
\end{enumerate}
\end{document}

My design document looks like this:

\documentclass[hidelinks]{article}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage{amsmath, amsthm ,amssymb}
\usepackage{graphicx}
\usepackage{enumerate}
\usepackage{hyperref}
\usepackage{xr}

\begin{document}
\externaldocument{../requirements/Requirements.tex}

\section{Functional Requirements}
Functional Requirements are things the system must do. These are: \\

\begin{tabular}{| l | l |}
    \hline
    Requirement & Subsystem(s) implementing the requirement \\ \hline
    \ref{Req1} & Graphical Front End \\ \hline

\end{tabular}

\end{document}  

I'd like to see the number that is given to the item in the enumeration show up in the \ref{Req1} space. But what I see now are two question marks. What am I missing?

2

In your requirement document, add \usepackage{hyperref} and \usepackage{enumerate}. The enumerate package will write the label to auxiliary file. Then only we will able to call it in the design file. The hyperref package is needed, since you have used this package in the design file. Otherwise you will end up in error while compiling second file.

Also put \externaldocument before \begin{document}.

  • Thanks for the help! I'm getting some extraneous section information included in the reference as well as the enumeration number. I'm asking another question about that though. – user1509669 Jul 7 '13 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.