This is a follow up question to \nameref only shows reference as a red rectangle, no name in it.

In the answers to the question cited @Werner suggested to have the package xpatch installed so that revtex4 can properly do cross-referencing. Thus, after a number of attempts (because instead of a file to save I was getting a listing of code) I was able to download xpatch.ins and xpatch.dtx, placed them in the working folder and ran pdflatex xpatch.ins from within WinEdt. Then I tried to compile the TeX document (F9) and got the error message

! LaTeX Error: Two \documentclass or \documentstyle command.

Notice, I'm trying to compile @Werner's minimal working example given in the original question cited above.

Now that I was unsuccessful in this compilation, I reverted to MiKTeX, trying to install xpatch from there. I started the MiKTeX package manager and it was soon populated with a list of packages. The package xpatch was in the list but was uninstallable. So, I tried to get it from the list of repositories which show up when going to Repository->Change Package Repository. None of these repositories, however, seems to contain xpatch. Also, none of these repositories is the one @Werner pointed to in the original question; namely, http://ctan.org/pkg/xpatch and I couldn't find a way to get to it through MiKTeX. So, the problem still stands -- how can I install xpatch so that revtex4's cross-referencing starts working?

EDIT: I'd like to add that before pressing Ctrl+Z in WinEdt after the unsuccessful compilation, the error seen is

1.55 \documentclass[full]{
! Emergency stop.

You can install xpatch via the MiKTeX Package Manager. In your windows program folder are the folders Maintenance and Maintenance (Admin). For package installation you should start the Package Manager as admin. In the menu Repository just Synchronize yours with the source repository first. After that look for the xpatch package, mark it and click Install in the Task menu. Thats all. If there are other packages which are needed by xpatch and they aren't installed just repeat the procedure with the Manager. To install all non installed packages in one run, go to Edit --> Select Installable Packages and than Task --> Install. So you have all available packages on your computer.

If you have other problems with the package (or with others), start the Update(Admin) in the Maintenance (Admin) folder and refresh the complete MiKTeX first. enter image description here

  • @Holle I would suggest first synchronising the Package Manager, and then doing updates both in Admin and standard mode first. – Joseph Wright Feb 16 '12 at 22:23
  • Joseph, how does MikTeX package manager allow you to do updates in Admin mode? – ganzewoort Feb 16 '12 at 22:34
  • @Holle, Seems I'm following your instructions, the installations starts and seemingly completes but at the end an error message appears saying: – ganzewoort Feb 17 '12 at 0:48
  • The operation failed for some reason. – ganzewoort Feb 17 '12 at 0:49
  • I don't see folders Maintenance and Maintenance (Admin). Maybe I'm not starting mpm right and that's the problem. – ganzewoort Feb 17 '12 at 0:53

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.