GeneralCompanion Book Design and referencing/labeling

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
jfhspike
Posts: 2
Joined: Wed Jul 10, 2013 4:28 pm

Companion Book Design and referencing/labeling

Post by jfhspike »

I've written a book with many chapters and equations. 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 as if it'll do the job for me. But I also want the new "books" to have chapter names and equations with numbers. For the "solutions" book, I'd like to write something that looks like this:

Code: Select all

\chapter{Topic 1 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$.


and have the results look like this:

Chapter 1S Topic 1 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 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.

I hope that this question is clear enough and minimal enough -- it's my first attempt at posting a question, although I've been helped enormously by reading answers here as I wrote the book itself.
-John

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply