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?

1
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
    – Joseph Wright
    Jul 7, 2013 at 5:52

1 Answer 1

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}.

1
  • 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. Jul 7, 2013 at 17:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .