SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2k stars 364 forks source link

Request: show equation numbers with reference completion #1478

Open carlmueller opened 4 years ago

carlmueller commented 4 years ago

I have a suggestion about \ref and \eqref completion. Why not use the .aux file to list the equation number along with the key? It would be much easier, and I never understood why standard packages don't do this. I'm attaching a vim function that I wrote to show you what I mean, along with a screenshot. Of course users would have to compile to generate an aux file, but most people do that constantly to see the current latex output. If the reference hasn't been compiled yet, the key could appear without an equation number.

To use the attached plugin, open a .tex file in vim, preferably one that already has several equation labels. Then source the plugin with ":source tab.vim" (after deleting the .txt ending). Next type \ref{ and you will see automatic completion to \ref{} with the cursor between the brackets. Pressing the tab key will create a split window with equations and keys listed. Moving to the desired equation number and pressing "enter" will close the split window and copy the key to \ref{}.

Screen Shot 2020-07-06 at 9 28 31 AM

tab.vim.txt