I am writing a book using the amsbook style. I would like references to formulas and theorems to appear without chapter numbers when I cite within the chapter, and with them otherwise. For example, I want

... see (3.2) ... [if that equation is in the same chapter]


... see (II.3.2)... [if this appears in, say, Chapter IV but the equation is in Chapter II]

Is there an easy way to do this? I can do it now by writing (\ref{ChapterII}.\ref{3.2}) in the latter case, and just (\ref{3.2}) in the former but I wonder if there is an automatic way of doing it.

EDIT: I saw the linked answer - but that does not work with amsbook! Any idea?

Here is an example based on the linked one. It works (without eq. numbers) but it does not with amsbook!


\documentclass{book}  \% does not work with amsbook  

% From your post I assume you have settings like this:

% Redefine the format of the theorem number:

% May print the chapter number
% Tests if current chapter is equal to the chapter number of label)
 % Print nothing if so
 % Set 'chapter' locally (=> no \setcounter) to the label chapter and
 % print it in the usual format followed by a dot

% Test document:
Here \ref{theo:11}  % prints "1.1"
and there \ref{theo:21}. % print "II.1.1" 

The eq. number should be (1.1) (section.eq). 

\section{Section 2}

There \ref{theo:11}  % prints "I.1.1"
and here \ref{theo:21}. % print "1.1"


See (\ref{11}) for more details. I expected (I.1.1). 

  • 2
    Related: Cross-referencing in multiple chapters – Werner Sep 16 '14 at 19:23
  • 1
    The amsbook document class uses arabic rather than uppercase-Roman "numbers" for chapter. Have you redefined the numbering system? If so, please show the code you've utilized, as it may have some bearing on how your objective may be achieved. – Mico Sep 16 '14 at 19:41
  • Yes, I have this command: \def\thechapter{\Roman{chapter}} – ABC Sep 16 '14 at 19:44
  • And how have you redefined \theequation? As chapter_number.section_number.eq_num or as section_number.eq_num? Ideally, you would be providing this information up front, in the form of an MWE (minimum working example). – Mico Sep 16 '14 at 20:33
  • 2
    Could you post a minimal example of where it doesn't work, then? The example should be complete—from \documentclass{amsbook} to \end{document}. – Sean Allred Sep 18 '14 at 4:14

Your Answer

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

Browse other questions tagged or ask your own question.