Hi,

> - F9 works only after the first compilation (not too restrictive)
> - F9 completes based on either labels or current reference numbers. -
> The labels method works almost as before, except that the outline window
> does not show a preview of the relevant part of the .tex file.
Yes.


> For the "new" method, how does your algorithm detect which numbers to
> scan?
It looks in the aux-file and tries to differentiate between equations 
(which use \eqref) and other things (which use \cref, \autoref, or 
simply \ref). It works best if you are using hyperref and cleveref. E.g. 
by using the tex-file

=================================================
\documentclass[]{article}
\usepackage{hyperref}
\usepackage{amsthm}
\usepackage{cleveref}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\begin{document}
\section{Preliminaries}
\begin{theorem}
        \label{lem:trivial}
        \begin{equation}
                \label{sec:trivial}
                1 + 1 = 2
        \end{equation}
\end{theorem}
\begin{lemma}
        \label{lem:obvious}
        \begin{equation}
                \label{subsec:obvios}
                2 = 1 + 1
        \end{equation}
\end{lemma}
\end{document}
=================================================

you can use the following four completions:
theorem.1.1<F9> => \cref{lem:trivial}
lemma.1.2<F9>   => \cref{lem:obvious}
(1)<F9>         => \eqref{sec:trivial}
(2)<F9>         => \eqref{subsec:obvious}

Moreover, you can still complete via the labels, e.g.
"\ref{<F9>".

> Is it sensitive to a keyword like section, part, theorem, eq, fig,
> etc. when F9 is hit?
No, it just looks into the aux file. It does not matter that e.g. the 
label is prefixed with something like "eq:" (see above). This renders 
this method really robust.

> And depending on this keyword, it enters various
> commands like \autoref, \eqref... right?
Currently, it uses
        Tex_RefCompletionCommand
for the completion of something like "theorem.1.",
        \eqref
for the completion of something that looks like an equation number, e.g. 
"(1".
You can also use "\myrefcommand{<F9>" to get a completion with a custom 
reference command (which should contain 'ref').

> How about the \cite command? As far as I understand, its
> functionality would stay as before.
Yes, this has not been changed.


Anybody who would try to test the new behaviour, is invited to use
        https://github.com/gerw/vim-latex-suite
instead of the default latex-suite.


Best regards,
Gerd

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Vim-latex-devel mailing list
Vim-latex-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vim-latex-devel

Reply via email to