LaTeX: Improving bibliographical label completion

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

LaTeX: Improving bibliographical label completion

JairoB
This is not a bug report but a question on how I could improve TM for my personal use.

I use a macro \myhyperbibitem that extends the usual \bibitem to allow hyperlinks in the bibliography. (If you're curious: http://tex.stackexchange.com/questions/39177/web-links-in-the-bibliographical-labels/40423 )

Is it too difficult to edit the LaTeX bundle so that the drop-down menu that appears when I hit Command+Esc on \cite{} also includes both kinds of labels (\bibitem and \myhyperbibitem)?

Here's an example:

\myhyperbibitem[St]{http://tex.stackexchange.com/}{Stack} Stackexchange -- Tex
\bibitem[Ho]{Hobbit} J.R.R. Tolkien. The Hobbit.

In this case, the labels that should appear on the drop-down list are "Stack" and "Hobbit".


PS: Thank you Allan for solving the \ref{} problem.
Reply | Threaded
Open this post in threaded view
|

Re: LaTeX: Improving bibliographical label completion

Allan Odgaard-4
On 6 Nov 2013, at 14:51, JairoB wrote:

> Is it too difficult to edit the LaTeX bundle so that the drop-down
> menu that
> appears when I hit Command+Esc on \cite{} also includes both kinds of
> labels
> (\bibitem and \myhyperbibitem)?

Looking at the bundle source, it seems the logic to collect labels is at
https://github.com/textmate/latex.tmbundle/blob/master/Support/lib/LaTeXUtils.rb#L228

I didn’t write any of the code but it looks like you need to duplicate
one of the scanner.extractors setup calls with a regular expression to
match your \bititem lines.

_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: LaTeX: Improving bibliographical label completion

JairoB
Ok, I found the rb file on my system. Once I edit it, what do I need to do to make the changes effective? Do I need to compile it? (Sorry for the newbie questions.)
Reply | Threaded
Open this post in threaded view
|

Re: LaTeX: Improving bibliographical label completion

Allan Odgaard-4
On 10 Nov 2013, at 2:35, JairoB wrote:

> Ok, I found the rb file on my system. Once I edit it, what do I need
> to do to
> make the changes effective? Do I need to compile it? (Sorry for the
> newbie
> questions.)

Ruby is an interpreted language, so nothing is required after making
changes, just re-run your test in TextMate.

Before making changes, you may wish to “git clone” the bundle to
~/Library/Application Support/Avian/Bundles so that changes you make are
not overwritten on updates. Though after installing the bundle locally,
you will have to manually update it (git pull).

_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate