1

I want to start creating clickable links for my equation reference etc. How can I let TeXShop know to auto-complete commands like \cref and friends defined by the cleveref package? I have loaded the package more than once and have relaunched TeXShop to make sure that the package is already in the system.

I've been using the basic \ref and \eqref by AMSmath, and my TeXShop (fully updated) can recognize the commands so that I can set up a key (ESC or Tab) to press and activate an alphabetically ordered drop-down list of items with the given initials.

Each of the two-columned reports I write ranges from 30 to 150 pages, and most equations and figures have long labels. Without the auto-completed drop-down list, I cannot even begin to generate the links. Is there some common practice that I'm not aware of? Thank you.

P.S.

I haven't tried hyperref since according to this answer cleveref seems better (and zref is less popular) ... assuming the status haven't changed in the past 5 years.

P.P.S. I realize my question might be closed since it's more about TeXShop and less about LaTeX. This post being closed without getting an answer is not something I'd like to see, but I'll understand if it happens. I have cross-posted it here.

2 Answers2

3

I've had similar issues with the Bibdesk autocomplete in texshop. In particular I've not been able to get it to look outside of the current file I'm working on.

Instead I've reverted to using the built in "insert reference" macro accessible by "macros>insert reference". This command works well enough for my purposes as you can select the start of a reference, for example "fig:" and it will provide you with selection list of all the matching labels in the current project including those in imported and included files.

The best thing about this macro is that it is customisable. Go to "Macros>open macro editor" select "insert reference" and find the line beginning

property ref_command : "ref" --...

change this to

property ref_command : "cref" --...

and the macro will now automatically insert a cleveref command when you've selected your label.

2

The completion of \ref and \pageref commands in TeXShop is accomplished by the same code that works with BibDesk for completing bibliographic references. That code is supplied by the BibDesk folks. You might try to get in contact with those folks. It would be nice if that code allows some configuration to for which commands it understands.

You might just use \ref and \pageref and the do find/replace after your document is stable.

Herb Schulz
  • 3,410