4

I've recently written a book and I now need to produce two companion volumes -- (1) a set of per-chapter 'appendices', consisting of material that expands on the stuff in each chapter, and (2) a solutions manual for the many exercises in the book.

I want to refer to the original book's chapters and equations, and the xr package looks like the right tool.

Each of the two new books will have its own chapters and equations, of course, but these are related to the "master" book. In the "solutions" book, I'd like to write something that looks like this:

\chapter{Solutions}
Problem~\ref{ex:intro-warmup}: In Equation~\ref{eq:quadratic}, the coefficient
of $x^2$ is $a$. For a cubic like
\begin{align}
\label{eqS:cubic1}
a x^3 + b x^2 + c^x + d
\end{align}
\noindent
the coefficient of the cubic term is $a$, while the coefficient of $x^2$ in
Equation~\ref{eqS:cubic1} is $b$.

in hopes of producing something whose ASCII approximation looks like this:

Chapter 1S Solutions

Problem 1.1: In Equation 1.3, the coefficient of x2 is a. For a cubic like

a x^3 + b x^2 + c^x + d (1.1S)

the coefficient of the cubic term is a, while the coefficient of x2 in Equation 1.1S is b.

In this example, ex:intro-warmup and eq:quadratic are labels defined in the main book; for the solutions book, I'll be labeling all equations with the prefix eqS: instead of eq: to avoid name-conflicts.)

My goal is that I'd like the number for every chapter, section, subsection, equation, etc., in the solutions manual to terminate with an "S", so that a reference to "Equation 1.3" clearly refers to the main book, while "Equation 1.1S" refers to equations in the solutions manual.

It appears that xr lets me do the opposite of this -- I can change the way the externally-referenced items are shown -- but I do not see how to make it happen in the INTERNAL numbering.

  • 1
    Do you mean something like \renewcommand\theequation {\arabic{equation}S} in the preamble of the solutions book? Not having worked with xr, I don't know if this will actually work across multiple docs. – Steven B. Segletes Jul 11 '13 at 15:04
  • Exactly what I needed, except that to get my kind of numbering, I had to use \renewcommand\thechapter {\arabic{chapter}W} and \renewcommand\theequation {\arabic{chapter}.\arabic{equation}W}. – John Jul 11 '13 at 15:35
3

This comment has been made an answer, at the request of Joseph Wright.

Placing \renewcommand\theequation {\arabic{equation}S} in the preamble of the solutions book will make it so that the equation numbers in the solutions book will have an "S" suffixed to the equation number.

Not having worked with xr, I don't know if this will actually work across multiple docs.

The MWE:

\documentclass{article}
\renewcommand\theequation {\arabic{equation}S}
\begin{document}
\begin{equation}
\label{eq:myeq}
a x^3 + b x^2 + c^x + d
\end{equation}
In equation \ref{eq:myeq}, we see the following...
\end{document}

would seem to achieve the desired effect.

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.