Open atticus-sullivan opened 1 year ago
Seems that there are some common ones: | Type | log | output | input |
---|---|---|---|---|
acronyms | .alg |
.acr |
.acn |
|
symbols | .slg |
.sls |
.slo |
|
numbers | .nlg |
.nls |
.nlo |
|
index | .ilg |
.ind |
.idx |
With the following file types:
xindy
/makeindex
xindy
/makeindex
At least that's what I found in the documentation of the glossaries
(and glossaries-extra
, but didn't found additional ones there) package.
So maybe it would be worth it to add these extensions by default as well. In addition, we should somehow enable the user to add own extensions/-pairs.
I've seen that for building the glossary, there exist three/four possibilities. Currently using options 1-3 (tex
-driven, makeindex
and xindy
) can be used easily with cluttex. Options 2 and 3 really easy with makeindex(-lite)
.
Some additional thoughts:
bib2gls
) isn't supported right now (as far as I read it, intermediate data is stored to .aux
, which makes it pretty hard for us to detect whether to run bib2gls
or not).makeindex
or xindy
(or any other command which has to be run per file extension) directly as --makeglossaries
command becomes hard. We'd need to either use some pattern (provided by the user when configuring) where we can input the corresponding filenames, specify one command per file extension (or loose the option to configure the command that flexible)Maybe it would be better not to add all extensions by default so that the current behavior sticks if nothing is changed. If the user specifies additional extensions, then multiple commands have to be specified (question is still how).
So I'm still unsure how to do this the nice way.
Currently I'm planning to implement something like this:
The interface will be passing formatted strings like this type[makeindex/xindy]:log:output:input:path-to-command:command args[optional]
via a new commandline argument (keep being backwards compatible,--makeglossaries
would be an incompatible (?) orthogonal option as I plan on using makeindex
and/or xindy
directly). This argument will push tables like
-- store struct
local s = {
type = "",
log = "",
out = "", -- infer from log (replace last char by 's')
inp = "", -- infer from log (replace last char by 'o')
path = "", -- try PATH
args = "", -- infer from log, out and inp
cmd = "" -- built at last
}
to a list of glossary configurations (support for multiple glossaries). We then just watch for changes in the respective inp
files, if so we run the generated cmd
to build the respective out
file.
As I'm not sure what we currently parsing from the aux
file and how to extract the bib2gls
information, I refrain from implementing bib2gls
specific stuff for now.
The current plan is to give all possibilities to the user (adjust the basename of the glossaries files as the filename has to be given, not just the extension, add arbitrary options to the called executable and use executable not contained in PATH
).
Even if the type
is unknown, it suffices to provide commandline arguments and the path to the executable and the filenames (so that we can watch for changes) to get it working (at least that's what is planned).
If there are any thoughts on the plan I outlined so far just let me know (here in this issue).
I'm looking at .aux
file, and there's lines like \@newglossary{main}{glg}{gls}{glo}
. I wonder if they could be parsed to detect input/output files. What do you think?
Yes you're right, in my case it is \@newglossary{acronym}{alg}{acr}{acn}
. Just checked for how currently (in #15) the option is passed (--glossaries="makeindex:main.gls:main.glo:main.glg"
) I see that one is more configurable in terms of wether to use makeindex or xindy.
I'm not completely sure whether this maybe a bit more complex but also more flexible configuration is worth it. I think people who figure out how to set up additional manual glossaries also can find this option (but there might be some that just copy-pasted the glossary setup from tex.stackexchange).
Maybe we can go on, check the .aux
file for the common ones like glo
/acn
and display a hint on how to set these things up.
But when I think about it, that's almost like using the information from the .aux
file (in terms of complexity, so we might just use the information from the .aux
and if the user specified something else for that combination of input-/output-/log-files we can use that).
Any thought at which part of the code such parsing can take place? (iirc we're already parsing the .aux
file at some point).
--makeglossaries
doesn't work with other extensions than.glo
/.glg
/.gls
. Therefore, it can't be used for acronyms or other glossaries.I'd work on this, but not right now. Just wanted to file this "bug/feature".
I'd have to read the glossaries documentation more carefully if there are some common extensions (I think so). Then maybe we should activate these by default and allow the user to add more extensions to it.