Skip to content

Request: show equation numbers with reference completion #1478

@carlmueller

Description

@carlmueller

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](https://github.com/SublimeText/LaTeXTools/files/4879229/tab.vim.txt)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions