TeXShopNo auto-complete (drop-down list) for labels

Information and discussion about TeXShop, an integrated LaTeX environment for Mac OS X
Post Reply
davidcllee
Posts: 4
Joined: Sun Mar 05, 2017 2:04 pm

No auto-complete (drop-down list) for labels

Post by davidcllee »

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'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 labels with the given initials.

Somehow the same doesn't work for commands from cleveref. I have loaded the package more than once and have relaunched TeXShop to make sure that the package is already in the system. The couple of posts on StackExchange are of no help, and there are many posts in this forum here regarding auto-completion but I haven't found the ones about the drop-down list.

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?

Any pointer would be appreciated. Thank you.


P.S.

I haven't tried hyperref since cleveref seems better and zref is less popular (according to http://tex.stackexchange.com/a/36312/119235 ... assuming the status haven't changed in the past 5 years).

P.P.S.
I originally posted this on StackExchange, which has a rather different interface. This is my first post here and I'm still figuring things out.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

No auto-complete (drop-down list) for labels

Post by Stefan Kottwitz »

Hi David,

welcome to the forum!

The TeXshop manual says in 1.1.6 Auto completion:
Auto completion is user configurable. To configure, open the file
̃
/Library/TeXShop/Keyboard/autocompletion.plist

with TeXShop. Read the comments at the top, edit appropriately to redefine Landweber’s choices or add your own, and save. Be sure to edit and save in UTF-8 format if you use Unicode characters.
And there's command completion (section 1.1.7):
To add a word to the dictionary, select the word and choose “Add Word” under the Format menu. Notice that this menu command has a key equivalent. To see and edit the entire dictionary, choose “Open Completion File” under the Format menu. Notice that the completion can be more complicated than just a single word, and the cursor can be placed correctly within this completion. Examine the samples provided in the default file for details.
You can take a look at completion.plist and autocompletion.plist.

Stefan
LaTeX.org admin
davidcllee
Posts: 4
Joined: Sun Mar 05, 2017 2:04 pm

No auto-complete (drop-down list) for labels

Post by davidcllee »

Stefan Kottwitz wrote:
Auto completion is user configurable. To configure, open the file
̃/Library/TeXShop/Keyboard/autocompletion.plist
with TeXShop. Read the comments at the top, edit appropriately to redefine ....
And there's command completion (section 1.1.7):
To add a word to the dictionary, select the word and choose “Add Word” under the Format menu. To see and edit the entire dictionary, choose “Open Completion File” under the Format menu. Examine the samples provided in the default file for details.
You can take a look at completion.plist and autocompletion.plist.
Stefan
Thanks Stefan for your interest. I'm gonna show some screen shots of me getting to these sources but not seeing how this would work.
For example, I've read Herbert Schulz's article and I've know the relevant parts in the TeXShop manual, but they don't seem to answer my question.


Firstly, I don't know why the `Add Word' functionality is never available:

Image


Secondly, I actually having been adding and using my own shortcuts in the CommandCompletion.txt for a while now, but I don't see how this can produce the drop-down list. The 1st image right below shows the beginning of the default command completion, and the 2nd image shows the end of the command completion where I put all my own shortcuts.

Image

Image

I have no idea what `codes' for the drop-down list should be here. I tentatively added a line of \cref{ } at the end just like \ref{ }, but it didn't work.


Then there's the dictionary. As you said I can open the two .plist with TeXShop, and there are some examples. However, it's rather unclear how I can add a word (obviously following the pattern) to prompt the drop-down list.

Image


Now, the drop-down list I'm talking about looks like this

Image

and all entries have (BibDesk) at the end. I have double checked in Preference that (of course) the box for it (5th item on the right) is checked.

Image



I also went to activate the Text completion in the Service, but after relaunch nothing changed:

Image

Image



So ..... a makeshift solution is to always call the labels by the basic \ref and \eqref and then change the command to those from cleveref that is not recognized by TeXShop. However, this is clearly the wrong way.
Last edited by davidcllee on Sun Mar 05, 2017 5:31 pm, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

No auto-complete (drop-down list) for labels

Post by Stefan Kottwitz »

davidcllee wrote:Firstly, I don't know why the `Add Word' functionality is never available
I think a word has to be marked (highlighted with mouse or keyboard) before it can be added. The editor / menu needs to know which word.

Stefan
LaTeX.org admin
davidcllee
Posts: 4
Joined: Sun Mar 05, 2017 2:04 pm

No auto-complete (drop-down list) for labels

Post by davidcllee »

Stefan Kottwitz wrote: I think a word has to be marked (highlighted with mouse or keyboard) before it can be added. The editor / menu needs to know which word.
Stefan
ha, duh, Thanks. Okay so now I know how to add word, but this makes no difference.

I'm starting to have a feeling that either how I phrase my question is wrong, or there's something missing.


I actually am NOT trying to complete the command as a word. What I'm trying to do is to prompt the drop-down list of labels (for equation and figures etc).

When I press ESC right after keying `\ref{` the drop-down list appears, as shown in one of my screen shots. Either with just a single left brace or both braces, or with additional letters in, this `command completion' works. It works for both \ref and \eqref.

What I don't understand is why nothing happens for \cref when I press ESC, that no such drop-down list shows up. What I need to know is how to activate such a functionality, how to let TeXShop knows that \cref should also be completed by a label in BibDesk (I guess).
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

No auto-complete (drop-down list) for labels

Post by Stefan Kottwitz »

I'm a Mac user too, but I use TeXworks. So I'm trying to help a bit but maybe you need some information from the TeXworks developer or an experienced user. I did not see a mailing list, but there's a contact button at the top right corner of the TeXshop homepage. Perhaps try this?

If there's another issue but LaTeX specific, let me know. ;-)

Stefan
LaTeX.org admin
davidcllee
Posts: 4
Joined: Sun Mar 05, 2017 2:04 pm

No auto-complete (drop-down list) for labels

Post by davidcllee »

Stefan Kottwitz wrote:there's a contact button at the top right corner of the TeXshop homepage. Perhaps try this?

If there's another issue but LaTeX specific, let me know. ;-)
Stefan
Good idea, directly to the source.

Thanks for your responses. Yeah I have been antsy because this is such a strange issue.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

No auto-complete (drop-down list) for labels

Post by Johannes_B »

Why strange? LaTeX is based on TeX, that is one guys idea based on another guys idea.
In the meantime, some editors have evolved that deal with LaTeX syntax and nice things.
In the meantime, we have several thousand packages that extend LaTeX by some means.

That is a whole lot to think about for a software developer, considering you don't need a LaTeX editor.

Summing up: A direct ping might be the best way to go. Making that functionality availabe for everybody.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
herbs
Posts: 3
Joined: Fri May 24, 2019 12:28 am

No auto-complete (drop-down list) for labels

Post by herbs »

Howdy,

Unfortunately that feature (which uses F5 rather than ESC) is not configurable. However, recent versions of TeXShop can have a popup menu on the Source Window's Toolbar that lists all the labels in the file open in that window.

Good Luck,
herbs
Post Reply