Closed Aster89 closed 1 year ago
So I hope the feedback I'm giving can help give an improvement in this respect.
Thanks; I appreciate this kind of feedback, and I think the worst case consequence is that you learn something. Often I learn something as well, and sometimes we end up improving VimTeX either functionally or e.g. in documentation. :)
In
:h vimtex
,makeindex
is mentioned twice, fundamentally in identical texts:
latexmk
: http://users.phys.psu.edu/~collins/software/latexmk-jcc "a perl script for running LaTeX the correct number of times to resolve cross references, etc; it also runs auxiliary programs (bibtex, makeindex if necessary, and dvips and/or a previewer as requested).
Ah, yes; notice that makeindex
is mentioned in a text directly quoted from latexmk
s own home page.
From this I'd deduce that that
makeindex
runs out of the box, but apparently, if I don't manually runmakeindex -s main.ist -o main.gls main.glo
, I gethas been referenced but does not exist, replaced by a fixed one
for entries I've added vianewglossaryentry
.
I can see where you are coming from and I agree that latexmk may have misleading documentation here. I find that I use the following in my own .latexmkrc
file (see all of it here:
push @generated_exts, "nlo";
push @generated_exts, "nls";
# ....
add_cus_dep('nlo', 'nls', 0, 'nlo2nls');
sub nlo2nls {
system("makeindex $_[0].nlo -s nomencl.ist -o $_[0].nls -t $_[0].nlg" );
}
This is for nomenclatures, but as you see, it is clearly related to your issue.
Since the bibliography handling was automatic (so, in practice, I didn't need to look up for VimTeX documentation at all), I'd have expected that also glossay handling was automatic. If it is not, then maybe the doc could tell something more.
Ok, so: latexmk
is responsible for compilation here (or, through user configuration, other engines). And I believe it is important that users actually know at least something about how compilation of LaTeX documents work and in turn how latexmk
(or their chosen engine) works. I'm not sure exactly how to properly handle this within the VimTeX documentation. We can't explain everything there either.
let g:vimtex_delim_stopline = 1000 let g:vimtex_view_general_viewer = 'zathura' let g:vimtex_view_method = "zathura" let g:vimtex_fold_enabled = 1 let g:vimtex_fold_manual = 1 let g:vimtex_quickfix_method = 'pplatex' let g:vimtex_quickfix_autoclose_after_keystrokes = 5 let g:tex_flavor = 'latex' " avoid some skinny *.tex file to be interpreted as plaintex files
Two comments:
g:vimtex_view_general_viewer
, since you are using let g:vimtex_view_method = 'zathura'
.g:tex_flavor
, see :help vimtex-tex-flavor
.Expected behavior
From the doc, I'd have expected that executing
makeindex ...
was automatic.
Perhaps a solution would be to remove the parantheses where makeindex
is mentioned?
I see that in your .latexmkrc
snippet some of the extensions obviously refer to n
omenclature, so changing the to those referring to g
lossary was kind of obvious. However, one of them, nomencl.ist
suggests that we don't want it to clash with other *.ist
files, so I would have thought that I would name it something along the lines of glossary.ist
, but the point is that the file is generated upon running pdflatex
on my main.tex
files, and it is named main.ist
, so I changed your snippet to this
push @generated_exts, "glo";
push @generated_exts, "gls";
push @generated_exts, "glg";
add_cus_dep('glo', 'gls', 0, 'glo2gls');
sub glo2gls {
system("makeindex $_[0].glo -s $_[0].ist -o $_[0].gls -t $_[0].glg" );
}
And it works. But... am I doing something that will bite me when I'll add stuff like nomenclature, index, and others? Or will pdflatex
generate main.ist
with all that the several runs of makeindex
will all need?
Perhaps a solution would be to remove the parantheses where
makeindex
is mentioned?
Yep, maybe it's a good idea.
Two comments:
Thanks! :)
I see that in your
.latexmkrc
snippet some of the extensions obviously refer ton
omenclature, so changing the to those referring tog
lossary was kind of obvious. However, one of them,nomencl.ist
suggests that we don't want it to clash with other*.ist
files, so I would have thought that I would name it something along the lines ofglossary.ist
, but the point is that the file is generated upon runningpdflatex
on mymain.tex
files, and it is namedmain.ist
, so I changed your snippet to this …
Yes, that seems safe - and I'm glad to hear it works. I have to admit I don't understand these things as well as I should, but I believe you will find a lot of information on these topics if you search for e.g. latexmk and makeindex
and similar on the web.
And it works. But... am I doing something that will bite me when I'll add stuff like nomenclature, index, and others? Or will
pdflatex
generatemain.ist
with all that the several runs ofmakeindex
will all need?
I think this is safe. But again, I believe you will also find a lot of relevant information online for these things if you search specifically for latexmk
and glossaries/nomenclatures, etc.
Perhaps a solution would be to remove the parantheses where
makeindex
is mentioned?Yep, maybe it's a good idea.
I'll do that, then.
Description
Disclaimer: I've been away from LaTeX since late 2018, which a long long loooong time for LaTeX, in my experience, so I'm a bit rustly and might be missing something obvious. So here I'm playing the role of the beginner, maybe, but I rember that VimTeX was, and I know still is, a great (the greatest imho) plugin for LaTeX that can even make novices start using it. So I hope the feedback I'm giving can help give an improvement in this respect.
In
:h vimtex
,makeindex
is mentioned twice, fundamentally in identical texts:From this I'd deduce that that
makeindex
runs out of the box, but apparently, if I don't manually runmakeindex -s main.ist -o main.gls main.glo
, I gethas been referenced but does not exist, replaced by a fixed one
for entries I've added vianewglossaryentry
.Since the bibliography handling was automatic (so, in practice, I didn't need to look up for VimTeX documentation at all), I'd have expected that also glossay handling was automatic. If it is not, then maybe the doc could tell something more.
Steps to reproduce
In short, I've put an example from Overleaf in a
main.tex
file and started VimTeX on it.As far as the vimrc is concerned, I'm pretty confident making it minimal with respect to non-VimTeX stuff is overkill, so I've just make sure to not define
g:vimtex_compiler_latexmk
. The rest is just a few options which are unrelated to the issue:Expected behavior
From the doc, I'd have expected that executing
makeindex ...
was automatic.Actual behavior
The compilation results in
main.tex|| No file main.gls.
. Manually executingmakeindex -s main.ist -o main.gls main.glo
makes all work.Do you use a latexmkrc file?
No (I use it, but I've deleted it while doing repro steps from Overleaf example.)
VimtexInfo