I'm working on a large project (3 volumes of about 500 pages each), and I'm using bib2gls
to manage my glossaries. In order to save compilation time I started using arara
with conditionals like in How to tell Arara to skip redundant steps? but I cannot figure out how to pass a conditional to run bib2gls
only when I add another instance of a glossary entry in my document, say \gls{example}
.
I've tried adding % arara: bib2gls if changed ('glg') || changed ('glstex')
assuming that I've made a previous run so that both MyDoc.glg
and MyDoc.glstex
already exists. I don't understand how bib2gls
works but I noticed that MyDoc.glstex
changes by adding the example
information after running bib2gls
. So I'm lost here.
I would appreciate any ideas or insight about bib2gls
to solve my problem.
Edit: a MWE
MyDoc.tex
:
% arara: xelatex
% arara: biber if missing('bbl') || found('log', 'Citation')
% arara: --> || changed (toFile('MyBibliography.bib'))
% arara: bib2gls if missing('glstex') || changed ('glg')
% arara: --> || changed ('glstex') || changed (toFile('MyGlos.bib'))
% arara: xelatex until !found('log', '\\(?(R|r)e\\)?run (to get|LaTeX)')
\documentclass{book}
\usepackage[backend=biber, style=numeric]{biblatex}
\usepackage{csquotes}
\usepackage[colorlinks]{hyperref}
\usepackage[record,index,postdot]{glossaries-extra}
\usepackage{glossary-bookindex}
\setglossarystyle{bookindex}
\renewcommand{\glsxtrbookindexcols}{3}
\newglossary{ind}{ing}{ige}{My Index}
\GlsXtrLoadResources[
src=MyGloss,
type=ind,
]
\addbibresource{MyBibliography.bib}
\begin{document}
Test \gls{hi} as seen in~\cite{blah}
\printunsrtglossary[type=ind, style=bookindex]
\printbibliography
\end{document}
MyGloss.bib
:
@index{hi,
name = {Hello World!},
}
@index{foo,
name = {Foo},
}
MyBlibliography.bib
:
@book{blah,
author = {The Author},
publisher = {Publisher},
title = {An imortant book},
year = {2020}
}
arara
cant do this, because after first LaTeX run there are nobi2gls
files. Best way would be to uselatexmk
viaarara
and setuplatexmk
in such a way to detect if it is needed to runbib2gls
or not. I am not proficient withlatexmk
, so I dont know how to do that - butlatexmk
is scanning.aux
file for clues, which is exactly what you are asking to do.latexmk
bib2gls
always writes.glstex
and.glg
files. I guess thatlatexmk
could be suitable to control this.bib2gls
withlatexmk
should be here: tex.stackexchange.com/questions/400325/latexmkrc-for-bib2gls The issue is not very old (so theres big chance it will work without making changes) but the code looks pretty advanced (to me at least).